6_Sistemi di acquisi..

Transcript

6_Sistemi di acquisi..
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)
MUX
FIFO
DAC
Timing and
control logic
ADC
ADC
DIO
Scuola CIRA 2002, G.U - 3
I/O Connector
Bus Controller
Programm. gain
amplifier
Struttura vera di una DAC
Scuola CIRA 2002, G.U - 4
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
Max Sampling Rate (kS/sec)
Max Number of Channels/Module
USB/Portable
DAQ
Low cost –
M series
High Accuracy –
M Series
1,250
250
625 single,
500 multi-channel
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
x
x
8,192
4,095
4,095
USB, PCMCIA,
Firewire
PCI, PXI,
CompactPCI
PCI, PXI,
CompactPCI
Board to Board Synchronization Bus
Max On-Board Memory (Samples)
Bus Support
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
Scuola CIRA 2002, G.U - 9
Sistemi su USB
Kit per l’acquisizione da PC
cavi di collegamento
moduli di condizionamento
contenitore moduli
Scuola CIRA 2002, G.U - 10
terminaliera
Scheda nel PC
Sistemi di grandi dimensioni
da 4 a 18 schede
Scuola CIRA 2002, G.U - 11
Fino a centinaia di canali di ingresso
Prestazioni massime
Costo anche
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
Schermata di esempio
Scuola CIRA 2002, G.U - 15
LabView Control Panel
Est Power peak
S p e c t ru m U n it
device
2 .6 4 2 6
dBVrms
1
Vrms^2
Est Freq peak
1 1 8 9 .3 1 0 7
Hz
0 .3
channel (0)
0
-1 0 . 0
-2 0 . 0
number of
samples
-3 0 . 0
-4 0 . 0
-5 0 . 0
1024
-6 0 . 0
sample rate
-7 0 . 0
2 0 0 0 0 .0 0
-8 0 . 0
Window
-9 0 . 0
H ann
-1 0 0 . 0
Display Unit
V rm s
Log/ Linear
dB
-1 1 0 . 0
-1 2 0 . 0
Hz
-1 3 6 . 1
0 .0
Scuola CIRA 2002, G.U - 16
5 0 0 .0
1 0 0 0 .0 1 5 0 0 .0
2 0 0 0 .0 2 5 0 0 .0 3 0 0 0 .0
3 5 0 0 .0 4 0 0 0 .0
4 5 0 0 .0 5 0 0 0 .0
LabView Diagram
0 .0
L o g / L in e a r
S p e c t ru m U n it
D is p la y U n it
d e v ic e
W in d o w
E s t F re q p e a k
c h a n n e l (0 )
d e lt a -f
E st P o w e r p e a k
n u m b e r o f s a m p le s
d e lt a -t
w in d o w c o n s t a n t s
s a m p le ra t e
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')
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);
set(ai, 'SampleRate', Fs);
start(ai);
while strcmp(ai.Running, 'On'); end
[data, time] = getdata(ai, N);
duration = L; %L seconds acquisition
ActualRate = get(ai, 'SampleRate');
remsamp = num2str(ai.SamplesAvailable);
disp(['Number of remaining samples: ', remsamp]);
set(chan, 'InputRange', [-5 5]);
get(ai)
chan=addchannel(ai,0:1);
delete(ai)
Scuola CIRA 2002, G.U - 19