Process Control Pattern

Name

Process Control

Problem

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.

Context

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.

Forces

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.

Solution

The Process Control pattern provides isolation between the various pieces of the problem:

  1. The software required to interface to the physical sensors
  2. The software required to interface the system’s actuators
  3. The model of the system under control, and the functionality and policy of the controller.

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.

Invariant

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.

Examples

Many Real-time control systems fit the Process Control pattern:

  1. Engine control unit – In engine control units, a sensor may measure the torque produced by such engine. If there is a need to increase the torque, computations are processed to determine the increase in the amount of air-fuel (AF) mixture that needs to be provided to the engine. As the AF mixture increases, torque starts to increase. The torque sensor sends new measurements to the engine control unit that in turn uses an actuator to control the new AF mixture. When the desired torque is reached, the controller stops the increase in the AF mixture.
  2. An airplane’s auto-pilot system which reads data from sensors and provides pressure on control-surfaces to maintain heading and attitude
  3. A Dynamic-Range Compression system in audio applications (e.g. a hearing-aid) must adjust the gain applied to the input audio signal based on a short-time average of perceived loudness.

Known Uses

Thermostats, DARPA Grand-Challenge, Auto-Pilot, Hearing aids, anti-lock breaks in automobiles.

Related Patterns

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.

Authors

Mark Murphy, Eric Battenberg

 
patterns/process_control.txt · Last modified: 2009/11/23 12:43 by kolossa
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki