|
The Global Leader of Portable Data Acquisition Solutions
|
|
1-888-714-3272 |
IOtech Events |
| Selection Guides | OEM Zone |
|
Chapter 11 DIGITAL I/O INTERFACING Digital signals moving through the system may be a single, serial stream of pulses entering or exiting one port, or numerous parallel lines where each line represents one bit in a multi-bit word of an alphanumeric character. The computers digital output lines often control relays that switch signals or power delivered to other equipment. Similarly, digital input lines can represent the two states of a sensor or a switch, while a string of pulses can indicate the instantaneous position or velocity of another device. These inputs can come from relay contacts or solid-state devices. High Current and Voltage Digital I/O TTL and CMOS devices usually connect directly to high-speed, low-level signals, such as those used in velocity and position sensors. But in applications where the computer energizes a relay coil, TTL or CMOS devices may not be able to provide the needed current and voltage. So a buffer stage is inserted between the TTL signal and the relay coil, typically to supply 30 V at 100 mA. An example of this type of system is an optional card for a digital I/O instrument. It contains an amplifier/attenuator stage, consisting of a PNP transistor, a fly-back diode, and a resistor (See Figure 11.02). To energize a standard 24-V relay, an external 24-V supply is connected to the circuit. As the internal TTL output goes high, the transistor is biased and the output goes low, (about 0.7 V). When the TTL output is low, the transistor stops conducting and the output goes to 24 V. Since the relay coil is an inductive load, the fly-back diode should be attached to prevent damage during switching. Figure 11.03 shows a high-voltage digital input with an attenuator circuit. This allows the TTL circuitry to read voltages up to 48 V. The high-voltage signal connects to a resistive voltage divider, which is a signal attenuator. Selecting an appropriate resistance value R provides a means for selecting the high-voltage level. The table in Figure 11.04 shows the resistor values for frequently used levels. DIGITAL INPUTS Asynchronous Digital-Input Readings Synchronous Digital-Input Readings Externally Triggered Digital Input Readings One example of a device that operates in this fashion has an inhibit line among its six handshake/control lines for notifying external devices that the input latch is being read. This procedure lets the external device hold new digital information until the current read event is performed successfully. DIGITAL ISOLATION PULSE TRAIN SIGNAL CONDITIONING For example, one widely used input frequency card in a data acquisition system provides four channels of frequency input through two separate front-end circuits, one for true digital input circuits and one for analog inputs. The card conditions digital inputs of different levels, and the analog input circuit converts a time-varying signal into a clean digital pulse train. Figure 11.06 shows the schematic of the analog input, signal-conditioning path. The front-end RC network provides ac coupling allowing all signals above about 25 Hz to pass. The selectable attenuator reduces the overall magnitude of the waveform to desensitize the circuit from unwanted low-level noise. When using a pulse train from a relay closure, the unit provides programmable settings that let the user select the amount of debounce time required. The digital circuitry monitors the conditioned pulse-train for a sustained high or low level. Without debouncing, the extra edges in the signal produce an excessively high and erratic frequency reading (See Figure 11.07). Many transducers generate frequency-modulated output signals rather than amplitude-modulated. For instance, sensors that measure rotational motion and fluid flow typically fall into this class. Photomultiplier tubes and charged-particle detectors also are often used for measurements that require pulse counting. In principle, such signals could be sampled with an ADC, but this approach generates much more data than necessary and makes the analysis cumbersome. Direct frequency measurements are far more efficient. FREQUENCY-TO-VOLTAGE CONVERSION Pulse-Train Integration The response time of the frequency-to-voltage converter is low the inverse of the cutoff frequency of the low-pass filter. This cutoff frequency should be much lower than the input frequencies being measured, but high enough to provide the required response time. As the measured frequency approaches the cutoff frequency however, significant ripple in the output becomes a problem as shown in Figure 11.09. An external capacitor selects the time constant for an IC dedicated to frequency to voltage conversion. The circuit can measure signals in vastly different fixed frequency ranges, but the capacitor must be changed to change a frequency range. Unfortunately, such frequency-to-voltage converters work relatively poorly for frequencies below 100 Hz because a low-pass filter with a cutoff frequency under 10 Hz requires an excessively large capacitor. Digital-Pulse Counting For example, the analog input channel of a typical frequency-input data acquisition card contains a low-pass filter with a selectable cutoff frequency of 100 kHz, 300 Hz, or 30 Hz. It measures frequencies from 1 Hz to 100 kHz for signals ranging from 50 mV to 80 Vp-p. The digital input circuit measures A microcontroller accurately measures a total period consisting of several cycles extending over one user-selectable minimal period, which determines the frequency resolution. The microcontroller computes the frequency from the measured period and converts it to a command for a DAC, which, in turn, provides the dc level to the data acquisition system. The dc output of the DAC drives the input of an ordinary dc signal conditioner, and the software converts the dc level to an equivalent frequency reading. This method allows extremely low frequencies to be measured over an exceptionally wide range, and the output update can be relatively fast. Moreover, the frequency range can be programmed, letting the expected frequencies use the entire ADC range. The output range of the DAC is +5 to -5 V. The minimum frequency selected by the user becomes the The resolution is 12 bits over all ranges, but the update time depends on the range selected. From In addition to the low-pass filter, a predefined hysteresis level is built in to help prevent false counting caused by high-frequency noise. A debounce time can be programmed from 0.6 ms to 10 ms for handling electromechanical devices such as switch or relay contacts that bounce or chatter while switching. Frequency Measurement by Gated-Pulse Counting Many data acquisition systems include TTL-compatible counter/timer ICs that can perform gated-pulse, digital-level input, however, they are unsuitable for unconditioned analog signals. Fortunately, many frequency-output devices feature a TTL output option. Some products use a counter/timer IC, which contains five counter/timers. Many counter/timer ICs generally use an oscillator built into the data acquisition system, or an external oscillator. Such ICs usually have several channels available to assist counting applications. Each channel contains an input, a gate, and an output. The simplest counting method only uses the input, and the PC is programmed to periodically read and reset the counter. The weakness in this approach is the uncertainty in the timing interval. Variations crop up in the execution speeds of the functions that begin and end counting. In addition, the function call that delays execution of the program for 50 ms runs under an inaccurate software timer. These two effects can render a short-counting interval, frequency measurement useless. However, the technique is usually sufficient for counting intervals greater than one second. Gating can attain greater accuracy because the gate controls the counting interval. Consequently, frequency measurements are independent of any software timing issues. The gate can be configured so that pulses are counted only when a high-level signal enters it. Similarly, the gate can start counting when it detects one pulse and stop counting when it detects another. A disadvantage of gated-pulse counting is that it requires an extra counter to provide the gate. However, in multiple channel applications, a single counter can provide the gate for many channels. For example, in a five-channel system, four channels count while one channel provides a gate. Timing Applications Because a 16-bit counter overflows at 65,535 counts, the maximum pulse width measurable with a ...to read the entire 144-page book,
|
![]() |
|
[ IOtech PC-Based Data Acquisition (DAQ) and Instrumentation - PDF Format IOtech PC-based products (USB, PCI, Ethernet, GPIB) and signal conditioning options capture waveforms and measure most physical parameters including temperature, vibration, strain, velocity, acceleration, position, as well as common voltage, current, power, and data logging. IOtech's solutions are used in environments such as |