Transcript
8/3/2019 Data Acquisiton and Conversion
1/28
DATA ACQUISITION AND
CONVERSIONThe process of taking analogue information, often from a number of
sources, and converting it into a digital form is often termed data
acquisition.
The purpose of a Data Acquisition system is to measure a physical
phenomenon such as light, temperature, pressure, sound, etc. Thebuilding blocks of a Data Acquisition system are as follows:
Transducer Signal Signal Conditioning Data Acquisition (DAQ) device Driver level and application level software
These five building blocks allow you to bring the physical phenomena
you want to measure into your computer for analysis and presentation.
In the following pages, we will discuss each one of these blocks
individually to give you knowledge of each building block, and how they
fit together to make up your Data Acquisition system.
8/3/2019 Data Acquisiton and Conversion
2/28
TRANSDUCERto use for measuring the following physical
phenomena:
Temperature Light Sound Force Pressure
8/3/2019 Data Acquisiton and Conversion
3/28
Position Fluid flow pH levelsThe purpose of a transducer is to convert physical phenomena (light,
temperature, pressure, sound, etc.) into a measurable electrical signal,
such as voltage or current.
With the help of a transducer we have converted physical
phenomena (light, temperature, pressure, sound, etc.) into a signal.
Not all signals are measured in the same manner, so we will need to
learn how to categorize our signal as one of two types:
Digital
Analog
Once we have categorized our signal we need to figure out what
type of information we want out of that signal. The possible types of
information we can obtain from a signal are:
State Rate Level Shape
8/3/2019 Data Acquisiton and Conversion
4/28
Frequency
SIGNAL CONDITIONING
In the signal conditioning stage, electrical signals are conditioned so
they can be used by an analog input board. The signal may be
conditioned by amplification, where the power of the signal is
increased to make it easier to read in more detail. Isolation may also
occur, so that the input and output circuitry do not interfere with
each other. The signal may also be filtered, to remove noise or
8/3/2019 Data Acquisiton and Conversion
5/28
8/3/2019 Data Acquisiton and Conversion
6/28
Amplification is a way of increasing a signal from a transducer
that is too small for your DAQ device to accurately measure. A
common example is a thermocouple. Thermocouples output a
voltage in the mill volt range. If you were to send the signal from
your thermocouple straight to your DAQ device, it is feasible that a
change of a degree or two in temperature would not be detected by
your system. However, if we amplify the signal we will be measuring
a signal that is better suited to the range of our DAQ device. Your
signal can either be amplified on the DAQ device or externally. The
problem with amplifying the signal on the DAQ device is that we also
amplify the noise the signal has picked up on its way to the DAQ
device. In order to minimize the amount of noise that is amplified it
is best to place the amplifier as close to the signal source as possible.
Thus it is usually best to use some form of external amplification. As
we will see next, we can show the benefit of external amplification
with an index called the Signal to Noise Ratio
MUTIPLEXING
Although it is quite possible to have a system with a single
analogue input or a single analogue output, it is usual to
have multiple inputs and outputs. Clearly, one solution to this problem
8/3/2019 Data Acquisiton and Conversion
7/28
is to use a separate converter for each input and output signal, but
often a more economical solution is to use some form ofmultiplexing.
A number of analogue input signals can be connected to a single ADC
using an analogue multiplexer. This is a form of electrically controlled
switch based on the use of analogue switches; analogue signal is
connected in turn to the ADC for conversion, the sequence and timing
being determined by control signals from the system. For certain
applications, the arrangement in Figure (a) is unsuitable as each
analogue input signal is sampled at a different time. This may make itimpossible to obtain detailed information as to the relationship between
the signals, such as their phase difference. The problem can be
overcome by
8/3/2019 Data Acquisiton and Conversion
8/28
Sampling all the inputs simultaneously using a number of sample and
hold gates, as shown in Figure (b). Once the input signals have been
sampled, they can be read sequentially without losing the time
relationship between the channels.
SAMPLE AND HOLD SYSTEM
In electronics, a sample and hold circuit is an analog device that
samples (captures, grabs) the voltage of a continuously varying analog
signal and holds (locks, freezes) its value at a constant level for a
specified minimal period of time. Sample and hold circuits and related
peak detectors are the elementary analog memory devices. They are
typically used in analog-to-digital converters to eliminate variations in
input signal that can corrupt the conversion process.
A typical sample and hold circuit stores electric charge in a capacitor
and contains at least one fast FET switch and at least one operational
amplifier. To sample the input signal the switch connects the capacitor
to the output of a buffer amplifier. The buffer amplifier charges or
discharges the capacitor so that the voltage across the capacitor is
practically equal, or proportional to, input voltage. In hold mode the
switch disconnects the capacitor from the buffer. The capacitor is
invariably discharged by its own leakage currents and useful load
currents, which makes the circuit inherently volatile, but the loss of
8/3/2019 Data Acquisiton and Conversion
9/28
voltage (voltage drop) within a specified hold time remains within an
acceptable error margin.
One of the factors to consider in converting analog signals to digital is
the sampling rate. The sampling rate determines how often conversions
take place. The higher the sampling rate, the better. This example
shows three different sampling rates for an analog input signal. The 16
samples per cycle digitized signal looks closer to the original analog
input than the 4 samples per cycle signal. The reason one would use a
lower sampling rate is because the amount of total samples that can be
taken is limited, the processing power required to handle that much
8/3/2019 Data Acquisiton and Conversion
10/28
data is limited, or the extra precision obtained by the high sampling rate
is unnecessary.
A problem with using too low of a sampling rate is that aliasing might
occur. Aliasing is when the acquired signal gets distorted by a sampling
rate that is too small. In this example, the original signal is sampled so
slowly that the sampled signal looks like a completely different
frequency than the original signal.
The minimum sampling frequency required to represent the signalshould be at least twice the maximum frequency of the analog
signal under test.(this is called nyquist rate)
If the sampling frequency is equal or less than twice the frequencyof the input signal ,a signal of low frequency is generated from
such a process.(this is called aliasing)
8/3/2019 Data Acquisiton and Conversion
11/28
For accurate frequency representation: Sample at least 2x the highest frequency signal being measured.
For accurate shape representation
Sample 510x the highest frequency signal being measured
Anti-aliasing filter
An analog filter that removes frequencies above Fs/2,where Fs is
the sample frequency.
Analog-to-digital converter circuits (ADC) are usually equipped
with analog low-pass filters to pre-condition the signal prior to
digitization. This prevents signals with frequencies greater than the
sampling rate from being seen by the ADC
8/3/2019 Data Acquisiton and Conversion
12/28
Resolution
an Analog-to-Digital Converter (ADC) takes an analog signal and turns it
into a binary number. Therefore, each binary number from the ADC
represents a certain voltage level. The ADC returns the highest possible
level without going over the actual voltage level of the analog signal.
Resolution refers to the number of binary levels the ADC can use to
represent a signal. To figure out the number of binary levels available
based on the resolution you simply take 2Resolution. Therefore, the higher
the resolution, the more levels you will have to represent your signal.
For instance, an ADC with 3-bit resolution can measure 23 or 8 voltage
levels, while an ADC with 12-bit resolution can measure 212 or 4096
voltage levels. Even though ADCs are not made with only 3-bit
resolution let us further examine our example of a 3-bit ADC. The
lowest voltage level will correspond to 000, the next highest to 001, and
8/3/2019 Data Acquisiton and Conversion
13/28
so on all the way up to 111. As we will see next this is usually not
enough resolution to properly represent a signal.
We will compare a 3-bit ADC and a 16-bit ADC. As we learned earlier a
3-bit ADC can represent 8 discrete voltage levels. A 16-bit ADC can
represent 65,536 discrete voltage levels. As you can see the
representation of our sine wave with 3-bit resolution looks more like a
step function than a sine wave. However, the 16-bit ADC gives us a
clean looking sine wave. One way to think of resolution is by
considering your television screen. The higher the resolution of the
screen, the more pixels you have to show the picture, so you will get a
better picture. Another way to think resolution is by considering the
amount of colors your computer monitor uses to display an image. Ifyou are only using 16 colors the picture is choppy and doesnt look very
good, but if you use 16-bit color the picture is smooth and looks great.
Keep in mind that resolution is a fixed quantity of an ADC, and it
8/3/2019 Data Acquisiton and Conversion
14/28
depends on the DAQ device that you use. Your standard National
Instruments DAQ device has either 12-bit or 16-bit resolution.
Quantization:Each flat region in the sampled signal is rounded-off to the
nearestmember of a set of discrete values (e.g., nearest integer)
Range:
Sample
and hold
ckt
output
3-bit
ADC
3 bit
digital
output
8/3/2019 Data Acquisiton and Conversion
15/28
ADCs also have a parameter called the range. The range refers to the
minimum and maximum analog voltage levels the ADC can digitize.
Unlike the resolution of the ADC, the range of the ADC is selectable.
Most DAQ devices offer a range from 0 - +10 or -10 to +10. The range
is chosen when you configure your device in NI-DAQ. We will learn
how to configure our DAQ device in software later in this chapter. Keep
in mind that the resolution of the ADC will be spread over whatever
range you choose. The larger the range, the more spread out your
resolution will be, and you will get a worse representation of your signal.
Thus it is important to pick your range to properly fit your input signal.
As an example let us reconsider the colors we use to represent an
image on our computer monitor. As we said earlier a picture looks
better when more colors are used to represent it. Now let us examine
the effect that changing the range would have on our picture. Let us
compare a picture with 16 color resolution in black and white to a
picture with 16 color resolution in color. Our black and white picture
will be clearer because our resolution is only spread across two colors
instead of all colors. Next we will see this affect with our analog signal.
8/3/2019 Data Acquisiton and Conversion
16/28
Choosing the proper range for a signal is very important to help
maximize the resolution of our ADC. To illustrate this, let us revisit our
sine wave and our 3-bit ADC. Due to poor resolution we are still not
going to be able to represent our sine wave very well. However, an
improper choice of range can make our representation of the sine wave
even worse. Our sine wave has a minimum value of 0 Volts and a
maximum value of +10 Volts. If we choose our range as 0 - +10 Volts
we will have 8 different voltage levels we can represent. If we were to
improperly choose a range of -10 to +10 Volts we would now only have
4 voltage levels to represent our signal, because the other 4 levels
would be used by the 0 to -10 Volt range. Our smallest detectable
voltage would change from 1.25 to 2.50 and we would get a worse
representation of our sine wave. As you can see improperly choosing
the range will negatively impact the representation of your signal.
However, we do not always have a choice as to what range to pick. For
8/3/2019 Data Acquisiton and Conversion
17/28
instance, if our sine wave actually went from -2 to +8 Volts, we could
not choose 0 to +10 Volts as our range, because the signal does not fit
within that range. We would be forced to choose a range of -10 to +
10, even though it spreads out our resolution.
GainGain refers to any amplification or attenuation of a signal. The gain is
not applied by your ADC. Instead the gain is applied by the
instrumentation amplifier that proceeds the ADC on your DAQ device.
The gain setting is a scaling factor. For example, possible gain settings
for an E-Series device are 0.5, 1, 2, 5, 10, 20, 50, or 100. Each voltage
level on your incoming signal is multiplied by the gain setting to achieve
the amplified or attenuated signal. Unlike resolution that is a fixed
setting of the ADC, and range that is chosen when the DAQ device is
configured, the gain is specified indirectly. in Lab VIEW will you find a
place to set the gain. The gain is chosen indirectly through a setting
called input limits. Input limits refers to the minimum and maximum
values of your actual analog input signal. The input limits are specified
in Lab VIEW. Based on the input limits you set, the largest possible gain
8/3/2019 Data Acquisiton and Conversion
18/28
is applied to your signal that will keep the signal within the chosen
range of the ADC. So instead of needing to calculate the best gain
based on your signal and the chosen range, all you need to know is the
minimum and maximum values of your signal. If you dont set the input
limits of your signal a gain of 1 (no change) will be applied.
Applying a gain to an analog input signal is very similar to amplifying a
your voice with a microphone. If you tried speaking in a stadium for
100, 000 people without a microphone, very few of the 100,000 people
will be able to hear your voice. However, if you amplify your voice with
a microphone you can maximize the number of people that can hear
you. In the same way a small signal will not be able to use the entire
resolution of the ADC, unless a gain is applied to amplify the signal. Let
us take a look at how the gain setting affects an analog input signal.
Assume we have a sine wave with a range of 0 to +5 Volts and an ADC
8/3/2019 Data Acquisiton and Conversion
19/28
range of 0 to 10 Volts. As you can see above if we applied a gain of 1
(no change) to our signal we would only be taking up half of the range,
and thus using only half of our resolution. However, if we apply a gain
of 2 to our signal we now have a sine wave with a range of 0 to +10
Volts. Now our signal fits exactly in our range and we will be
maximizing the use of our resolution. Now let us consider a sine wave
with a range of 0 to +6 Volts with the same ADC range of 0 to +10
Volts. We can no longer apply a gain of 2, because our sine wave
would have a range of 0 to +12 Volts which exceeds our ADC range.
The only gain we can apply is a gain of 1. It is also important to note
that if we put a 0 to +5 Volt signal into our device, our graph in
LabVIEW will show a 0 to +5 Volt signal regardless of the gain that is
applied. The gain setting is only used to maximize the use of the ADC
resolution. It will not affect your measurement.
Code width
Code width is the smallest change in your signal that your system can
detect. The formula for the code width is shown above. As you can see
the code width is a property of the resolution, range, and gain. Thesmaller our code width is the better we can represent our signal. The
formula confirms what we have already learned in our discussion of
resolution, range, and gain:
8/3/2019 Data Acquisiton and Conversion
20/28
Larger resolution = smaller code width = better representation ofthe signal
Larger gain = smaller code width = better representation of thesignal
Larger range = larger code width = worse representation of thesignal
Types of ADC
Successive approximation
The DAC is driven by a digital word produced by the successive
approximation logic. Initially, all the bits of this word are set to 0 and
then the most significant bit (MSB) is set to 1. This input word is
converted by the DAC into an analogue signal corresponding to half of
the full range of the DAC. This value is compared with the analogue
input signal using a comparator and the result is fed back to the control
logic. If the comparison shows that the DAC output is less than the
analogue input, the MSB will be left at 1; if not, it will be reset to 0. In
any event, the logic then sets the next MSB and, again, compares the
output of the DAC with the input signal. In this way, each bit of the
input to the DAC is set in turn and its correct state determined. The
conversion is completed when all the bits of the DAC input have been
set correctly. Therefore, for an n-bit conversion, this will take
8/3/2019 Data Acquisiton and Conversion
21/28
approximately ntimes the settling time of the DAC and the comparator.
This compares favorably with the counter type, which requires up to 2n
times the settling time of the DAC and comparator. Typical successive
approximation converters might have settling times of110 s for an 8-
bit conversion, increasing to perhaps 10100 s for a 12-bit device.
High-speed variants are available with considerably improved conversion
times. The complexity of this form of converter is somewhat greater
than that of the counter type. However, its superior speed of operation
makes it one of the most commonly used arrangements for integrated
circuit converters.
DAC
R-2R ladder
The R2Rmethod also makes use of the current-to-voltage converter
but does not require a broad spread of resistorvalues. all the resistors
connected to the switches have the same value. Theother end of the
resistor in each case is joined to a chain of resistors, whichgoes from
8/3/2019 Data Acquisiton and Conversion
22/28
the inverting input of the operational amplifier to earth. The circuit is
arranged such that currents flowing through each of the resistors
connected to the switches see a resistance of2Rlooking in either
direction along the resistor chain. Therefore, half the current will go in
each direction.
Similarly, currents flowing up the chain see equal resistances in either
direction at each node and will again be split. Therefore, each switch
contributes half as much current as the switch above, as its current is
repeatedly halved at each node on its journey to the op-amp. Therefore,
the currents generated by the switches are binary weighted, as in theprevious method, but without the use of a wide range of resistor values.
Here, only resistors ofRand 2Rare required and, if appropriate, these
can be formed using only resistors of one value (R) by connecting two
in series to form the other (2R). This allows temperature-matched
resistors to be used to provide greatly improved temperature stability.
Flash ADC
8/3/2019 Data Acquisiton and Conversion
23/28
The parallel or flash converter is the fastest of the various forms of
ADC. It operates by having a separate comparator to compare the input
voltage with every discernible voltage step within the converters
range.The various voltage steps are produced using a precision resistor
chain from a reference voltage source. Each voltage increment is
connected to a separate comparator that compares it with the input
voltage. The result is that all of the comparators connected to points
along the resistor chain that have voltages greater than the input
voltage will produce an output of one polarity, whereas those connected
to voltages below the input voltage will produce voltages in theopposite sense. Combinational logic is then used to determine the value
of the input voltage from this pattern. The great advantage of this
method is its high speed of conversion, as all the comparisons are
performed simultaneously. This allows sample rates in excess of 150
million conversions per second, with conversion times of only a few
nanoseconds. However, as an n-bit converter requires 2ncomparators,
the hardware is significantly more complicated and therefore more
expensive than it is for other techniques.
8/3/2019 Data Acquisiton and Conversion
24/28
Internal PC bus DAS\External Bus
Remote DAS
Data acquisition software
8/3/2019 Data Acquisiton and Conversion
25/28
Transforms the PC and DAQ hardware into a complete DAQ,analysis, and display systems
Enables the developers to design the custom instrument bestsuited to their application.
Examples: Test point , Lab view etc
8/3/2019 Data Acquisiton and Conversion
26/28
Hard copy
DATA ACQIUSITION and
CONVERSION system
8/3/2019 Data Acquisiton and Conversion
27/28
8/3/2019 Data Acquisiton and Conversion
28/28
top related