Download DAC 1 - godinweb

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Time-to-digital converter wikipedia , lookup

Rectifier wikipedia , lookup

Stray voltage wikipedia , lookup

Pulse-width modulation wikipedia , lookup

Voltage optimisation wikipedia , lookup

Mains electricity wikipedia , lookup

Buck converter wikipedia , lookup

Power electronics wikipedia , lookup

Oscilloscope history wikipedia , lookup

Switched-mode power supply wikipedia , lookup

Integrating ADC wikipedia , lookup

Oscilloscope types wikipedia , lookup

Schmitt trigger wikipedia , lookup

Resistive opto-isolator wikipedia , lookup

Multimeter wikipedia , lookup

Rectiverter wikipedia , lookup

Analog-to-digital converter wikipedia , lookup

Opto-isolator wikipedia , lookup

Transcript
Digital to Analog Converters
(DAC)
1
Technician Series
©Paul Godin
[email protected]
March 2015
Digital and Analog
◊
Digital systems are discrete, meaning they have a finite
numerical value. Sometimes referred to as “fixed” or
“stepped” values.
◊
Analog values are continuous, meaning they have a value
that can vary continuously. The values can be to a great
degree of precision and may contain more information such
as frequency, phase, etc…
◊
Analog values make up real-world values that can be
measured.
◊
This presentation describes methods for converting digital
values to analog values.
DAC 1.2
Digital to Analog
◊ Digital electronics offers advantages over analog
in processing, data manipulation, storage and
analysis of values.
◊ Often these digital circuits must interface with the
real world:
◊ as inputs to analyze, process and manipulate
◊ as outputs to control the physical environment
◊ It is important to establish a means of converting
between digital systems and the real world.
DAC 1.3
Transducers
◊ Transducers are devices that convert physical
quantities into electrical quantities. There are
many possible physical measurements requiring
many types of transducers:
◊
◊
◊
◊
◊
◊
◊
◊
◊
Light
Pressure
Speed
Flow
Angle
Temperature
Rotation
Vibration
Sound, …
Images from MSclipart (now Bing). Source & copyright status unknown!
DAC 1.4
Actuators
◊
Actuators are electrically controlled devices that control the
physical environment. There are many types of actuators
available. These include:
◊
◊
◊
◊
◊
◊
◊
◊
◊
motors
solenoids (electromagnetic non-rotational motion)
relays
pumps
valves
lifts
heaters
lights
acoustic devices, …
Images from MSclipart (now Bing). Source & copyright status unknown!
DAC 1.5
Analog versus Digital
Distorted Analog signal
Original Analog signal
000000100000010000101000
101000011010010011001110
101000100000101000101000
011010010011001110101000
100000001000010100000010
000101000101000011010010
011001110101000100001010
000110100100110011101010
001010111011011010001001
Binary signal
DAC 1.6
Analog to Digital
Original Analog signal
A to D Conversion
The voltage is converted to a
binary value at regular intervals.
Animated
000100110111101010001
000111000000100000010
011100101001001011101
011110010101010010101
010101001001010101001
000101001010101111010
000001001011101011101
000000010101110101010
000000000001001111010
000000000000111111010
000000000001010101010
000000000001011011101
000000000001101101100
000000001100010111010
000000100011111010110
000001001010101000100
000001010111101111000
000011001101010100101
000110111000010100101
…
Binary signal
DAC 1.7
Digital to Analog
000100110111101010001
000111000000100000010
011100101001001011101
011110010101010010101
010101001001010101001
000101001010101111010
000001001011101011101
000000010101110101010
000000000001001111010
000000000000111111010
000000000001010101010
000000000001011011101
000000000001101101100
000000001100010111010
000000100011111010110
000001001010101000100
000001010111101111000
000011001101010100101
000110111000010100101
…
Digital signal
Animated
D to A Conversion
Analog signal
The binary value is converted to
a voltage at regular intervals.
DAC 1.8
Digital to Analog
◊ We will begin looking at converting binary and
analog values from the perspective of the
actuator; we will look at digital to analog
converters.
◊ There are several ways to implement such a
system. This presentation will look at several of
these systems.
◊ It is important to understand their basic operation
to determine a circuit fault.
DAC 1.9
DAC Challenges
◊ Digital to Analog Converters take a digital value
and convert it to voltage or current over time.
◊ Converting discrete (digital) values to analog
values has some challenges.
◊ Since the digital values have discrete steps, the steps
and the values between the steps cannot always be
completely and accurately represented in analog.
◊ How well a digital value creates an analog value depends
on the number of bits that are used. Fewer bits means
less resolution.
DAC 1.10
Scaling
◊ The range of the available digital values
represents the scale. It is based on the
number of bits in the binary number.
◊ Scale is referred to as Resolution in DACs.
◊ DACs have two extremes in output values:
zero and full-scale output. Knowing these two
extremes and the number of unique digital
outputs in between, the resolution of a circuit
can therefore be determined.
DAC 1.11
Resolution Example
C
B
A
VOUT
0
0
0
0
0.0
0
0
0
1
0.5
0
0
1
0
1.0
0
0
1
1
1.5
0
1
0
0
2.0
0
1
0
1
2.5
0
1
1
0
3.0
There are 16 values from 0000 to
1111, but the first step (0000) equals
0V. Therefore there are 15 steps.
0
1
1
1
3.5
1
0
0
0
4.0
1
0
0
1
4.5
1
0
1
0
5.0
If the maximum output is 7.5 Volts
(input 1111), the calculated scale will
be 0.5 Volts per binary increment.
1
0
1
1
5.5
1
1
0
0
6.0
1
1
0
1
6.5
1
1
1
0
7.0
1
1
1
1
7.5
Min binary = 0000
Max binary = 1111
D
MSB
LSB
D
C
B
A
VOUT
DAC
Min VOUT = 0V
Max VOUT = 7.5V
DAC 1.12
Resolution Example
◊ Analyzing the voltage output from the example it
becomes evident that the output voltage, although
analog, still follows a pattern of discrete values.
DAC 1.13
Resolution
◊ The resolution represents the smallest change, or
step, in the analog output. The greater the
resolution, the smaller the steps.
◊ To increase resolution increase the number of bits
in the binary value.
◊ In our example, a 4-bit number represented a 0.5
volt change per step. By increasing the number
to 5 bits, each change would represent
approximately 0.25 volt change per step,
increasing the resolution.
DAC 1.14
Improved Resolution
◊ By increasing the binary number size
by one bit the voltage between steps
decreases.
4-bit resolution
5-bit resolution
DAC 1.15
Resolution
◊
Volts per step is calculated as the full scale voltage divided
by the number of steps.
◊
A percent resolution is the percent of output voltage change
with one step. It is simply calculated as 1/(2N -1) where N
represents how many bits in the binary number.
◊
Discussion: assuming 12V out on a full scale, what is the
resolution of:
◊
◊
◊
8-bit value
16-bit value
20-bit value
DAC 1.16
Bipolar DAC
◊ The examples shown so far represented positive
digital values. Analog values can be negative or
positive.
◊ To represent a negative value two popular
numbering systems are used:
◊ signed magnitudes
◊ 2’s compliment values
DAC 1.17
Signed Magnitude
◊ Binary systems utilize only 1’s and 0’s. The
negative symbol cannot be used.
◊ In a signed magnitude value, the bit in the
leftmost position of a binary number is used to
indicate if the value is positive or negative. This is
the sign bit. The value following the sign bit is
the magnitude.
01001101 = positive value, 10011012
11001101 = negative value, 10011012
The leftmost bit is the sign bit.
DAC 1.18
2’s Compliment
◊ In Binary there is an interesting principle.
◊ If each digit of a binary number is inverted and a 1 is
added to the number, the new value is the “negative
equivalent” of it.
◊ 2’s compliment example:
12
-3
9
1100 is 12
0011 is 3
1100 is 1’s compliment
1101 is 2’s compliment
1100 (12)
+1101 (-3)
11001 (9)
Note the extra bit is always disregarded
DAC 1.19
DAC DEVICES
DAC 1.20
DAC Devices
◊ DACs require an input that can scale the binary
values and an output circuit in the form of an
amplifier.
◊ There are several different ways of building DACs.
◊ Each has advantages and disadvantages. They are
chosen based on the required circuit parameters.
DAC 2.21
Operational Amplifiers (Op-Amps)
◊
The Operational Amplifier (Op-Amp) is one of the basic
building blocks of electronics.
◊
Its basic form has two inputs, one inverting and the other
non-inverting.
◊
Op-Amps can be configured in many different ways:
◊
◊
◊
◊
◊
◊
Compare voltages
Amplify signals
Invert signals
Oscillate
Filter, …
VDD
VEE
Op Amps typically require a positive (VDD) and negative (VEE)
supply, and a ground reference (VSS).
DAC 1.22
Op-Amp as an Amplifier
◊ This Operational Amplifier configuration operates
in this general manner:
◊ Gain (voltage increase) equals the input voltage times
the ratio of the feedback resistor Rf to the input resistor.
◊ In this configuration the output is inverted (goes
negative)
Rf
Vin
Vout = Vin●(Rf/RIN)
Rin
VDD
VOUT
VEE
DAC 2.23
Binary-Weighted Resistor DAC
◊ The Summing Op-Amp output will be the sum of
the input voltages times the ratio of Rf over each
Rin.
Rf
Rin1
VDD
Rin2
Rin3
Rin4
VEE
DAC 2.24
Binary-Weighted Resistor DAC
◊ The first resistor has no attenuation therefore the
voltage is passed. The second R has a ½ ratio so
will attenuate by 50%. The 3rd R attenuates by ¼,
and the last by 1/8.
◊ This is an inverting amplifier (output voltage is
negative)
1 kΩ
1 kΩ
VDD
2 kΩ
4 kΩ
8 kΩ
VEE
DAC 2.25
Binary-Weighted Resistor DAC
◊ A 4-bit binary input is applied to the input
resistors, with the 1 kΩ resistor considered the
MSB.
1 kΩ
MSB
1 kΩ
VDD
2 kΩ
4 kΩ
LSB
8 kΩ
VEE
◊ The resistor ratio for the MSB is 1:1...if the input
voltage is 5V, the output is 5V.
DAC 2.26
Binary-Weighted R DAC - Table
◊ Based on an input of 5V for the
MSB, the resolution can be
calculated:
◊ If just the MSB is active, the output
voltage equals the MSB input
voltage (gain =1)
◊ 10002 = 810, therefore each step =
5V/8 = 0.625V per step
◊ Note the amplifier inverts,
therefore the output voltage is
negative
D
C
B
A
VOUT
0
0
0
0
-0.000
0
0
0
1
-0.625
0
0
1
0
-1.250
0
0
1
1
-1.875
0
1
0
0
-2.500
0
1
0
1
-3.125
0
1
1
0
-3.750
0
1
1
1
-4.375
1
0
0
0
-5.000
1
0
0
1
-5.625
1
0
1
0
-6.250
1
0
1
1
-6.875
1
1
0
0
-7.500
1
1
0
1
-8.125
1
1
1
0
-8.750
1
1
1
1
-9.375
DAC 2.27
Limitations
◊ The Binary-Weighted DAC can be difficult to
implement:
◊ The resistors must be precise, otherwise the scale steps
will be uneven.
◊ The output of logic devices such as gates or flip-flops are
not always at 5 volts and will therefore affect the scale.
◊ If switches are used, pull-up resistors will affect the
operation of the device.
◊ Larger binary values require progressively larger
resistors for the LSB. For our example:
◊ 5 bit = 16kΩ
◊ 8 bit = 128kΩ
◊ 12 bit = 2.048MΩ
DAC 2.28
Conclusion
◊ There are other configurations for DACs.
◊ Next presentation will look at other methods.
DAC 2.29
End of Part 1
©Paul R. Godin
prgodin°@ gmail.com
DAC 1.30