Electro Mechanic Project Last
Electro Mechanic Project Last
Electro Mechanic Project Last
1. Kefale Tenaw-------------------------------------0565/09
2. Kirubel Menberu --------------------------------0588/09
3. Natnael Wondimu-------------------------------0765/09
4. Nahom Berhanu----------------------------------0741/09
Submitted To - Instructor Mitiku
17/06/2012 E.C
1
MODERN CONTROL SYSTEM PROJECT
Abstract
Water tankers and DC motors are amongst the common industrial components which need a
reliable, fast and quality controlling mechanism. In this project we will discuss level controlling
mechanisms for two tank system and position control for DC motors via with feedback
controller design, observer controller design and servo controller design.
Introduction
Liquid tanker level when two tankers are connected and there is flow between the tankers is
monitored and controlled in industries such as beverage processing, water boilers, water and
sewage treatment, etc. Motors are used in plenty more applications such as prime movers for
pumps, fans, compressors and more. Controlling the speed and position of the motor in an
issue of interest. Among the plenty options of control, we will use servo controller, forward
gain controller and observer gain controller.
2
MODERN CONTROL SYSTEM PROJECT
QUESTION 1
We are asked to design a servo controller for a DC motor where angular position, angular
velocity and armature current are the states and angular position is the output of the system.
Let us assume for the system given below, 𝑉 is the input voltage, angular position (𝜃) as the
output of the system, and armature current 𝑖, angular velocity (𝜔) and angular position (𝜃) are
the states of the DC motor.
3
MODERN CONTROL SYSTEM PROJECT
But
𝑇𝑚 = 𝑇𝑒 = 𝐾𝑡 𝐼
𝐽𝜔̇ + 𝐷𝜔 = 𝐾𝑡 𝐼
𝑑𝜔
𝐽 + 𝐷𝜔 = 𝐾𝑡 𝐼 − − − − − −(2)
𝑑𝑡
Let, 𝑢 = 𝑉, 𝑦 = 𝜃, 𝑥1 = 𝑖, 𝑥2 = 𝜔 𝑎𝑛𝑑 𝑥3 = 𝜃
From equation 1
𝐿ẋ1 + 𝑅𝑥1 + 𝑘𝑏 𝑥2 = 𝑢
𝑹 𝒌𝒃 𝒖
ẋ𝟏 = − 𝒙𝟏 − 𝒙𝟐 + − − − − − − − (3)
𝑳 𝑳 𝑳
Form equation 2
𝐽ẋ2 + 𝐷𝑥2 = 𝑘𝑡 𝑥1
𝑲𝒕 𝑫
ẋ𝟐 = 𝒙𝟏 − 𝑱 𝒙𝟐 − − − − − − − − − (4)
𝑱
ẋ𝟑 = 𝒙𝟐 − − − − − − − −(5)
The state space representation becomes
𝑅 −𝑘𝑏
− 0 𝑥 1
ẋ1 𝐿 𝐿 1
[ẋ2 ] = 𝑘𝑡 −𝐷 [𝑥2 ] + [𝐿]
ẋ3 0 𝑥3 0
𝐽 𝐽 0
[ 0 1 0]
𝑥1
𝑦 = [0 0 ] 𝑥
1 [ 2]
𝑥3
𝑦 = 𝑥3
Let, R=20Ω, L=1H, Kb=0.5V/(rad/sec), Kt=0.5Nm/A, J=0.25 Kgm2, D=1NmSec/rad. These constants
are arbitrarily chosen from data found from the internet. They are the most common values.
Therefore, substituting the values gives:
−20 −0.5 0
A =[ 2 −4 0]
0 1 0
1
B = [ 0 ] , C = [0 0 1] , D = 0
0
4
MODERN CONTROL SYSTEM PROJECT
Design of Controller
Step 1: - Checking of controllability
M = [𝐵; 𝐴𝐵; 𝐴2 𝐵; … . ; 𝐴𝑛−1 B] = [𝐵; 𝐴𝐵; 𝐴2 𝐵]
−20 −0.5 0 1 −20
But, AB =[ 2 −4 0] [ 0 ] = [ 2 ]
0 1 0 0 0
399 12 0 1 399
𝟐
A B = [−48 15 0] [ 0 ] = [−48]
2 −4 0 0 2
1 −20 399
[𝑀] = [0 2 −48] , |𝑀| = 4 ≠ 0
0 0 2
Since the matrix determinant is not singular our matrix is of full rank therefor fully controllable.
√1 − 𝜉 2 = 1.65347𝜉
1 − 𝜉 2 = 2.7340𝜉 2
𝝃 = 𝟎. 𝟓𝟏𝟔𝟗
5
MODERN CONTROL SYSTEM PROJECT
4
𝜔𝑛 =
𝜉𝑇𝑠
4
𝜔𝑛 = 0.5169∗2
𝒓𝒂𝒅
= 𝟑. 𝟖𝟕 𝒔𝒆𝒄
𝜔2
𝑛 𝟏𝟒.𝟗𝟖
Therefore, 𝐺(𝑠) = 2 =
𝑠 2 +2𝜉 𝜔 𝑛 𝑠+𝜔𝑛 𝒔𝟐 +𝟒𝒔+𝟏𝟒.𝟗𝟖
To make this second order function a 3rd order, we add another pole that is far away to the left
from the dominant pole so that it has very little effect on the overall response. And we assume
that the exponential decay is negligible after five time constants. Thus, the added pole can be
five times farther to the left than the dominant poles. Therefore, let us take the third pole to be
S = -10
11.44
𝐺(𝑠) =
(𝑠 2 + 4𝑠 + 11.44)(𝑠 + 10)
11.44
𝐺(𝑠) =
(𝑠 − (−2 + 𝑗5.46))(𝑠 − (−2 − 𝑗5.46))(𝑠 + 10)
(𝑠 2 + 4𝑠 + 11.44)(𝑠 + 10) = 𝑠 3 + 14𝑠 2 + 51.44𝑠 + 114.4
Therefore, equating this result with equation (6) the results:
𝑠 3 + 14𝑠 2 + 51.44𝑠 + 114.4 = 𝑠 3 + (24 + 𝐾1 )𝑠 2 + (81 + 4𝐾1 + 2𝐾2 )𝑠 + 2𝐾3
14 = 24 + 𝐾1
𝑲𝟏 = −𝟏𝟎
81 + 4𝐾1 + 2𝐾2 = 51.44
81 + 4 ∗ (0) + 2𝐾2 = 51.44
𝑲𝟐 = 𝟓. 𝟐𝟐
114.4 = 2𝐾3
𝑲𝟑 = 𝟓𝟕. 𝟐
Now let we calculate the state space of the servo dc moter.
−20 −0.5 0 −10 5.22 57.2
[ 2 −4 0] -[ 0 0 0 ]
0 1 0 0 0 0
6
MODERN CONTROL SYSTEM PROJECT
𝑟
=-(-10 5.22 57.2) [0]-10r
0
𝑟
=(10 -5.22 -57.2) [0]-10r
0
10r-10r=0
0=0
MATLAB and Simulink results and Observations
7
MODERN CONTROL SYSTEM PROJECT
Bs=B*17.8713
SSsv=ss(Acl,Bs,C,D)
step (SSsv)
8
MODERN CONTROL SYSTEM PROJECT
Here we have managed to reach our desired overshoot and settling time by using a controller K
and by setting the servo controller we have managed to zero down our steady state error.
QUESTION NUMBER 2:
Design observer and state feedback controller for DC motor
Here we are given a DC motor with only two state spaces, angular velocity and angular position.
To achieve this, we will assume our inductance to be zero, resulting our current component to
disappear resulting in a 2× 2 matrix.
̇ 0 1 0
( 𝜃 ) =(
θ
) ( )+( )
𝜔̇ 0 − (Dm/Jm + ktkb/JmRa) 𝜔 kt/JmRa
10
MODERN CONTROL SYSTEM PROJECT
Here we have assumed the value of components as such :- La=0, Dm=3, Ra=2, Kt=2,
kb=0.5, Jm=0.5
̇
( 𝜃 ) =(
0 1 θ 0
) ( )+( )
𝜔̇ 0 −7 𝜔 2
θ
Y=(1 0) ( )
𝜔
0 1 0
A=( ) B=( ) C = (1 0)
0 −7 2
0 1 0
A-BK=( ) − ( )*(K1 k2)
0 −7 2
0 1 0 1
=( )−( )
0 −7 2𝑘1 2𝑘2
0 1
=( )
−2𝑘1 − 7 − 2𝑘2
𝑆 −1
SI-A+BK=( )
2𝐾1 𝑆 + 7 + 2𝐾2
Determinant of SI-A+BK= S2+(7+2K2)S+2K1……………..eqn(2.1)
𝝃=0.517 ωn=3.87
ωn^2
G(S)= s^2+2 𝜉ωn s+ ωn^2
S2+4s+14.98=s2+(7+2k2)s+2k1
4=7+2k2 k2=-1.5
11
MODERN CONTROL SYSTEM PROJECT
2k1=14.98 k1=7.49
K=(𝟕. 𝟒𝟗 − 𝟏. 𝟓)
After we get the controller k we find the roots of the desired equation using quadratic equation
solving method:
S2+4s+14.98=0
S1,2=-2±j3.313
It is recommended that the poles of an observer should be two to five times faster than the
controller, hence we multiply the controller pole by five.
𝑠 + 𝑘𝑒1 −1
Determinant of ( )
𝑘𝑒2 𝑠+7
=(s+ke1) (s+7)+ke2
S2+20S+374.5=S2+(7+Ke1)S+7Ke1+Ke2
20=7+Ke1 Ke1=13
374.5=7Ke1+ke2 Ke2=283.5
𝑲𝒆𝟏 𝟏𝟑
Ke=( )=( )
𝑲𝒆𝟐 𝟐𝟖𝟑. 𝟓
MATLAB and Simulink results and observations.
12
MODERN CONTROL SYSTEM PROJECT
Here it can be observed that we have managed to achieve our desired overshoots and settling
time. It can also be concluded that the observer is matching the output of the plant (motor), we
can see this by referring to the error value or the difference between the observer output and
the plant output summing up to zero.
A=[0 1; 0 -7];
B=[0; 2];
C=[1 0];
D=0;
SS=ss(A,B,C,D) % Our state space
step (SS)
13
MODERN CONTROL SYSTEM PROJECT
Figure 12 (a)
Figure 13 (c) Observer state space response Figure 13 (d) Error in observer estimation
14
MODERN CONTROL SYSTEM PROJECT
Figure 13 Controller Ke
Figure 14 Controller K
15
MODERN CONTROL SYSTEM PROJECT
Question 3 and 4
#3,4. First we need to model the two-tank system
We have been given with, qin as the input flow rate, h2 (height of the second tank) is the
output, and the states as h1 (height of the first tank) and h2 (height of the second tank)
R is the resistance paused by the valve on the liquid flow, for liquid flow in such a pipe or
restriction is defined as the change in the level difference (the difference of the liquid levels of
the two tanks) necessary to cause a unit change in flow rate; that is,
change in level difference,m
𝑅= m-2sec
change in flow rate,m3sec
h1−h2
𝑞1 = -----------------------(2)
R1
Since Volume V = Area base * height, and volume flow rate is q= Area base * rate change of
height
dh
𝑞 =𝐴∗ dt
Therefore
𝑑ℎ1
qin−𝑞 1= 𝐴1 ∗ ---------------(3)
𝑑𝑡
16
MODERN CONTROL SYSTEM PROJECT
𝑑ℎ2
q1−𝑞 0= 𝐴2 ∗ ---------------(4)
𝑑𝑡
U h1 h2
Ẋ1 = - + --------------------(5)
A1 A1R1 A1R1
𝑑ℎ2 𝑑𝑥2
From equation (4) q1−𝑞 0= 𝐴2 ∗ =A2* 𝑑𝑡 =A2* h2
𝑑𝑡
q1−qo
ℎ̇2= A2 then substituting for q1 from (2) and then substituting for qo from (1)
h1−h2 h2
ℎ̇2= R1A2 − R2A2
h1 1 1
ℎ̇2= − ℎ2 ( + )
R1A2 R1A2 R2A2
h1 𝑅1+𝑅2
ℎ̇2= − ℎ2( )
R1A2 R1R2A2
h1 −𝑅1−𝑅2
ℎ̇2= + ℎ2( ) ------------------------(6)
R1A2 R1R2A2
ℎ1
y=(0 1) ( )
ℎ2
Assuming values for the area of each tanks and the resistance of each valves to be:
R1=0.25 m-2sec, R2=0.5 m-2sec , A1=1m2 and A2=0.5m2
ℎ1 −4 4 ℎ1 1
( )=( ) ( ) +( )U ------------------------(8)
ℎ2 8 − 12 ℎ2 0
17
MODERN CONTROL SYSTEM PROJECT
ℎ1
y=(0 1) ( )
ℎ2
The above is the state space representation of the system
Now, we shall select our performance index.
1. The settling time Ts
Ts is the time it takes before the step response remains within p percent of its steady state
value. The value p = 2 % is commonly used. It is given by;
𝟒
𝑻𝒔 = 𝛏𝛚𝐧
Since speed of response is indicated by The settling time as it is related to the time constant
of the control system, we will limit the location of the poles by specifying settling time value.
To compromise these two opposing requirements, we take a reasonable value of 2 second for
the settling time.
Ts= 2 sec
2. Percent overshoot, %OS.
Percent overshoot is the amount that the waveform overshoots the steady-state, or final, value
at the peak time, expressed as a percentage of the steady-state
value. It is given by;
To find ξ
𝐎𝐒
−𝐥𝐧(% )
𝟏𝟎𝟎
𝝃= 𝑂𝑆
√𝜋 2 +𝑙𝑛2 (% )
100
18
MODERN CONTROL SYSTEM PROJECT
𝐎𝐒
−𝐥𝐧(% )
𝟏𝟎𝟎
𝝃= 𝑂𝑆
√𝜋 2 +𝑙𝑛2 (% )
100
−𝐥𝐧(𝟎.𝟏𝟓)
𝝃 =√𝜋2 =0.5169
+𝑙𝑛2 (0.15)
𝟒
𝟒= , ωn=3.869
𝟎.𝟔∗𝛚𝐧
Since the poles are given by the following formula substituting the vales we will get;
To find our controller K first, we will check state controllability, the controllability matrix is
given by;
1 −4
Qc=[B AB]=( )
0 8
Then, |Qc|=8 i.e. different from 0, the system is completely state controllable.
We then determine of the state feedback gain matrix K, using direct substitution method
Let K= (𝑘1 𝑘2)
|sI - A + BK |=0
𝑠 0 −4 4 1
sI - A + BK=( )-( )+( ) (K1 K2)
0 𝑠 8 − 12 0
𝑠+4 −4 𝐾1 𝐾2 𝑠 + 4 + 𝐾1 𝐾2 − 4
( )+ ( )=( )
−8 𝑠 + 12 0 0 −8 𝑠 + 12
19
MODERN CONTROL SYSTEM PROJECT
𝑠 + 4 + 𝐾1 𝐾2 − 4
|( )|=0
−8 𝑠 + 12
S2 +(16+ K1)S+12K1+8K2+16=0------------------(9)
From the desired closed poles of the system
Equating equations (9) and (10) gives then comparing corresponding coefficients
S2 +3.998S +14.95= S2 +(16+ K1)S+12K1+8K2+16-----------------(10)
16+ K1 =3.998 12K 1+8K2+16=14.95
K1=-12.002 K2=17.87
state feedback gain matrix then becomes
U(∞)=0
20
MODERN CONTROL SYSTEM PROJECT
𝐬+𝟒 𝐊e1 − 𝟒
Then, |sI - A + Ke C|=|( )|=0
−𝟖 𝐊e2 + 𝒔 + 𝟏𝟐
= S2 +(16+ Ke2)S+8Ke1+4Ke2+16 = 0----------------------(11)
16+Ke2=19.996,
Ke2=3.996
8Ke1+4Ke2+16=373.86
Ke1=42.73
𝟒𝟐. 𝟕𝟑
Observer gain matrix then becomes Ke=( )
𝟑. 𝟗𝟗𝟔
̃̇ = (A - Ke C) 𝒉
𝒉 ̃ + Bu + Key------------------(13)
̃̇ = (A - KeC- BK)𝒉
𝒉 ̃ + Key
21
MODERN CONTROL SYSTEM PROJECT
̃̇ −4 4 42.73 (0 1 ̃ 42.73
(𝒉1) =(( )-( ) 1)-( ) ∗ (−12.002 17.86)) (𝒉𝟏)+( )y
̇𝒉
̃2 8 − 12 3.996 0 ̃
𝒉𝟐 3.996
The observer equation becomes
Since the Block diagram representation of system with a controller-observer is given by the
following diagram, the transfer function of the observer-controller is then, Transfer function of
the observer-controller becomes;
𝐔(𝐬)
=
−𝐘(𝐬)
22
MODERN CONTROL SYSTEM PROJECT
A=[-4 4; 8 -12];
B=[1;0];
C=[0 1];
D=[0];
SS=ss(A,B,C,D)
step (SS)
Observed-state feedback control system the dynamics of the observed-state feedback control
24
MODERN CONTROL SYSTEM PROJECT
Figure 20 (a) Plant response Figure 20 (b) Plant state space response
As the filling process begins, the rate at which height two reaches the rise time value quicker
but the rise time value of h1 is greater than h2. Again, height two will reach its peak value faster
than h1 but the value of h1 is still greater. H1 seem to reach stability faster than h2 and the
steady state value of h1 remains greater than that of h2 for the rest of the system operation.
26
MODERN CONTROL SYSTEM PROJECT
27
Figure 22 Observer K
MODERN CONTROL SYSTEM PROJECT
28