Controller Algorithms

An automatic controller compares a process measurement to a desired "setpoint" value and produces a "controller output" in response.

The first step in most algorithms is a "comparator" which calculates an "error":

Error def'n
This error is used to calculate a compensating change in the controller output (CO), which when transmitted to the control element changes the manipulator to adjust the process.

The goal of the controller is thus to reduce the error to zero in an appropriate fashion.

Manual Control

Sometimes an operator will choose to adjust a manipulator based on intuition, experience, etc. Such an approach is inconsistent, and not practical in a situation where there are many control loops.

Almost all controllers will have an "auto/manual" switch, which can be used to toggle between open loop (controller disengaged) and closed loop (automatic control) operation.

On-Off Control

The simplest control algorithm is on-off control. This approach is employed by most home thermostats.

On/Off Algorithm

Proportional Control (P-only Control)

On-off control takes exactly the same action for small errors as it does for huge ones. The resulting cycling might be reduced if the controller was able to make big changes when error is big, but small changes when error is small.

P-only Algorithm

Some controllers (especially older models) use "proportional band" instead of "gain":
Proportional Band
the gain must be dimensionless for this to work.

A P-only controller won't necessarily drive a process back to perfect setpoint. The permanent error which results is called "offset". This is because the gain of a process under proportional control has a (1+KcKp) term in the denominator.

Source of Offset
Consequently, offset decreases as Kc increases. Be warned though, too big of a gain can drive a process unstable.

Integral Control (Reset)

In many cases, would like to completely eliminate offset, so need a way to penalize persistent errors.

Integral Algorithm

When a fixed error -- caused by calibration problems, valve saturation, overrides, etc. -- continues for a long time, the integrator can stick at a large value. This is called "reset windup". Most controllers have an "anti-reset windup" feature, where the error is calculated as the difference between setpoint and controller output rather than setpoint and process measurement, at least for the integral control calculations.

Derivative Control (Rate)

PI control is effected only by the magnitude and persistence of the error. There are times when it would be nice if could move the output faster when error is changing rapidly.

Derivative Algorithm
This is the algorithm for an "ideal" derivative action. Looking at it, you should suspect that it will not be easy to implement.

PID Control (Proportional-Integral-Derivative, Three Mode)

The PID controller is the workhorse of the process industries and around 90% of industrial loops are PI. PID Algorithm
Shown is a "position form" of the PID algorithm, so called because it provides the control element with complete information as to where to position the manipulator.


References:

  1. Luyben, W.L., Process Modeling, Simulation and Control for Chemical Engineers (2nd Edition), McGraw-Hill, 1990, p. 222- 226, 261-262.
  2. Riggs, J.B., Chemical Process Control (2nd Edition), Ferret, 2001, pp. 217-20, 230-38.
  3. Seborg, D.E., T.F. Edgar, D.A. Mellichamp, Process Dynamics and Control, John Wiley, 1989, pp. 184-193.

R.M. Price
Original: 10/15/93
Modified: 2/3/94, 3/3/97, 3/16/98, 12/8/98; 7/1/2003, 8/10/2004

Copyright 1998, 2003, 2004 by R.M. Price -- All Rights Reserved

Validated