Embedded Control Week 3 (7/13/11)
Week 3 15:00 Lecture Overview of analog signals Digital-to-analog conversion Analog-to-digital conversion 16:00 Lab NXT analog IO
Overview of Analog Signals Continuous voltage signals Vcc Voltage may be any value between reference voltages Analog voltage signals are the output 0V signal of many types of sensors Advantages and disadvantages Advantages of analog signals High information density in signals Disadvantages of analog signals Susceptible to fluctuations in voltage (noise)
Digital-to-Analog Conversion (DAC) Converting discrete digital signals to continuous analog voltage signals Used to generate voltage signals to drive analog devices DC motors Audio speakers Monitors Used to generate voltage signals to compare with an input analog signal (analog-to-digital conversion) Voltage output is limited to resolution (number of states, Nres) of the DAC (e.g. n-bit resolution, 2^n states) and the reference voltage (Vref) Voltage output is a linear function of the numerical input, N V out V ref N N in res V ref N 2 in n
Operational Amplifier VS Overview A circuit component that amplifies a voltage signal based on a differential input (+, ) to produce an output voltage between that of the cathode and anode connections Pin connections (+) non-inverting input ( ) inverting input (Vs+) cathode connection (Vs ) anode connection (Vout) voltage output + VS+ Vout + VS+ Vout VS
Binary Resistor Ladder/Weighted Summing Amplifier DAC that uses a row of resistors of exponentially increasing value connected in parallel from the most-significant-bit (MSB) to the least-significantbit (LSB) to convert a binary value to a proportional voltage Circuit has one resistor per MSB BN input of a non-standard resistance; the resistors B(N 1) leading up to the MSB must be of an increasingly high tolerance B2 Circuit acts as a current divider that divides each input voltage by the corresponding resistance and adds the currents into the summing amplifier LSB B1 B0 1RΩ 2RΩ V o 2^(N 2)RΩ 2^(N 1)RΩ 2^(N)RΩ IBN R f R IB(N 1) V ref N i0 http://www.youtube.com/watch?v=-mwuzknancw IB2 IB1 IB0 Itotal + RfΩ VS VS+ V R Vout Bi Bi VO
R-2R Resistor Ladder RfΩ DAC that uses a ladder configuration of resistors of either R or 2R resistance to convert a binary value to a proportional voltage signal Circuit uses two standard resistors (or pairs of standard resistors) per input; the resistors leading up to the MSB must be of an increasingly high tolerance V o R f R V ref N i0 V R Bi Bi MSB BN B(N 1) B2 B1 LSB B0 2RΩ IBN 2RΩ IB(N 1) 2RΩ IB2 2RΩ IB1 2RΩ IB0 Itotal 1RΩ 1RΩ 1RΩ 1RΩ 2RΩ + VS VS+ Vout VO http://www.youtube.com/watch?v=fpb1qrw9gmi
Digital-to-Analog Conversion - Problem A DAC with a 12-bit resolution is used to generate a voltage between 0V and 5V What is the voltage increment per bit of the DAC? What is the voltage produced if the input is 3152? What is the maximum voltage that can be produced by the DAC?
Digital-to-Analog Conversion - Solution A DAC with a 12-bit resolution is used to generate a voltage between 0V and 5V What is the voltage increment per bit of the DAC? 1 1 5V 5V 1. 221mV 12 2 4096 What is the voltage produced if the input is 3152? 3152 3152 5V 5V 3. 848V 12 2 4096 What is the maximum voltage that can be produced by the DAC? 12 2 1 4095 5V 5V 4. 9988V 12 2 4096
Analog-to-Digital Conversion (ADC) Converting continuous analog voltage signals to discrete digital signals Used to read output of analog devices Any sensor that returns an analog voltage as a measurement of state Numerical output is limited to resolution (number of states, Nres) of the ADC (e.g. n-bit resolution, 2^n states) and the reference voltage (Vref) Numerical output is a linear function of the voltage input, V Vin N out int Nres int 2 Vref n V V in ref
Method of Successive Approximation/Bisection Method ADCs use the method of successive approximation to find the numerical representation of the voltage input by generating voltages that are half of the voltage range and comparing the input voltage to the generated voltage 31 21 16 Decrease the generated voltage by half of the current voltage range if the input voltage is less than the generated voltage; increase the generated voltage by half of the current voltage range if the input voltage is greater than or equal to the generated voltage 0 1 MSB 0 1 0 1 LSB 21
Analog-to-Digital Conversion Problem 1 Using the method of successive approximation, find the output of the ADC and draw the steps taken to find the output 31 16 0 MSB LSB
Analog-to-Digital Conversion Solution 1 Using the method of successive approximation, find the output of the ADC and draw the steps taken to find the output 16 31 The input voltage (16) is greater than or equal to the generated voltage (32/2 = 16), so the generated voltage increments by (16/2 = 8) and becomes (16 + 8 = 24) and the fifth bit (MSB) becomes 1 0 1 MSB LSB
Analog-to-Digital Conversion Solution 1 Using the method of successive approximation, find the output of the ADC and draw the steps taken to find the output 16 31 The input voltage (16) is less than the generated voltage (24), so the generated voltage decrements by (8/2 = 4) and becomes (16 + 8 4 = 20) and the fourth bit becomes 0 0 1 MSB 0 LSB
Analog-to-Digital Conversion Solution 1 Using the method of successive approximation, find the output of the ADC and draw the steps taken to find the output 16 31 The input voltage (16) is less than the generated voltage (20), so the generated voltage decrements by (4/2 = 2) and becomes (16 + 8 4 2 = 18) and the third bit becomes 0 0 1 MSB 0 0 LSB
Analog-to-Digital Conversion Solution 1 Using the method of successive approximation, find the output of the ADC and draw the steps taken to find the output 16 31 The input voltage (16) is less than the generated voltage (18), so the generated voltage decrements by (2/2 = 1) and becomes (16 + 8 4 2 1 = 17) and the second bit becomes 0 0 1 MSB 0 0 0 LSB
Analog-to-Digital Conversion Solution 1 Using the method of successive approximation, find the output of the ADC and draw the steps taken to find the output 16 31 The input voltage (16) is less than the generated voltage (17), so the first bit (MSB) bit becomes 0 and the numerical output is solved 0 1 MSB 0 0 0 0 LSB 16
Analog-to-Digital Conversion Problem 2 An ADC has a 10-bit resolution and an input voltage range of 0V to 5V what is the voltage increment of the ADC? What is the numerical output of the ADC if the input voltage is 3.93V? What is the voltage input of the ADC if the numerical output is 775?
Analog-to-Digital Conversion Solution 2 An ADC has a 10-bit resolution and an input voltage range of 0V to 5V what is the voltage increment of the ADC? 1 1 5V 5V 4. 883mV 10 2 1024 What is the numerical output of the ADC if the input voltage is 3.93V? 10 3.93V int 2 int10240.768 804 5V What is the voltage input of the ADC if the numerical output is 775? 775 775 5V 5V 3. 784V 10 2 1024
Lab NXT analog IO Building digital-to-analog converter circuits using the NXT and HiTechnic sensor expansion kit
Weighted Summing Amplifier 500Ω B3 B2 B1 B0 4RΩ 2RΩ 1kΩ 500Ω + VS Vout VS+ Vcc
R-2R Resistor Ladder 1kΩ B3 B2 B1 B0 2kΩ 2kΩ 2kΩ 2kΩ 1kΩ 1kΩ 1kΩ + VS Vout VS+ Vcc 2kΩ