EE 4343/EE 5320
Fall 2004
TITLE : how to WRITE A report
The document is written assuming use of:
matlab 6
simulink 4
control system toolbox 5
Accompanying files:
labmodel.mdl
labtutorial.m
UTA, 10/22/2004
Compiled by:
J Gadewadikar
contents
1. answers on questions 5.1 3
1.1. question 1. 3
1.2. question 2. 3
1.3. question 3. 4
2. answers on questions 6.2 5
2.1. question 1. 5
2.2. question 2. 5
2.3. question 3. 5
2.4. question 4. 6
2.5. question 5. 7
2.6. question 6. 8
2.7. question 7. 9
3. answers on questions 7.2 11
3.1. question 1. 11
3.2. question 2. 11
3.3. question 3. 11
3.4. question 4. 11
4. table of figures 11
1. answers on questions 5.1
Here you use your transfer function obtained using the data from the lab handout. In this little tutorial we will use the following transfer function just for the illustration purposes:
Open loop transfer function (or transfer function of the plant) is:
s^2 + s + 3
---------------------
s^3 + 2 s^2 + 3 s + 4
1.1. question 1.
The poles of the transfer function are:
-1.6506
-0.1747 + 1.5469i
-0.1747 - 1.5469i
All the poles are in the left hand side half plane, thus the open loop system is stable.
(if there are poles on the right hand side the system is unstable).
1.2. question 2.
The controllability matrix of the system is:
co =
1 -2 1
0 1 -2
0 0 1
Determinant of the controllability matrix is:
det_co =
1
thus, since it is not equal zero, the system is controllable.
Or, rank(co) is:
rank_co =
3,
thus the controllability matrix is of full rank and the system is controllable.
1.3. question 3.
The observability matrix of the system is:
ob =
1 1 3
-1 0 -4
2 -1 4
Determinant of the observability matrix is:
det_ob =
-5
thus, since it is not equal zero, the system is observable.
Or, rank(ob) is:
rank_ob =
3,
thus the observability matrix is of full rank and the system is observable.
2. answers on questions 6.2
2.1. question 1.
Yes, because the system is controllable.
2.2. question 2.
You did that in the lab. You should have your compensator recorded with the data from the experiment. Describe the design procedure (it will not be described here).
For the system in this example we will use the following compensator:
C
Zero/pole/gain:
1.9643
---------
(s+1.964)
2.3. question 3.
For the root locus plot you may use rltool. first open rltool. Then import your transfer function as plant (G) and import your compensator as compensator (C). That will give root locus plot of the closed loop system. SOME OF YOU HAVE BEEN PLOTING SOMETHING CALLED ROOT LOCUS OF THE OPEN LOOP in your lab reports and homeworks. THERE IS NO SUCH THING. ROOT LOCUS IS DEFINED AS PROCEDURE USING THE OLTF ALONG WITH THE COMPENSATOR IN THE “OPEN LOOP” AS EXPLAINED IN CLASS. THIS DIRECTLY GIVES US CLOSED LOOP PERFORMANCE (ie POLES AND ZEROS OF THE CLTF).NOTE THAT YOU SHOULD NEVER PLOT THE ROOT LOCUS FOR THE CLTF!!
Now, how to make a nice figure (plot) from the rltool. Under "File" tab, use "Print to figure" option. You will then see the usual matlab figure on your screen. Copy that figure in your report and label it:
Since you have designed compensator for the system in such way that the system is stable, that is what root locus should show. So, check the poles, and since they are on the LHP, that shows that the system is stable. (as can be seen from Figure 1)
Figure 1: Root locus of the system.
2.4. question 4.
From the rltool export to workspace closed loop system. If you are using Matlab 6, it will have name T_r2y. Then use matlab to obtain closed loop poles and zeros.
poles_tfclosedloop=pole(T_r2y)
poles_tfclosedloop =
-0.1647 + 1.6713i
-0.1647 - 1.6713i
-1.8175 + 1.2539i
-1.8175 - 1.2539i
zeros_tfclosedloop =
-0.5000 + 1.6583i
-0.5000 - 1.6583i
It can be seen that system has two complex pole pairs. Moreover, the zeros are not close to the poles, and complex poles are not far on the left hand side, so it can expected that the system will have overshoot and significant vibratory modes visible in the response.
(There can be done more detail analysis based on poles and zeros of the system, but for this report a short analysis like here is enough).
2.5. question 5.
The simplest way to plot step response is to use matlab control toolbox command step. Command step works for the step input 1 by default. Suppose that we want to plot step response for the input –200. Then use step(-200*T_r2y). Step response for the input –200 is shown in Figure 2. It has a big steady state error, however, the compensator for this examplke was not designed to cope with the steady state error.
Figure 2: Step response of the closed loop system
2.6. question 6.
Since you have used step command to plot the response, the easiest way to analyze it is to use matlab built-in possibilities. Right click on the figure you obtained using step command. In the small window that opens on the figure select characteristics and then select what you want to see (rise time, peak value, etc.). After you do that you will see dots on the graph on the points that represent the values you have chosen to show. left click on the point will write that value on the graph permanently. You can change alignment of the text using right click on the appropriate point. The step response with the peak value, rise time etc. is shown in Figure 3.
Figure 3: Step response with peak value etc. shown
For the linear system in most cases the natural frequency can be estimated from the step response. (You don't have to do math and theoretical approach here, although you should know how to do it).
Plot the step response again using step command.
Then put the points on the graph using left mouse click so that between two points you have a full period (as shown in Figure 4). That will give you a period of the natural frequency oscillations.
Figure 4: Natural frequency from the response
From the Figure 4 it can be seen that in this case that the period is 6.49-2.75=3.74 s. Now, the natural frequency is w=2P/T, or, in this case 1.68 rad/s. It can be seen that there are significant oscillations in the response, as expected from the analysis of the poles and zeros of the closed loop system.
Use zoom on the figures if necessary.
2.7. question 7.
The simplest way to plot the error, output and control output of the system is to use simulink. You can start simulink by typing "simulink" in the matlab command window.
The simulink model to obtain the required values looks like in Figure 5. The simulation should be set for 15 seconds (simulation button on the model toolbar). On the step input block, use step time=0, final value=-200 (or some other value). The values can be stored into workspace using scopes. Double click on the scope block, click on the "Properties button", then on "Data history", uncheck "Limit data points to last, and under format choose "Array". Give some name to the variable. In this example the names were error for error, output for output and control for control output. Run your simulation and plot results.
Use LTI system block from Control system toolset for simulink. C is your compensator and other LTI block is your open loop transfer function.
Figure 5: Simulink model
Here is given only plot for output. For the plot the following commands were used:
plot(output(:,1),output(:,2)),grid,xlabel('t [s]'),ylabel('output')
Figure 6: Output - simulation
3. answers on questions 7.2
3.1. question 1.
You have done that in the lab.
3.2. question 2.
Load your results from the lab and plot them. Example for the plotting commands is given in answer on question 7 for part 6.2.
3.3. question 3.
Here you are on your own. Remember that if control input is changing, even slightly, output of the linear system has to change, it can stay on 0 on or any other value.
3.4. question 4.
Here you are on your own. If the differences between simulation and the experiment are significant, that means that the model used was not very good (providing that simulation was correct).
4. table of figures
Figure 1: Root locus of the system. 6
Figure 2: Step response of the closed loop system 7
Figure 3: Step response with peak value etc. shown 8
Figure 4: Natural frequency from the response 9
Figure 5: Simulink model 10
Figure 6: Output - simulation 10