Proportional-integral control (source code)

= Proportional-integral control
{title2=$u=k_p e+k_i z,\quad\dot z=e$}

= PI control
{c}
{synonym}

<Proportional-integral control> is the proportional and integral part of a <PID controller>, with the derivative term omitted. <Proportional-integral control> combines <proportional control> with <integral action>. For the ideal <controlled plant>, a constant <reference signal>, exact measurement and a constant <control disturbance>, the <ordinary differential equations> give
$$
\dot e=-k_p e-k_i z-w,\qquad\dot z=e,\qquad
\ddot e+k_p\dot e+k_i e=0.
$$
The <characteristic polynomial> is $\lambda^2+k_p\lambda+k_i$. Positive $k_p$ and $k_i$ imply <asymptotic stability> of the <equilibrium point>: real <roots of a polynomial> have negative sum and positive product, hence are both negative; a nonreal <complex conjugate> pair has real part $-k_p/2<0$. This is a short stability check for this ideal <controlled plant>, rather than a rule for every <dynamical system>.

At the <equilibrium point>, $e_*=0$, $x_*=r$, and $z_*=-w/k_i$. For $w=0.2$ and $k_i=1$, the stored value $z_*=-0.2$ supplies $u_*=-0.2$ even though the <tracking error> is zero. This separates the eventual accuracy from the transient response: <integral action> cancels the lasting offset but can make the <plant output> pass beyond the goal. The authors discuss practical limits on <integral action> in https://www.fbswiki.org/wiki/index.php/PID_Control[Åström and Murray, Feedback Systems, Chapter 11].

For $k_p=2$, $k_i=1$, $x(0)=z(0)=0$ and $w=0$, the <characteristic polynomial> is $(\lambda+1)^2$. The <initial conditions> are $e(0)=1$ and $\dot e(0)=-2$, giving
$$
e(t)=(1-t)e^{-t},\qquad x(t)=1-(1-t)e^{-t},\qquad z(t)=te^{-t}.
$$
The <tracking error> changes sign at $t=1$. Since $\dot x=(2-t)e^{-t}$, the largest <plant output> occurs at $t=2$ and is $1+e^{-2}\simeq1.135335$, about $13.53\%$ above the <reference signal>.

For a separate comparison, start the <control disturbance> $w=0.2$ at $t=4$. For $t\ge4$, write $s=t-4$. The exact responses are
$$
x_P(t)=1-e^{-2t}+0.1(1-e^{-2s}),\qquad
x_{PI}(t)=1-(1-t)e^{-t}+0.2s e^{-s}.
$$
The <proportional control> response tends to $1.1$, while the <proportional-integral control> response returns to $1$. At $t=8$, the values are approximately $1.099966$ and $1.017001$. The added term in the <proportional-integral control> response eventually vanishes, exposing how memory removes a constant <control disturbance>'s lasting effect.

\Image[/proportional-versus-integral-feedback.png]
{title=<Proportional control> and <integral action>: arrival and disturbance rejection}
{description=Left: the ideal <controlled plant> has <reference signal> $r=1$ and no <control disturbance>; <proportional-integral control> reaches a peak $1.135335$ at $t=2$. Right: a <control disturbance> $w=0.2$ begins at $t=4$; <proportional control> settles at $1.1$, while <proportional-integral control> returns to $1$. The generator uses the <classical fourth-order Runge-Kutta method> with step $0.002$, splits the computation at $t=4$, and checks both full responses and the stored memory against their exact formulas. All coordinates are <dimensionless quantities>.}