Root locus design +
In this section, we will see how to use root locus plots not just for analysis, but also for control design. We will cover the general design workflow and then work through several examples.
Motivating example: PI controller¶
Root locus is fundamentally a tool for doing P control. The root locus plot tells us how the closed-loop poles move as we change the proportional gain . However, it can also be used to guide the design of more complicated compensators.
Say we wanted to design a PI controller for a plant . we shouldn’t think of this as “picking and ”. Instead, we should rewrite the PI compensator as:
where . Therefore, our characteristic equation is:
So we can think of PI control of as equivalent to P control of the augmented plant . The idea is to split the design of the compensator into three steps:
Shape the root locus. First, we pick to shape the root locus of so that it passes through our desired closed-loop pole locations. This is the “compensator design” phase and in this case, it amounts to placing a zero somewhere on the real axis. For example, we could use it to cancel a LHP pole.
Pick the gain. Once we have the desired shape of the root locus, we can pick to achieve the desired closed-loop poles. This is the “gain design” phase. Note that when we are varying , we must keep fixed, so this means we are actually changing at the same time since .
Calculate . Finally, we can calculate using the relationship .
This is a powerful idea that applies to any compensator, not just PI. Let’s turn this into a general workflow for root locus design.
Root locus design workflow¶
Let’s see how this works in practice with some examples.
Example: Controlling overshoot¶
Suppose we have the plant . We would like to design a compensator that achieves a damping ratio of for the dominant closed-loop poles.
This plant is already a second-order system. Our first step is to see if P control can do the job. If P control is enough, then we don’t need to worry about pole dominance because there are only two poles. The root locus of is shown below.
Figure 1:Root locus of the second-order plant with dashed lines indicating a damping ratio of , or .
The damping ratio of corresponds to a pole angle of , shown in green in Figure 1. We can see that the root locus does intersect the dashed line, so P control can achieve our design goals. There are many ways to find the appropriate gain .
One way is to find the characteristic polynomial of the closed-loop system, which is , or equivalently . From here, we have:
Since we want , we have and .
An alternative approach is to notice that the pole location at the intersection must be based on the angle of the pole. Plugging this into the characteristic equation , we have
Sometimes, P control is not enough to achieve our design goals, and we need to add poles/zeros to our compensator. Let’s see how this works with a more complicated example.
Example: Inverted pendulum design¶
Let’s revisit the inverted pendulum example from the PID control section. The transfer function of our plant is:
Let’s follow the root locus design workflow. Our goal is to achieve a stable closed-loop system (all poles in the LHP) with sufficient damping. In particular, we will strive to move our poles to . We start with P control.
P control design¶
Let’s start by seeing if P control can achieve our design goals. We can check this by plotting the root locus of , which is shown below.
Figure 2:Root locus of the inverted pendulum transfer function from (5), with desired poles at indicated by the green asterisks.
For small , the closed-loop poles are on the real axis, with one in the RHP and one in the LHP. So the system is unstable. Intuitively, the input tries to counteract the falling motion of the pendulum, but is not strong enough to prevent it from falling over.
As we increase , the poles eventually break away from the real axis and become imaginary, so the closed-loop system is now marginally stable. Intuitively, the input is now strong enough to prevent the pendulum from falling over, but it does not induce any damping, so the pendulum just oscillates back and forth. Further increasing does not help, it only makes the oscillations faster.
Intuitively, we would like to attract the root locus to the LHP to achieve stability and introduce some damping. To do this, we can add a zero to our compensator .
PD control design¶
If we add a zero at for some and include a gain , then our compensator is . In other words, it is a PD controller with and . Let’s assume for now and see how this changes the root locus. The plant with the additional zero is
The root locus of this transfer function is shown below.
Figure 3:Root locus of the inverted pendulum with an extra zero (PD control) from (6). Desired poles at are indicated by the green asterisks.
The zero we added causes the root locus to bend left, leading to both stability and damping. We can vary to change the zero location and the size of the circle. We can also change to move the poles along the locus. The locus of Figure 3 still does not pass through our desired pole locations, but it will if we nudge appropriately to move the circle. A straightforward way to find the appropriate compensator is to use the characteristic equation. We can plug into the characteristic equation and solve for and . This leads to:
Setting real and imaginary parts equal to zero yields and . Remember that our compensator is , so we have = . This is a PD controller with and . Alternatively we could have used the characteristic equation and solved for and directly. Here is the root locus of the compensated system, which now passes through our desired pole locations:
Figure 4:Root locus of the inverted pendulum with tuned PD controller from (6). We now pass through the desired pole locations shown in green.
PI control design¶
The previous PD design achieved our goals, but did not achieve zero steady-state error to a step input. In other words, if there were a constant disturbance (e.g. wind), the pendulum would not stabilize in the vertical position; there would be steady-state error.
Achieving zero steady-state error was not one of our design goals, but if it were, then we would need to add an integrator to our compensator. If we add an integrator to our PD controller, it becomes a PI controller:
Again, we can use root locus to give a qualitative evaluation of the feasibility of this design. Let’s pick again, and our plant with the additional zero and pole is
The root locus of this transfer function is shown below.
Figure 5:Root locus of the inverted pendulum with an extra zero and integrator (PI control) from (9).
Now we can see that a PI compensator won’t do the job due to the RHP vertical asymptote; the closed-loop poles can never be in the LHP. What if we placed the zero in a different location? Clearly the zero must be in the LHP, so . The location of the centroid is:
The centroid is therefore always in the RHP, and closed-loop stability is impossible.
PID control design¶
To achieve both stability and zero steady-state error to a step input, we need to add an integrator, but the PI design above showed that one zero is not enough. We therefore add two zeros to the compensator. This gives a PID controller of the form
The integrator gives zero steady-state error to a step input, while the two zeros give us enough freedom to shape the root locus and stabilize the inverted pendulum. Let’s design a PID controller that places closed-loop poles at again.
To simplify our task, we can use one of the zeros to cancel the stable pole at . This is a common design technique that simplifies the root locus and makes it easier to achieve our design goals. Setting , our characteristic equation is
We can substituted and solve for and as we did in the PD case. Here is an alternative approach. We know we want the closed-loop poles at , so the desired closed-loop characteristic polynomial is
Equating the characteristic polynomials from Eqs. (12) and (13), we obtain and , which gives . Thus, one possible PID controller is
Therefore, , , and . Here is the resulting root locus, which now passes through our desired pole locations:
Figure 6:Root locus of the inverted pendulum with tuned PID controller. We now pass through the desired pole locations shown in green. Note the pole-zero cancellation at .
Be mindful of zeros!¶
The root locus shows us how the poles move as we change the gain . However, the zeros of the plant (and whatever zeros we add to the compensator) do not move as we change . The only way to move an existing zero is to change the way the system is actuated or measured.
We saw in the section on the effect of zeros that zeros have a significant effect on transient response:
Zeros close to the imaginary axis can cause large overshoot and oscillations.
Zeros in the RHP cause inverse response (undershoot).
Zeros have an attenuating effect on nearby poles.
So it is not enough to just consider pole location when designing a controller.
Inverted pendulum¶
Returning to our inverted pendulum example, we designed PD and PID controllers that placed the closed-loop poles at . The characteristic polynomial for such poles is:
So and . This is a highly damped second-order system, so we would expect very little overshoot. However, our designs also introduced zeros!
Our PD design was , so we introduced a zero at . We can calculate the closed-loop transfer function using this controller as:
So the closed-loop system still has a zero at , which we saw in our root locus plot.
Our PID design was , which introduced zeros at and . The closed-loop transfer function with this controller is:
Once again, the zero we introduced at is still present in the closed-loop system. The zero at did not survive, as it was used to cancel one of the plant’s poles.
The characteristic polynomial of the closed-loop system is in both cases, which corresponds to our desired poles at .
Here is a comparison of the step and impulse responses we obtain from the closed-loop systems with the PD and PID controllers, compared to the response we would get if we had a pure second-order system with the same characteristic polynomial but no zeros:
Figure 7:Step and impulse responses of the inverted pendulum with PD and PID controllers, compared to a second-order system with the same characteristic polynomial but no zeros. The presence of zeros in the PD and PID designs causes additional overshoot compared to the second-order system.
The PD compensator has a steady-state error to a step input, which is expected since it does not have an integrator, while the PID compensator has no steady-state error. However, both compensated systems have additional overshoot due to the zeros we introduced. The second-order equivalent system with no zero has no overshoot at all, which is what we would expect from a system with . When comparing impulse responses, the zeros cause an initial jump in the response. So the poles alone do not tell the whole story.
Test your knowledge¶
Solution to Exercise 1 #
Let’s start by sketching the root locus of . The poles are at , , and . It’s clear from the sketch below that the root locus does not pass through , so P control alone cannot achieve our design goals.
Figure 8:Root locus of the system described by (18). The green asterisks indicate the desired closed-loop pole locations at .
Using the compensator , the characteristic equation is
We can proceed in several ways from here. We will show two different solutions.
Since we know is a solution, we can plug it in and get two equations (real part and imaginary part) that we can solve for and .
We conclude that and .
Another way is to find the desired characteristic polynomial based on the desired closed-loop poles, and then match coefficients with the characteristic polynomial we have above. We know we have poles at , and there is a third pole that we don’t know yet. Let this pole be at . Then the desired characteristic polynomial is
Setting this equal to the characteristic polynomial we have above, we can match coefficients to find , , and :
Solving yields , , and , which is the same result as before. This approach is nice because it avoids arithmetic with complex numbers.
Here is a root locus plot of the compensated system (), with highlighted as green asterisks, which confirms that the root locus now passes through the desired pole locations.
Figure 9:Root locus of the system described by (18) with PD compensation. The root locus now passes through the desired pole locations, which corresponds to the overall gain . Adding a zero means that we now have two asymptotes instead of three. The vertical asymptote is at , which happens to be the same as the location of the zero (this is a coincidence, not a general rule!).
Our compensator is therefore
So and . This example shows how adding a zero can reshape the root locus so that it passes through a desired complex pole location. It also illustrates that, for a higher-order system, specifying one complex-conjugate pair does not specify all of the closed-loop poles. The remaining pole is determined by the characteristic equation.