Process Control
Many systems are intended to provide dynamic control of a physical environment using a feedback loop in which inputs are used by the system to determine a set of outputs that will produce a new state of the environment.
Dynamic control systems are used to allow digital systems to interact with the physical world, for example: control systems for machines and engines. Such systems use sensors to receive information, perform computations, and control the machine or engine via actuators. The sensors then collect information again and the process repeats. This is a closed loop system.
Frequently these systems take the form of a dynamic, stateful system which provides sensor feedback to a controller. The controller then has access to a set of parameters that modify the dynamics of the system. The system under control is usually stochastic and unpredictable, as well as real-time; correct functionality depends upon deadline-driven response to sensor feedback. Engines and machines generate analog information. Digital Control Theory was developed so that micro-controllers and computers could be used to perform such control tasks.
Universal Forces:
Sample Rate Samples are taken at regular intervals, as determined by Digital Control Theory. A higher sample rate provides higher accuracy, but requires more computation. Since the controller needs to guarantee that the computations are finished before the deadline demanded by the physical requirements of the system, the designer needs to balance the trade-off between high sample rate and computation limits
Model Complexity The controller must have an internal model of the system under control; the complexity of this model influences the latency of its response. However, a more complex model provides more precise control over the system. Similar to the sample rate, simpler models are usually faster to compute, but may not capture some nuances of the physical system.
Implementation Force:
Determinism vs. Performance Real-time constraints demand that the controller respond withing its allocated time to sensor feedback. Control systems designers measure execution times in order to guarantee that deadlines are always met. It is much harder to guarantee deadlines in systems that vary its performance depending on conditions that cannot be easily modeled. For instance, caches are widely used since they increase the global throughput of computer system, but their use reduces determinism in the system. Where multiple cache levels should be used is a decision designers need to make.
The Process Control pattern provides isolation between the various pieces of the problem:
By isolating the code for the system components, evaluating the central trade-off of the system design becomes possible. The designer is free to experiment with different implementations of the controller and system model that balance precision in control versus response latency.
In choosing the sampling rate, the central aim is to find a rate that is as low as possible while still meeting all design criteria, especially closed loop stability and required error margins. To help in the selection, several rules of thumb exist. One of those relates the sampling rate Fs to the closed-loop bandwidth Fc of the controlled system by Fc *5 < Fs < Fc *30 [The control handbook, W. S. Levine], while others take into account the rise time of the feedback system or the phase margin of the discretized control system. In general, it is advisable to check via computation of the discrete system transfer function (for linear systems) or via simulation (for non-linear and stochastic systems), whether the chosen sampling rate will satisfy all requirements placed on the control system.
The only paths of information between the process and the controller are the sensors and the actuators. It is presumed that the controller understands the inherent unreliability of the sensors and actuators: the Process Control pattern itself makes no provision for hardware failures. Furthermore, the controller must understand possible anomalies and prevent its control response from becoming unstable.
Many Real-time control systems fit the Process Control pattern:
Thermostats, DARPA Grand-Challenge, Auto-Pilot, Hearing aids, anti-lock breaks in automobiles.
The Process Control pattern is neither inherently sequential nor inherently parallel. Therefore the PLPP patterns do not directly apply. Parallelism is present in a similar manner as in the Pipe-and-Filter pattern, however the feedback loop presents a necessary extra consideration in implementation.
Mark Murphy, Eric Battenberg