CMU
UM


Example: Root Locus Design Method for the DC Motor

Drawing the open-loop root locus
Finding the gain using the rlocfind command
Adding a lag controller
Plotting the closed-loop response

From the main problem, the dynamic equations in state-space form are the following:

and the system schematic looks like:

For the original problem setup and the derivation of the above equations and schematic, please refer to the Modeling a DC Motor page.

With a 1 rad/sec step reference, the design criteria are:

* settling time less than 2 seconds
* overshoot less than 5%
* steady-state error less than 1%

Now let's design a controller using the root locus method.

Create a new m-file and type in the following commands (refer to main problem for the details of getting those commands).

Drawing the open-loop root locus

The main idea of root locus design is to find the closed-loop response from the open-loop root locus plot. Then by adding zeros and/or poles to the original plant, the closed-loop response will be modified. Let's first view the root locus for the plant. Add the following commands at the end of your m-file, then and rerun the file.

The commands sgrid and sigma are functions. Sgrid is a function in the Matlab tool box, but sigma is not. Click here to see how to copy sigma.m into a m-file. The variables in the sgrid command are the zeta term (0.8 corresponds to a overshoot of 5%), and the wn term (no rise time criteria) respectively. The variable in the sigma command is the sigma term (4.6/2 seconds = 2.3). You should get the root locus plot below:

Finding the gain using the rlocfind command

If you recall, we need the settling time and the overshoot to be as small as possible. Large damping corresponds to points on the root locus near the real axis. A fast response corresponds to points on the root locus far to the left of the imaginary axis. To find the gain corresponding to a point on the root locus, we can use the rlocfind command. We can find the gain and plot the step response using this gain all at once. To do this, enter the following commands at the end of your m-file and rerun it.

Go to the plot and select a point on the root locus half-way between the real axis and the damping requirement (white, diagonal line). Matlab should return the an output similar to the following after you have selected the point: Note that the values returned in your Matlab command window may not be exactly the same, but should at least have the same order of magnitude. You should also get the following plot:

As you can see, the system is overdamped and the settling time is about one second, so the overshoot and settling time requirements. The only problem with this plot is the steady-state error is 0.5. If we increase the gain to reduce the steady-state error, the overshoot condition will not be satisfied. We will have to add a lag controller.

Adding a lag controller

From the plot we see that this is a very simple root locus. The damping or settling time criteria were met with the proportional controller. The steady-state error is the only criteria not met with the proportional controller. A lag compensator can reduce the steady-state error. By doing this, we might however increase our settling time. Try the following lag controller first:

This can be done by changing your m-file to look like the following:

numa and dena are the numerator and denominator of the controller, and numb and denb are the numerator and denominator of the overall open-loop transfer function.

You should get the following root locus, which looks very similar to the original one:

Plotting the closed-loop response

Now let's close the loop and see the closed-loop step response Enter the following code at the bottom of your m-file:

When prompted to select a point, pick one that is near the damping requirement. Rerun the program and you should get the a plot similar to the following:

Your gain should be about 20. As you can see the response is not quite satisfactory. You may also note that even though the gain was selected to correlate with a position close to the damping criteria, the overshoot is not even close to five percent. This is due the the effect of the lag controller kicking in at a later time than the plant. (its pole is slower). What this means is that we can go beyond the dotted lines that represent the limit, and get the higher gains without worrying about the overshoot . Rerun your m-file, place the gain just above the white, dotted line. Keep trying until you get a satisfactory response. It should look similar to the following (we used a gain of around 50):

The steady-state error is smaller than 1%, and the settling time and overshoot requirements have been met. As you can see, the design process for root locus is very much a trial and error process. That is why it is nice to plot the root locus, pick the gain, and plot the response all in one step. If we had not been able to get a satisfactory response by choosing the gains, we could have tried a different lag controller, or even added a lead controller.


User Survey
Your anonymous answers to the following questions will help us to improve future versions of these tutorials.
How useful was this example?
Very useful Useful Somewhat useful Not very useful A waste of time
How was the level of the example?
Too simple About right Too difficult
How much time did you spend on it?
Less than 30 mins. 30 - 60 mins. More than 60 mins.
How much of the Matlab code did you run?
None Some Most

We would like to hear about suggestions you have for improvement, difficulties you had with the tutorials, errors that you found, or any other comments that you have. This feedback is anonymous.

If you would like to receive a response, send your comments or questions to ctm-feedback@umich.edu


Root Locus Examples
Cruise Control | DC Motor | Bus Suspension | Inverted Pendulum

DC Motor Examples
Modeling | PID | Root Locus | Frequency Response | State Space

Tutorials
Basics | Modeling | PID | Root Locus | Frequency Response | State Space | Examples

8/29/96 YS