Plotting the root locus of a transfer function
Choosing a value of K from root locus
Key Matlab commands used in this tutorial: cloop, rlocfind, rlocus, sgrid, step
Matlab commands from the control system toolbox are highlighted in red.
The root locus of an (open-loop) transfer function H(s) is a plot of the locations (locus) of all possible closed loop poles with proportional gain k and unity feedback:
The closed-loop transfer function is:
If we write H(s) = b(s)/a(s), then this equation has the form:
Let n = order of a(s) and m = order of b(s) [the order of a polynomial is the highest power of s that appears in it].
We will consider all positive values of k. In the limit as k -> 0, the poles of the closed-loop system are a(s) = 0 or the poles of H(s). In the limit as k -> infinity, the poles of the closed-loop system are b(s) = 0 or the zeros of H(s).
No matter what we pick k to be, the closed-loop system must always have n poles, where n is the number of poles of H(s). The root locus must have n branches, each branch starts at a pole of H(s) and goes to a zero of H(s). If H(s) has more poles than zeros (as is often the case), m < n and we say that H(s) has zeros at infinity. In this case, the limit of H(s) as s -> infinity is zero. The number of zeros at infinity is n-m, the number of poles minus the number of zeros, and is the number of branches of the root locus that go to infinity (asymptotes).
Since the root locus is actually the locations of all possible closed loop poles, from the root locus we can select a gain such that our closed-loop system will perform the way we want. If any of the selected poles are on the right half plane, the closed-loop system will be unstable. The poles that are closest to the imaginary axis have the greatest influence on the closed-loop response, so even though the system has three or four poles, it may still act like a second or even first order system depending on the location(s) of the dominant pole(s).
Consider an open loop system which has a transfer function of
The plot above shows all possible closed-loop pole locations for a pure proportional controller. Obviously not all of those closed-loop poles will satisfy our design criteria. To determine what part of the locus is acceptable, we can use the command sgrid(Zeta,Wn) to plot lines of constant damping ratio and natural frequency. Its two arguments are the damping ratio (Zeta) and natural frequency (Wn) [these may be vectors if you want to look at a range of acceptable values]. In our problem, we need an overshoot less than 5% (which means a damping ratio Zeta of greater than 0.7) and a rise time of 1 second (which means a natural frequency Wn greater than 1.8). Enter in the Matlab command window:
On the plot above, the two white dotted lines at about a 45 degree angle indicate pole locations with Zeta = 0.7; in between these lines, the poles will have Zeta > 0.7 and outside of the lines Zeta < 0.7. The semicircle indicates pole locations with a natural frequency Wn = 1.8; inside the circle, Wn < 1.8 and outside the circle Wn > 1.8.
Going back to our problem, to make the overshoot less than 5%, the poles have to be in between the two white dotted lines, and to make the rise time shorter than 1 second, the poles have to be outside of the white dotted semicircle. So now we know only the part of the locus outside of the semicircle and in between the two lines are acceptable. All the poles in this location are in the left-half plane, so the closed-loop system will be stable.
From the plot above we see that there is part of the root locus inside the desired region. So in this case we need only a proportional controller to move the poles to the desired region. You can use rlocfind command in Matlab to choose the desired poles on the locus:
Note that since the root locus may has more than one branch, when you select a pole, you may want to find out where the other pole (poles) are. Remember they will affect the response too. From the plot above we see that all the poles selected (all the white "+") are at reasonable positions. We can go ahead and use the chosen kd as our proportional controller.
In order to find the step response, you need to know the closed-loop transfer function. You could compute this using the rules of block diagrams, or let Matlab do it for you:
As we expected, this response has an overshoot less than 5% and a rise time less than 1 second.