PID Controller

PID Controllers

General Overview

A proportional–integral–derivative controller also known as a PID controller is a basic control loop response mechanism/controller which is extensively used in industrial control systems. A PID controller is used for calculating "error" values as the difference between a measured process variable and a desired set point. By adjusting the process control inputs, the controller attempts to reduce the error. Parameters of a PID controller used in the calculations must be tuned according to the nature of the system.
Three separate parameters are involved with PID controller calculations which are; the proportional, the integral and derivative values. Proportional values determine the reaction to the current error, while integral values determine the reaction based on the sum of recent errors, and derivative values determine the reaction based on the rate at which the error has been changing. The weighted sum of the proportional, integral, and derivative actions are used to adjust the process by means of a control element such as the position of a control valve or the power supply of a heating element. Consequently, the PID controller can be illustrated as a controller that takes into account the present, the past, and the future of the error.

$\scriptsize{Figure 1:}$ A block diagram of a PID controller

Tuning the three constants in the PID controller algorithm, will allow the controller can provide control action designed for detailed process requirements. The response of the controller can be described in terms of the responsiveness of the controller to an error, the degree to which the controller overshoots the set point and the degree of system oscillation. Also, note that the use of the PID algorithm for control does not guarantee optimal control of the system or system stability.

Control Loop Summary

A basic explanation of a control loop is the simple act of adjusting hot and cold faucet valves to preserve the faucet water at the preferred temperature. Usually by mixing of the two streams, the hot and cold water, the desired temperature can be obtained. When the person touches the water to measure its temperature the sense of feel tells them if the stream of water has met the desired temperature. From this point the person will either adjust the hot and cold water valves until the preferred temperature is met and stabilized or do nothing because the desired temperature has already been met. Sensing the water temperature is equivalent to taking a measurement of the process value or process variable (PV). The desired setpoint (SP) is the temperature in which the person is trying to obtain. Additionally, the water valve position which can be called the input to the process is known as the manipulated variable (MV), which basically means that one can change the values of this variable. Moreover, in this example the difference between the desired setpoint and the temperature measurement is known to be the error (e). The error will quantify if the water is too hot or cold and by how much.

After measuring the process variable (PV) or in this case the temperature, then calculating the error, the controller determines when to change the manipulated variable (MV) or tap position and by how much. Once the controller turns on the water, they might turn the hot valve slightly if warm water is preferred, or they may turn it all the way. This is an example of the proportional control. To speed up the process so that the water becomes hot faster, the controller may open the valve more and more as the time elapse, this is an simple example of an integral control. By using both the proportional and integral control methods, the water temperature has the potential to oscillate between hot and cold. This is due to the fact that the controller is over-compensating and overshooting the desired setpoint at a rapid rate.
If the controller wanted to achieve the desired temperature on a more gradual convergence, the controller can damp the anticipated future oscillations. In other words the controller may elect to temper their adjustments; this can be referred as a derivative control method.

PID Controller Theory

As stated in the previous sections the PID control scheme is named after its three correcting terms, whose sum constitutes the manipulated variable (MV). Which presents the equation:

(1)
$$MV(t) = P_{out}+I_{out}+D_{out}$$

where

• $P_{out}$ is the proportional term
• $I_{out}$ is the integral term
• $D_{out}$ is the derivative term

These terms are the contributions to the output from the PID controller.

Proportional term

$\scriptsize{Figure 2:}$ Plot of PV vs. time, for three values of $K_{p}$($K_{i}$ and $K_{d}$ held constant)

The proportional term which can also be referred to as gain, makes a change to the output that is proportional to the current error value. By myltiplying the error by a constant $K_{p}$, which is known as the proportional gain, the proportional response can be adjusted.

The proportional term is given by:

(2)
$$P_{out} = K_{p}e(t)$$

where

• $P_{out}$: Proportional term of output
• $K_{p}$: Proportional gain, a tuning parameter
• $e$: Error = SP - PV
• $t$: Time or instantaneous time (the present)

When the proportional gain has a value it results in a large change in the output in the given change in the error. As a result of the proportional gain being out of range or too high, the system can eventually become unstable. On the other hand, if the proportional gain is very small it will result in an output response to a large error in the input which will also make the responsive controller lessen. Additional having a proportional gain that is too low may cause the t control action to be too small when it tries to respond to the system.

Integral Term

$\scriptsize{Figure 3:}$ Plot of PV vs. time, for three values of $K_{i}$($K_{p}$ and $K_{d}$ held constant)

The integral term which can also be called the reset, its contribution is proportional to the magnitude and duration of the error. By the summation of the instantaneous error over the time, which is basically the integration of the error, gives the accumulated offset that should have been corrected previously. This accumulated error is multiplied by the integral gain then added to the controller output. Additionally, the integral gain, $K_{i}$, determines just how much the integral term will contribute to the total control action.

The integral term is given by:

(3)
\begin{align} I_{out} = k_{i}\int^{t}_{0}e(\tau)d\tau \end{align}

where

• $I_{out}$: Integral term of output
• $K_{i}$: Integral gain, a tuning parameter
• $e$: Error = SP - PV
• $t$: Time or instantaneous time (the present)
• $\tau$: a dummy integration variable

When added to the proportional term, the integral term accelerates the movement of the proccess towards the desired setpoint which will eliminate the residual steady state error which occurs with the proportional controller. The one drawback from the integral term is the simple fact that it responds to an accumulated error from the past which can cause the present values to overshoot the desired setpoint value.

Derivative Term

$\scriptsize{Figure 4:}$ Plot of PV vs. time, for three values of $K_{d}$($K_{p}$ and $K_{i}$ held constant)

By determining the slope of the error over time and multiplying that rate of change, which is done by the derivative gain $K_{d}$, the rate of change of the process error is calculated. From here, the magnitude of the contribution of the derivative term which is also known as the rate, to the overall control action is called the derivative gain, $K_{d}$.

The derivative term is given by:

(4)
\begin{align} D_{out}=K_{d}\frac{d}{dt}e(t) \end{align}

where:

• $D_{out}$: Derivative term output
• $K_{d}$: Derivative gain, a tuning parameter
• $e$: Error = SP - PV
• $t$: Time or instantaneous time (the present)

A noticeable slow down in the rate of change close to the controller set point is done by the derivative term. Therefore, the derivative control helps reduce the magnitude of the overshoot which is the result of the integral component while also improving the combined controller-process stability.

Summing the Terms

Thus, these three terms are then added up to produce the output for the PID controller. The final form of the PID algorithm is:

(5)
\begin{align} u(t)=MV(t)=K_{p}e(t) + K_{i}\int^{t}_{0}e(\tau)d\tau + K_{d}\frac{d}{dt}e(t) \end{align}

Where $u(t)$ is defined as the controller output.