Control Tutorials for MATLAB and Simulink (2024)

Key MATLAB commands used in this tutorial are: tf , roots , rlocus , sgrid , step

Related Tutorial Links

  • Intro to Root Locus
  • Notch Filters
  • Root Locus Activity
  • Example Animation

Related External Links

Contents

  • Plotting the root locus
  • Adding a notch filter
  • Finding the gain from the root locus
  • Plotting the closed-loop response

From the main problem, the dynamic equations in transfer function form are the following:

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

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

where,

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

and the system schematic is the following where F(s)G1(s) = G2(s).

Control Tutorials for MATLAB and Simulink (4)

For the original problem and the derivation of the above equations and schematic, please refer to the Suspension: System Modeling page.

We want to design a feedback controller so that when the road disturbance (W) is simulated by a unit step input, the output (X1-X2) has a settling time less than 5 seconds and an overshoot less than 5%. For example, when the bus runs onto a 10-cm step, the bus body will oscillate within a range of +/- 5 mm and will stop oscillating within 5 seconds.

The system model can be represented in MATLAB by creating a new m-file and entering the following commands (refer to the main problem for the details of getting those commands).

m1 = 2500;m2 = 320;k1 = 80000;k2 = 500000;b1 = 350;b2 = 15020;nump=[(m1+m2) b2 k2];denp=[(m1*m2) (m1*(b1+b2))+(m2*b1) (m1*(k1+k2))+(m2*k1)+(b1*b2) (b1*k2)+(b2*k1) k1*k2];G1=tf(nump,denp);num1=[-(m1*b2) -(m1*k2) 0 0];den1=[(m1*m2) (m1*(b1+b2))+(m2*b1) (m1*(k1+k2))+(m2*k1)+(b1*b2) (b1*k2)+(b2*k1) k1*k2];G2=tf(num1,den1);numf=num1;denf=nump;F=tf(numf,denf);

We are now ready to design a controller using the root locus design method.

First let's see what the open-loop poles of the system are:

R = roots(denp)
R = -23.9758 +35.1869i -23.9758 -35.1869i -0.1098 + 5.2504i -0.1098 - 5.2504i

Therefore, the dominant poles are the roots -0.1098+/-5.2504i, which are close to the imaginary axis with a small damping ratio.

Plotting the root locus

The main idea of root locus design is to estimate the closed-loop response from the open-loop root locus plot. By adding zeros and/or poles to the original system (adding a compensator), the root locus and thus the closed-loop response will be modified. Let's first view the root locus for the plant. In your m-file, add the following command and then run the file, you should get the root locus plot below:

rlocus(G1)z=-log(0.05)/sqrt(pi^2+(log(0.05)^2))sgrid(z,0)
z = 0.6901

Control Tutorials for MATLAB and Simulink (5)

Note from the specification, we required the maximum overshoot, Control Tutorials for MATLAB and Simulink (6), to be less than 5% and damping ratio, Control Tutorials for MATLAB and Simulink (7), can be found from the approximate damping ratio equation, Control Tutorials for MATLAB and Simulink (8). The command sgrid is used to overlay the desired percent overshoot line on the close-up root locus; you can find more information from commands list.

From the plot above, we see that there are two pair of poles and zeros that are very close together. These poles and zeros are almost on the imaginary axis, they might make the bus system marginally stable, which might cause a problem. We have to make all of the poles and zeros move into the left-half plane as far as possible to avoid an unstable system. We have to put two zeros very close to the two poles on the imaginary axis of uncompensated system for pole-and-zero cancellation. Moreover, we will put another two poles further to the left on the real axis to get fast response.

Adding a notch filter

We will probably need two zeros near the two poles on the complex axis to draw the root locus, leading those poles to the compensator zeros instead of to the plant zeros on the imaginary axis. We'll also need two poles placed far to the left to pull the locus to the left. It seems that a notch filter (2-lead controller) will probably do the job. Let's try putting the poles at 30 and 60 and the zeros at 3+/-3.5i. In your m-file add the following lines of code:

z1=3+3.5i;z2=3-3.5i;p1=30;p2=60;numc=conv([1 z1],[1 z2]);denc=conv([1 p1],[1 p2]);C=tf(numc,denc);rlocus(C*G1)

Control Tutorials for MATLAB and Simulink (9)

Now let's change the axis to see the details of the root locus.

axis([-40 10 -30 30])z=-log(0.05)/sqrt(pi^2+(log(0.05)^2))sgrid(z,0)
z = 0.6901

Control Tutorials for MATLAB and Simulink (10)

Finding the gain from the root locus

