|
Many industrial control systems feature highly visual human interfaces that depict the process under control, which may
be a medical device, an industrial plant, an assembly line, etc. These displays may also involve rapidly changing data,
or they may include interfaces to network-accessible databases to access schematic diagrams or diagnostic and
maintenance procedures. Such systems therefore benefit from the ubiquity and richness of GPOSs such as Microsoft Windows*
and the computational performance of powerful CPUs. Yet they also require strict real-time control to ensure that
robotic machines assemble parts with exacting precision, move gantries and X-ray machines to exact locations, operate
switches and actuators at precise times, or perform functions for exact durations. Many require closed-loop feedback
control systems: for example, if a sensor detects that a machine has reached a specific point, that sensor sends a
signal that must be acted upon by the control software within a timeframe that is measured in microseconds in order that
the machine can be halted in that exact position without variance.
As we noted above, GPOSs such as Microsoft Windows are not suitable for performing this level of real-time control
because they are designed to share processor resources fairly between running processes, thereby preventing "starvation"
of some processes. Traditional industrial control systems therefore typically separate their processing and control
functions into a Master Station component that implements the human computer interface, database interface, and other
non-real-time management functions, and separate Remote Terminal Units (RTUs) which are small, rugged computers that
implement the real-time control functions, traditionally using separate Programmable Logic Controllers for that purpose.
These RTUs contain the sensors and actuators to detect and control the operating environment, along with sufficient
computing performance to react to environmental changes and control commands extremely quickly, and to execute the
communications protocol stack to exchange data with the Master Station. RTUs frequently must also operate within extreme
temperature, humidity, vibration, or other environmental conditions that are more challenging for the electronics than
for the mechanical components. These environmental conditions restrict the choice of computing components that can be
employed, or they increase the cost of those components, particularly if ample performance headroom is desired to
support future functionality. Therefore, for reasons of cost reduction and the desire for a common, scalable
infrastructure upon which greater functionality can be layered, trends in industrial control are toward a consolidated
platform that can provide the required separation of the real-time control functionality from the non-real-time
functions [5]. In this way RTUs can be simplified, while the Master Station provides real-time control that can be given
absolute priority so that signals can be operated upon within strictly defined bounded timeframes, while still providing
the rich graphical environment, databases, and device support of a GPOS.
Scheduler and interrupt latencies for virtualized solutions in industrial control
Although the graphical user interface of a GPOS such as Microsoft Windows or Linux* combined with XWindows meets the
requirements for control of medical equipment or industrial equipment, the applications' response times are often not
acceptable. The average interrupt latency provided by a GPOS may indeed be within acceptable limits (on the order of
5-20 microseconds), but the worst-case latency must be designed for, and this may be orders of magnitude too long in a
GPOS.
The main reasons why GPOSs are not suitable are due to the policies of the scheduler and the design of the kernel. The
scheduler is the entity that determines how much time a specific task/process/thread is allowed to spend on a given
processor. Modern GPOS schedulers allow users to provide an element of application scheduling control. Both Windows and
Linux OSs provide such features. Still, even when equipped with these kinds of features, the scheduling algorithms
utilized by GPOSs do not provide sufficient real-time control.
The scheduler behavior has an immediate effect on interrupt handling. When controlling a critical process, interrupts
generated by the equipment under control must be serviced within a very specific and bounded time frame. GPOSs do not
have this capability, as high priority tasks/processes or threads can take priority. This behavior is unacceptable for
applications that require real-time control. The design of the OS kernel may also include critical sections of code that
must execute atomically, and therefore interrupts must be disabled during these critical sections, thereby causing the
worst-case latency to increase by the length of the longest critical section in the OS.
Today there are different solutions available to provide this element of real-time control. Some solutions provide a
real-time kernel and run the GPOS and graphical user interface within a complete thread. An API is defined that allows
the GPOS to interact with the real-time kernel. If the requirement for thread scheduling exists, an application within
the GPOS would utilize the thread mechanism offered by the real-time kernel.
Another approach is to run a small real-time kernel along with the GPOS. Both OSs share the CPU, memory, and interrupt
controller. However, each version of the kernel has its own context (descriptor tables, memory management etc.). The
real-time kernel determines when specific processes have to be executed to maintain determinism, and interrupt delivery
is also controlled so that it does not affect the behavior of the system. If an interrupt occurs during the execution of
a real-time task, the real-time kernel will not necessarily execute the interrupt service routine if it is associated
with the GPOS. Instead it will continue execution of the real-time task and on completion it will hand over control to
the GPOS, which will then deal with the interrupt.
Designing in determinism in a GPOS this way can be very complex. The OS source may not be available: with this in mind,
some assumptions must be made in order to predict the behavior of the general-purpose kernel.
Commercial virtualization solutions for industrial control applications
Commercial solutions exist that meet the stringent latency constraints of real-time control while still providing the
rich and ubiquitous development framework of Microsoft Windows. Products such as TenAsys Corporation's INtime* employ
the hardware capabilities of Intel's processors with Intel® VT to provide extremely low latencies (worst-case measured as
low as 3 microseconds) and real-time capabilities for Microsoft Windows, while allowing Visual Studio* to be used for
development in both the Windows environment and the INtime environment. This enables developers to create and deploy
sophisticated real-time applications without trying to force a GPOS or device driver to achieve real-time performance.
|