Professional Documents
Culture Documents
DCS Lab 4 Report (Zain, Umer, Abdullah)
DCS Lab 4 Report (Zain, Umer, Abdullah)
Lab #4 Report
Objective:
• Design of cascade controller for the QNET rotary pendulum
• Design of state feedback controller for the QNET rotary pendulum
Model
The rotary pendulum is a nonlinear system. One way to simplify the designing of controllers for
nonlinear systems is to find a linear approximation at the operating point of interest. The desired
operating point in case of the inverted pendulum is the point where the angle of the pendulum arm
is 0 degrees.
The linearized state space model of the QNET rotary pendulum is given below:
𝜃 0 0 1 0 𝜃 0
𝑑 𝛼 0 0 0 1 𝛼 0
[ ]=[ ][ ]+ [ ]𝑣
𝑑𝑡 𝜃̇ 0 22.374 −0.298297 0 𝜃̇ 8.95788
𝛼̇ 0 36.2091 −0.0765277 0 𝛼̇ 2.29813
1 0 0 0 𝜃
0 1 0 0 𝛼
𝑦=[ ][ ]
0 0 1 0 𝜃̇
0 0 0 1 𝛼̇
Where
The variable quantity that is most important in the rotary pendulum system is the Pendulum arm
angle 𝛼. To find a transfer function between 𝛼 and 𝑣, we can use the state space output matrix.
𝐶 = [0 1 0 0].
Using the matrices, A and B of the system model and 𝐶 = [0 1 0 0], find the transfer function
between 𝛼 and 𝑣. You can use the MATLAB commands that you have learnt in the LCS course
for this task.
Ans. The poles of the system are at -0.2509, -6.0421, 0 and 5.9947. This system is not stable
because there is a pole on the right side of the imaginary axis.
Using the techniques learnt in LCS, design a controller that stabilizes the system. You may use
proportional, PI, PID, lag lead, or any combination of controllers. You may also use advanced
software tools, such as the SISOTOOL in MATLAB.
Q. Is it possible to stabilize the system? Is the stabilizing controller feasible?
Ans. It is possible to stabilize the system. A controller (compensator) can be made, and the
pole-zero plot can be checked to determine stability of the system.
Controller Design:
MATLAB Code:
% State Space Model to Continuous-Time Transfer Function Conversion
A=[0 0 1 0;
0 0 0 1;
0 22.374 -0.298297 0;
0 36.2091 -0.0765277 0];
B=[0;
0;
8.95788;
2.29813];
C=[0 1 0 0];
D=[0];
sys_ss = ss(A,B,C,D);
sys_tf = tf(sys_ss)
zpk(sys_tf)
MATLAB Output:
sys_tf =
2.298 s - 6.687e-07
----------------------------------
s^3 + 0.2983 s^2 - 36.21 s - 9.089
Continuous-time transfer function.
ans =
2.2981 (s-2.91e-07)
------------------------------
(s-5.995) (s+6.042) (s+0.2509)
Continuous-time zero/pole/gain model.
Conclusion:
In this lab, we learned how to model inverted pendulum using state space and transfer function
approaches. Thereafter, we learned how to design a controller that can stabilize the inverted
pendulum system.