Sistemi di acquisizione Grazie al sito National Instruments
Tipiche funzionalità per scheda Ingressi analogici 8-32 canali Amplificazione controllabile da PC Uscite analogiche (di solito 2) Ingressi per encoder Timers, counters Ingressi uscite digitali per relais, LED, pulsanti, ecc. Buffer interno per disaccoppiare l attività di acquisizione da quelle del computer (NON usare per controllo a feedback) Trasferimento in DMA Scuola CIRA 2002, G.U - 2
Struttura di una DAC (data acquisition card) FIFO DAC MUX Bus Controller Timing and control logic Programm. gain amplifier ADC ADC I/O Connector DIO Scuola CIRA 2002, G.U - 3
Scuola CIRA 2002, G.U - 4 Struttura vera di una DAC
Differential Input stage The best solution as for noise rejection Requires TWO inputs per channel The sources must have balanced outputs Sometimes banned by grounding requirements Scuola CIRA 2002, G.U - 5
Single Ended Input Stage Non referenced ground SE A good compromise Reduces the ground noise Use it, when provided referenced ground SE or SE The common choice Worst for coupling noise Acceptable for high levels (1V) Scuola CIRA 2002, G.U - 6
Sound Cards The cheapest way to acquire (and to generate) analog signals Good resolution (16 bits) Generally a satisfactory signal/noise ratio Two channels on the line input (about 1Veff), only ONE on the microphone one (about 2mVeff)! Most environments have the software drivers for them Fixed set of sampling times Perhaps one poor antialias filter for the highest sampling frequency Low frequency limited to some Hertz Scuola CIRA 2002, G.U - 7
Caratteristiche di alcune famiglie USB/Portable DAQ Low cost M series Max Sampling Rate (ks/sec) 1,250 250 High Accuracy M Series 625 single, 500 multi-channel Max Number of Channels/Module 16 32 32 Programmable Filters x Simultaneous Sampling x Programmable gains 15 4 7 Automatic On-Board Calibration x x x NIST Traceable Calibration Cert. x x x Board to Board Synchronization Bus x x Max On-Board Memory (Samples) 8,192 4,095 4,095 Bus Support USB, PCMCIA, Firewire PCI, PXI, CompactPCI PCI, PXI, CompactPCI Scuola CIRA 2002, G.U - 8
Sistemi portatili per portatili e palmari, senza alim. est. 8 ch, 12 bit, 50 KS/s PCMCIA cards 16 ch, 16 bit, 200 KS/s Sistemi su USB Scuola CIRA 2002, G.U - 9
Kit per l acquisizione da PC cavi di collegamento moduli di condizionamento contenitore moduli terminaliera Scheda nel PC Scuola CIRA 2002, G.U - 10
Sistemi di grandi dimensioni da 4 a 18 schede Fino a centinaia di canali di ingresso Prestazioni massime Costo anche Scuola CIRA 2002, G.U - 11
Struttura interna Può essere fino a un Pentium a 2.5GHz con disco, ecc. Scuola CIRA 2002, G.U - 12
Software LabView Matlab
LabView One of the first software environments for data acquisition and control It is a de facto industry standard Several channels of communication (serial, TCP/IP) even WEB-based remote user interface Dedicated modules vision motion control PLC systems Good, reliable, fast algorithms Based of graphic programming (but the user can write C-lang. modules) easy for simple systems requires a very careful top-down design for large ones Scuola CIRA 2002, G.U - 14
Scuola CIRA 2002, G.U - 15 Schermata di esempio
LabView Control Panel device 1 Spectrum Unit dbvrms 0.3 Est Power peak 2.6426 Vrms^2 Est Freq peak 1189.3107 Hz channel (0) -10.0 0-20.0 number of samples -30.0-40.0 1024-50.0 sample rate 20000.00 Window Hann -60.0-70.0-80.0-90.0-100.0 Display Unit -110.0 Vrms -120.0 Log/ Linear db -136.1 0.0 500.0 1000.0 1500.0 2000.0 2500.0 3000.0 3500.0 4000.0 4500.0 5000.0 Hz Scuola CIRA 2002, G.U - 16
LabView Diagram 0.0 device Log/ Linear Display Unit Spectrum Unit channel (0) W indow Est Freq peak number of samples delta-t delta-f Est Power peak window constants sample rate Scuola CIRA 2002, G.U - 17
The Matlab DAQ Toolbox Drives all the NI cards, sound cards and a few other systems The acquisition process is fully integrated in the software The cards are fully controlled by ML scripts gain selection acquisition can be triggered (pre- post-trigger allowed) timers can start/stop the acquisition Can t be used for control purposes (it is highly buffered) Scuola CIRA 2002, G.U - 18
A Programming Example function [data,time]=acq(n,fs,l); ai=analoginput('nidaq',1); %set(ai, 'InputType', 'Differential'); %set(ai, 'InputType',... 'NonreferencedSingleEnded'); set(ai, 'InputType', 'SingleEnded'); %set(ai, 'DriveAISenseToGround', 'Off') chan=addchannel(ai,0:1); set(ai, 'SampleRate', Fs); duration = L; %L seconds acquisition ActualRate = get(ai, 'SampleRate'); set(chan, 'InputRange', [-5 5]); set(ai, 'SamplesPerTrigger', ActualRate*duration); set(ai, 'TriggerChannel', chan(1)); set(ai, 'TriggerType', 'Software'); %set(ai, 'TriggerCondition', 'Rising'); set(ai, 'TriggerCondition', 'Falling'); set(ai, 'TriggerConditionValue', -1); set(ai, 'TriggerDelayUnits', 'Samples'); set(ai, 'TriggerDelay', -100); start(ai); while strcmp(ai.running, 'On'); end [data, time] = getdata(ai, N); remsamp = num2str(ai.samplesavailable); disp(['number of remaining samples: ', remsamp]); get(ai) delete(ai) Scuola CIRA 2002, G.U - 19