You are on page 1of 4

REAL TIME INTERFACING

Introduction

Real-time interfacing is a general term used to describe the aspects of connecting a computer with a real-world process
and communicating data between the two. Monitors, keyboards, printers, disks, modems, and CD’s are familiar (but
specific) examples of real-time interfacing. Interfacing process has four major components: sensors, actuators, the
computer, and a real-world process. For example, the process of entering data into a computer satisfies this
categorization if the human operator is viewed as the real-time process. The sensor is the keyboard; it transfers
information from the real-time process to the computer. The monitor is the actuator, transferring information from the
computer back to the real-time process. Sensors and actuators then become components which transfer information
between the electrical computer discipline and others (including electrical, mechanical, fluid, thermal, and human).

Elements of Data Acquisition and Control System

A data acquisition (DA) system is a collection of add-on hardware and software components that allow computer to
receive real-world information from sensors. Although sensors can be based on electrical, mechanical, optical, or other
principles, they all perform the same function: to convert real-world information (such as motion, temperature, and
pressure) into low-power electrical signals which can be read by the computer. Once the data resides within the
computer, any of three operations may be performed: plotting, processing, and writing to a file.
A data acquisition system also can be thought of as a monitoring system. It can receive data from a real-world process
and display the data. It can also display the features of the data extracted through its processing. In situations where it is
necessary to acquire and process data and to also send data back to the real-time process, we make use of a data
acquisition and control (DAC) system.
A DAC system is a superset of a DA system and requires both sensors and actuators. The purpose of the actuator is to
convert low-power computer signals real-world signals, into resulting in motion, heat, pressure, etc. Common actuators
include stepper motors, solenoids, relays, hydraulic motors, speakers, and piezoelectric actuators.
As an example that illustrates the difference between a DA and a DAC system, consider the measurement of the speed–
flow–pressure characteristics of a variable speed compressor at 20 different speed values. The compressor has been
connected to a variable speed motor—the speed of which can be manually varied by turning a knob. Signals from flow,
pressure, and speed sensors attached to the compressor outlet and motor are read and plotted by a computer.
The DA system reads and displays the three sensor input values. At each speed, the operator must vary the speed knob
until the desired speed is reached and then record the sensor readings for speed, flow, and pressure. In the DA system
just described, there is a fair amount of variation in the speed reading due to the speed adjustment at each point by the
operator. A DAC version of the same system could be used to remove this speed variation. The DAC application could
be created by adding an actuator that moves the speed knob in response to a signal produced by the computer. If the
value of this signal is programmed as a function of the error between the actual motor speed and the desired speed, the
knob will be moved in the direction that reduces this error. Eventually, the actual motor speed will agree precisely with
the desired speed. An application program could be written to automate this process further—to reset the desired speed
value to each of the 20 desired values, wait for the flow and pressure signals to stabilize, and record and save a
measurement.
The current trend is to use personal computers (PCs) with DAQ hardware for data acquisition in areas of laboratory
research, testing and measurement, and industrial automation. The DAQ hardware which act as an interface between the
computer and the outside world could be in the form of modules that can be connected to the computer’s ports (parallel,
serial, USB, etc.) or cards connected to slots (PCI, ISA, PCI-Express, etc.) in the mother board. The newest DAQ
devices offer connectivity over wireless and cabled ethernet for remote or distributed DAQ applications. The DAC
system presented in Figure 7-1 shows a screw terminal panel with I/O fdevices.
The PC-based DAQ system depends on each of the following system elements.
• Computer
• Transducers and sensors
• Signal conditioning
• DAQ hardware
Screw terminal panel(s)
• General purpose input/output (GPIO) card
• Software

Overview of I/O process

The input/output (I/O) process is the means by which a computer communicates with real-world phenomena via the
DAQ device. The performance of the I/O process therefore is dependent on the available computer, selected DAQ
device, and the bus architecture. Today’s computer (with high speed processor coupled with high-performance bus
architecture) has the capability of transferring data by any of the following methods.

• Direct Memory Access (DMA): With this mechanism data is transferred between the DAQ device and computer
memory without the involvement of the CPU. This mechanism makes DMA the fastest available data transfer
mechanism. Also, the processor is not burdened with moving data, and hence, it can engage in more complex processing
tasks.
• Interrupt Request (IRQ): IRQ transfers rely on the CPU to service data transfer requests. The device notifies the CPU
when it is ready to transfer data. Hence, the data transfer speed is tightly coupled to the rate at which the CPU can
service the interrupt requests.
• Programmed I/O: This is a data transfer mechanism in which a buffer is not used—instead the computer reads and
writes directly to the device.
• Memory Mapping: It is a technique for reading and writing to a device directly from the program, which avoids the
overhead of delegating the reads and writes to kernel-level software.
However, the data transfer mechanism the computer can use depends upon the selected data-acquisition device and its
bus architecture. For example, while PCI and FireWire devices offer both DMA and interrupt-based transfers, PCMCIA
and USB devices use interrupt-based transfers.
The available hard drive is the limiting factor for real-time storage of large amounts of data.
Hard drive access time and hard drive fragmentation can significantly reduce the maximum rate at which data can be
acquired and streamed to disk. For systems that must acquire high-frequency signals, high speed hard drive with large
memory space is needed.
In general, the overall communication speed is directly proportional to
• The clock frequency of the processor chip
• The bit length of the bus (i.e., 8 bit, 16 bit, 32 bit ...) and inversely proportional to
• The bit length of the processor (i.e., 16 bit, 32 bit ...)