Now that we have moved the root locus across the 5% damping ratio line, we can choose a gain that will satisfy the design requirements. Recall that we want the settling time and the overshoot to be as small as possible. Generally, to get a small overshoot and a fast response, we need to select a gain corresponding to a point on the root locus near the real axis and far from the imaginary axis or the point that the root locus crosses the desired damping ratio line. But in this case, we need the cancellation of poles and zeros near the imaginary axis, so we need to select a gain corresponding to a point on the root locus near the zeros and percent overshoot line. There is a method to do this with the rlocfind command in MATLAB. Add the code [k,poles]=rlocfind(C*G1) onto the end of your m-file to help you choose a specific loop gain. After running in the command window, go to the root locus plot and select a point near those indicated by the cross marks on the plot below.

Control Tutorials for MATLAB and Simulink (11)

After doing this, you should see the following output in the MATLAB command window.

Select a point in the graphics window selected_point = -2.8357 + 12.8306i k = 1.0888e+08 poles = 1.0e+02 * -0.6323 + 6.2136i -0.6323 - 6.2136i -0.0294 + 0.1306i -0.0294 - 0.1306i -0.0292 + 0.0367i -0.0292 - 0.0367i 

Note that the value returned from your MATLAB command window may not be exactly the same, but should at least have the same order of magnitude. This returned value can be used as the gain for the compensator. Recall that the schematic of the system is the following:

Control Tutorials for MATLAB and Simulink (12)

and the closed-loop transfer function can be derived as following:

k = 1.0888e+08;sys_cl=F*feedback(G1,k*C);

Plotting the closed-loop response

Let's see what the closed-loop step response looks like with this compensator. Keep in mind that we are going to use a 0.1-m step as the disturbance. To simulate this, simply multiply sys_cl by 0.1. Add the following commands into the m-file and put % marks in front of all rlocus and rlocfind commands.

t=0:0.01:2;step(0.1*sys_cl,t)title('Closed-Loop Step Response w/ Notch Filter')

Control Tutorials for MATLAB and Simulink (13)

From this plot we see that when the bus encounters a 0.1 m step on the road, the maximum deviation of the bus body from the wheel (or the road) is about 3.75 mm, and the oscillations settle in 2 seconds. Thus this response is satisfactory.


Published with MATLAB® 9.2

Control Tutorials for MATLAB and Simulink (2024)
Top Articles
Craigslist Boats For Sale Seattle
Wjar Channel 10 Providence
Uti Hvacr
Dollywood's Smoky Mountain Christmas - Pigeon Forge, TN
15 Types of Pancake Recipes from Across the Globe | EUROSPAR NI
Gameplay Clarkston
House Share: What we learned living with strangers
Locate Td Bank Near Me
Delectable Birthday Dyes
Craigslist Jobs Phoenix
REVIEW - Empire of Sin
Persona 4 Golden Taotie Fusion Calculator
Accuradio Unblocked
Darksteel Plate Deepwoken
Rainfall Map Oklahoma
Hoe kom ik bij mijn medische gegevens van de huisarts? - HKN Huisartsen
Alejos Hut Henderson Tx
Highland Park, Los Angeles, Neighborhood Guide
Craiglist Kpr
/Www.usps.com/International/Passports.htm
Kirksey's Mortuary - Birmingham - Alabama - Funeral Homes | Tribute Archive
Ein Blutbad wie kein anderes: Evil Dead Rise ist der Horrorfilm des Jahres
Wbiw Weather Watchers
Riversweeps Admin Login
How to Watch Every NFL Football Game on a Streaming Service
D2L Brightspace Clc
Truvy Back Office Login
Shelby Star Jail Log
O'reilly's In Mathis Texas
The Collective - Upscale Downtown Milwaukee Hair Salon
3 Ways to Drive Employee Engagement with Recognition Programs | UKG
130Nm In Ft Lbs
Rs3 Bring Leela To The Tomb
Mini-Mental State Examination (MMSE) – Strokengine
Noaa Marine Forecast Florida By Zone
Ofw Pinoy Channel Su
Nail Salon Open On Monday Near Me
2487872771
Kstate Qualtrics
10 Most Ridiculously Expensive Haircuts Of All Time in 2024 - Financesonline.com
Does Iherb Accept Ebt
Hindilinks4U Bollywood Action Movies
Nba Props Covers
How to Print Tables in R with Examples Using table()
Juiced Banned Ad
60 Days From May 31
Windy Bee Favor
17 of the best things to do in Bozeman, Montana
Assignation en paiement ou injonction de payer ?
Game Akin To Bingo Nyt
Amourdelavie
300 Fort Monroe Industrial Parkway Monroeville Oh
Latest Posts
Article information

Author: Madonna Wisozk

Last Updated:

Views: 5601

Rating: 4.8 / 5 (68 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Madonna Wisozk

Birthday: 2001-02-23

Address: 656 Gerhold Summit, Sidneyberg, FL 78179-2512

Phone: +6742282696652

Job: Customer Banking Liaison

Hobby: Flower arranging, Yo-yoing, Tai chi, Rowing, Macrame, Urban exploration, Knife making

Introduction: My name is Madonna Wisozk, I am a attractive, healthy, thoughtful, faithful, open, vivacious, zany person who loves writing and wants to share my knowledge and understanding with you.