Data Acquisition: A/D & D/A Conversion Mark Colton ME 363 Spring 2011
Sampling: A Review In order to store and process measured variables in a computer, the computer must sample the variables 10 Continuous Discrete 8 6 Discretization 4 2 x 0-2 -4-6 -8-10 0 0.2 0.4 0.6 0.8 1 t
Sampling: A Review Sampling causes information to be lost We only have data points at discrete times We don t know the values of the waveform between samples The shape of the input waveform is unclear Sampling faster gives better results Data points are more closely spaced The waveform shape is better defined Aliasing is prevented
Quantization There is another source of uncertainty due to sampling Computers can not store numbers exactly Converting analog numbers to digital numbers is called quantization Results in an approximation to the value of the number
Quantization vs. Discretization Discretization Time Quantization Magnitude V Quantization Discretization t
Quantization vs. Discretization 5 x 0-5 0 0.5 1 1.5 2 t
Binary Numbers The smallest unit of digital information is the bit A bit is a single binary digit consisting of a 0 or a 1 A combination of bits can be used to represent numbers other than 0 or 1 A group of bits is called a word A byte is an 8-bit word
Binary Numbers Binary numbers represent a base-2 number system An M-bit word can represent 2 M different numbers Example: 2 bits 2 2 = 4 different numbers 00 10 01 11 If your computer uses 16 bits, how many different numbers can it represent? 2 16 = 65,536 If the number you are measuring is not one of those 65,536 numbers, then it will have to be approximated
Straight Binary Let s look at one binary representation system that uses an M-bit word M-1 A M-1 MSB Each bit represents the multiplier of the corresponding power of 2: number = A M-1 2 M-1 + + A 2 2 2 + A 1 2 1 + A 0 2 0 MSB denotes most significant bit LSB denotes least significant bit 3 2 1 0 A 3 A 2 A 1 A 0 LSB
Consider a 4-bit word Example There are 2 4 = 16 possible numbers 3 2 1 0 1 1 1 1 1 2 3 + 1 2 2 + 1 2 1 + 1 2 0 = 15 3 2 1 0 0 0 0 0 0 2 3 + 0 2 2 + 0 2 1 + 0 2 0 = 0 3 2 1 0 1 0 0 1 1 2 3 + 0 2 2 + 0 2 1 + 1 2 0 = 9
Bipolar Codes Straight binary is unipolar no sign information There are several bipolar codes see Table 7.1 Two s Complement is the most widely used in digital computers
Actual Digital Representation Computers don t really store 1 s and 0 s They store voltages, with 1 corresponding to the high voltage and 0 corresponding to the low voltage In many cases high means 5 V and low means 0 V
A/D and D/A Conversion Analog-to-Digital Conversion (A/D or ADC): Convert an analog voltage to a digital word MSB V in A/D LSB Digital-to-Analog Conversion (D/A or DAC): Convert a digital word to an analog voltage MSB D/A V out LSB
D/A Conversion MSB D/A V out LSB Switches set each bit to 0 or E ref c m corresponds to 1 or 0 at the m th bit Output voltage: E o = E ref R r M m= 1 c 2 m m 1 R
A/D Conversion Analog-to-digital converters quantize sampled analog signals Resolution: The smallest voltage increment that will cause a change in the converter (the smallest detectable difference in voltages) resolution = range of number of possible values possible values-1 resolution = full - scale voltage range bits of resolution 2 1 MSB Q EFSR = 2 M 1 V in A/D LSB
Consider a 3-bit straight binary A/D converter E FSR = 10 V Q = 10/(2 3-1)= 10/7 = 1.429 V Lab: Q = 10/(2 12-1)= 10/4095 = 0.0024 V Output 10.00 111 8.571 110 7.143 101 5.714 100 4.286 011 2.857 010 1.429 001 Example Saturation 0.00 000 1.429 2.857 4.286 5.714 7.143 8.571 10.00 Input
A/D Converter Types Successive Approximation Ramp (Integrating) Parallel (Flash) Sigma/Delta
Successive Approximation Uses a trial-and-error approach to set bits of digital M-bit register that approximates the analog signal being converted Starts with MSB Tests each bit of the register from MSB to LSB successively Compares input voltage to voltage generated using a D/A converter After all registers are set, approximation is complete Advantage: Relatively good speed at a reasonable cost Disadvantage: Sensitivity to noise
Successive Approximation
Ramp (Integrating) Uses a counter and a voltage ramp to perform the conversion Voltage ramp starts at bottom end of the A/D range and ramps up until it sweeps out the entire voltage range A counter simultaneously counts its way from 00000 to 11111 (for 5 bits) The input voltage is compared to the ramp voltage When the ramp exceeds the input voltage, the counter value is stored as the converted digital value Advantages: Cheap, insensitive to noise Disadvantage: Slow
Ramp (Integrating)
Parallel (Flash) Compares the input voltage to many voltage thresholds over the range of the A/D If the input voltage exceeds a particular threshold, then the corresponding comparator output is set HIGH Advantage: Fast Disadvantage: Expensive (requires 2 M -1 comparators)
Parallel (Flash)
Sigma/Delta More complicated to understand Fast and accurate
Overview Sigma/Delta and Successive Approximation converters used in data acquisition boards for PCs Ramp converters used in digital multimeters Flash converters used in high-speed DAC applications
Multiplexers (MUX) There is typically only one A/D converter in a multiple-channel A/D card Multiplexers make it possible to switch between channels and use a single A/D converter Usually the number of channels is a multiple of two
A Complete System (simplified)