Digital signal conditioning (ADC/DAC)
Data Handling Systems •
•
Both data about the physical world and control signals sent to interact with the physical physical world are typically "analog" or continuously varying quantities. In order to use the power of digital electronics, one must convert from from analog to digital form on the experimental measurement end and convert from digital to analog form on the control or output end of a laboratory system.
Data Collection and Control
Data Acquisition System System
Analog Signal
Signal Conditioner
ADC
Communication
Digital Processing
Analog vs. Digital Signal •
Analog signals: –
–
–
•
Continuous, expressed in decimal system No limitation on the maximum/minimum value Can not be processed by computer
Digital signals: binary number system system –
–
All numbers are expressed by a combination of 1 &0 The maximum value is limited by # of bits available
Types of data •
Analog data (All values on the time and amplitude are allowed).
•
Digital data (Only a few amplitude levels are allowed).
Review •
Ex 1 : Find the base 10 equivalent of the binary number 00101112
review •
Ex : octal & hexadecimal hexadecimal number???
•
(3 binary digit) 0002 = ?? 8
•
(3 binary digit) 1112 = ?? 8
•
4 binary digit 00002 = ??? 16 Hex
•
4 binary digit 11112 = ??? 16 Hex
Fractional Fractional binary number •
N10 = b1 2-1 + b2 2-2 + …….+ bm 2-m
Where
N10 = base number less than 1 b1 b2 … bm-1 bm = base 2 number less than
1 m = number of digits in base 2 numbers
•
Ex: Find the base 10 equivalent of the binary number 0.110102
ADC ADC -
Analo Analog g Repre eprese sent ntat atio ions ns of Sound Sound
Magnified phonograph grooves, viewed from above:
The shape of the grooves encodes the continuously varying audio signal.
Analog to Digital Recording Chain
ADC
Microphone converts acoustic to electrical energy. energy. It’ It ’s a transducer .
Continuously varying electrical energy is an analog of the sound pressure wave. ADC (Analog to Digital Converter) Converter) converts analog to digital electrical signal.
Digital signal transmits binary numbers. DAC DAC (Digital to Analog Converter) Converter) converts digital signal in computer to analog for your headphones.
Analog to Digital Conversion Instantaneous Instantaneous amplitudes of continuous analog signal, measured at equally spaced points in time.
A series of “snapshots”
Analog to Digital Overview Sampling Rate How often analog signal is measured [samples per second, Hz] Example: 44,100 Hz
Sampling Resolution [a.k.a. “sample word length,” “bit depth”] Precision of numbers used for measurement: the more bits, the higher the resolution.
Example: 16 bit
Sampling Rate Determines the highest frequency that you can represent with a digital signal.
Nyquist Theorem:
Sampling rate must be at least twice as high as the highest frequency you want to represent.
Capturing just the crest and trough of a sine wave will represent the wave exactly.
Aliasing What happens if sampling rate not high enough? A high frequency signal
sampled at too low a rate
looks like …
… a lower frequency signal. That’s called aliasing or foldover. An ADC has a low-pass anti-aliasing filter to prevent this.
Synthesis software can cause aliasing.
Common Sampling Rates Which rates can represent the range of frequencies audible by (fresh) ears?
Sampling Rate
Uses
44.1 44 .1 kH kHz z (441 (44100 00))
CD, CD, DAT DAT
48 kH kHz z (48 (4800 000 0)
DAT DAT, DV, DV, DVDVD-Vide ideo
96 kHz (96000)
DVD-Audio
22.05 22.05 kHz (22050 (22050))
Old sample samplers rs
Most software can handle all these rates.
3-bit Quantiza Qu antization tion A 3-bit binary (base 2) number has 2 3 = 8 values.
7 6 5 e d 4 tu il p 3 m A
2 1 0 Time — measure amp. at each tick of sample clock
A rough approximation
4-bit Quantiza Qu antization tion A 4-bit binary number has 2 4 = 16 values.
14 12 10 e d 8 tu il p 6 m A
4 2 0 Time — measure amp. at each tick of sample clock
A better approximation
Quantization Quantization Noise Round-off Round-off error: difference difference between actual signal and quantization to integer values…
Random errors: sounds like lowamplitude noise
Analog Input Signal •
Typically, Differential or Singleended input signal of a single polarity –
0 ~ 10V and 0 ~ 5V
•
•
Prescaling input signal using OP Amp •
If Actual input signal does not span Full Input range range •
Matching input signal and input range –
Typical Input Range •
–
•
–
Some of the converter output code never used Waste Waste of converter dynamic range
In a final stage of preconditioning circuit
By proportionally scaling down the reference signal •
If reference signal is adjustable
Greater relative effects effects of the converter errors on output
Ch
0
21
Converting Converting bipolar to unipolar •
•
Using unipolar converter when input signal is bipolar – –
•
Input signal is scaled and an offset is added Add offset
Scaling down the input Adding an offset
scaled
Bipolar Converter –
–
If polarity information in output is desired Bipolar input range •
–
Typically, Typically, 0 ~ 5V
Bipolar Output • • • •
2’s Complement Compl ement Offset Binary Sign Magnitude … Ch
0
22
Introduction Introduction DAC DAC A DAC is a Digital to Analog converter. converter. It converts converts a binary digital number into an analog representation, most commonly voltage though current is also used sometimes. 1 0 0 1
0 1 0 1
0 0 1 1
0 1 1 1
1 0 0 1
1 0 1 0
1 0 1 1
DAC Introduction to Mechatronics Student Lecture 10/23/06
Introduction Each binary number sampled by the DAC corresponds to a different output level.
l a n g i S t u tp u O g o l a n A
0111 1 100 1000 0 100 1001 1 101 1010 0 1011 0000 0001 0010 0011 0100 0101 0110 011 Digital Input Signal Introduction to Mechatronics Student Lecture 10/23/06
Typical Output DACs capture and hold a number, convert it to a physical signal, and hold that value for a given sample interval. interval. This is known as a zero-order zero-order hold and results in a piecewise constant output.
DAC
Ideally Sampled Signal
Output typical of a real, practical Introduction to Mechatronics DAC due to sample & hold Student Lecture
10/23/06
•
Ex: What is the output voltage of a 10-bit DAC with a 10V reference reference if the input is
•
a) 00101101012 b) 20F H
•
What input is needed to get a 6.5 V output?
Bipolar DAC •
•
•
Some DACs are designed to output a voltage that ranges from plus to minus some maximum when the input binary ranges ranges over the counting states. Although computers frequently use 2s complement to represent negative numbers, this is not common with DACs. Instead a simple offset-binary is frequently used wherein the output is simply biased by half the reference reference voltage equation equatio n
•
The bipolar DAC relationship is then given by
•
Vout = (N/ 2n ) VR – ½ VR
•
If N =0 ,, V out (min) = - VR /2
The max value for N is equal to (2n – 1) so that the Vout (max) = [(2n – 1)/ 2n ] VR – ½ VR = ½ VR - (VR / 2n )
•
•
Ex: A bipolar DAC has 10 bits and a reference reference of 5V. What outputs will results from inputs of 04F H and 2A4 H? What digital input gives a zero output voltage?
Conversion resolution •
•
The conversion conversion resolution is a function fun ction of the reference reference voltage voltage and the number of bits in the word. The more bits, the smaller the change in analog output for a bit change in a binary mode and hence the better better resolution.
Resolution •
•
•
The change in output voltage voltage for for a change of the LSB. Related to the size of the binary representation representation of the voltage. (8-bit) Higher resolution results in smaller steps between voltage voltage values
Resolution
V ref ref 2
Introduction to Mechatronics Student Lecture 10/23/06
n
•
•
Ex: Find Δvout of a DAC with a 10v reference?
Ex : Determine how many bits a DAC must have to to provide output increments of 0.04V or less. The reference is 10V.
FIGURE 3.11
Curtis Johnson
A generic DAC diagram, showing typical i nput and output signals.
Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458
•
•
•
Ex : A control control valve has a linear variation of opening as the input input voltage varies from from 0 to 10V . A microcomputer outputs an 8 bit bi t word to control control the valve opening using an 8 bit DAC to generate the valve voltage. a) Find the reference voltage required to obtain a full open valve valve (10V) b) Find the percentage percentage of valve opening for a 1 bit change in the input word.
A typical DAC is often implemented using a ladder network of resistors
ADC Basic Principle •
•
The basic principle of operation operation is to use the comparator comparator principle to determine d etermine whether or not to turn on a particular bit of the binary number output. It is typical for an ADC to use a digital-toanalog converter (DAC) to determine one of the inputs to the comparator.
ADC Various Approaches •
3 Basic Types
•
Digital-Ramp ADC
•
Successive Approxima Approximation tion ADC
•
Flash ADC
Digital-Ramp ADC •
•
Conversion from analog to digital form inherently involves comparator action where the value of the analog voltage at some point in time is compared with some standard. standard. A common way to do that is to apply the analog voltage to one terminal of a comparator comparator and trigger a binary counter which drives a DAC.
Digital-Ramp ADC
Digital-Ramp ADC •
•
•
The output of the DAC is applied to the other terminal of the th e comparator comp arator.. Since the output of the DAC is increasing with the counter, it will trigger the comparator comparator at some point when its voltage exceeds exceeds the analog input. The transition of the comparator stops the binary counter, which at that point holds the digital value corresponding to the analog voltage.
Successive approximation ADC
Illustration of 4-bit SAC with 1 volt step size
Successive approximation ADC •
•
Much faster than the digital ramp ADC because it uses digital logic to converge on the value closest to the input voltage. A comparator and a DAC are used in the process.
Flash ADC •
It is the fastest fastest type of ADC available, but requires a comparator for each value of output. (63 for 6-bit, 255 for 8-bit, etc.)
•
•
Such ADCs are available in IC form up to 8-bit and 10-bit flash ADCs (1023 comparators) comparators) are planned. The encoder logic executes executes a truth table to convert convert the ladder of inputs to the binary number output.
Illustrated is a 3-bit flash ADC with resolution 1 volt
Flash ADC •
The resistor net and comparators provide an input to the combinational logic log ic circuit, so the conversion time is just the propagation delay through the network - it is not limited by the clock rate or some convergence sequence.
•
Ex : Find the the successive approximation approximation Adc o/p for a 4 bit converter to a 3.217V input if the reference is 5V.
ADC formula •
The ADC will find a fractional fractional binary number that gives the closest approximation to the fraction formed by the input voltage and reference .
•
b12-1 + b22-2 +…+bn2-n ≤ Vin/VR ……1
•
Where b1 b2…bn = n- bit digital output
•
Vin = analog input voltage
•
VR = analog reference voltage
•
Uncertainty in the input voltage
•
ΔV = VR2-n
•
Ex : Temperature is measured by a sensor with an o/p of 0.02V/°C . Determine the required ADC reference and word size to measure 0° to 100°C with 0.1°C resolution.
•
•
•
•
•
Eqn 1 can be written in a simpler fashion N = INT [(Vin/VR )2n ] Where INT () means to take the integer part of the quantity in the bracket bracket Bipolar N = INT [((Vin/VR )+ ½ )2n ]
FIGURE 3.13
Curtis Johnson
A generic ADC di agram, showing typical input and output signals and noting the conversion time.
Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458
•
Ex : What are the hex and binary o/p of a bipolar 8 bit ADC with w ith a 5 V reference reference for inputs of -0.85V and + 1.5V? What input voltage would would cause an output of 72H?
Other signal conditioning circuit **Buffer, comparator. •
Buffer (follower)
•
Picture..
•
•
Ex: A Process control system specifies that temperature should never exceed 160°C if the pressure pressure also exceeds 10Kpa. Design an alarm system to detect this condition using temperature and pressure transducers with transfer function of 2.2mV/°C and o.2V/Kpa respectively.
Guideline for Design : Model for measurement and signal-conditioning objectives.
DESIGN GUIDELINE
Curtis Johnson
Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458
Design Guideline •
Ex: A sensor outputs a voltage ranging ranging from 2.4 to -1.1 V. For interface to an analog to digital converter, converter, this needs to be 0 to 2.5V. 2.5V. Develop the required signal conditioning.
•
•
•
Ex: A measurement of temperature using a sensor that outputs 6.5mV/°C must measure to 100°C . A 6 bit ADC with a 10V reference reference is used. A) Develop a circuit to interface the sensor and the ADC B) Find the temperature temperature resolution
•
•
Ex: A sensor outputs a range of 20 to 250mV as a variable varies over its range. Develop signal conditioning so that this becomes 0 to 5V. The circuit must have very high impedance.