matlab代写-EML 5311
时间:2022-04-25
EML 5311 Spring 2022
Control Systems Theory
University of Florida
Mechanical and Aerospace Engineering
Course Project
Please submit your project files only through e-learning.
No email or paper submissions will be accepted.
Goal of the project: Determining an approximate model of a physical plant, and ensuring robust-
ness to modeling errors, are crucial part of control design in practice. In this project you will go
through the process of system identification from open-loop experiments and control design based on
the identified plant model. The task is to identify an LTI-approximation of a plant provided as a
simulink model, design a feedback controller, and testing the controller on that plant.
The plant is shown in Figure 1. It consists of a linear dynamic system (denoted by P (s) with a
saturation nonlinearity due to the actuator’s limits. The saturation limits of the actuator are known
to be umin = −10 and umax = 10.
A “virtual plant” is provided to you through a Simulink model. You will treat this as a real plant,
identify a model by experimenting with the plant, and then design and test a feedback controller
to control the plant to perform reference tracking. The virtual plant is created to reproduce real
experiments as closely as possible, in which every new test will have some random variation in sensor
noise and initial conditions.
Files: All files are in e-learning. Download all the files to a folder of your choice. I strongly suggest
you ”cd” to that folder from MATLAB c©’s command prompt before you try to run anything. Open
all the MATLAB c© files and read the comments on the top portion of the scripts.
The Simulink model openLoopTestBed R2019b.slx contains the virtual plant that can be used to
perform open loop and closed loop experiments1. The simulink model takes an input signal u[ti] and
produces a time-trace of the output y[ti] at the same time instants. An example MATLAB
c©script is
provided, conductOpenLoopTestonVirtualPlant.m, to illustrate how to conduct an open loop test
on this virtual plant.
1 System identification
1.1 Task I.A
1. Identify a nominal frequency response of the plant, Pˆ0(jω), by performing sine sweep.
2. Fit a parametric transfer function Pˆ0(s) to the identified nominal frequency response Pˆ0(jω).
You can use the invfreqs command to fit Pˆ0(s). (Beware: usually some manual tweaking is
needed.)
1The R2019b means it was tested to work with R2019b relese of Matlab. Newer versions of Matlab should be able
to open and run this simulink model. If you have an older version of Matlab, try the R2017a version of the same files,
openLoopTestBed R2017a.slx is also provided. But the data extraction part of the scripts I am providing may not work
with that version, and may require you to modify the script.
Prabir Barooah 1
EML 5311 Spring 2022
umax
umin
u
plant
ucommand
actuator
saturation
y
sensor noise
P(s)
n
z
Figure 1: Plant with actuator saturation
Provide the relevant Bode plots in your report to show how accurately the parametric model fits the
identified frequency response. (More details about the report are at the end.)
1. Running simulations with openLoopTestBed.slx takes a long time. Without going into the
reasons for it, note that this in fact realistic since in practice performing experiments do take time.
Choosing a thousand frequency values arbitrarily and going through them using a for loop will take
forever. So do as much preliminary investigation with the plant as possible to pick the frequency points
carefully.
2. Due to the constraints of uniformity required for grading, you must do sine sweep. You can
use other methods to inform your choice of sine sweep parameters.
2 Control design
2.1 Objectives
The objective is to track a reference signal with small steady state error. The reference signal is a
sequence of two steps, and is generated by the function F ref at t.m, with the option ref type =
’step zero21 at5 back20 at15’. The script exampleGenerateReference.m shows how to generate
this reference signal2.
The target performance criteria to meet are:
1. Peak overshoot of less than 15%, and
2. Rise time less than 2 seconds.
2.2 Task II.A
Design a controller using state-space design techniques to achieve the performance objectives listed
above. Here are the sub-tasks:
1. Describe the structure of your proposed closed loop control system. Show a diagram, not just
words. (Hint: to avoid actuator saturation, you will probably need to LQR methodology. also,
this is a setpoint tracking problem, not a stabilization problem, don’t forget that.)
2The function can produce another reference, and you can modify the function to create all sorts of references, but
you do not need to show how your controller perform with those references.
Prabir Barooah 2
EML 5311 Spring 2022
2. Design and “design testing”:
(a) Design the controller parameters for the nominal plant model Pˆ0 you identified in the
system identification step.
(b) Test the performance of the closed loop with your design in Simulink. First construct your
own plant simulator by using Pˆ0 for the LTI part of the plant and then adding the actuator
saturation. Essentially, reproduce the virtual plant provided to you with your identified
model (minus the sensor noise). Do not use the virtual plant in this phase! Simulating that
takes a lot of time. These simulations should show that your design meets the performance
requirements, at least in the “design tests” that uses a mathematical model of the plant
in place of the real plant3.
3. “Production test”: Once you are satisfied with your design (based on the simulations above),
test your design on the real plant by wrapping a feedback loop around the “plant” block in the
Simulink model provided. (Goes without saying that you will have to create a separate Simulink
model: copy the plant block from the open loop example provided into that model’s window
and add the controller.) If the performance in the production tests are different from that seen
in the design tests, comment on where you think the difference is coming from.
3 Report
3.1 Task III
Write a clear report.
The grading for this project will be based mostly on the report. I will consider several aspects.
1. Your report must be clear and concise. The major results must be clearly visible and not hidden
within unimportant details.
2. For the system identification part, you must clearly describe what you have done to minimize
the effect of transients and measurement noise. The more precise and well-reasoned your choices
are, the better. For example, if the first X seconds of data was ignored to minimize the effect
of initial conditions, more points will be awarded if the choice of X is clearly explained.
3. Your report must describe the derivation of the controller. Merely specifying the control pa-
rameters without an explanation of how they were arrived at will fetch you a 0. Describe your
methodology, for example, what steps you have taken to ensure that the chances of reaching
saturation limits are minimized? What steps have you taken to guard against instability or
poor performance due to uncertainty in the plant model?
4. All plots have to have clear x-axis and y-axis labels and plot legends if multiple curves are
plotted in the same figure. The font size of the labels, captions, and legends have to sufficiently
large to the legible.
3If you cannot meet the requirements, that is ok, as long as you get close. Meaning, if your design achieves a peak
overshoot of 20% instead of 15%, I recommend you move on, and perhaps come back to refine the design later if you
have time; you would not lose too many points for being able to achieve 20% instead of the target 15%. Read the
grading rubric at the end before you spend too much time fine tuning your controller.
Prabir Barooah 3
EML 5311 Spring 2022
In terms of apportioning your time to these tasks, a rough guideline is to assume that Task I
(system identification) accounts for 20% (=15+5) of the points, Tasks II (controller design) 40 %
(=5+15+10+10) points, and Task III (report) 40% of the points.
This weight on the report may appear artificial: it is not possible to separate the report from
Tasks I and II. After all, if you do not do Tasks I and II, there is nothing to write a report on. In
that case, no matter how beautiful a report you submit, you will not get 40/100, instead you will get
0/100! But I mention “40 points for the report” so that you appreciate the role the report plays in
your grade. This relates to one of the footnote comments: as long as you get close to meeting the
performance requirements, do not spend much time refining the design to get performance. I will not
penalize you for missing the performance requirements by a little bit. But if it is not clear to me from
the report how you proceeded with the design, what design choices you made, and why, you will lose
a big fraction of the 40 points, even if your design meets all the performance requirements!
4 What to submit
1. A report in .pdf format (typed, not hand-written) that is at most 10 pages, including fig-
ures. There should not be any MATLAB c© code in the report. The report should named
ProjectReport.pdf.
2. A MATLAB c©script named sineSweepOnVirtualPlant.m that uses the provided Simulink model
(the virtual plant) to perform sine sweep. Meaning, the script should have the command
sim(’openLoopTestBed R201XX’) in it. The script should produce a plot of the identified
frequency response.
3. Two Simulink models, one for the “design test” and one for the “production test”:
(a) The first one should be named closedLoop DesignTest.slx: it should use the identified
model Pˆ0(s) for the plant.
(b) The second one should be named closedLoop ProductionTest.slx; it should use the
virtual plant.
(c) Two MATLAB c© scripts named testClosedLoop Design.m and testClosedLoop Production.m
that calls these Simulink models to perform the design tests and production tests. Thesee
scripts should generate the plots you used in your report to show closed loop performance.
The first line of each of these scripts must be clear.
4. All the MATLAB c© and Simulink files I provided as part of the project (so that I can run your
code in a folder with only your submission).
Two really important requirements:
1. If you submit any other files other than those listed above, you will automatically get a 0 in the
project4. I will download the files you submit into a folder and run your MATLAB c©scripts. If
they do not run (for instance, they throw an error), you will get a 0 in the project.
4You can use other MATLAB c© scripts during the design stage, that is fine. But then, consolidate your design and
testing into just the files I mentioned. I recommend that when you are ready to submit, create a folder, and move
only the files you need to submit to that folder. Go through the checklist carefully, a silly error can cost you the whole
project! Next, test that your scripts run without an error from that folder. You can then submit all files in that folder
to e learning.
Prabir Barooah 4
EML 5311 Spring 2022
2. Submit only once. Multiple submissions are not allowed5.
5Here is the reason. If you resubmit, e-learning renames your files by adding a number at the end of the files, so
even if you name your files correctly I wont be able to run them since your matlab code will include commands like
sim(’modelX’) while the simulink file modelX.slx will be renamed by e-learning to modelX-1.slx or modelX-2.slx,
depending on how many times you resubmit. I will not have the time to fix thse errors, and so I wont be able to check
the output from your script.
Prabir Barooah 5
essay、essay代写