Figure 7-2 presents these major components and their interconnections in a four-sensor/two actuator DAC system. The
number of I/Os varies, depending on the manufacturer, as does the functionality.
Some screw terminal panels have resistors that can be cut or soldered to change the gain range of a single or group of
channels. The screw terminal is attached to the GPIO card via ribbon cables. Figure 7-2 shows two cables; however, the
number may vary depending on the type of the card. On some cards four cables are required, two for the analog channels
and two for the digital channels. The application softwares function is to provide the engineer with an easy means of
reading sensors, writing to actuators, and processing data (plotting, control algorithms, saving data, and data
manipulation).

Installation of I/O chard and software

The necessary ingredients for the general I/O process are the PC and operating system software,
general purpose I/O (GPIO) card and software driver, and the proper termination panel(s)
and cabling for the GPIO card. The GPIO card is installed into a free expansion slot in the PC
bus. Its address is specified both on the card (using micro-switches) and in its driver software.

The termination panel is connected to the GPIO card by one or more cables. At this point, the
system is ready to operate, except for the application software.
Whatever application software is selected for the mechatronic programming tasks, it must provide
the programmer with the ability to create open-loop as well as closed-loop applications. Most
GPIO card manufacturers (including Computer Boards, Inc., Advantech, Data Translation, and
Metrabyte) offer their own Windows-based software for controlling their cards. An important limitation
of this type of software is that it only works on cards provided by one manufacturer, making
multi-card, multi-brand applications impossible.
An alternative to board-manufacturer software is a general Windows application software package
designed to work with many GPIO cards of different brands. The success of this approach is
evident by the popularity of such well-known packages as LabTech Notebook, LabVIEW, and
Snapshot. Most of these packages are aimed at the data acquisition market and, as such, are often
not suitable for closed loop applications. Listed packages capable of both open- and closed-loop
operation tend to be more oriented towards control systems and include LabVIEW, MATRIXX,
Simulink, and VisSim. Table 7-1 presents some of the most popular graphical application software.

POPULAR GRAPHICAL-BASED APPLICATION SOFTWARE


Name Description
Labtech Notebook General purpose DAC with analysis
LabWindows General purpose DAC with analysis

Workbench® PC General purpose DAC

Snap-Master™ General purpose DAC with analysis and display

EasyEst General purpose DAC with analysis


Unkel Scope High speed DA

Snapshot High speed DA

Acquire General purpose DAC

LabVIEW General purpose DAC with analysis

Hyperception High speed DAC with analysis and display

MATRIXX High speed DAC with analysis and display

Simulink High speed DAC with analysis and display

Visual Designer General purpose DAC with analysis

XANALOG High speed DAC with analysis and display

VisSim General purpose DAC with analysis and display

Installation of I/O chard and software

Before finalizing the data acquisition card, some thought should be given as to how frequently the
I/O must be sampled. Most GPIO cards operate in the 1 to 3 kHz range, which means that you can
expect anywhere from 1000 to 3000 samples per second, depending on the card. Application software
based on Windows may suffer a slight degradation in this rate, but the difference is small and
often can be regained by modifying the algorithm or moving to a more powerful processor. Each
GPIO card takes up one slot and provides inputs, outputs, or a combination of both. Most cards
come with digital I/O, which can be configured either as input, output, or a combination of both.
Analog I/O is harder to come by because it requires a D/A or A/D converter, but most card manufacturers
offer many configurations that combine digital and analog I/O.

Once you have selected a manufacturer and identified the potential card(s) which could be used,
you must determine the type and precision of the I/O channels needed. I/O channels may be either inputs
or outputs and are classified based on the type of data transferred. This leads to three channel types:
• Analog
• Digital
• Frequency (counter timer)
Precision of the I/O channel pertains to the accuracy and transient characteristics of the D/A and
A/D converter employed. Accuracy of the converter is a function of bit length. Most converters have
12-bit resolution, which is ample for most applications; however, this depends on your application
and should be a consideration prior to purchasing. A list of some of some popular I/O cards is presented
in the Appendix.
In mechatronic applications, the I/O typically operates in either of two modes, open loop or
closed loop. Open-loop operation exists when inputs are read and/or outputs are written, but no relationship
or dependency exists between the inputs and outputs.

You might also like