Me 365 Experiment 2 Introduction To Digital Data Acquisition Objectives
Me 365 Experiment 2 Introduction To Digital Data Acquisition Objectives
Analog Input
5V
Analog Output
integers
ADC
8 bits
D/A
Zero order
8
Hold
2 -1
Optional
Low pass
filter
5V
Note that there is no "front end" containing signal conditioning elements (filters and
amplifiers). There are two golden rules for putting signals into analog to digital
converters:
1.
make sure that the signal amplitude is as big as possible but still within the input
range of the analog to digital converter (amplify or attenuate the signal to achieve
this).
2.
make sure that the highest frequency in the signal is less than half the sample rate
of the analog to digital converter (low pass filter the signal to be sure that this is
true and make sure that the filter cut off frequency is much less than half the
sample rate).
Laboratory 2
ME 365
There is only a single input channel in this system. Multichannel systems like the one
used in the PC in the ME365 Lab, have a multiplexer in front of the analog to digital
converter. A multiplexer enables analog to digital conversion to take place on each
channel in sequence. The total sample rate for a digital system is equal to the number of
channels times the sample rate on each channel. So, if you are quoted a maximum sample
rate of 44KHz. for a two channel system, that often means you can sample at 44,000
samples per second if you use 1 channel but you can only sample at 22,000 samples per
second if you wish to use 2 channels.
Most systems would also have a sample and hold in front of the multiplexer. This piece
of hardware holds the signal constant while the analog to digital conversion is taking
place. If the analog to digital conversion is fast, relative to the speed at which the signals
are changing, the system will work acceptably without a sample and hold. If you are
doing multichannel data acquisition, then the sample and hold device becomes very
important. This is because the sample and hold device holds all signals constant while it
converts each signal in turn, and thus eliminates any time delays between samples taken
on different channels.
Laboratory 2
ME 365
Internal Clock: The heart of the internal clock is a 555 timing chip. By changing
the time constant (a capacitor and/or resistor) the frequency can be changed. In
this setup there is a switch one can use to select one of five frequencies. Note
that, in the detailed circuit diagram shown in Figure 5, each resistor is associated
with a potentiometer that is used to make fine adjustments in the frequency.
Because the values of the resistances and capacitors can change with time and
temperature, this method of controlling the frequency is not very stable.
b)
c)
External Clock: There are times when it is desirable to have an external signal
determine when a sample should be taken. For example, one may want to digitize
a signal when some particular event occurs or set the sample rate to a value not
Laboratory 2
ME 365
available on the internal clock. In the latter case an function generator may be
used to obtain an adjustable sample rate.
Internal: A ten-turn potentiometer is provided so that a voltage from +5 Volts to 5 Volts can be supplied to the ADC. The output of the potentiometer can be
switched to the output connectors for monitoring during system calibration.
b)
External: This connects the external signal to the input of the ADC.
c)
Ground: The input can be grounded to check the zero offset of the system.
Nearest Integer to
2n
where n is the number of bits in the ADC. This ADC has 8 bits. There are 28 = 256
states: 128 for zero volts and above and 128 for negative voltages. The true input span of
this ADC is 5.00 volts to + 4.96 volts, and a single bit represents an input change of
39.1 milliVolts = 9.96 volts (input range) divided by (28 -1). This is sometimes called the
quantization interval (Q), and it is also the resolution of the ADC,
Q
Note: the input range of this device is often quoted to be +/-5 Volts,
and the quantization interval is calculated by using:
Q
where the nominal input range in this case is 10 Volts. You will notice that both of these
formulae give the same value for Q.
Laboratory 2
ME 365
Binary Output
1000 0010
1000 0001
-100
-60
-20
20
60
100
0111 1111
0111 1110
Figure 3: Calibration curve for the ADC (resolution is 39.1 mV).
The result of an analog to digital conversion is usually stored on a computer. To relate the
integer codes back to the incoming voltages we use:
Stored Voltage
integer code
2n 1
You will notice that the Stored Voltage and the Incoming Voltage are usually not equal.
The maximum difference is +/- half the quantization interval which equals 19.5 mV in
this system. This is called the maximum quantization error and = +/-Q/2 Volts.
In summary here is a table of the characteristics of this ADC plus buffer, and the PC ADC
you will use in future Labs.
Table 1: ADC Characteristics
This Lab.
-5.00 to 4.96 V
5.00 V
-5.00 V
8
39.1mV
19.5mV
.196%
Output Latches
Holding the output constant during the convert cycle requires a latch placed between the
ADC and D/A. The latch also provides sufficient current to operate the light emitting
diodes (LEDs) which indicate the binary state of the ADC output.
5
Laboratory 2
ME 365
integer code
true output range of D/A
2n 1
The D/A holds this voltage constant until it is time to output the next sample. The output
of the D/A when a sinusoidal signal is fed into the box is shown in Figure 4.
D/A Output (volts)
1.00
0.00
-1.00
0.05
0.10
0.15
0.20
Time (seconds)
Figure 4: The output of the zero hold D/A when a sine wave is input into the system.
During switching, spikes may appear on the analog output. The D/A requires a reference
voltage. It is usual to low-pass filter the output of a D/A to eliminate the stepped effect
of the zero order hold. The cut-off frequency of the filter is often set to frequencies
between one-tenth of and one-third of the sample rate of the D/A. The choice is a function
of the characteristics of the filter you are using.
Op-Amp Current to Voltage Converter-Filter
The output of the D/A converter is a current which must be converted to a voltage.
Because of the high frequency switching spikes and the fact that the D/A output looks
like a staircase, it may be desirable to filter the output signal. A three position switch
allows the output to pass through single pole filters with cutoff frequencies of 5 kHz and
10 kHz or to pass through unfiltered ( ).
Laboratory 2
ME 365
Laboratory 2
ME 365
Laboratory 2
ME 365
Laboratory 2
ME 365
EXPERIMENT PROCEDURE
Note the switch names will be capitalized and underlined while switch positions will just
be underlined.
1.
2.
Nominal
Value
3.
Actual
Value
+ 15 V
- 15 V
+5V
-5V
______
GND
______
10
Laboratory 2
ME 365
ADC
Theoretical
Theoretical
Measured
Measured Voltage
State
No Error Voltage
(Volts)
Range of
Voltages
with this Code
(Volts)
Range of
Voltages
for this Code
(Volts)
Span
(Volts)
(+/-19.5mV?)
0000 0010
0000 0011
0000 0100
0111 1101
0111 1110
0111 1111
1000 0000
1000 0001
1000 0010
1111 1001
1111 1010
1111 1011
11
Laboratory 2
4.
ME 365
Error (mV)
5.00
3.75
2.50
1.25
0
-1.25
-2.50
-3.75
-5.00
Is the maximum error less than 1/2 LSB (least significant bit)?
5.
12
Laboratory 2
ME 365
Now, with RATE SELECT at 1 kHz, set the function generator to about 1100 Hz
and manually lower the frequency of the function generator by small
(approximately 1 Hz) increments. Note that the signal you see on the scope has a
very low frequency (can be made to approach D.C.). This is because the Nyquist
criterion is not satisfied (less than 2 samples/cycle) and the output is "aliased".
Sketch the waveforms on Channels 1 and 2 of the oscilloscope below on the same
graph.
6.
Filter Effects
Set the function generator frequency to 100 Hz.
Set RATE SELECT to 20 kHz and observe the OUTPUT with the FILTER
SELECT set at the 10 kHz cutoff.
Repeat with the FILTER SELECT set at the 5 kHz cutoff.
Observe the OUTPUT at various sample rate and filter cutoff frequency
combinations. Note that at the lowest filter setting the OUTPUT will be attenuated
and there will be a phase shift.
Now change the function generator OUTPUT to a square wave at 1 kHz and
observe the OUTPUT for the various combinations.
7.
8.
13