Control Tutorials for MATLAB and Simulink (2024)

Key MATLAB commands used in this tutorial are: tf , bode , feedback , step

Related Tutorial Links

  • Intro to Freq Resp
  • Freq Resp Activity
  • Lead/Lag Freq Resp

Related External Links

Contents

  • Open-loop bode plot
  • Phase-lead controller
  • Adding more phase

The open-loop transfer function of the plant for the ball and beam experiment is given below:

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

The design criteria for this problem are:

To see the derivation of the equations for this problem refer to the page.

Control Tutorials for MATLAB and Simulink (2)

Open-loop bode plot

The main idea of frequency based design is to use the Bode plot of the open-loop transfer function to estimate the closed-loop response. Adding a controller to the system changes the open-loop Bode plot, therefore changing the closed-loop response. Let's first draw the bode plot for the original open-loop transfer function. Create a new m-file with the following code and then run it in the MATLAB command window. You should get the following Bode plot:

m = 0.111;R = 0.015;g = -9.8;L = 1.0;d = 0.03;J = 9.99e-6;s = tf('s');P_ball = -m*g*d/L/(J/R^2+m)/s^2;bode(P_ball)

Control Tutorials for MATLAB and Simulink (3)

From this plot we see that the phase margin is zero. Since the phase margin is defined as the change in open-loop phase shift necessary to make a closed-loop system unstable this means that our zero phase margin indicates our system is unstable. We want to increase the phase margin and we can use a lead compensator controller to do this. For more information on Phase and Gain margins please refer to the Introduction: Frequency Domain Methods for Controller Design page.

Phase-lead controller

A first order phase-lead compensator has the form given below:

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

The phase-lead compensator will add positive phase to our system over the frequency range Control Tutorials for MATLAB and Simulink (5) and Control Tutorials for MATLAB and Simulink (6), which are called the corner frequencies. The maximum added phase for one lead compensator is 90 degrees. For our controller design we need a percent overshoot of less than 5%, which corresponds to a Control Tutorials for MATLAB and Simulink (7) of 0.7. Generally Control Tutorials for MATLAB and Simulink (8) will give you the minimum phase margin needed to obtain your desired overshoot. Therefore, we require a phase margin greater than 70 degrees.

To obtain Control Tutorials for MATLAB and Simulink (9) and Control Tutorials for MATLAB and Simulink (10), the following steps can be applied.

1. Determine the positive phase needed: We need at least 70 degrees from our controller.

2. Determine the frequency where the phase should be added (center frequency): In our case this is difficult to determine because the phase vs. frequency graph in the bode plot is a flat line. However, we have a relation between bandwidth frequency (Control Tutorials for MATLAB and Simulink (11) ) and settling time which tells us that Control Tutorials for MATLAB and Simulink (12) is approximately 1.92 rad/s. Therefore, we want a center frequency just before this. For now we will choose 1 rad/sec.

3. Determine the constant Control Tutorials for MATLAB and Simulink (13) from the equation below: this determines the required space between the zero and the pole for the maximum phase added.

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

where phi refers to the desired phase margin. For 70 degrees, Control Tutorials for MATLAB and Simulink (15) = 0.0311.

4. Determine Control Tutorials for MATLAB and Simulink (16) and Control Tutorials for MATLAB and Simulink (17) from the following equations:

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

(5)Control Tutorials for MATLAB and Simulink (19)

For 70 degrees and center frequency Control Tutorials for MATLAB and Simulink (20) = 1, Control Tutorials for MATLAB and Simulink (21) = 0.176 and Control Tutorials for MATLAB and Simulink (22) = 5.67.

Now, we can add our lead controller to the system and view the bode plot. Remove the bode command from your m-file and add the following. You should get the following bode plot:

phi=70*pi/180;a=(1-sin(phi))/(1+sin(phi));w=1;T=1/(w*sqrt(a));K = 1;C = K*(1+T*s)/(1+a*T*s);bode(C*P_ball)

Control Tutorials for MATLAB and Simulink (23)

You can see that our phase margin is now 70 degrees. Let's check the closed-loop response to a step input of 0.25 m. Add the following to your m-file. You should get the following plot:

sys_cl = feedback(C*P_ball,1);t = 0:0.01:5;step(0.25*sys_cl,t)

Control Tutorials for MATLAB and Simulink (24)

Although the system is now stable and the overshoot is only slightly over 5%, the settling time is not satisfactory. Increasing the gain will increase the crossover frequency and make the response faster. With Control Tutorials for MATLAB and Simulink (25) = 5, your response should look like:

K = 5;C = K*(1+T*s)/(1+a*T*s);sys_cl = feedback(C*P_ball,1);bode(C*P_ball)step(0.25*sys_cl,t)

Control Tutorials for MATLAB and Simulink (26)

