 # PID controller Algorithm

The PID controller is the most common form of feedback. PID control is an important ingredient of a distributed control system. The controllers are also integrated into many special purpose control systems. PID control is often combined with logical, sequential, selectors, and simple function blocks to build the complicated automation systems used for production, transportation, and energy fabrication.

## The PID Algorithm:

The PID algorithm is described by the equation:

Where y is the measured process variable, r the reference variable, u is the control signal and e is the control error (e = Ysp − y). The reference variable is often called the set point. The control signal is thus a sum of three terms: the P-term (which is proportional to the error), the I-term (which is proportional to the integral of the error), and the D-term (which is proportional to the derivative of the error). The controller parameters are proportional gain K, integral time Ti, and derivative time Td.

## Effects of Proportional, Integral and Derivative Action:

• For proportional control with Ti = infinite and Td = 0 is illustrated:

The process transfer function is P(s) = 1/(s 1)^3.

The figure shows that there is always a steady state error in proportional control. The error will decrease with increasing gain, but the tendency towards oscillation will also increase.

• The effect of adding integral action t

The strength of integral action increases with decreasing integral time Ti.

The process transfer function is P(s) = 1/(s + 1)^3, and the controller gain is
K = 1.

The figure shows that the steady state error disappears when integral action is used. The tendency for oscillation also increases with decreasing Ti.

• The effects of adding derivative action

The parameters K and Ti are chosen so that the closed-loop system is oscillatory.

The process transfer function is P(s) = 1/(s + 1)^3, the controller gain is K = 3, and the integral time is Ti = 2.

Damping increases with increasing derivative time but decreases again when derivative time becomes too large. Recall that derivative action can be interpreted as providing prediction by linear extrapolation over the time Td. Using this interpretation it is easy to understand that derivative action does not help if the prediction time Td is too large.