What Is Real-Time Control?
The primary requirement in any real-time control application is determinism. Determinism is a guarantee that a specified event will occur within a fixed period of time. This can include control algorithm calculations, alarm monitoring, signal I/O, or any other system function. For example, a deterministic system is required to ensure that an alarm gets triggered when a mechanical system goes out of its safe operating range. For true deterministic control, most major test control systems use a real-time operating system (RTOS) to provide determinism and stability.
Figure 1. A Basic PID Control Block Diagram
The term “real-time control” generally refers to closed-loop PID control. “Closed loop” indicates a feedback control mechanism during which a desired response is fed back (feedback) into the control algorithm and compared against the desired setpoint. To learn more about PID control, go to PID Theory Explained.
Requirements of a Real-Time Test System
In addition to real-time control, most modern control systems provide digital data acquisition, stimulus generation, safety monitoring, and data logging. These tasks must all execute deterministically to validate the performance of the DUT and to ensure that tests are executed safely.
Data acquisition provides sensor data for many tasks such as closed-loop control, alarm monitoring, data logging, and pass/fail analysis. Because of the importance of these tasks, you need to choose the correct data acquisition modules based on your application requirements. The following parameters are of particular importance:
- Sampling and Generation Rate: Data must be sampled or generated at a required rate plus or minus a known acceptable tolerance. Without this determinism, control-loop calculations may run based on expired data, causing tests to fail or compromising system safety.
- Sampling Resolution: Data acquisition modules range in resolution from 8 to 24 bits. It is important to choose a resolution that adequately represents the system under test. For example, if you are testing a motor that rotates 0 to 10,000 RPM, using 12-bit acquisition provides an ideal signal resolution of 10,000/4096 or 2.44 RPM while 16-bit acquisition provides 10,000/65536 or 0.15 RPM. The requirements of the application determine how precisely you must measure the system.
- Response Time: Analog-to-digital converters (ADCs) require time to sample signals and deliver data to the control system. This time varies based on the type of data acquisition module and can significantly impact the control system performance. Some modules can sample in parallel while others may multiplex multiple signals with one ADC. Single converter modules often cost less but introduce additional delays between samples. You can also choose modules that implement delta-sigma converters, which introduce a signal delay as they fill their internal pipelines. They may acquire at a high rate with high accuracy, but the signal coming out of the converter is delayed many milliseconds before providing data to control loops and alarms.
Timing and Synchronization
Coupled tightly with a test system’s data acquisition is the requirement for synchronization and coordination between various tasks within the control system. These tasks include data acquisition, multiaxis control, and safety operations; events within these tasks must occur at the same time or in relation to one another.
Figure 2. Timing and Synchronization Implementation Using NI PXI
Data acquisition tasks must be synchronized to ensure sampling across all devices to prevent samples from different devices from either drifting (where 1 kHz on one device is not exactly equal to 1 kHz on another) or lagging (where samples from one device are sampled at a later time than another). Multiaxis control processes require significant coordination to ensure synchronized motion commands. For example, if you are controlling two hydraulic actuators to apply a load, you must be able to deterministically specify the load for each actuator based on an absolute time. If the actuator commands are not synchronized, the actuators produce erroneous loads and possibly destroy themselves and the device under test.
In addition to synchronized data acquisition and coordinated axis control, a test cell control system must include safety mechanisms to prevent equipment damage and ensure personnel safety. Safety systems typically incorporate three levels of protection:
- Physical protection such as barriers, guarding, and direct electrical disconnects.
- Real-time software monitoring such as programmable logic controllers (PLCs) or real-time controllers that monitor the system and respond deterministically. Typically, these systems respond by opening disconnects such as safety relays.
- Supervisory software monitoring such as a Windows PC. This level of safety applies to noncritical tasks or warnings that, if ignored, eventually lead to a real-time controller safety action.
A test cell control system must respond deterministically to safety critical channels that go outside their operating limits. The control system must have a process dedicated to safety monitoring and alarm processing.
Most test cell control applications require a standard set of features and functionality from their control systems. The primary components necessary for these applications are determinism, closed-loop control, timing and synchronization, and safety monitoring. Without these features, a control system suffers from poor stability, inconsistent control, signal resolution issues, and unsafe operation. You can find a combination of determinism, closed-loop control, timing and synchronization, and safety monitoring in one off-the-shelf offering from National Instruments and Wineman Technology, Inc. By using Wineman's INERTIA real-time control add-on for NI VeriStand software, you can construct configuration-based, complex real-time test systems based on off-the-shelf hardware. These test systems provide deterministic, real-time PID control with tight synchronization, coordination, safety monitoring, data logging, and complex test profile generation.