Data Acquisition: The Elements of Intelligent Design
A data acquisition and control system typically consists of the following:
- Sensors, which measure physical variables such as temperature, strain, pressure, flow, and motion
- Signal conditioning, which converts the sensor outputs into signals readable by the A/D board in your PC
- An analog input board or module, which converts these analog signals into a digital format usable by your PC
- A computer system with the appropriate application software to acquire and log your data to disk. Such software may also process, analyze, and/or provide a graphical display of your data
- An output interface, to provide an appropriate process control response
For example, to regulate the temperature in your house with a PC, you would need to continuously measure the temperature of a room using a thermocouple (TC), then condition the TC signal for acceptance by an analog input board, convert this signal from an analog to a digital format readable by your PC, use software to compare this actual temperature data against the desired temperature, and respond via a digital output line to turn the heating/cooling circuit on or off.
Sensing and Signal Conditioning
In order to sense and measure physical variables such as pressure, flow, & motion, you need to use transducers (sensors), which convert physical variables into electrical signals and transmit these signals either to a signal conditioning device or directly to your data acquisition board.
The signal conditioning device amplifies and filters the sensor signal, then outputs a voltage which is easy to capture with an analog input board (additional information can be found in the Signal Conditioning tutorial.
Our CyMOD™ and ADAM™ series modules combine signal conditioning and A/D conversion in an external device that talks to your PC via a serial port.
Analog Input (A/D) Boards
After signal conditioning, the sensor signal is passed to the analog input (A/D) board. The A/D board converts the conditioned voltage or current signal into a digital format which is readable by your PC (see Schematic 1, below). Our A/D boards often incorporate some of the capabilities below:
- High-speed data transfer to the PC
- FIFO memory buffer
- Programmable gain amplifier
- Circuitry for hardware & software triggering
An analog signal is a continuous-time function with a physical parameter defined for every instance of time. This signal must be converted into a discrete-time signal so that it can be used by the computer to depict the original signal. Analog-to-Digital conversion is a ratio operation, where the input signal is compared to a reference and converted into a fraction which is then represented as a coded digital number. To optimize measurement accuracy, there is a minimum and a maximum number of data points that need to be acquired.
Sampling Rate: One of the most critical factors when selecting an A/D board is sampling rate (speed). The sampling rate is a measure of how rapidly your A/D board can scan the input channel and identify the discrete value of the signal present with respect to a reference signal. In order to better understand sampling rate, consider this example: If you want to acquire a sine wave that has frequency of 1Hz (1 cycle per second), how many data points will be necessary to approximate the waveform?
If the sample rate used is too slow, then a completely different waveform of a lower frequency is constructed from the data acquired. This effect is called aliasing. To avoid aliasing, it is necessary that the sample rate be at least twice the highest expected frequency input, and the signal should be band-limited. Thus, to sample a 1Hz sine wave, the sample rate should be at least 2Hz. However, a sampling rate of 8 to 16Hz would result in a more accurate representation of the signal being acquired. Diagram 1 illustrates the effect of sampling at different rates. Low-pass filters may be employed to eliminate high-frequency transients that could corrupt the data.
Throughput is another important selec-tion factor. If your A/D board has 4 input channels with a maximum throughput of 4Hz, when you are sampling on a single channel you will be able to acquire 4 samples/sec. However, if you want to sample on all 4 channels, you will only acquire 1 sample per second per channel, a sampling rate of 1Hz. Thus:
Resolution defines the number of divisions into which a full-scale input range can be divided to approximate an analog input voltage. For example, if you want to measure a 0–10V signal, and your A/D board has 8-bit resolution, you can measure the input signal in steps of 10/28 = 10/256 = 0.039V. Thus, a 10V input is equal to the digital number 255, and a 0V input equals 0. This A/D board would be capable of detecting only input changes greater than 0.039V. Each 0.039V change in the input is indicated by adding or subtracting 1 from the previous number, i.e., 9.961V is digitally represented by 254.
The true accuracy of an A/D board can be as much as 2 bits lower than the manufacturer’s specification. This means that a 16-bit board may be accurate only to 14 bits.
Which input configuration is best? You have two basic options when connecting your input signals: single-ended and differential. Single-ended (SE) inputs offer the lowest cost per input. However, differential (Diff) inputs offer greater noise immunity for more accurate readings. A typical A/D board offers 16 SE or 8 Diff input channels.
Single-Ended Inputs should be utilized whenever analog measurements are to be made with respect to a common external ground and there is no practical way to bring both a remote ground and the analog ground back to your DAS system’s front end.
A Differential Input configuration should be considered when:
- Measuring signals with large common mode voltages, like many strain gauges
- Several sensors with no common ground are to be measured. Connecting the LOW side of each sensor together at a common point can create unwanted ground currents, resulting in offset and noise errors
- The input sensor is physically distant from the data acquisition system. The Common Mode Rejection of a true differential input offers noise immunity from cable or transmission line pickup
Due to the high input impedance and bias currents of the input amplifiers, a floating offset error will occur if the sensor (or differential input pair) is not referenced to analog ground. This can be avoided by connecting equal value bias return resistors between both the HIGH and LOW analog inputs and analog ground.
The bias return resistor values are determined by balancing the ability of the source to drive them with the input amplifier’s bias current. A 100pA input bias current with a bias return resistor value of 1M½ will develop a 100µV offset error. Mismatched bias return resistors will also cause a predictable gain error (Ae):
Hence, a pair of ±1% resistors will cause a ±1% gain error. It is possible to optimize the Common Mode Rejection Ratio (CMRR) while minimizing gain errors by carefully matching the input bias impedances.
Most A/D boards require current signals to be converted to voltages before acquiring them as inputs. This can be done by con-necting a 250½ resistor from the input to ground. This action converts the 4–20mA current to a 1–5V input signal. Some of our A/D boards, however, do offer direct current input capability.
For best results, the full-scale voltage or current range of the signal should be known. Most boards offer several different input ranges, selectable via software, DIP-switches, or jumpers. If the built-in ranges do not match your signal directly, most boards have an on-board programmable (gain) amplifier to help match the signals being acquired.
Supporting Hardware Considerations
1. Sample and Hold Circuit (S&H): This feature allows your A/D board to acquire multiple channels of inputs at exactly the same instance in time.
2. A Multiplexer increases the input capacity of an A/D board by increasing the number of available input channels to as many as 512 single-ended or 256 differen-tial. This feature is useful if you don’t have any PC slots available for expansion. A multiplexer module can also be an inexpensive way to expand an existing system.
3. Data transfer methods include DMA, REP INSW, and PCI-bus transfers.
Most CyberResearch A/D boards have a FIFO (First In, First Out) memory buffer to enhance their data transfer capabilities. Delays during high-speed data transfers can lead to a loss of data. The FIFO buffer temporarily stores data so that no informa-tion is lost. A FIFO buffer is required for data acquisition under Windows, due to the large number of system interrupts which would otherwise cause
gaps in your data.
Direct Memory Access (DMA) enables you to transfer data from your A/D board directly into your PC’s memory at high speeds. This kind of data transfer does not involve the use of your CPU. Your computer can be processing another task while your A/D board is capturing and transferring data directly into the PC’s memory. Use an A/D board with DMA capability if you need to collect a lot of data over a short time. (DMA is not supported on the PCI bus, so this does not apply to PCI-bus boards).
REP INSW is a CPU instruction which allows the PC to transfer large blocks of data using a single instruction, resulting in very fast data transfers to PC memory.
Many of our cards have been designed for the PCI bus. PCI expansion slots can support data transfers at up to 132MB per second or more. A bus-mastering card (one that can take control of the bus for short periods) can, with the right software, move 40 million samples/second over the bus to PC memory. While this does make moving blocks of data much easier, a FIFO buffer is still required anytime you want continuous sampling under Windows.
Analog Outputs (D/A)
Analog outputs are generated using a procedure which is the exact reciprocal of that used to read analog inputs. The user writes a binary word — which represents a percentage of the full-scale range — to the output register. The D/A converter generates that analog level until the register is updated. The output rate is a function of the settling time and is critical in determining the maxi-mum frequency of the output waveform.
For audio applications, you’ll want a D/A board with a fast settling time to control the output and reduce over-tones and interfer-ence generated as the output stabilizes. However, for motion control applications — where the system responds slowly to the output voltage — the settling time is less critical. The motor acts like a damper and reduces the effects of the oscillating output.
An analog output is typically required for any application involving a variable con-trol device such as a servo motor or servo valve. Most D/A boards output voltages; some can output 4–20mA current loops.
Digital Inputs and Outputs (DIO)
Most analog input boards also incorpo-rate general-purpose digital I/O channels which are useful for many system functions. Digital I/O lines are commonly used:
Digital I/O lines can also be used for parallel communication between plug-in expansion cards and to generate strobe, pulse, clock, and other timing signals. Special-purpose digital input boards which use interrupt-driven control can operate in the background while your PC is running another application.
Software plays a vital role in obtaining reliable, high-performance operation from your data acquisition and control system. Selecting the right application software package is just as important as choosing the right hardware. To make the right choice, you must determine if a given package has the functionality and flexibility that you need, consistent with your software develop-ment skills. The primary issues to consider are: the programming methodology used by each package, the operating system under which the program runs, and compatibility with your existing and proposed hardware.