Skip to main content
Engineering LibreTexts

11.7: Example: PID Control

  • Page ID
    50391
    • Franz S. Hover & Michael S. Triantafyllou
    • Massachusetts Institute of Technology via MIT OpenCourseWare
    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Consider the case of a mass \((m)\) sliding on a frictionless table. It has a perfect thruster that generates force \(u(t)\), but is also subject to an unknown disturbance \(d(t)\). If the linear position of the mass is \(y(t)\), and it is perfectly measured, we have the plant\[ m y''(t) \, = \, u(t) + d(t). \]

    Suppose that the desired condition is simply \(y(t) = 0\), with initial conditions \(y(0) = y_o\) and \(y'(0) = 0\).

    Proportional Only

    A proportional controller alone invokes the control law \(u(t) = −k_p y(t)\), so that the closed-loop dynamics follow

    \[ m y''(t) \, = \, - k_p y(t) + d(t). \]

    In the absence of \(d(t)\), we see that \(y(t) = y_o \cos \sqrt{\frac{k_p}{m}} t\), a marginally stable response that is undesirable.

    Proportional-Derivative Only

    Let \(u(t) = - k_p y(t) - k_d y'(t)\), and it follows that

    \[ m y''(t) \, = \, - k_p y(t) - k_d y'(t) + d(t). \]

    The system now resembles a second-order mass-spring-dashpot system where \(k_p\) plays the part of the spring, and \(k_d\) the part of the dashpot. With an excessively large value for \(k_d\), the system would be overdamped and very slow to respond to any command. In most applications, a small amount of overshoot is tolerated because the response time is shorter. The \(k_d\) value for critical damping in this example is \(2 \sqrt{m k_p}\), and so the rule is \(k_d < 2 \sqrt{m k_p}\). The result, easily found using the Laplace transform, is

    \[ y(t) \, = \, y_o e^{\frac{-k_d}{2m}t} \left[ \cos \omega_d t + \frac{k_d}{2 m \omega_d} \sin \omega_d t \right], \]

    where \(\omega_d = \sqrt{4m k_p - k_d^2} / 2m\). This response is exponentially stable as desired. Note that if the mass had a very large amount of natural damping, a negative \(k_d\) could be used to cancel some of its effect and speed up the system response.

    Now consider what happens if \(d(t)\) has a constant bias \(d_o\): it balances exactly the proportional control part, eventually settling out at \(y(t = \infty) = d_o / k_p\). To achieve good rejection of \(d_o\) with a \(PD\) controller, we would need to set \(k_p\) very large. However, very large values of \(k_p\) will also drive the resonant frequency \(\omega_d\) up, which is unacceptable.

    Proportional-Integral-Derivative

    Now let \(u(t) = - k_p y(t) - k_i \displaystyle\int\limits_{0}^{t} y(\tau) \, d\tau - k_d y'(t)\): we have

    \[ m y''(t) \, = \, - k_p y(t) - k_i \int\limits_{0}^{t} y(\tau) \, d\tau - k_d y'(t) + d(t). \]

    The control system has now created a third-order closed-loop response. If \(d(t) = d_o\), a time derivative leads to

    \[ m y'''(t) + k_p y'(t) + k_i y(t) + k_d y''(t) = 0, \]

    so that \(y(t = \infty) = 0\), as desired, provided the roots are stable. Note that for the case of the \(PD\) control, it was enough to select \(k_p\) positive and \(k_d\) positive because these terms represent spring and dashpot-type forces. The use of \(k_i\) complicates the stability however, and it is not enough in general to set all three gains positive - stability should be checked explicitly.


    This page titled 11.7: Example: PID Control is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Franz S. Hover & Michael S. Triantafyllou (MIT OpenCourseWare) via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.