Control Assignment 1.1
Control Assignment 1.1
EPE 3050
Assignment
Under the supervision of:
By
Name Sec
Moustafa Mohamed Mahmoud 4
Youssef Emad Mohamed 4
Youssef Hany Tohamy 4
1
2
Table of figures
Figure 1. diagram of an armature-controlled DC motor
Figure 2 .root-locus of the system with unity feedback and gain k
Figure 3 values at critical stability
Figure 4 controller gain to satisfy a 0.7 damping ratio
Figure 5 minimum settling time
Figure 6 range that satisfies settling time less than 2s
Figure 7 root locus for Wn=5 rad/s
Figure 8 gain for critically damped
Figure 9. critically damped Output
Figure 10 critically damped control action
Figure 11 critically damped control action
Figure 12 output for system with cascaded controller C(s)
Figure 13 transient performance for system with cascaded controller C(s)
Figure 14 control action with cascaded C(s) controller
Figure 15 new root locus after adding controller in (h)
Figure 16 step response output of the system after adding the controller in (h)
Figure 17 state space model parameters
Figure 18 controllability and observability check
Figure 19 Simulink model for state feedback (measurable states)
Figure 20 system output after adding state feedback
Figure 20 system output after adding state feedback
Figure 21 position vs time after adding state feedback
Figure 21 position vs time after adding state feedback
Figure 22 speed vs time after adding state feedback
Figure 22 speed vs time after adding state feedback
Figure 23 armature current vs time after adding state feedback
Figure 23 armature current vs time after adding state feedback
Figure 24 simulink model for state obsever
Figure 24 simulink model for state obsever
Figure 25 actual and estimated position
Figure 25 actual and estimated position
Figure 26 actual and estimated speed
Figure 26 actual and estimated speed
Figure 27 actual and estimated armature current
Figure 27 actual and estimated armature current
Figure 28 Simulink model for observer based controller
Figure 28 Simulink model for observer based controller
Figure 29 entering given initial conditions
Figure 29 entering given initial conditions
Figure 30 output after using observer-based controller
Figure 30 output after using observer-based controller
Figure 31 actual and estimated position after using observer-based controller
3
Figure 31 actual and estimated position after using observer-based controller
Figure 32actual and estimated speed after using observer-based controller
Figure 32actual and estimated speed after using observer-based controller
Figure 33 error in estimating the speed state
Figure 33 error in estimating the speed state
Figure 34 actual and estimated armature current after using observer-based controller
Figure 34 actual and estimated armature current after using observer-based controller
Figure 35 error in estimating the armature current state
Figure 35 error in estimating the armature current state
4
a) the open loop transfer function of the position control system
𝑅𝑎 : 𝐴𝑟𝑚𝑎𝑡𝑢𝑟𝑒 𝑟𝑒𝑠𝑖𝑠𝑡𝑎𝑛𝑐𝑒
𝐿 𝑎 : 𝐴𝑟𝑚𝑎𝑡𝑢𝑟𝑒 𝑖𝑛𝑑𝑢𝑐𝑡𝑎𝑛𝑐𝑒
𝑖𝑎 : 𝐴𝑟𝑚𝑎𝑡𝑢𝑟𝑒 𝑐𝑢𝑟𝑟𝑒𝑛𝑡
𝑣𝑎 : 𝐴𝑟𝑚𝑎𝑡𝑢𝑟𝑒 𝑣𝑜𝑙𝑡𝑎𝑔𝑒
𝑒 : 𝐵𝑎𝑐𝑘 𝑒𝑚𝑓
𝐾: 𝑀𝑜𝑡𝑜𝑟 𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡
𝑇: 𝑇𝑜𝑢𝑟𝑞𝑒 𝑑𝑒𝑣𝑒𝑙𝑜𝑝𝑒𝑑 𝑏𝑦 𝑡ℎ𝑒 𝑚𝑜𝑡𝑜𝑟
𝜃: 𝐴𝑛𝑔𝑢𝑙𝑎𝑟 𝑑𝑖𝑠𝑝𝑙𝑎𝑐𝑒𝑚𝑒𝑛𝑡 𝑜𝑓 𝑡ℎ𝑒 𝑠ℎ𝑎𝑓𝑡 Figure 1. diagram of an armature-controlled DC motor
5
𝑇(𝑠) = 𝐾 𝐼𝑎 (𝑠) => (8)
From (6) and (8)
𝑏𝑠𝜃(𝑠)+𝐽𝑠 2 𝜃(𝑠)
𝐼𝑎 (𝑠) = => (9)
𝐾
From (5),(7),(9)
𝑏𝑠𝜃(𝑠)+𝐽𝑠 2 𝜃(𝑠) (𝑅𝑎 +𝐿 𝑎 𝑠)(𝐽𝑠 2 +𝑏𝑠)
𝑉𝑎 (𝑠) = 𝐾𝑠𝜃(𝑠) + ( ) (𝑅𝑎 + 𝐿 𝑎 𝑠) = 𝜃(𝑠) (𝐾𝑠 + )
𝐾 𝐾
𝟑𝟎𝟎
𝑮(𝒔) =
𝑺𝟑 + (𝟓𝟔. 𝟏𝟐)𝒔𝟐 + (𝟑𝟖𝟎. 𝟖𝟖𝟕𝟓)𝒔
6
b) Considering unity feedback and gain controller "k", draw the
root-locus of the system.
Stability range:
0 < K <71.1
7
d) The controller gains to satisfy:
i. Damping ratio equals to 0.7
8
ii. Settling time less than 0.75 sec, 2 sec
For Ts less than 0.75 sec
No gain will achieve this settling time as deduced from the following figure that the minimum
settling time is 0.785 sec
9
For Ts less than 2 sec:
10
iii. Natural Frequency equals 5 rad/sec.
Gain K = 4.0685
11
e) Get the controller gain to achieve critically damped response,
draw the output and the control action if the system reference
is unit step.
12
Output response
Control action
13
f) Calculate the error steady state error for unit step and unit
ramp input using this gain controller in e
The Code:
G=tf([300],[1 56.12 380.8875 0]); % Transfer Function (G)
SG=tf([300 0],[1 56.12 380.8875 0]); % S*G to get ess for ramp input
Kp=dcgain(Kcrit*G);
ess1=1/(1+Kp)
Kv=dcgain(Kcrit*SG);
ess2=1/Kv
result:
Unit step Unit ramp
Dc gain Kp= ∞ Kp= 1.8163
steady state error (ess) 0 0.5506
Comment:
Since the system is Type 1,
Therefore, the error steady state for a unit step input is Zero while has a
number in case of unit ramp input
14
g) the system is cascaded by a controller
𝑠+15
C(s)=7 𝑠+25
i. Root locus
ii. Output
15
From the output figure we get
the system settling time = 0.705 seconds
overshoot= 1.57%
error steady state = 0
16
h) Design a compensator to achieve maximum percent overshoot
less than 5 % and settling time less than 0.4 sec. Are these
requirements achievable by the controller in (g)? Justify your
answer.
i) Plot the closed loop output and control action using the
controller in (h) to verify your design.
17
1) Step response
Figure 16 step response output of the system after adding the controller in (h)
2) Control action
𝑑𝑖 𝑑𝑖𝑎 𝐾 𝑅 1
𝑣𝑎 = 𝐾𝜃̇ + 𝑖𝑎 𝑅𝑎 + 𝐿 𝑎 𝑎 => =− 𝜃̇ − 𝑎 𝑖𝑎 + 𝑣
𝑑𝑡 𝑑𝑡 𝐿𝑎 𝐿𝑎 𝐿𝑎 𝑎
𝑑𝑖𝑎 𝐾 𝑅𝑎 1
=− 𝑋2 − 𝑋3 + 𝑢
𝑑𝑡 𝐿𝑎 𝐿𝑎 𝐿𝑎
Then :
𝑋1̇ = 𝑋2
𝑏 𝐾
𝑋2̇ = − 𝑋2 + 𝑋3
𝐽 𝐽
𝐾 𝑅𝑎 1
𝑋3̇ = − 𝑋2 − 𝑋3 + 𝑢
𝐿𝑎 𝐿𝑎 𝐿𝑎
𝑋̇ = 𝐴𝑋 + 𝐵𝑢
𝑦 = 𝐶𝑋 + 𝐷𝑢
19
0 1 0 0
𝑋1̇ 𝑏 𝐾 𝑋1
0 −
[𝑋2̇ ] = 𝐽 𝐽 [𝑋2 ]+[ 01 ] 𝑢
𝐾 𝑅𝑎
𝑋3̇ 0 − − 𝑋3 𝐿
[ 𝐿𝑎 𝐿 𝑎] 𝑎
𝑋1
𝑦 = [1 0 0] [𝑋2 ] + [0]𝑢
𝑋3
0 1 0
𝑏 𝐾 0
0 − 0
𝐴= 𝐽 𝐽 𝐵=[1]
𝐾 𝑅𝑎
0 − − 𝐿𝑎
[ 𝐿𝑎 𝐿 𝑎]
𝐶 = [1 0 0 ]
𝐷 = [0]
Given that
Ra=1.17 ohm La=0.024 H b=0.0737 N.m.s J =0.01 Kg.m^2
K=0.072 V / (rad/sec)
Using MATLAB
20
Figure 17 state space model parameters
0 1 0 0
𝐴 = [0 −7.37 7.2 ] 𝐵=[ 0 ] 𝐶 = [1 0 0] 𝐶 = [0]
0 −3 −48.75 41.67
21
k) Check the system controllability and observability
controllability matrix 𝑀 = [𝐵: 𝐴𝐵: 𝐴2 𝐵]
the system is completely controllable if |𝑀| ≠ 0
𝐶
observability matrix 𝑁 = [ 𝐶𝐴 ]
𝐶𝐴2
Using MATLAB
%controllability check
M=ctrb(Motor_ss)
Det_M=det(M)
if det(M)==0
fprintf('Det(M)=0 => System is not completely
controllable')
else
fprintf('Det(M)not equal zero => System is completely
controllable')
end
%observability check
N=obsv(Motor_ss)
Det_N=det(N)
if det(N)==0
fprintf('Det(N)=0 => System is not completely
observable')
else
fprintf('Det(M)not equal zero => System is completely
observable')
end
22
Figure 18 controllability and observability check
23
Simulink implementation
24
Output vs time
States vs time
25
Figure 22 speed vs time after adding state feedback
26
m) design a full state observer to estimate the states.
La = 24e-3; b = 0.0737; J = 0.01; k = 0.072; Ra = 1.17;
A = [0 1 0;0 -b/J k/J;0 -k/La -Ra/La];
B = [0;0;1/La];
C = [1 0 0];
p1 = (-4/0.4)*1.4; %choosing a pole less than the real achieving 0.4
Ts
% Getting further poles as the dominant is p1
p2 = 10*p1;
p3 = 20 * p1;
P = [p1;p2;p3];
k = place(A,B,P)
Ke = acker(A',C',4*P)'
27
Figure 25 actual and estimated position
28
Figure 27 actual and estimated armature current
Comments:
The estimated values of the states and their actual values are equal
29
n) Using the observer in (m), implement the state feedback in
(k) without measuring the real states. Use initial conditions for
the position as 40 degree and for speed as 10 degree/s
30
Figure 30 output after using observer-based controller
31
Figure 32 actual and estimated speed after using observer-based controller
32
Figure 34 actual and estimated armature current after using observer-based controller
33
Comments:
There’s an error between the estimated states and the actual states due to initial
conditions
There’s some windup in the position due to error accumulation done by the
integral component
34