You are on page 1of 74

Digital signal conditioning

(ADC/DAC)
Data Handling Systems
• Both data about the physical world and control
signals sent to interact with the physical world are
typically "analog" or continuously varying quantities.
• In order to use the power of digital electronics, one
must convert 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

Analog Signal
Signal Conditioner

ADC

Digital
Communication
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


– 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 number???
• (3 binary digit) 0002 = ?? 8
• (3 binary digit) 1112 = ?? 8
• 4 binary digit 00002 = ??? 16 Hex
• 4 binary digit 11112 = ??? 16 Hex
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 - Analog Representations of 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. It’s a transducer.
Continuously varying electrical energy is an analog
of the sound pressure wave.
ADC (Analog to Digital Converter) converts analog to
digital electrical signal.
Digital signal transmits binary numbers.
DAC (Digital to Analog Converter) converts digital signal in
computer to analog for your headphones.
Analog to Digital Conversion
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 kHz (44100) CD, DAT
48 kHz (48000) DAT, DV, DVD-Video
96 kHz (96000) DVD-Audio
22.05 kHz (22050) Old samplers

Most software can handle all these rates.


3-bit Quantization
A 3-bit binary (base 2) number has 23 = 8 values.

7
6
5
Amplitude

4
3
2
1
0
Time — measure amp. at each tick of sample clock
A rough approximation
4-bit Quantization
A 4-bit binary number has 24 = 16 values.

14
12
10
Amplitude

8
6
4
2
0
Time — measure amp. at each tick of sample clock
A better approximation
Quantization Noise
Round-off error: difference between actual signal and
quantization to integer values…

Random errors: sounds like low-


amplitude noise
Analog Input Signal
• Typically, Differential or Single- • Matching input signal and
ended input signal of a single
input range
polarity
– Prescaling input signal
– Typical Input Range
using OP Amp
• 0 ~ 10V and 0 ~ 5V
• In a final stage of
– If Actual input signal does preconditioning circuit
not span Full Input range
– By proportionally scaling
• Some of the converter output
code never used down the reference signal
• Waste of converter dynamic • If reference signal is
range adjustable
• Greater relative effects of the
converter errors on output

Chap 0 21
Converting bipolar to unipolar
• Input signal is scaled and an offset
is added
• Using unipolar converter when
input signal is bipolar Add
– Scaling down the input offset
– Adding an offset scaled
• Bipolar Converter
– If polarity information
in output is desired
– Bipolar input range
• Typically, 0 ~ 5V
– Bipolar Output
• 2’s Complement
• Offset Binary
• Sign Magnitude
• …

Chap 0 22
Introduction DAC

A DAC is a Digital to Analog converter. It


converts a binary digital number into an
analog representation, most commonly
voltage though current is also used
sometimes.
1 0 0 0 1 1 1
0 1 0 1 0 0 0
0 0 1 1 0 1 1
1 1 1 1 1 0 1 DAC
Introduction to Mechatronics
Student Lecture – 10/23/06
Introduction
Each binary number sampled by the DAC corresponds to
a different output level.
Analog Output Signal

0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011
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. This is known as a zero-order
hold and results in a piecewise constant output.

DAC

Ideally Sampled Signal Output typical of a real, practical


Introduction to MechatronicsDAC due to sample & hold
Student Lecture – 10/23/06
• Ex: What is the output voltage of a 10-bit DAC
with a 10V 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 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 voltage equation
• 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
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 resolution is a function of the
reference 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 resolution.
Resolution
• The change in output voltage for a change of the LSB.
• Related to the size of the binary representation of the
voltage. (8-bit)
• Higher resolution results in smaller steps between voltage
values

Vref
Resolution n
2
Introduction to Mechatronics
Student Lecture – 10/23/06
• Ex: Find Δvout of a DAC with a 10v reference?

• Ex : Determine how many bits a DAC must


have to provide output increments of 0.04V or
less. The reference is 10V.
FIGURE 3.11 A generic DAC diagram, showing typical input and output signals.

Copyright ©2006 by Pearson Education, Inc.


Curtis Johnson
Upper Saddle River, New Jersey 07458
Process Control Instrumentation Technology, 8e] All rights reserved.
• Ex : A control valve has a linear variation of
opening as the input voltage varies from 0 to
10V . A microcomputer outputs an 8 bit word
to 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 (10V)
• b) Find the 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 is to use the
comparator principle to determine whether or
not to turn on a particular bit of the binary
number output.
• It is typical for an ADC to use a digital-to-
analog converter (DAC) to determine one of
the inputs to the comparator.
ADC Various Approaches
• 3 Basic Types

• Digital-Ramp ADC
• Successive Approximation 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.
• A common way to do that is to apply the
analog voltage to one terminal of a
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 comparator.
• Since the output of the DAC is increasing
with the counter, it will trigger the
comparator at some point when its voltage
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 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) are planned.
• The encoder logic executes a truth
table to 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 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 successive 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 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

• Bipolar
• N = INT [((Vin/VR )+ ½ )2n ]
FIGURE 3.13 A generic ADC diagram, showing typical input and output signals and noting the conversion time.

Copyright ©2006 by Pearson Education, Inc.


Curtis Johnson
Upper Saddle River, New Jersey 07458
Process Control Instrumentation Technology, 8e] All rights reserved.
• Ex : What are the hex and binary o/p of a
bipolar 8 bit ADC with a 5 V reference for
inputs of -0.85V and + 1.5V? What input
voltage 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 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

Copyright ©2006 by Pearson Education, Inc.


Curtis Johnson
Upper Saddle River, New Jersey 07458
Process Control Instrumentation Technology, 8e] All rights reserved.
Design Guideline
• Ex: A sensor outputs a voltage ranging from -
2.4 to -1.1 V. For interface to an analog to
digital converter, this needs to be 0 to 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 is
used.
• A) Develop a circuit to interface the sensor
and the ADC
• B) Find the 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.

You might also like