So far, we have only discussed P control, which is a simple and intuitive control strategy. However, P control causes a steady-state error when applied to first and second-order systems. In this section, we take a closer look at steady-state error and how to eliminate it using PI control.
To compute the steady-state error for a given input r(t), we should start by finding the transfer function from r to e. We can do this algebraically, but a useful trick is to redraw the block diagram with e as the output instead of y. This is shown below.
Figure 2:Redrawn unity feedback diagram with e as the output.
From the block diagram, we can see that the transfer function from r to e is
The only way to make this zero is to have lims→0G(s)C(s)=∞. This means that the loop gain must have an integrator. The integrator can be in the plant or in the controller. If our plant contains no integrators, then we must add one to the controller.
This is the same result we found by looking at the step response in the section on P-control, where we found the steady-state value of the output to be yss=1+kk, which means that the steady-state error is ess=1−yss=1+k1.
Now let’s verify that the error becomes zero when we add an integrator to the compensator. Let’s assume C(s)=sk (this is called integral control or I-control). The steady-state error is now:
If we want to generalize this idea to more complicated reference inputs, we may need to add more integrators. To this end, let’s define the notion of system type.
As anticipated, the DC gain of this closed-loop transfer function is 1, which means that the steady-state error to a step input is zero. However, this came at a cost. The system is now second-order! Unlike with P-control, making the gain k larger does not make the system respond faster. To see why, notice that we will have an underdamped response whenever k>4τ1. In this case, the poles are located at:
The real part of the poles is fixed at −2τ1, so increasing k does not make the system respond faster. The system will respond with settling time 8τ, which is half the speed of the original first-order system.
The imaginary part of the poles grows with k, so increasing k makes the system more oscillatory. This is similar to what happened when we tried using P-control on a second-order system.
So clearly, I-control replaced one problem (nonzero steady-state error) with another problem (slow and oscillatory response). The solution to this problem is to use a proportional-integral (PI) controller, which is a combination of a proportional gain and an integrator
This controller has two tuning parameters, kp and ki, which we can adjust to achieve good performance while still maintaining zero steady-state error. The reason this works is that we can rewrite the PI controller as
This still has an integrator, so it still increases the system type by 1 and makes the steady-state error zero, but the numerator kps+ki gives us more freedom to shape the transient response of the system. In fact, the PI compensator adds a zero to the loop gain at s=−kpki.
We now have independent control over the real and imaginary parts of the poles, so we can make the system respond as fast as we want without making it more oscillatory. It’s not that straightforward though, because the system also contains a zero, which we saw can have an effect on the transient response (see the section on zeros).
One common approach is to use the zero to cancel one of the poles of the plant. To accomplish this, we would choose:
This is a first-order system with time constant k1, and DC-gain 1, so we can make the system respond as fast as we want by increasing k, without making it more oscillatory, and also maintain zero steady-state error. We get it all! This is a common design strategy for PI controllers: use the zero to cancel one of the poles of the plant, and then tune the gain to achieve the desired speed of response. Of course, the usual caveats about high-gain control still apply.
In the section on P-control and steady-state error, we argued that P-control couldn’t achieve zero steady-state error for a shower temperature control problem and a drone altitude control problem. One way to fix this problem is to control the rate of change of the input rather than the input itself:
For the shower control example, we control whether we increase or decrease the knob angle; not the knob angle itself.
For the drone control example, we control whether we increase or decrease the thrust; not the thrust itself.
If the original thing we were controlling was “position” (knob angle, throttle amount), you can think of this as controlling “velocity” (rate of change of position) instead.
So instead of picking u, we pick v=u˙. Writing out the equations, we have:
Y(s)U(s)V(s)=G(s)U(s)=s1V(s)=C(s)E(s)(plant equation)(definition of v)(compensator)
Figure 3:Unity feedback with velocity control rather than position control. The net effect is that we have added an integrator to the loop gain, thereby increasing the type by 1 and eliminating the steady-state error to a step input if we use P-control.
The net effect of this change is that we have added an integrator to the loop gain, which increases the system type by 1. So now proportional control will achieve zero steady-state error to a step input, which is what we wanted!
That being said, proportional control of the velocity is simply I-control of the original system, and we saw that this didn’t perform well. So while this approach does eliminate the steady-state error, a better approach is to use a PI controller on the position.
We can verify that the DC gain is 1, so the steady-state error to a step input is zero. The time constant of this system is 5k1, so the settling time is approximately 4 times the time constant: