Objectives Topics Analog vs Digital (1)

Objectives
•
•
•
•
•
•
•
Digital to Analog converter (DAC) and
Digital-to-Analog
Analog-to-Digital converter (ADC)
Asst. Prof. Suree Pumrin, Ph.D.
Semester
Se
este 1/2553
/ 553
2142492 Selected Topics in
Automotive Engineering I
Explain the basic difference between digital and analog quantities.
Explain how analog signals are converted to digital form.
Describe the sampling process.
State the purpose of analog
analog-to-digital
to digital conversion
Explain how Analog-to-Digital converter operates
State the p
purpose
p
of Digital-to-Analog
g
g conversion
Explain how Digital-to-Analog converter operates
1
2142492 Selected Topics in
Automotive Engineering I
Topics
2
Analog vs Digital (1)
• Digital-to-Analog
g
g converter ((DAC))
• Analog-to-Digital converter (ADC)
• Sample-and-Hold
Sample and Hold operation
„
Analog
… It
is a quantity that can vary over a continuous
range of values
values.
„
Digital
… It
is a symbol representation (digits) of
discrete quantity.
2142492 Selected Topics in
Automotive Engineering I
3
2142492 Selected Topics in
Automotive Engineering I
4
Analog vs Digital (2)
Analog vs Digital (3)
• A digital quantity has two possible values: 0 or 1,
L
Low
or Hi
High,
h ttrue or ffalse,
l
etc.
t
• A digital value for TTL logic,
+5
1
0
1
V
Time
0 V to 0.8 V = logic 0
2 V to 5 V = logic 1
–5
(a)
• An analog quantity can be any value over a
continuous range of values
values, its exact value is
significant.
(b)
Figure 1 (a) Analog signal ; (b) Digital signal
2142492 Selected Topics in
Automotive Engineering I
5
Binary Quantities (1)
6
Binary Quantities (2)
Figure 3 (a) voltage assignments; (b) binary signal timing
diagram
Figure 2 (a) Open ‘0’ and closed ‘1’; (b) absence ‘0’ or presence ‘1’
2142492 Selected Topics in
Automotive Engineering I
2142492 Selected Topics in
Automotive Engineering I
7
2142492 Selected Topics in
Automotive Engineering I
8
Approximation of an analog signal
A/D and D/A
3
2
1
0
Most physical variables are analog. Any information that must be input
to a digital system must first be put into digital form. Analog-to-digital
(A/D) converter and digital-to-analog (D/A) converter are used to
interface a computer to the analog world so that the computer can
o to a
and
d co
control
to ap
physical
ys ca variable.
a ab e
monitor
Quantization – The process of converting an analog value to a
code. During the quantization process a binary code is
g
to each sampled
p
value.
assigned
2142492 Selected Topics in
Automotive Engineering I
9
DAC (1)
2142492 Selected Topics in
Automotive Engineering I
10
2142492 Selected Topics in
Automotive Engineering I
12
DAC (2)
Digital-to-analog conversion (DAC) is a process of taking a
value represented in digital code and converting it to a
voltage or current that is proportional to the digital value
value.
2142492 Selected Topics in
Automotive Engineering I
11
DAC (3)
DAC Example (1)
Analog output = K x digital input,
K = Afs/(2N-1)
where K is a resolution ((step
p size),
), Afs is the analog
g full-scale
output and N is the number of bits.
Percentage resolution:
% resolution = (step size / full scale) x 100%
13
2142492 Selected Topics in
Automotive Engineering I
2142492 Selected Topics in
Automotive Engineering I
DAC Example (2)
DAC Specifications (1)
A computer controls the speed of a motor. The 0-2 mA current is
amplified to produce a motor speeds from 0-1000 rpm. How many
bits should be used to produce a motor speed with error < 2 rpm?
The desired speed is 326 rpm, what is the actual speed?
2N -1 ≥ 1000/2
2N ≥ 501
Nmin = 9
14
•
•
ƒ Full scale error: the maximum deviation of the DAC’s output from its
expected
p
value,, e.g.,
g , an accuracyy of ± 0.01% F.S.
Ex. F.S. output = 9.375 V
± 0.01% x 9.375 V = ±0.9375 mV
This mean that the output of this DAC can be off by as much as 0.9375
mV from its expected value.
ƒ Linearity error: the maximum deviation in step size from the ideal step
size, e.g., a linearity error of ± 0.01% F.S.
Ex An expected step size is 0.625
Ex.
0 625 V.
V and F
F.S.
S output = 9.375
9 375 V.
V
This mean that the actual step size count be off by as much as
0.9375 mV.
step size = 1000/29 – 1
= 1.957 rpm
# of steps = 326/1.957
= 166.58 -> 167
Actual speed = 167 x 1.957
= 326.8 rpm.
2142492 Selected Topics in
Automotive Engineering I
Resolution (step size): A smallest amount by which the analog
input must change to produce a change in digital output
output.
Accuracy:
15
2142492 Selected Topics in
Automotive Engineering I
16
DAC Specifications (2)
Analog-to-Digital (A/D) Converter
• Offset error: A deviation from the ideal 0 V at
the output of a DAC when the input is all 0s.
• Settling time: Time for the output of a DAC to
go from 0 to full scale ±½ step size as all 0s
inputs are changed into all 1s.
• Monotonicity: The ouput of a DAC increases as
the binary input is increased
increased.
2142492 Selected Topics in
Automotive Engineering I
17
ADC Specifications
Analog to Digital (A/D)
Analog-to-Digital
Converter is a circuit that
converts an analog input
t a corresponding
to
di di
digital
it l
output.
2142492 Selected Topics in
Automotive Engineering I
18
Sample-and-Hold Operation (1)
• Quantization error: A difference between the
actual (analog) quantity and the digital value
g
to it,, e.g.,
g , ± LSB or ± ½ LSB
assigned
• Conversion time, tc: it is a time interval between
the end of the START pulse and the activation of
the end of conversion, (EOC), output.
tc (max) = (2N - 1) clock cycles
tc (avg.) = tc(max)/2 ≈ 2N-1 clock cycle
2142492 Selected Topics in
Automotive Engineering I
19
2142492 Selected Topics in
Automotive Engineering I
20
Sample-and-Hold Operation (2)
•
•
•
•
ADC with Multiple Inputs
Sampling – The process of converting an analog signal into a series
p
representing
p
g the amplitude
p
of the signal
g
at a g
given time.
of impulses
Hold – After the signal is sampled it is applied to a hold circuit.
Sampling frequency – should be at least twice the highest analog
freq enc
frequency
Nyquist frequency – if the sampling rate is less than 2 times the
highest
g
analog
g frequency
y and effect called aliasing
g where
frequencies are generated by the sampling process that cause
interference problems
2142492 Selected Topics in
Automotive Engineering I
21
Data Acquisition
22
Digital Oscilloscope
•
A typical
i l computer d
data
acquisition system
•
The computer initiates a new
conversion cycle by generating
the START pulses.
•
The end of conversion signal
from the ADC is fed to the
computer.
computer
•
The computer monitors the
end of conversion then it loads
the digital data into memory.
2142492 Selected Topics in Automotive
Engineering I
2142492 Selected Topics in
Automotive Engineering I
23
2142492 Selected Topics in
Automotive Engineering I
24
Digital Signal Processor
Exercise
1. What is the function of a transducer?
2 What does a computer usually do with the data that it
2.
receives from an ADC?
3 What is the function of an actuator?
3.
4. What is the advantage of a smaller (finer) resolution?
5 Explain quantization error?
5.
6. Describe the steps in a computer data acquisition
process.
process
2142492 Selected Topics in
Automotive Engineering I
25
2142492 Selected Topics in
Automotive Engineering I
26