The response is faster, however, the overshoot is much too high. Increasing the gain further will just make the overshoot worse.

Adding more phase

We can increase our phase-lead compensator to decrease the overshoot. Create an m-file and copy the following code from your web-browser into it:

pm = 80;w = 1;K = 1;%view compensated system bode plotpmr = pm*pi/180;a = (1 - sin(pmr))/(1+sin(pmr));T = sqrt(a)/w;aT = 1/(w*sqrt(a));C = K*(1+aT*s)/(1+T*s);figurebode(C*P_ball)%view step responsesys_cl = feedback(C*P_ball,1);t = 0:0.01:5;figurestep(0.25*sys_cl,t)

Control Tutorials for MATLAB and Simulink (27) Control Tutorials for MATLAB and Simulink (28)

The overshoot is fine but the settling time is just a bit long. Try different numbers and see what happens. Using the following values the design criteria was met.

pm = 85;w = 1.9;K = 2;%view compensated system bode plotpmr = pm*pi/180;a = (1 - sin(pmr))/(1+sin(pmr));T = sqrt(a)/w;aT = 1/(w*sqrt(a));C = K*(1+aT*s)/(1+T*s);figurebode(C*P_ball)%view step responsesys_cl = feedback(C*P_ball,1);t = 0:0.01:5;figurestep(0.25*sys_cl,t)

Control Tutorials for MATLAB and Simulink (29) Control Tutorials for MATLAB and Simulink (30)

Note: A design problem does not necessarily have a unique answer. Using this method (or any other) may result in many different compensators. For practice you may want to go back and change the added phase, gain, or center frequency.


Published with MATLAB® 9.2

Control Tutorials for MATLAB and Simulink (2024)
Top Articles
Exploring The World Of Mkvmoviespoint: Your Gateway To Movies And More
Where and How to Free Download 300MB MKV Movies?
Tsukihime -A piece of blue glass moon- Review
Die Reiseauskunft auf bahn.de - mit aktuellen Alternativen gut ans Ziel
Hemispheres Dothan Al
Palmbeachschools Jobs
Air Chat En Espanol
Nail Salon In Victoria Tx Mall
Python Regex Space
Dtm Urban Dictionary
6 Underground movie review & film summary (2019) | Roger Ebert
Wlds Obits
Leccion 4 Lesson Test
Guide:Guide to WvW Rewards
Trinket Of Advanced Weaponry
Craigslist Albany Oregon Free Stuff
Chittenden County Family Court Schedule
Netflix Phone Number: Live Human Help - Netflix - Claimyr
ONE PAN BROCCOLI CASHEW CHICKEN
14314 County Road 15 Holiday City Oh
Nascar Espn Schedule
Pixel Speedrun Unblocked Games 76
Ratchet & Clank Rift Apart: Trofea - lista | GRYOnline.pl
Is Slatt Offensive
Watch The Most Popular Video Of Mikayla Campinos Online
Experience the Convenience of Po Box 790010 St Louis Mo
Watch The Lovely Bones Online Free 123Movies
Exploring Green-Wood Cemetery: New York Citys First Garden Cemetery | Prospect Park West Entrance,Brooklyn,11218,US | October 6, 2024
What tools do you recommend for emceeing?
Eddie Scozzare Salary
Wilson Tattoo Shops
Bj지밍
Closest Dollar Tree Store To My Location
Exploring The Craigslist Washington DC Marketplace - A Complete Overview
Chris Bailey Weather Forecast
Highplainsobserverperryton
Knock At The Cabin Showtimes Near Alamo Drafthouse Raleigh
10 Top-Rated Tourist Attractions in Negril
About My Father Showtimes Near Megaplex Theatres At Mesquite
Guide for The Big Con
Riverry Studio
Solve x^2+2x-24=0 | Microsoft Math Solver
Pho Outdoor Seating Near Me
Finastra Gfx
Myapps Tesla Ultipro Sign In
Plusword 358
55000 Pennies To Dollars
Texas State Academic Probation
Einschlafen in nur wenigen Minuten: Was bringt die 4-7-8-Methode?
El Craigslist
Stihl Bg55 Parts Diagram
Priority Pass: How to Invite as Many Guests as Possible to Airport Lounges?
Latest Posts
Article information

Author: Kelle Weber

Last Updated:

Views: 6331

Rating: 4.2 / 5 (73 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Kelle Weber

Birthday: 2000-08-05

Address: 6796 Juan Square, Markfort, MN 58988

Phone: +8215934114615

Job: Hospitality Director

Hobby: tabletop games, Foreign language learning, Leather crafting, Horseback riding, Swimming, Knapping, Handball

Introduction: My name is Kelle Weber, I am a magnificent, enchanting, fair, joyous, light, determined, joyous person who loves writing and wants to share my knowledge and understanding with you.