sistemas de aquisição de dados
TRANSCRIPT
Sistemas de Aquisição de Dados
Mestrado Integrado em Eng. Física Tecnológica 2020/21
Aula 2
Sistemas de Aquisição de Dados MEFT 2020/21
Data Acquisition: “Sampling the World”
2
Data acquisition is the process of sampling signals that measure real world physical conditions and converting the resulting samples into digital numeric values that can be manipulated by a computer.
Sistemas de Aquisição de Dados MEFT 2020/21
Very Simple DAQ System
3
Record/Measuring Temperature
Sample Rate= 1 Sample per Second
Sistemas de Aquisição de Dados MEFT 2020/21
Another Example: “Gamma Particle”
The components of data acquisition system include: •Sensors that convert physical parameters to electrical signals. •Signal conditioning circuitry to convert sensor signals into a form that can be converted to digital values. •Analog-to-digital converters, which convert conditioned sensor signals to digital values.
Sistemas de Aquisição de Dados MEFT 2016/17
Extreme Example:CERN CMS Detector
5
CMS Collision Analisys
DAQ SYSTEM
Sistemas de Aquisição de Dados MEFT 2020/21 6
!"#$%&'()#*+,--./0/1- 1
!"#$%&'()$*+,-.,(/
!"#"$#%&'()*+(,-%.)-(#&/,,"&(
0&%$"''%&
1")+%2#(3*/#'(4135(6 7*#"--/,"*#(.288"&/*,(+"9/$"'
:2/-+"&(3*/#'(4:35()*+(;/-#"&(3*/#'(4;35(8%&(
</,<6-"9"-(#&/,,"&'
Sistemas de Aquisição de Dados MEFT 2020/21
Tokamak ITER CODAC
7
Sistemas de Aquisição de Dados MEFT 2016/17
Typical Components of Small Data Acquisition Systems
8
5.1 A/D ConversionVoltage measurement during data acquisition relies on a processknown as analog-to-digital conversion (often abbreviated as A/D or A-to-D). An analog input board contains an A/D converter and supportcircuitry (Figure 5-1), which conditions and digitizes the incomingvoltage. The following list summarizes the individual circuit stages andoperation of a typical complete A/D circuit. Specialized analog inputboards may depart from this description, with multiple A/D convert-ers, large FIFO buffers, circular buffers, triggering, or other features.
• Signal conditioning (optional)
- Sensor excitation
- Filtering
- Input protection
• Multiplexer (selects a channel on multi-input A/D boards)
• Programmable instrumentation amplifier (applies gain)
• A/D converter (digitizes the signal)
• FIFO buffer (temporarily stores measurement data)
• Control circuitry (retrieves data from FIFO buffer)
Figure 5-1. Typical A/D converter and associated circuitry
5.1.1 A/D Resolution and SpeedThree of the most important specifications involved in choosing ananalog input board are A/D converter resolution, accuracy, and speed.These specifications and other A/D characteristics are interrelated,because higher performance in one area may come at the expense ofperformance in other areas. For example, high speed and high resolu-tion are usually mutually exclusive to some degree, and achieving both
- SECTION 5
InputProtection Multiplexer
InstrumentationAmplifier
ChannelSelect
GainSelect
CTRLControl
A/DConversion
Data
Data
Bus
A...
FIFO
Signal Conditioning: •Protection •Amplification (Unipolar/Differential) •Isolation •Filtering •Multiplexing (MUX) •Sampling and Hold (S&H)
Sensors
Sistemas de Aquisição de Dados MEFT 2016/17
Example of Analog Circuits (Signal Conditioning)
9
Refer to “Electronic Instrumentation” Course
BufferDifference
Adder
Measure Resistance
Differentiator Integrator
Sistemas de Aquisição de Dados MEFT 2016/17
Signal Conditioning IIInstrumentation amplifier
10
Use: Precise measurements and Low Noise Input Circuit to ADC High Input Impedance High Common Mode Rejection (CMRR) Low Offset Output Voltage
Sistemas de Aquisição de Dados MEFT 2020/21
Simple, Robust and very
stable. No power needed
11
Signal Conditioning IIIInput filters (passive)
Sistemas de Aquisição de Dados MEFT 2020/21 12
Example: Sallen-Key Low Pass Filter Note: Switch “Rx” <->“Cx” and get a
“High Pass Filter”
Signal Conditioning IIIInput filters (passive)
Sistemas de Aquisição de Dados MEFT 2016/17
The Data Converter Interface
13
Introduction
Boris MurmannStanford UniversityStanford University
Copyright © 2012 by Boris Murmann
B. Murmann 1EE315B - Chapter 1
Motivation (1)
This course
A/DSignal
This course
Digital Processing
A/D
D/A
Signal Conditioning
Signal
Analog Media and
Transducers D/A g
Conditioning
Sensors, Actuators, Antennas, Storage Media, ...
B. Murmann 2EE315B - Chapter 1
Sistemas de Aquisição de Dados MEFT 2020/21
Data Converters
14
Overview
• We'll fist look at these building blocks from a functional, "black box" perspective– Refine later and look at implementations
B. Murmann 3EE315B - Chapter 2
p
Uniform Sampling and Quantization
• Most common way of performing A/D conversionconversion– Sample signal uniformly in time– Quantize signal uniformly in
lit damplitude
• Key questions– How much "noise" is added dueHow much noise is added due
to amplitude quantization?– How can we reconstruct the
signal back into analog form?signal back into analog form?– How fast do we need to sample?
• Must avoid "aliasing"
B. Murmann 4EE315B - Chapter 2
A/D Conversion
D/A Conversion
Sistemas de Aquisição de Dados MEFT 2020/21
The Data Conversion Problem
15
Sampling, Reconstruction, Quantization
Boris MurmannStanford UniversityStanford University
[email protected] © 2012 by Boris Murmann
B. Murmann 1EE315B - Chapter 2
The Data Conversion Problem
• Real world signalsg– Continuous time, continuous amplitude
• Digital abstractionDi t ti di t lit d– Discrete time, discrete amplitude
• Two problems– How to discretize in time and amplitudeHow to discretize in time and amplitude
• A/D conversion– How to "undescretize" in time and amplitude
• D/A conversion
B. Murmann 2EE315B - Chapter 2
• D/A conversion
• Real world signals – Continuous time, continuous amplitude
• Digital abstraction – Discrete time, discrete amplitude
• Two problems – How to discretise in time and amplitude ? A/D conversion – How to "undescretise" in time and amplitude D/A conversion
Sistemas de Aquisição de Dados MEFT 2020/21
ADC: “Double Discretisation"
16
FUNDAMENTALS OF SAMPLED DATA SYSTEMS
2.2 SAMPLING THEORY
2.23
SECTION 2.2: SAMPLING THEORY
Walt Kester
This section discusses the basics of sampling theory. A block diagram of a typical real-
time sampled data system is shown in Figure 2.25. Prior to the actual analog-to-digital
conversion, the analog signal usually passes through some sort of signal conditioning
circuitry which performs such functions as amplification, attenuation, and filtering. The
lowpass/bandpass filter is required to remove unwanted signals outside the bandwidth of
interest and prevent aliasing.
Figure 2.25: Sampled Data System
The system shown in Figure 2.25 is a real-time system, i.e., the signal to the ADC is
continuously sampled at a rate equal to fs, and the ADC presents a new sample to the
DSP at this rate. In order to maintain real-time operation, the DSP must perform all its
required computation within the sampling interval, 1/fs, and present an output sample to
the DAC before arrival of the next sample from the ADC. An example of a typical DSP
function would be a digital filter.
In the case of FFT analysis, a block of data is first transferred to the DSP memory. The
FFT is calculated at the same time a new block of data is transferred into the memory, in
order to maintain real-time operation. The DSP must calculate the FFT during the data
transfer interval so it will be ready to process the next block of data.
Note that the DAC is required only if the DSP data must be converted back into an
analog signal (as would be the case in a voiceband or audio application, for example).
There are many applications where the signal remains entirely in digital format after the
initial A/D conversion. Similarly, there are applications where the DSP is solely
responsible for generating the signal to the DAC. If a DAC is used, it must be followed
by an analog anti-imaging filter to remove the image frequencies. Finally, there are
LPF
OR
BPF
N-BIT
ADCDSP
N-BIT
DAC
LPF
OR
BPF
fa
t
fs fs
AMPLITUDE
QUANTIZATIONDISCRETE
TIME SAMPLING
fa
1
fs
ts=1
fs
ts=
Sistemas de Aquisição de Dados MEFT 2020/21
ADC Uniform Sampling and Quantization
17
Overview
• We'll fist look at these building blocks from a functional, "black box" perspective– Refine later and look at implementations
B. Murmann 3EE315B - Chapter 2
p
Uniform Sampling and Quantization
• Most common way of performing A/D conversionconversion– Sample signal uniformly in time– Quantize signal uniformly in
lit damplitude
• Key questions– How much "noise" is added dueHow much noise is added due
to amplitude quantization?– How can we reconstruct the
signal back into analog form?signal back into analog form?– How fast do we need to sample?
• Must avoid "aliasing"
B. Murmann 4EE315B - Chapter 2
• Most common way of performing A/D conversion: – Sample signal uniformly in time – Quantize signal uniformly in amplitude
• Key questions 1– How much "noise" is added due to amplitude quantization? 2– How can we reconstruct the signal back into analog form?
3– How fast do we need to sample? Must avoid "aliasing"
Sistemas de Aquisição de Dados MEFT 2020/21
What is Aliasing ?
18
fsig=101kHz
fsig=899 kHz
fsig=1101 kHz
All sampled signals are equal!
Sistemas de Aquisição de Dados MEFT 2020/21
How to describe time discretisation using Math? “Dirac Pulses”
19
X
Dirac CombSignal
=
f(t) �T =n=⇥�
n=�⇥�(t� n · T ) fa(t)
fa(t) = �T · f(t)
f(t0) =� ⇥
�⇥f(t)�(t� t0)dtBy definition of Delta “function”
“Sampled” signal (continuous time)
Sampled Signal
X =
Sistemas de Aquisição de Dados MEFT 2020/21
With analog signals when we know the spectrum we use the “Fourier Transform”
20
FT Properties:
1) If f(t) is Real F (�w) = F �(w) (Symmetry of FT)
f1(t) ⇤ f2(t) TF�⌅F1(w) · F2(w)
(Inverse) f1(t) · f2(t) TF�⌅12�
F1(w) ⇤ F2(w)
F (w) =� ⇥
�⇥f(t)e�iwtdt� f(t) =
12�
� ⇥
�⇥F (w)eiwtdw
2) Convolution FT
g(t) = f1(t) ⇥ f2(t) ⇤� ⇥
�⇥f1(�)f1(t� �)d�
Sistemas de Aquisição de Dados MEFT 2020/21
Fourier Transform of the Sampled Signal
21
fa(t) = �T · f(t) TF⇤⌅12⇥
TF{�T }(w) ⇥ F (w)
Fa(w) =n=⇥�
n=�⇥�(w � n · WT ) ⇤ F (w) =
⇥ ⇥
�⇥
n=⇥�
n=�⇥�(⇥ � n · WT ) · F (w � ⇥)d⇥
Fa(w) =n=⇥�
n=�⇥F (w � n · WT )
w
|F (w)|
WT�WT wWT�WT
......* =
2WT
|Fa(W )|
Sistemas de Aquisição de Dados MEFT 2020/21
Discrete-time Fourier transform DTFT & DFT
22
X2⇡(w) =1X
n=�1x[n]e�iwn w normalised frequency
in radians per sampleDTFT
DFT
Pick a arbitrary number of samples (N), and sample X(w)
xN [n] ⌘1X
m=�1x[n�mN ]
Xk =1X
n=�1x[n]e�i2⇡ kn
N for k = 0, . . . , N � 1
=X
N
xN [n]e�i2⇡ knN
Xk ⌘N�1X
n=0
x[n]e�i knN x[n] ⌘ 1
N
N�1X
k=0
X[k]eiknN , k, n 2 Z
Sistemas de Aquisição de Dados MEFT 2020/21
Frequency AliasingThe frequencies
fsig and N· fs ± fsig (N integer), are indistinguishable in the discrete time domain
Sistemas de Aquisição de Dados MEFT 2020/21
Nyquist–Shannon sampling theorem
A real signal with a frequency range DC(0Hz) -> Fmax must be sampled at a minimum frequency Fsamp ≥ 2⋅Fmax
The frequency spectrum is “periodized” by the timed sampling process, and it can overlap: (period WT=2π/Tsampling) - “ALIASING”
In a more general way, for real signals with frequency spectrum limited to an bandwidth ∆F= Fmax - Fmin , the minimum sampling frequency, is n: Fa ≥ 2⋅ ∆F
To avoid “ALIASING” for signals with an unknown frequency spectrum we need to eliminate frequency components ≥ Fsamp / 2 by Analog Filters before sampling
Jim CampbelL Portrait of a Portrait of Harry Nyquist (2000)
12 x 16 (192) LEDs
Sistemas de Aquisição de Dados MEFT 2020/21
Sampling Baseband bandwidth signals. (Bandwidth equals the upper frequency)
• In order to prevent aliasing, we need fsig,max< fsamp /2
• The half of sampling rate fNyq= fs 2 is called the Nyquist rate.
• Two possibilities:
• Sample fast enough to cover all spectral components, including "parasitic" ones outside band of interest. (eg. harmonics)
• Limit fsig,max through filtering, e.g. Anti-Alias
Sistemas de Aquisição de Dados MEFT 2020/21
Ideal Brick Wall Anti-Alias Filter
• But there are no Ideal Filters…
Sistemas de Aquisição de Dados MEFT 2020/21
Practical Anti-Alias Filters
Sistemas de Aquisição de Dados MEFT 2020/21
Anti-Aliasing Analog Filters
28
Signal with unknown Spectrum Bandwidth
Correctly Sampled signal
PRATICAL ANALOG! Filter
ADC
LP Filter
|F (w)|
A=1
A=0
Ideal Filter
fs/2fs/2
Sistemas de Aquisição de Dados MEFT 2020/21
Bibliography
• Analog-to-Digital Conversion, Second Edition, Marcel J.M. Pelgrom, Springer 2013
• Data Conversion Handbook, Chapter 2 Analog Devices Inc., 2004
• http://www.analog.com/library/analogDialogue/archives/39-06/data_conversion_handbook.html
• Data Acquisition and Control Handbook, A Guide to Hardware and Software for Computer-Based Measurement and Control , Keithley http://tinyurl.com/q6okgxs
29