Section 12.2 Proportional-Integral (PI) Control
It’s possible that a proportional control system may not be able to completely correct the error. This is known as steady-state error (error that persists over time). Introducing an integral control term may fix this issue. An integral control term calculates past values of error to correct previous error values. To that end, proportional-integral (PI) control contains both proportionality control (to correct the current error value) as well as integral control (to correct past error). The past error in a system is defined by (12.2.1).
\begin{equation}
\textrm{past error} = \int_{0}^{t} e(\tau) d\tau\tag{12.2.1}
\end{equation}
In a discrete-time system such as a microcontroller, an integral becomes a sum, in which case the past error is defined by (12.2.2). This sum can be calculated similar to the circular buffer discussed in Subsection 7.3.1. The larger the value of \(\tau\text{,}\) the more past error is taken into account (and the more memory that is required to store all of the entires in the circular buffer). The smaller the value of \(\tau\text{,}\) the less past error is taken into account.
\begin{equation}
\textrm{past error} = \sum_{n=0}^{t} e(\tau)\tag{12.2.2}
\end{equation}
Proportional control is still affected by the proportionality constant \(K_P\text{.}\) Integral control is affected by a new term known as the integral control term, \(K_I\text{.}\) The new output of the system is now modified as defined in (12.2.3).
\begin{equation}
u(t) = y(t) + K_P e(t) + K_I \int_{0}^{t} e(\tau) d\tau\tag{12.2.3}
\end{equation}
PI control error correction is depicted as a block diagram in Figure 12.2.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. The output of the second adder is sent to the process.
This integral constant helps the feedback system achieve a steady-state value much quicker than otherwise, based on the fact that it helps compensate for errors that have not yet been cleaned up by the linear proportionality constant \(K_P\text{.}\) However, a careful value of \(K_I\) still needs to be chosen, due to the fact that a poorly chosen value can still lead to an overdamped (\(K_I\) too low) or underdamped (\(K_I\) too high) output.
Figure 12.2.2 shows a control system with a \(K_P\) value that would ordinarily lead to a highly overdamped system (indicated by the dashed curve) and no integral control. By adding integral control to the system, it is able to respond much quicker to change, with the drawback that it introduces overshoot. The graph shows a blue curve that introduces an integral control term. This value causes a little bit of overshoot or undershoot of the setpoint, but reaches the setpoint much faster than proportionality control alone. The red curve shows a larger value of \(K_I\text{,}\) leading to a bit more overshoot and undershoot, while reaching the setpoint the fastest.
