Control Tutorials for MATLAB and Simulink (2024)

In this tutorial, we will introduce the root locus, show how to create it using MATLAB, and demonstrate how to design feedback controllers that satisfy certain performance criteria through the use of the root locus.

Key MATLAB commands used in this tutorial are: feedback , rlocus , step , controlSystemDesigner

Run Live Script Version in MATLAB Online

Related Tutorial Links

  • Root Locus Activity
  • Example Animation

Related External Links

Contents

  • Closed-Loop Poles
  • Plotting the Root Locus of a Transfer Function
  • Choosing a Value of K from the Root Locus
  • Closed-Loop Response
  • Using Control System Designer for Root Locus Design

Closed-Loop Poles

The root locus of an (open-loop) transfer function Control Tutorials for MATLAB and Simulink (1) is a plot of the locations (locus) of all possible closed-loop poles with some parameter, often a proportional gain Control Tutorials for MATLAB and Simulink (2), varied between 0 and Control Tutorials for MATLAB and Simulink (3). The figure below shows a unity-feedback architecture, but the procedure is identical for any open-loop transfer function Control Tutorials for MATLAB and Simulink (4), even if some elements of the open-loop transfer function are in the feedback path.

Control Tutorials for MATLAB and Simulink (5)

The closed-loop transfer function in this case is:

(1)Control Tutorials for MATLAB and Simulink (6)

and thus the poles of the closed-loop system are values of Control Tutorials for MATLAB and Simulink (7) such that Control Tutorials for MATLAB and Simulink (8).

If we write Control Tutorials for MATLAB and Simulink (9), then this equation can be rewritten as:

(2)Control Tutorials for MATLAB and Simulink (10)

(3)Control Tutorials for MATLAB and Simulink (11)

Let Control Tutorials for MATLAB and Simulink (12) be the order of Control Tutorials for MATLAB and Simulink (13) and Control Tutorials for MATLAB and Simulink (14) be the order of Control Tutorials for MATLAB and Simulink (15) (the order of the polynomial corresponds to the highest power of Control Tutorials for MATLAB and Simulink (16)).

We will consider all positive values of Control Tutorials for MATLAB and Simulink (17). In the limit as Control Tutorials for MATLAB and Simulink (18), the poles of the closed-loop system are solutions of Control Tutorials for MATLAB and Simulink (19) (poles of Control Tutorials for MATLAB and Simulink (20)). In the limit as Control Tutorials for MATLAB and Simulink (21), the poles of the closed-loop system are solutions of Control Tutorials for MATLAB and Simulink (22) (zeros of Control Tutorials for MATLAB and Simulink (23)).

No matter our choice of Control Tutorials for MATLAB and Simulink (24), the closed-loop system has Control Tutorials for MATLAB and Simulink (25) poles, where Control Tutorials for MATLAB and Simulink (26) is the number of poles of the open-loop transfer function Control Tutorials for MATLAB and Simulink (27). The root locus then has Control Tutorials for MATLAB and Simulink (28) branches, each branch starts at a pole of Control Tutorials for MATLAB and Simulink (29) and approaches a zero of Control Tutorials for MATLAB and Simulink (30). If Control Tutorials for MATLAB and Simulink (31) has more poles than zeros (as is often the case), Control Tutorials for MATLAB and Simulink (32) and we say that Control Tutorials for MATLAB and Simulink (33) has zeros at infinity. In this case, the limit of Control Tutorials for MATLAB and Simulink (34) as Control Tutorials for MATLAB and Simulink (35) is zero. The number of zeros at infinity is Control Tutorials for MATLAB and Simulink (36), the number of open-loop poles minus the number of open-loop zeros, and is the number of branches of the root locus that go to "infinity" (asymptotes).

Since the root locus consists of the locations of all possible closed-loop poles, the root locus helps us choose the value of the gain Control Tutorials for MATLAB and Simulink (37) to achieve the type of performance we desire. If any of the selected poles are on the right-half complex 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 if a system has three or four poles, it may still behave similar to a second- or a first-order system, depending on the location(s) of the dominant pole(s).

