Proportional-mode control
With proportional control, the control input is a multiple of the error, u = Kpe, or U = KpE in the transform domain, where Kp is the loop gain (Section 8.6.1). With unity feedback, H = 1, the fundamental equation of a feedback system becomes
Write the plant as G = N/D. Multiplying the top and bottom of each fraction by D shows that both terms have the denominator D + KpN. So the closed-loop poles are the roots of D(s) + KpN(s) = 0, and changing the loop gain moves them.
Example 8.9 controls the request buffer of the Web server of Example 8.2, which is an integrator, G(s) = 1/s. With u = (r − y)/τ, the loop gain is 1/τ, the closed-loop pole is at −1/τ, and the step response is y(t) = 1 − e−t/τ. The steady state error is zero for every loop gain.
Section 8.6.1 warns that this is not true in general. If the plant needs a nonzero control input to hold its output steady, a proportional controller can produce it only from a nonzero error, called the droop. The first-order system of EQ 8.7 is such a plant. In this tab you can watch the droop shrink as Kp grows, but never vanish.
The request buffer of the Web server: G(s) = 1/s, a single pole at s = 0.
G(s) = K/(1 + τs) (EQ 8.7), a pole at −1/τ.
The controller
Disturbance
The disturbance is added at the plant input, as in EQ 8.14: Y = GU + GW. As printed, Examples 8.9 to 8.11 subtract W instead, which flips the sign of their disturbance terms. The errata correct this.
The closed loop (EQ 8.17, H = 1)
- closed-loop poles
- —
- final value of y
- —
- steady state error r − y(∞)
- —
- peak of the response to r
- —
- settling time (within 2%)
- —
The final value and steady state error come from the final-value theorem, and include the disturbance if it is on. The peak and settling time are for the response to the step in r alone.
What to notice
With the integrator plant, increasing Kp moves the single closed-loop pole to the left, so the output reaches the setpoint faster. The final value stays at 1 whatever the gain, as Example 8.9 shows.
Switch to the first-order plant. With Kp = 0 the closed-loop pole is the plant's own pole at −1/τ. As Kp grows, the pole moves to the left and the response speeds up, but the final value is less than 1. The final-value theorem gives the droop: the response to r has the value KKp/(1 + KKp) at s = 0.
Turn on the disturbance with the integrator plant. The output moves away from the setpoint and settles at a new level. For the integrator to hold its output steady, u + w must be zero, so the controller must supply u = −w. A proportional controller can do this only with an error of −w/Kp. Proportional control removes the steady state error caused by a step in r here, but not the error caused by a step in w.
Try these
- Example 8.9 with τ = 2: choose the preset. Where is the closed-loop pole, and what is the settling time? Now double Kp. What happens to each?
Show answer
With Kp = 1/τ = 0.5 the pole is at −0.5 and the output is within 2% of 1 after 7.82 s, which is τ ln 50. Doubling Kp to 1 moves the pole to −1 and halves the settling time to 3.91 s. The final value stays at 1. - Choose the first-order plant with K = 1 and τ = 1. Read off the final value for Kp = 1, 4 and 9. How large must Kp be to bring the steady state error down to 5%?
Show answer
The final values are 0.5, 0.8 and 0.9, and the poles are at −2, −5 and −10. The steady state error is 1/(1 + Kp), so an error of 5% needs Kp = 19, which puts the pole at −20. A small droop needs a large loop gain, which Section 8.6.1 warns can reduce damping and cause instability in less simple plants. - Choose the integrator plant with Kp = 1 and a disturbance of size 0.5 at t = 10 s. What is the final value? What is it with Kp = 5?
Show answer
The final value is 1.5 with Kp = 1 and 1.1 with Kp = 5. In both cases the error after the disturbance is −w/Kp: a larger gain shrinks it but cannot remove it. The next tab shows how integral mode does. - Why does the integrator plant have no droop in response to a step in r, while the first-order plant does?
Show answer
In steady state the output of the integrator is constant only if its input is zero. So the controller must supply u = 0, which a proportional controller does with zero error. The first-order plant settles at K times its input, so holding y near 1 needs u near 1/K, which a proportional controller can produce only from a nonzero error.
Integral-mode control
With integral control, the control input is proportional to the error accumulated over the past, u = Ki∫e, or U = (Ki/s)E (Section 8.6.2). The longer an error persists, the stronger the correction. This removes the need for a steady state error, but usually makes the control less stable. Example 8.10 shows how much less. With the integrator plant and no disturbance,
The closed-loop poles are at ±j√Ki, on the imaginary axis, so the output oscillates for ever about the setpoint: the system is marginally stable.
In practice integral mode is combined with proportional mode in a PI controller, U = (Kp + Ki/s)E, which is EQ 8.18 with Kd = 0. The Kp slider adds proportional mode.
The controller now has a pole at s = 0. If the closed loop is stable, the final-value theorem gives a final value of exactly 1 for a step in r, whatever the plant and whatever the gains, so there is no steady state error. With the first-order plant this removes the droop of the previous tab. The same pole at 0 also removes the steady state error caused by a step disturbance.
The price is an extra closed-loop pole. With the first-order plant, the closed loop is now second order, and too much integral gain makes it overshoot and oscillate.
The request buffer of the Web server: G(s) = 1/s, a single pole at s = 0.
G(s) = K/(1 + τs) (EQ 8.7), a pole at −1/τ.
The controller
Disturbance
The disturbance is added at the plant input, as in EQ 8.14: Y = GU + GW. As printed, Examples 8.9 to 8.11 subtract W instead, which flips the sign of their disturbance terms. The errata correct this.
The closed loop (EQ 8.17, H = 1)
- closed-loop poles
- —
- final value of y
- —
- steady state error r − y(∞)
- —
- peak of the response to r
- —
- settling time (within 2%)
- —
The final value and steady state error come from the final-value theorem, and include the disturbance if it is on. The peak and settling time are for the response to the step in r alone.
What to notice
In Example 8.10, changing Ki slides the two poles up and down the imaginary axis. The oscillation never dies away, whatever the gain. Adding even a little proportional gain pulls the poles into the left half-plane, and the oscillation decays.
With the first-order plant, start with Kp = 1 and Ki = 0, and keep the curve. The output settles at 0.5. Now raise Ki. The output now settles at 1, but as Ki grows the poles move off the real axis and the response overshoots more and more.
Turn on the disturbance. With Ki = 0 the output settles at a new level after the step in w. With Ki > 0 it returns to the setpoint, because the integral of the error keeps growing until the error is zero.
Try these
- Choose Example 8.10 with Ki = 1, then with Ki = 4. Where are the poles, and what is the period of the oscillation in each case?
Show answer
The poles are at ±j and ±2j. The periods are 2π ≈ 6.28 s and π ≈ 3.14 s. A larger loop gain gives a faster oscillation, which is why the book's sentence needs correcting. - Start from Example 8.10 with Ki = 1 and set Kp = 1. Where do the poles go, and what happens to the response?
Show answer
The characteristic polynomial becomes s2 + s + 1, with poles at −0.5 ± j0.866 in the left half-plane. The oscillation now decays and the output settles at 1, after an overshoot of 29.8%. - Choose the first-order plant with K = 1, τ = 1 and Kp = 1. Read off the final value. Then set Ki = 1, and then Ki = 4. What changes?
Show answer
With Ki = 0 the final value is 0.5. With Ki = 1 it is 1, and the closed loop has a double pole at −1, so there is no overshoot. With Ki = 4 the poles are at −1 ± j1.732: the final value is still 1, but the response now overshoots by 19.1%. - Choose the preset with the integrator plant, a PI controller and a disturbance. Compare it with Ki = 0. What does integral mode do after the disturbance?
Show answer
With Ki = 0 the output settles at 1.5 after the disturbance, as in the previous tab. With Ki = 0.5 it returns to 1. The controller's pole at s = 0 gives the response to w a zero at s = 0, so its final value is 0.
Derivative-mode control
With derivative control, u = Kd de/dt, or U = KdsE (Section 8.6.3). It reacts to the trend of the error: it pushes harder when the error is growing and backs off when it is shrinking, so it tends to damp the controller. It cannot be used on its own, because a constant error, however large, has zero derivative. Example 8.11 shows this with the integrator plant:
The output jumps to Kd/(1 + Kd) and stays there. There is no transient, but there is a steady state error of 1/(1 + Kd), which shrinks as the loop gain grows.
The characteristic polynomial in this example is (1 + Kd)s, with a root at s = 0. In the response to r this pole is cancelled by the zero at s = 0 that the derivative introduces, which is why there is no transient. The pole is still there in the response to w, as the disturbance term 1/(s(1 + Kd)) in Example 8.11 shows. So a step disturbance makes the output drift away for ever. Turn on the disturbance to see this.
In practice derivative mode is combined with proportional mode, U = (Kp + Kds)E. This tab also offers the second-order plant of EQ 8.9, where derivative mode adds damping. Derivative mode is also very sensitive to noise in the measurements, so they must be low-pass filtered first (Section 8.6.3). The lab does not model noise.
The request buffer of the Web server: G(s) = 1/s, a single pole at s = 0.
G(s) = K/(1 + τs) (EQ 8.7), a pole at −1/τ.
G(s) = Kωn2/(s2 + 2ζωns + ωn2) (EQ 8.9).
The controller
Disturbance
The disturbance is added at the plant input, as in EQ 8.14: Y = GU + GW. As printed, Examples 8.9 to 8.11 subtract W instead, which flips the sign of their disturbance terms. The errata correct this.
The closed loop (EQ 8.17, H = 1)
- closed-loop poles
- —
- final value of y
- —
- steady state error r − y(∞)
- —
- peak of the response to r
- —
- settling time (within 2%)
- —
The final value and steady state error come from the final-value theorem, and include the disturbance if it is on. The peak and settling time are for the response to the step in r alone.
What to notice
In Example 8.11, increasing Kd raises the level at which the output sits, towards the setpoint, with no transient at any gain. The closed-loop pole stays at s = 0, and the readout notes that it is cancelled in the response to r.
Turn on the disturbance. After the step in w the output rises in a straight line, with slope w/(1 + Kd). The pole at 0 shows itself, and the controller does nothing to stop the drift, because the error is changing at a constant rate.
With the second-order plant, fix Kp and raise Kd. The poles move away from the imaginary axis, the oscillation dies away much sooner, and the settling time falls. The final value does not change, because Kd does not appear in the final-value theorem: at s = 0 the derivative term Kds is zero.
Try these
- Choose Example 8.11. What is the output for Kd = 1, 4 and 9?
Show answer
The output is 0.5, 0.8 and 0.9, so the steady state error is 1/(1 + Kd) = 0.5, 0.2 and 0.1. As the book says, the error can be reduced by increasing the loop gain, but never removed. - Choose Example 8.11 with a disturbance of size 0.5 at t = 10 s. What is y(20)? Explain the shape of the curve after the disturbance.
Show answer
y(20) = 3.0. From t = 10 s the output rises in a straight line with slope 0.5/(1 + 1) = 0.25, so it gains 2.5 in 10 s. A step in w passes through 1/(s(1 + Kd)), and with the step's own 1/s this gives a ramp. The derivative controller only sees an error that changes at a constant rate, so it applies a constant correction, which is not enough to stop the drift. - Choose the second-order preset (K = 1, ωn = 2, ζ = 0.2, Kp = 1, Kd = 0.1). Keep the curve, then raise Kd to 0.5. How do the poles, the peak and the settling time change?
Show answer
The poles move from −0.6 ± j2.764 to −1.4 ± j2.458, further from the imaginary axis. The overshoot falls from 52.7% to 45.1%, and the settling time from 5.94 s to 2.63 s. The final value stays at 0.5. If you go on raising Kd, the overshoot starts to grow again even though the poles are better damped. This is because the derivative also puts a zero, at s = −Kp/Kd, into the response to r. - Choose the second-order plant with derivative mode alone. What is the final value, and why?
Show answer
The final value is 0, even though the closed loop is stable. The output first rises, then falls back to zero. The response to r has the numerator Kds times that of the plant, which is zero at s = 0, so by the final-value theorem the output must return to 0. This is the sense in which derivative mode cannot be used in isolation.
Combining modes
A PID controller combines all three modes, with a loop gain for each:
Section 8.6.4 sums up the roles of the three modes. Proportional mode corrects for error, integral mode removes steady state error, and derivative mode corrects for instability that integral mode may produce and damps the control action.
With G = N/D, the closed-loop poles are the roots of sD(s) + (Kds2 + Kps + Ki)N(s) = 0. Each gain appears in some of the coefficients of this polynomial, so three gains give the designer more freedom over where the poles go than a single loop gain does. When Ki = 0 the factor s drops out and the controller has no pole at 0. The readout shows the closed loop for the current settings.
Choose a plant and look for gains that give a fast response with little overshoot, no steady state error, and good rejection of a disturbance. The plant's own poles are shown faintly in the s-plane, so you can see how far the controller has moved them.
The request buffer of the Web server: G(s) = 1/s, a single pole at s = 0.
G(s) = K/(1 + τs) (EQ 8.7), a pole at −1/τ.
G(s) = Kωn2/(s2 + 2ζωns + ωn2) (EQ 8.9).
The controller
Disturbance
The disturbance is added at the plant input, as in EQ 8.14: Y = GU + GW. As printed, Examples 8.9 to 8.11 subtract W instead, which flips the sign of their disturbance terms. The errata correct this.
The closed loop (EQ 8.17, H = 1)
- closed-loop poles
- —
- final value of y
- —
- steady state error r − y(∞)
- —
- peak of the response to r
- —
- settling time (within 2%)
- —
The final value and steady state error come from the final-value theorem, and include the disturbance if it is on. The peak and settling time are for the response to the step in r alone.
What to notice
As long as Ki > 0 and the loop is stable, the final value is 1, with or without the disturbance. The integral and derivative gains then trade off against each other: more Ki makes the response less damped, and more Kd restores the damping.
With the second-order plant, raise Ki slowly from the preset. Two of the three closed-loop poles move towards the imaginary axis, and the response oscillates for longer and longer. Past a critical gain they cross into the right half-plane and the output grows without bound. This is the loss of stability that Section 8.6.2 warns about.
Turn on the disturbance and compare Ki = 0 with Ki > 0. Without integral mode the disturbance leaves a permanent offset. With it, the output returns to the setpoint, and the response to w has its own transient set by the same closed-loop poles.
Try these
- Choose the first-order plant with K = 1 and τ = 1. Find gains that give zero steady state error, an overshoot below 10% and a settling time below 2 s.
Show answer
One answer is the preset: Kp = 5, Ki = 9 and Kd = 0. The closed loop has a double pole at −3, the overshoot is 5.5% and the settling time is 1.55 s. The small overshoot, despite the real poles, comes from the zero that the PI controller adds at s = −Ki/Kp. Many other choices also work. - Choose the second-order preset (K = 1, ωn = 2, ζ = 0.2, Kp = 1, Ki = 1, Kd = 0.5) and raise Ki. At what value does the loop stop being stable? Where are the poles then?
Show answer
The loop is stable for Ki = 5.55 and marginally stable at Ki = 5.6, where the characteristic polynomial is s3 + 2.8s2 + 8s + 22.4, with poles at −2.8 and ±j2.828. For larger Ki two poles are in the right half-plane. Raising Kd pushes the critical value of Ki up again. - With the second-order preset and the disturbance on, compare Ki = 0 with Ki = 1. What is the final value in each case?
Show answer
With Ki = 0 the final value is 0.75: the disturbance of 0.5 adds 0.25, on top of a droop of 0.5 in the response to r. With Ki = 1 the final value is 1, so both errors are removed. The response is slower to settle, 5.85 s rather than 2.63 s for the step in r, because the extra pole at −0.599 is close to the origin. - Section 8.6.3 says that derivative mode is very sensitive to noise in the measurements. Using EQ 8.18, explain why.
Show answer
The derivative term is KdsE. For a sinusoidal component of the error at frequency ω, s = jω, so this term multiplies it by Kdω. Measurement noise usually has a lot of high-frequency content, and the derivative amplifies it in proportion to frequency. A sharp spike in the noise looks like a sudden large change in the error, and the controller reacts strongly to it. This is why the measurements must be low-pass filtered before derivative mode is used.