0% found this document useful (0 votes)
23 views

Control Assignment 1.1

Uploaded by

Mostafa Hamdy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Control Assignment 1.1

Uploaded by

Mostafa Hamdy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

Automatic control systems

EPE 3050
Assignment
Under the supervision of:

Dr. Abdel-Moneim Saif Dr. Ahmed Sakr Dr. Mahmoud El-Nagar


Eng. Mohmed Khaled

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

𝐽 ∶ 𝑀𝑜𝑚𝑒𝑛𝑡 𝑜𝑓 𝑖𝑛𝑒𝑟𝑡𝑖𝑎 𝑜𝑓 𝑚𝑜𝑡𝑜𝑟 𝑎𝑛𝑑 𝑙𝑜𝑎𝑑


𝑏 ∶ 𝐹𝑟𝑖𝑐𝑡𝑖𝑜𝑛𝑎𝑙 𝑐𝑜𝑒𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑡 𝑜𝑓 𝑚𝑜𝑡𝑜𝑟 𝑎𝑛𝑑 𝑙𝑜𝑎𝑑
By applying Kirchhoff's voltage law on the armature circuit:
𝑑𝑖
𝑣𝑎 = 𝑒 + 𝑖𝑎 𝑅𝑎 + 𝐿 𝑎 => (1)
𝑑𝑡

By applying Newton's 2nd law on the motor shaft


𝑇 = 𝑏𝜃̇ + 𝐽𝜃̈ => (2)
Since: 𝑒 ∝ 𝜃̇ then : 𝑒 = 𝐾𝑏 𝜃̇
Since: 𝑇 ∝ 𝑖𝑎 then : 𝑇 = 𝐾𝑡 𝑖𝑎
In SI units 𝐾𝑡 = 𝐾𝑏 = 𝐾
𝑒 = 𝐾𝜃̇ => (3)
𝑇 = 𝐾𝑖𝑎 => (4)
By performing Laplace transform on (1),(2),(3),(4)
𝑉𝑎 (𝑠) = 𝐸(𝑠) + 𝐼𝑎 (𝑠)𝑅𝑎 + 𝐿 𝑎 𝑠𝐼𝑎 (𝑠) = 𝐸(𝑠) + 𝐼𝑎 (𝑠)(𝑅𝑎 + 𝐿 𝑎 𝑠) => (5)
𝑇(𝑠) = 𝑏𝑠𝜃(𝑠) + 𝐽𝑠 2 𝜃(𝑠) => (6)
𝐸(𝑠) = 𝐾𝑠𝜃(𝑠) => (7)

5
𝑇(𝑠) = 𝐾 𝐼𝑎 (𝑠) => (8)
From (6) and (8)
𝑏𝑠𝜃(𝑠)+𝐽𝑠 2 𝜃(𝑠)
𝐼𝑎 (𝑠) = => (9)
𝐾

From (5),(7),(9)
𝑏𝑠𝜃(𝑠)+𝐽𝑠 2 𝜃(𝑠) (𝑅𝑎 +𝐿 𝑎 𝑠)(𝐽𝑠 2 +𝑏𝑠)
𝑉𝑎 (𝑠) = 𝐾𝑠𝜃(𝑠) + ( ) (𝑅𝑎 + 𝐿 𝑎 𝑠) = 𝜃(𝑠) (𝐾𝑠 + )
𝐾 𝐾

(𝑅𝑎 + 𝐿𝑠)(𝐽𝑠 2 + 𝑏𝑠) + 𝐾 2 𝑠


𝑉𝑎 (𝑠) = 𝜃(𝑠) ( )
𝐾
𝐾
𝜃(𝑠) 𝐾 𝐽𝐿 𝑎
= =
𝑉𝑎 (𝑠) (𝑅𝑎 + 𝐿 𝑎 𝑠)(𝐽𝑠 2 + 𝑏𝑠) + 𝐾 2 𝑠 𝑅𝑎 𝑏 2 𝑘 2 + 𝑅𝑎 𝑏
𝑆3 + ( + )𝑠 + ( 𝑠
𝐿𝑎 𝐽 𝐽𝐿 𝑎 )

Then the open loop transfer function of the position armature-controlled dc


motor is:
𝐾
𝐽𝐿 𝑎
𝐺(𝑠) =
𝐽𝑅𝑎 + 𝐿 𝑎 𝑏 2 𝑘 2 + 𝑅𝑎 𝑏
𝑆3 + ( ) 𝑠 +( 𝑠
𝐽𝐿 𝑎 𝐽𝐿 𝑎 )
Given that

