Section 12.3 Proportional-Integral-Derivative (PID) Control
A full proportional-integral-derivative (PID) control feedback system takes into account also anticipated future values of the error based on calculating the derivative of the current error. The future error term is defined in (12.3.1).
\begin{equation}
\textrm{future error} = \frac{d}{dt}e(t)\tag{12.3.1}
\end{equation}
Adding a derivative control term (\(K_D\)) may make the feedback mechanism much more sensitive to noise, and is only recommended in cases where noise will be minimum.
In a discrete-time system such as a microcontroller, the derivative of the error can be calculated by determining how much the output has changed over time by taking the difference between current and past values and dividing by the elapsed time.
To affect the output in PID control, a derivative control term \(K_D\) is included in the control equation. The process variable is now modified as defined by (12.3.2).
\begin{equation}
u(t) = y(t) + K_P e(t) + K_I \int_{0}^{t} e(\tau) d\tau + K_D \frac{d}{dt}e(t)\tag{12.3.2}
\end{equation}
Values for each of the constants (\(K_P\text{,}\) \(K_I\text{,}\) and \(K_D\)) must be chosen specifically for each application in which they are to be used. Changing any other part of the process may also require a change in the constants.
PID control error correction is depicted as a block diagram in FigureΒ 12.3.1. The circle labeled \(\Sigma\) denotes the addition operation. Arrows pointing into the circle with a + sign will be added and arrows pointing into the circle with a β sign will be subtracted. Therefore, the block diagram depicts the process variable being subtracted from the setpoint. This is equal to the error. The error multiplied by the proportionality constant is sent to another adder. The error is also sent to a block depicting the integral calculation multiplied by the integral constant. This is also sent to the second adder. Finally, the error is also sent to a block depicting the derivative caclulation multiplied by the derivative constant. This is also sent to the second adder. The output of the second adder is sent to the process.
FigureΒ 12.3.2 shows a control system with only proportional control (dashed line, overdamped response). By adding integral control to the system, it is able to respond much quicker to change, with the introduction of some overshoot and undershoot (red line). The graph shows a third blue curve that introduces a derivative control term. This value settles to the setpoint the quickest with the least amount of overshoot and undershoot.
