COMPUTER CONTROL and
DATA ACQUISITION
by David A. Ward
Part 4: Working With Analog Signals
Many things in the natural world are not either ON or OFF
or digital in nature like they are in the inner workings of
computers; these non-digital occurrences are analog in
nature. Some examples of analog occurrences are: sound,
light, temperature, atmospheric pressure, and humidity, just
to name a few. For example, the temperature in a room is
not exactly 72°F or 73°F all of the time, it will pass from
72° up to 73° in small increments or steps from perhaps
72.1° then to 72.2° etc., until it finally reaches exactly 73°,
but this will probably last for just an instant. In order to
acquire analog information into the computer, transducers
are needed that convert these analog measurements into varying
voltages or currents that are then presented to an analog-to-digital (A-to-D) converter. The A-to-D converter converts
the analog values into a digital format that is compatible
with a digital computer. Likewise, for a digital computer to
output an analog signal, the digital numbers must pass
through a digital-to-analog (D-to-A) converter.
There are several different types of A-to-D converters but
one of the most common ones — and one that is used
in the NI USB-6008( 9) units — is the successive approximation
register or SAR A-to-D converter. Let’s take a minute and
step through the operation of a simplified SAR conversion
process. The A-to-D converter in the USB-6008 unit is either
12 or 11 bits and either 14 or 13 bits in the USB-6009 unit.
We’ll use a much simpler three bit A-to-D converter for our
example. As we step through the three bit process, you’ll
quickly understand why we don’t want to step through an
A-to-D converter with many more bits than this.
First of all, let’s calculate the resolution of an A-to-D
converter; the resolution is a value that tells you how much
the voltage will change before the digital conversion value
increments or decrements by one. The equation for A-to-D
resolution is: Resolution = (Vmax – Vmin) / (2N – 1). The
Vmax and Vmin are the maximum and minimum analog
voltages that will be presented to the A-to-D converter. The
number “2” is used because the conversion answer is base
2 or a binary number. The value “N” is the number of bits
that the A-to-D converter converts the analog voltage into.
Since the voltage range is divided by (2N – 1), increasing the number of bits decreases the resolution value, or in
other words divides the analog voltage into smaller sections.
The smaller the resolution voltage for an A-to-D converter, the
more sensitive it is. So, smaller analog voltage changes will
result in changes in the converted binary result. The resolution
needs to be matched to the transducer supplying the analog
voltage to the converter. For example, a temperature transducer
54 SERVO 06.2009
FIGURE 1
such as the LM34 which produces
10 mV/°F at its output terminal
should be connected to an A-to-D
,
converter with at least a 10 mV
resolution so that the binary con-
-
version value would change for
every °F change in the transducer.
Going back to the three bit A-to-D
explanation, if the applied analog FIGURE 2
voltage was 0V to +7V, then 7V
would be divided by 23, or eight; subtract 1 is 7, and the
resolution comes out to 1V. Therefore, every change of 1V
will result in a change of one in the binary conversion value.
As you read through the following explanation, refer to
Figure 1. The SAR conversion begins by making the most
significant bit (MSB) a 1, and feeds this value into a (D-to-A)
converter. This voltage then goes into a comparator, comparing the incoming analog voltage with the internal
approximation voltage. Let’s say an analog voltage of 3.25V
was sent to the A-to-D converter. The first value to be compared would be “100” or 4V versus 3.25V. If 4V is greater
than the applied 3.25V — which it is — the approximation
voltage is too high and the MSB of 1 is cleared to a 0. This
is then placed in the SAR’s three bit holding register. On the
next pass, an approximation of “010” or 2V is compared
with 3.25V. If the approximated voltage is below the incoming voltage — which it is — the 1 remains a 1 and is placed
in the holding register for the next bit. On the third pass, an