Plotting the Root Locus of a Transfer Function

Consider an open-loop system which has a transfer function of

(4)Control Tutorials for MATLAB and Simulink (38)

How do we design a feedback controller for the system using the root-locus method? Let's assume our design criteria are 5% overshoot and 1 second rise time. Create an m-file titled rl.m. Within this file, create the transfer function model and employ the rlocus command as follows:

s = tf('s');sys = (s + 7)/(s*(s + 5)*(s + 15)*(s + 20));rlocus(sys)axis([-22 3 -15 15])

Control Tutorials for MATLAB and Simulink (39)

Choosing a Value of K from the Root Locus

The plot above shows all possible closed-loop pole locations for a pure proportional controller. In this case, not all of these closed-loop pole locations indicate satisfaction of 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 (Control Tutorials for MATLAB and Simulink (40)) and natural frequency (Control Tutorials for MATLAB and Simulink (41)) [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 Control Tutorials for MATLAB and Simulink (42) of greater than 0.7) and a rise time of 1 second (which means a natural frequency Control Tutorials for MATLAB and Simulink (43) greater than 1.8). Enter the following in the MATLAB command window:

zeta = 0.7;wn = 1.8;sgrid(zeta,wn)

Control Tutorials for MATLAB and Simulink (44)

On the plot above, the two dotted lines at about a 45-degree angle indicate pole locations with Control Tutorials for MATLAB and Simulink (45) = 0.7; in between these lines, the poles will have Control Tutorials for MATLAB and Simulink (46) > 0.7 and outside of these lines Control Tutorials for MATLAB and Simulink (47) < 0.7. The semicircle indicates pole locations with a natural frequency Control Tutorials for MATLAB and Simulink (48) = 1.8; inside of the circle, Control Tutorials for MATLAB and Simulink (49) < 1.8 and outside of the circle Control Tutorials for MATLAB and Simulink (50) > 1.8.

Going back to our problem, to make the overshoot less than 5%, the poles have to be in between the two angled dotted lines, and to make the rise time shorter than 1 second, the poles have to be outside of the dotted semicircle. So now we know what part of the root locus, which possible closed-loop pole locations, satify the given requirements. 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. Therefore, in this case, we need only a proportional controller to move the poles to the desired region. You can use the rlocfind command in MATLAB to choose the desired poles on the locus:

[k,poles] = rlocfind(sys)

Click on the plot the point where you want the closed-loop pole to be. You may want to select the points indicated in the plot below to satisfy the design criteria.

Control Tutorials for MATLAB and Simulink (51)

Note that since the root locus may have more than one branch, when you select a pole, you also identify where other closed-loop poles are too, all for the same corresponding value of Control Tutorials for MATLAB and Simulink (52). Remember that these poles will affect the response too. From the plot above, we see that of the four poles selected (indicated by "+" signs), the two closest to the imaginary axis are in our desired region. Since these poles tend to dominate the response, we have some confidence that are desired requirements will be met for a proportional controller with this value of Control Tutorials for MATLAB and Simulink (53).

Closed-Loop Response

In order to verify the step response, you need to know the closed-loop transfer function. You could compute this using the rules of block diagram reduction, or let MATLAB do it for you (there is no need to enter a value for K if the rlocfind command was used):

K = 350;sys_cl = feedback(K*sys,1)
sys_cl = 350 s + 2450 -------------------------------------- s^4 + 40 s^3 + 475 s^2 + 1850 s + 2450 Continuous-time transfer function.

The two arguments to the function feedback are the transfer function in the forward path and the transfer function in the feedback path of the open-loop system. In this case, our system is unity feedback.

If you have a non-unity feedback situation, look at the help file for the MATLAB function feedback, which demonstrates how to find the closed-loop transfer function with a gain in the feedback path.

