From the main problem, the dynamic equations in transfer function form are the following:
(1)
(2)
where,
(3)
and the system schematic is the following where F(s)G1(s) = G2(s).
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.
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
Note from the specification, we required the maximum overshoot, , to be less than 5% and damping ratio, , can be found from the approximate damping ratio equation, . 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.
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)
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
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.
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:
and the closed-loop transfer function can be derived as following:
k = 1.0888e+08; sys_cl=F*feedback(G1,k*C);
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')
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.
Matlabsolutions.com provides guaranteed satisfaction with a
commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain
experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support
to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been
empanelled after extensive research and quality check.
Matlabsolutions.com provides undivided attention to each Matlab
assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services
include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work
done at the best price in industry.
Desktop Basics - MATLAB & Simulink
Array Indexing - MATLAB & Simulink
Workspace Variables - MATLAB & Simulink
Text and Characters - MATLAB & Simulink
Calling Functions - MATLAB & Simulink
2-D and 3-D Plots - MATLAB & Simulink
Programming and Scripts - MATLAB & Simulink
Help and Documentation - MATLAB & Simulink
Creating, Concatenating, and Expanding Matrices - MATLAB & Simulink
Removing Rows or Columns from a Matrix
Reshaping and Rearranging Arrays
Add Title and Axis Labels to Chart
Change Color Scheme Using a Colormap
How Surface Plot Data Relates to a Colormap
How Image Data Relates to a Colormap
Time-Domain Response Data and Plots
Time-Domain Responses of Discrete-Time Model
Time-Domain Responses of MIMO Model
Time-Domain Responses of Multiple Models
Introduction: PID Controller Design
Introduction: Root Locus Controller Design
Introduction: Frequency Domain Methods for Controller Design
DC Motor Speed: PID Controller Design
DC Motor Position: PID Controller Design
Cruise Control: PID Controller Design
Suspension: Root Locus Controller Design
Aircraft Pitch: Root Locus Controller Design
Inverted Pendulum: Root Locus Controller Design
Get Started with Deep Network Designer
Create Simple Image Classification Network Using Deep Network Designer
Build Networks with Deep Network Designer
Classify Image Using GoogLeNet
Classify Webcam Images Using Deep Learning
Transfer Learning with Deep Network Designer
Train Deep Learning Network to Classify New Images
Deep Learning Processor Customization and IP Generation
Prototype Deep Learning Networks on FPGA
Deep Learning Processor Architecture
Deep Learning INT8 Quantization
Quantization of Deep Neural Networks
Custom Processor Configuration Workflow
Estimate Performance of Deep Learning Network by Using Custom Processor Configuration
Preprocess Images for Deep Learning
Preprocess Volumes for Deep Learning
Transfer Learning Using AlexNet
Time Series Forecasting Using Deep Learning
Create Simple Sequence Classification Network Using Deep Network Designer
Train Classification Models in Classification Learner App
Train Regression Models in Regression Learner App
Explore the Random Number Generation UI
Logistic regression create generalized linear regression model - MATLAB fitglm 2
Support Vector Machines for Binary Classification
Support Vector Machines for Binary Classification 2
Support Vector Machines for Binary Classification 3
Support Vector Machines for Binary Classification 4
Support Vector Machines for Binary Classification 5
Assess Neural Network Classifier Performance
Discriminant Analysis Classification
Train Generalized Additive Model for Binary Classification
Train Generalized Additive Model for Binary Classification 2
Classification Using Nearest Neighbors
Classification Using Nearest Neighbors 2
Classification Using Nearest Neighbors 3
Classification Using Nearest Neighbors 4
Classification Using Nearest Neighbors 5
Gaussian Process Regression Models
Gaussian Process Regression Models 2
Understanding Support Vector Machine Regression
Extract Voices from Music Signal
Align Signals with Different Start Times
Find a Signal in a Measurement
Extract Features of a Clock Signal
Filtering Data With Signal Processing Toolbox Software
Find Periodicity Using Frequency Analysis
Find and Track Ridges Using Reassigned Spectrogram
Classify ECG Signals Using Long Short-Term Memory Networks
Waveform Segmentation Using Deep Learning
Label Signal Attributes, Regions of Interest, and Points
Introduction to Streaming Signal Processing in MATLAB
Filter Frames of a Noisy Sine Wave Signal in MATLAB
Filter Frames of a Noisy Sine Wave Signal in Simulink
Lowpass Filter Design in MATLAB
Tunable Lowpass Filtering of Noisy Input in Simulink
Signal Processing Acceleration Through Code Generation
Signal Visualization and Measurements in MATLAB
Estimate the Power Spectrum in MATLAB
Design of Decimators and Interpolators
Multirate Filtering in MATLAB and Simulink