𝟑𝟎𝟎
𝑮(𝒔) =
𝑺𝟑 + (𝟓𝟔. 𝟏𝟐)𝒔𝟐 + (𝟑𝟖𝟎. 𝟖𝟖𝟕𝟓)𝒔

6
b) Considering unity feedback and gain controller "k", draw the
root-locus of the system.

Figure 2 .root-locus of the system with unity feedback and gain k

c) Get the range of the controller gain to ensure system stability.

Stability range:
0 < K <71.1

Figure 3 values at critical stability

7
d) The controller gains to satisfy:
i. Damping ratio equals to 0.7

Figure 4 controller gain to satisfy a 0.7 damping ratio

At Damping = 0.7 K=4.365

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

Figure 5 minimum settling time

9
 For Ts less than 2 sec:

Figure 6 range that satisfies settling time less than 2s

Therefore, Gain range: 1.7931 < K < 30.709

10
iii. Natural Frequency equals 5 rad/sec.

Figure 7 root locus for Wn=5 rad/s

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.

Figure 8 gain for critically damped

At damping ratio =1 Gain K=2.3061

12
Output response

Figure 9. critically damped Output

Control action

Figure 10 critically damped control action


Figure 11 critically damped 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

Kcrit=2.306; %critically damped gain

%Error steady state for step input

Kp=dcgain(Kcrit*G);

disp('the steady state error for unit step = ')

ess1=1/(1+Kp)

%Error steady state for Ramp input

Kv=dcgain(Kcrit*SG);

disp('the steady state error for unit ramp = ')

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

Figure 12 output for system with cascaded controller C(s)

ii. Output

Figure 13 transient performance for system with cascaded controller C(s)

15
From the output figure we get
the system settling time = 0.705 seconds
overshoot= 1.57%
error steady state = 0

iii. Control action

Figure 14 control action with cascaded C(s) controller

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.

Figure 15 new root locus after adding controller in (h)

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

Comment: No as the root locus in (g) doesn’t intersect with the


requirements where settling time 0.7 sec
18
j) obtain the state space model
taking the states as, position, velocity and armature current
𝑋1 = 𝜃
𝑋2 = 𝜃̇
𝑋3 = 𝑖𝑎
𝑦 = 𝑋1
𝑢 = 𝑣𝑎
𝑋1̇ = 𝜃̇ = 𝑋2
𝑋2̇ = 𝜃̈
𝑑𝑖𝑎
𝑋3̇ =
𝑑𝑡
From the system`s differential equations:
𝑏 𝐾 𝑏 𝐾
𝐾𝑖𝑎 = 𝑏𝜃̇ + 𝐽𝜃̈ => 𝜃̈ = − 𝜃̇ + 𝑖𝑎 = − 𝑋2 + 𝑋3
𝐽 𝐽 𝐽 𝐽

𝑑𝑖 𝑑𝑖𝑎 𝐾 𝑅 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

%define system parameters


Ra=1.17;
La=0.024;
b=0.0737;
J=0.01;
K=0.072;
%define state space matrices

A=[0 1 0; 0 -b/J K/J; 0 -K/La -Ra/La];


B=[0; 0; 1/La];
C=[1 0 0];
D=[0];
Motor_ss = ss(A,B,C,D)

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

the system is completely observable if |𝑁| ≠ 0

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

l) Design a state feedback controller in order to stabilize the


system and achieve settling time less than 0.4 sec
using MATLAB to get k
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)

𝐾 = [1829.3 139.7 9.1]

23
Simulink implementation

Figure 19 Simulink model for state feedback (measurable states)

24
Output vs time

Figure 20 system output after adding state feedback

States vs time

Figure 21 position vs time after adding state feedback

25
Figure 22 speed vs time after adding state feedback

Figure 23 armature current 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)'

𝐾𝑒 = [1679.88 626624.2 546586.4]

Figure 24 simulink model for state obsever

27
Figure 25 actual and estimated position

Figure 26 actual and estimated speed

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

Figure 28 Simulink model for observer based controller

Figure 29 entering given initial conditions

30
Figure 30 output after using observer-based controller

Figure 31 actual and estimated position after using observer-based controller

31
Figure 32 actual and estimated speed after using observer-based controller

Figure 33 error in estimating the speed state

32
Figure 34 actual and estimated armature current after using observer-based controller

Figure 35 error in estimating the armature current state

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

You might also like