Checking the step response of the closed-loop system with the chosen value of Control Tutorials for MATLAB and Simulink (54):

step(sys_cl)

Control Tutorials for MATLAB and Simulink (55)

As we expected, this response has an overshoot less than 5% and a rise time less than 1 second.

Using Control System Designer for Root Locus Design

Another way to complete what was done above is to use the interactive Control System Designer tool within MATLAB. Using the same model as above, we first define the plant, Control Tutorials for MATLAB and Simulink (56).

s = tf('s');plant = (s + 7)/(s*(s + 5)*(s + 15)*(s + 20));

The controlSystemDesigner function can be used for analysis and design. In this case, we will focus on using the root locus as the design method to improve the step response of the closed-loop system. To begin, type the following into the MATLAB command window:

controlSystemDesigner(plant)

The following window should appear. You can also launch the GUI by going to the APPS tab and clicking on the app icon under Control System Design and Analysis. Here you can see the root locus plot, along with open-loop Bode plot, and the closed-loop step response plot for the given plant in unity feedback with a default controller of Control Tutorials for MATLAB and Simulink (57).

Control Tutorials for MATLAB and Simulink (58)

The next step is to add the design requirements to the Root Locus plot. This is done directly on the plot by right-clicking and selecting Design Requirements, New. Design requirements can be set for the Settling Time, the Percent Overshoot, the Damping Ratio, the Natural Frequency, or a Region Constraint.

Here, we will set the design requirements for the damping ratio and the natural frequency as was done previously with the sgrid command. Recall that the boundary of our requirements call for Control Tutorials for MATLAB and Simulink (59) = 0.7 and Control Tutorials for MATLAB and Simulink (60) = 1.8. Set these within the design requirements. On the plot, any area which is still white is an acceptable region for the closed-loop poles.

Zoom into the Root Locus by right-clicking on an axis and selecting Properties followed by the label Limits. Change the real-axis limits to -25 to 5 and the imaginary axis limits to -2.5 to 2.5.

Also, we can see the current values of some key parameters in the response. On the Step response plot, right-click on the plot and go to Characteristics and select Peak Response. Repeat for the characteristic Rise Time. There should now be two large dots on the screen indicating the values of these parameters. Click each of these dots to bring up a box with information.

Both plots should appear as shown here, once the Bode plot is closed:

Control Tutorials for MATLAB and Simulink (61)

As the characteristics show on the Step response, the overshoot is acceptable, but the rise time is much too large. The pink boxes on the root locus show the corresponding closed-loop pole locations for the currently chosen control gain Control Tutorials for MATLAB and Simulink (62).

To fix this, we need to choose a new value for the gain Control Tutorials for MATLAB and Simulink (63). Similar to how we employed the rlocfind command, the gain of the controller can be changed directly on the root locus plot. Click and drag the pink box closest to the imaginary axis (at the origin) to the acceptable region of our root locus plot as shown below.

Control Tutorials for MATLAB and Simulink (64)

In the Preview box of the window, it can be seen that the loop gain has been changed to 360. Inspecting the closed-loop step response plot, both of our requirements are now met.

Control Tutorials for MATLAB and Simulink (65)


Published with MATLAB® 9.2

Control Tutorials for MATLAB and Simulink (2024)

References

Top Articles
Latest Posts
Article information

Author: Rev. Porsche Oberbrunner

Last Updated:

Views: 5862

Rating: 4.2 / 5 (53 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Rev. Porsche Oberbrunner

Birthday: 1994-06-25

Address: Suite 153 582 Lubowitz Walks, Port Alfredoborough, IN 72879-2838

Phone: +128413562823324

Job: IT Strategist

Hobby: Video gaming, Basketball, Web surfing, Book restoration, Jogging, Shooting, Fishing

Introduction: My name is Rev. Porsche Oberbrunner, I am a zany, graceful, talented, witty, determined, shiny, enchanting person who loves writing and wants to share my knowledge and understanding with you.