PID vs. Linear Control -- Really?

I have seen the arguments. State space models are superior. PID is all you really need, so why mess with state space? And so on and on. If you have no system model, and don't intend to get one, you need a heuristic controller such as PID or a fuzzy rule-based controller. With these, of course, you have all of the usual tuning grief and little to help you. For the case where you have a rather good understanding of the system, including a state model, but PID controls are all you really need for the implementation, it seems a shame that the system model and PID control model are not consistent... or are they?

There are lots of reasons why you might choose to use PID controls, even in situations when other controllers would be advantageous.

  1. Economics.
  2. Availability - PID controllers are probably in inventory.
  3. Lack of an appropriate system model.
  4. Your boss actually understands PID.

So check out the following. If it makes no sense, flame away. I have never seen an analysis of this sort in print. I apologize if this is old business. Perhaps it is just too obvious. Or maybe it was published in a classic paper that anybody who matters would know about...


Augmenting the System Model

Assume we have a state space system model with state vector x, a single-variable control v, state matrix a, input coupling matrix b, observation matrix c, with single-output y.

    // System model
    x' = a x  +  b u
    y  = c x

We will consider the input to consist of two parts: a setpoint driving term s, and a feedback term v.

    // Input model
    u  =  v  +  s

proportional control

We certainly have the information needed for proportional control, given the observed output y and knowing the current control setpoint level s. A proportional feedback rule would be

    // proportional feedback
    v  =  -kp (y - s)  =  -kp ( c x - s )

derivative control

PID control needs integral error and derivative control as well. The derivative (if we could measure it) would be

    y' = c x' = c a x  +  c b u

with a derivative feedback rule

    //derivative feedback
    v  =  -kd  (c a x  +  c b u)

This expression has used the derivative of the output, not the derivative of the setpoint tracking error. The derivative of the setpoint error would produce an additional s' derivative term. In most cases, decouping from this term is considered an advantage. If the setpoint is changed to a new level quickly, the input signal derivative term injects impulsive "glitches" into the control output, and this is seldom useful. Usually the setpoint level is held constant or ramped slowly, and for these cases the impact of the input signal derivative is negligible.

This expression is still not quite right, however. If we expand the rightmost term, we see that feedback variable v appears on both sides of this expression.

    //derivative feedback
    v  =  -kd  (c a x  +  c b v  +  c b s)

If we do an algebraic reduction, we get a better behaved expression for the derivative feedback.

    Kd  =  kd /[1 + kd c b]
    kd  =  Kd /[1 - Kd c b]

    v  =  -(kd /[1 + kd c b]) (c a x  +  c b s)
    v  =  -Kd c a x  -  Kd c b s

integral control

The integral of tracking error is the integral of the difference between output y and the setpoint level s. Augment the system equations with an additional artificial state z to represent the integral state of the controller.

      z' = c x - s

The integral feedback rule is

    //integral feedback
    v  =  -ki  z

The state equations augmented with the addtional PID integrator are

    // Augmented system model
    x' = a x  +  0 z  +  b v  +  b s
    z' = c x  +  0 z  +  0 v  -  1 s
    y  = c x

We can put this in a more conventional form by defining the augmented state and input vectors

    X  =    |   x   |
            |   z   |

    U  =    |   v   |
            |   s   |

and also the augmented state and input matrices

    A  =    |  a    0   |      B =   | b  0 |
            |  c    0   |            | 0 -1 |

This yields an equivalent expression for the state equations in the conventional form.

    X'  =  A X  +  B U


Observed Variables and PID Feedback

To apply the P, I and D control rules, we must respond to three observed variables. Collect these to form the observation equations.

    yp =   c x  -  s               // proportional error
    yi =   z                       // integral of proportional error
    yd =   Kd c a x  +  Kd c b s   // output derivative

The PID feedback is a weighted sum of the P, I and D control rules, with gain parameters kp, ki and kd.

      v  =  -kp  ( c x - s )   +
            -ki  ( z )    +
            -kd  ( Kd c a x  +  Kd c b s)

To put the control law into matrix form, collect the PID gain parameters in row matrix Kpid.

    Kpid  =   [ kp  ki  kd ]

Also define the observation matrices C and D.

              |  c         0    |
      C  =    |  0         1    |
              |  Kd c a    0    |

              |   -1      |
      D  =    |    0      |
              |   Kd c b  |

Split the two columns of the B matrix into Bv and Bs. The relationships can now be summarized in matrix notation as follows:

     X' =  A X  +  Bv v  +  Bs s     // system
     Y  =  C X  +  0  v  +  D  s     // observation
     v  =  -Kpid Y                   // PID feedback

To examine properties of this system under feedback control, we can substitute the feedback expression into the system equations.

     X' =  A X  -  Bv Kpid Y  +  Bs s

     X' =  A X  -  Bv Kpid C X  -  Bv Kpid D s  +  Bs s

     X' =  (A - Bu Kpid C ) X  +  (B - Bu Kpid D) s

The first matrix term of this final expression can be studied to evaluate stability and robustness properties of the system response given various tunings of the Kpid matrix.

What we have just obtained is a state space model of a system under PID control. This is a matter of notation, not control theory. Because it is clear that this is both PID control, and also a state space representation, there is no need to choose between PID or linear control theory. PID is a special case of a state space controller, with a special constrained structure.

Okay, that's the idea. What I don't know is... how well does this work in practice?


Site:    RidgeRat's Barely Operating Site    http://home.earthlink.net/~ltrammell
Author:  Larry Trammell   Created: Nov 24, 2002    Revised: Oct 18, 2003   Status: Experimental
Contact: NOSPAM ltramme1476 AT earthlink DOT net NOSPAM
Related: (none)     Restrictions: This information is public