Professional Documents
Culture Documents
2015-Im-25 Ic Cep
2015-Im-25 Ic Cep
2015-Im-25 Ic Cep
Submitted by:
Zaib Hassan
2015-IM-25
Submitted to:
Dr. Prof. Mohammad Pervez Mughal
Objective:
To control the automobile speed select the best controller and examine the system’s
state space, signal flow diagram, steady state error, stability, step response, root
locus and bode plot.
Schematic diagram:
(Ds)
+
Desired Speed Cruise Controller + Automobile System Car Speed
(Us) + K 1 (Ys)
- (𝑠 + 2)(𝑠 + 8)
Sensor
1
We have an automobile system which has G(s) = , a sensor which gives us the
(𝑠+2)(𝑠+8)
feedback. Here it is unity feedback step response. We will use a controller to get our desired
speed.
In this report, we have applied the the cruise controller on an automobile system to control
and get the desired output speed. We have divided the system into 4 different cases which
are:
Case I: Without controller with no disturbance
Case II: Without controller with disturbance
Case III: With PI controller with set requirments
Case IV: With PD controller
Case V: With PID controller
2
CEP- Instrumentation & Control
Ds
+
Us K + 1
+
Ys
(𝑠 + 2)(𝑠 + 8)
-
Transfer Function:
Let, we have an input source Us;
Then, the transfer function from block diagram can be calculated by Mason’s Rule:
1
𝑌(𝑠) 𝐾∗
(𝑠 + 2)(𝑠 + 8)
=
𝑈(𝑠) 1 + [𝐾 ∗ 1
]
(𝑠 + 2)(𝑠 + 8)
𝑌(𝑠) 𝐾
= 2
𝑈(𝑠) 𝑠 + 10𝑠 + 16 + 𝐾
State Space:
As, we have the transfer function,
𝑌(𝑠) 𝐾
= 2
𝑈(𝑠) 𝑠 + 10𝑠 + 16 + 𝐾
Divide both numerator and denominator by (s2),
𝑌(𝑠) 𝐾 𝑠 −2
=
𝑈(𝑠) 1 − [−10𝑠 −1 − (16 + 𝐾) 𝑠 −2]
Now, there are two forms of state space:
i- Control Conical Form
ii- Observer Conical Form
3
CEP- Instrumentation & Control
X1’ 0 1 X1 0
+ [Us]
X2’ -16-K -10 X2 1
Output Equation:
X1
𝑌(𝑠) K 0 X2 + 0 * [Us]
-10
-16-K
4
CEP- Instrumentation & Control
Here,
Kp = lim G(s) (G(s) is the Transfer Function)
𝐾
Kp = lim
𝑠2 +10𝑠+16+𝐾
𝐾
Kp =
16+𝐾
Here, it is noted that greater the value of gain “K”; greater will be the error constant “Kp”
and lesser will be the steady state error. But here is the limitation that greater value of “K”
leads our system towards the unstability (move the locus towards the imaginary axis)
Stability:
To determine the stability of our system we use the Ruth table. As our transfer is:
𝑌(𝑠) 𝐾
= 2
𝑈(𝑠) 𝑠 + 10𝑠 + 16 + 𝐾
s2 1 16+K
s1 10 0
s0 16+K
So,
16+K > 0
K>0
5
CEP- Instrumentation & Control
Program:
%without controller with no disturbance
K=1;
n=[K];
d=[1 10 16+K];
G=tf(n,d);
step(G);
rltool(G)
Root locus
See Fig.1.1 &Fig 1.4
Step response
See Fig.1.2
Bode plot
See Fig.1.3
State-space:
As, we have the transfer function with disturbance is,
𝑌(𝑠) 1
= 2
𝑈(𝑠) 𝑠 + 10𝑠 + 16 + 𝐾
Divide both numerator and denominator by (s2):
𝑌(𝑠) 1 𝑠 −2
=
𝑈(𝑠) 1 − [−10𝑠 −1 − (16 + 𝐾) 𝑠 −2]
As, there are two forms of state space:
i- Control Conical Form
6
CEP- Instrumentation & Control
X1 = y ; X2 = X1’
X1’ 0 1 X1 0
+ [Us]
X2’ -16-K -10 X2 1
Output Equation:
X1
+ 0 * [Us]
𝑌(𝑠) 1 0 X2
1 1/s 1/s 1
Us Ys
X2’ X2 X1
-10
-16-K
As the denominator of in both cases are same ( i.e. 𝑠 2 + 10𝑠 + 16 + 𝐾). So, the range of
Gain “K” is also remains same (K > 0).
7
CEP- Instrumentation & Control
So,
1
Ess =
1+𝐾𝑝
Here,
Kp = lim Gs (Gs is the Transfer Function)
1
Kp = lim
𝑠2 +10𝑠+16+𝐾
1
Kp =
16+𝐾
Steady state error for different vale of K are:
Percentage
Error constant Steady State Error
K Steady State
Kp Ess
Error
Here, it is the different case, that greater the value of gain “K”; lesser will be the error
constant “Kp” and greater will be the steady state error.
Program:
%without controller with disturbance
K=5;
n=[1];
d=[1 10 16+K];
G=tf(n,d);
step(G);
rlocus(G)
Root locus
See Fig.2.1
Step response
See Fig.2.1
Bode plot
See Fig.2.1
8
CEP- Instrumentation & Control
- Addition of PI Controller:
Here the controller will be:
G(c) = Kp + (Ki/s)
Let set some values which we want,
1
Us Kp+(ki/s) Ys
+ (𝑠 + 2)(𝑠 + 8)
-
9
CEP- Instrumentation & Control
As,
1
G=
(𝑠+2)(𝑠+8)
P.O < 5%
Zeta = ɭ = 0.7
4
Ts = = 1.5
ɭ∗Ѡ𝑛
4
Ts = = 1.5
0.7 ∗Ѡ𝑛
From here,
Ѡ𝒏 = 𝟑. 𝟕𝟕
Now, as we have to change the type of system to “1”. So, the one pole by using PI controller
will be added on origin.
Transfer Function:
𝑌(𝑠) 𝐾𝑝∗𝑠+𝐾𝑖
T.F = =
𝑈(𝑠) 𝑠3 +10𝑠2 +(16+𝐾𝑝)𝑠+𝐾𝑖
As we have set the value of error “єss =0.25” and our system is of Type “1”. So,
1
Єss =
𝐾𝑣
From here we get the value of Kv, which is:
1
Kv = =4
0.25
Stability:
By using the Ruth table:
10
CEP- Instrumentation & Control
s3 1 16+Kp
s2 10 Ki
160+10𝐾𝑝−𝐾𝑖
s1 0
10
s0 Ki
Ki = 64
So, we have found the range of Ki,
0 < Ki < 64
And as,
𝛴𝑃𝑖−𝛴𝑍𝑖
Centroid = σn =
𝑛𝑃−𝑛𝑍
And it should be less than -2.6 (as required)
𝐾𝑖
(0−2−8)−(− )
𝑘𝑝
σn = < -2.6
3−1
(Ki/kp) < 4.7
11
CEP- Instrumentation & Control
Characteristic Equation:
For closed loop,
1 + KGH = 0
𝐾𝑖
𝐾𝑝(𝑠+𝐾𝑝 )
1 + (1)( 𝑠(𝑠+2)(𝑠+8))(1) = 0
So, by varying value of Kp, our gain increase and location of asymptotes will vary. But we
are required to have overshoot less than 5%.
From the Fig.1,
We can see that by setting (Kp) of 25 and (Ki) of 64, we will be satisfying all the
requirements (i.e. O.S < 5%, zeta < 0.7, Ess < 25% and Ts < 1.5).
Program:
%with PI controller
n=[1];
d=[1 10 16];
G=tf(n,d);
H=[1];
Kp=25;
Ki=64;
Kd=0;
Gc=pid(Kp,Ki,Kd);
M=feedback(G*Gc,H);
step(M)
Root locus
See Fig.3.1 & Fig 3.5
Step response
See Fig.3.2
Bode plot
See Fig.3.3
12
CEP- Instrumentation & Control
Variation # 1
Now if change the positions of controller pole and zero,
z at -1.75 and p at 0
so our controller will,
(𝑠+1.75)
G(c) =
𝑠
So transfer fuction from block diagram 3 will be calculated by mason rules as:
𝑌(𝑠) 𝑠+1.75
T.F = =
𝑈(𝑠) 𝑠3 +10𝑠2 +11𝑠+17.75
Root locus
See Fig.4.1
Step response
See Fig.4.2
Bode plot
See Fig.4.3
Variation # 2
Now if change the positions of controller pole and zero,
z at -9 and p at -3
so our controller will,
(𝑠+9)
G(c) =
(𝑠+3)
So transfer function from block diagram 3 will be calculated by mason rules as:
𝑌(𝑠) 𝑠+9
T.F = =
𝑈(𝑠) 𝑠3 +13𝑠2 +47𝑠+73
Root locus
See Fig.5.1
Step response
See Fig.5.2
Bode plot
See Fig.5.3
13
CEP- Instrumentation & Control
G(c) = Kp + Kds
So, the block diagram will be:
1
Us Kp+kds Ys
+ (𝑠 + 2)(𝑠 + 8)
-
Transfer Function:
𝑌(𝑠) 𝐾𝑝+𝐾𝑑𝑠
T.F = =
𝑈(𝑠) 𝑠2 +(10+𝐾𝑑)𝑠+16+𝐾𝑝
14
CEP- Instrumentation & Control
Percentage
Error constant Steady State Error
Kp Steady State
Kp Ess Error
As, the Kp increases the steady state error decreases but its % overshoot and peak time
increases with deceasing the rise time and stability time. As shown in Fig !!!
Stability:
By using the Ruth table:
𝒔𝟐 + (𝟏𝟎 + 𝑲𝒅)𝒔 + 𝑲𝒑 + 𝟏𝟔
s2 1 Kp+16
s1 10+Kd 0
s0 Kp+16
15
CEP- Instrumentation & Control
Root locus
See Fig.6.1
Step response
See Fig.6.2
Bode plot
See Fig.6.3
1
Us Kp+Ki/s+kds Ys
+ (𝑠 + 2)(𝑠 + 8)
-
Transfer Function:
𝑌(𝑠) (𝑠+1.8+1𝑗)(𝑠+1.8−1𝑗)
T.F = =
𝑈(𝑠) (𝑠+3)(𝑠+2)(𝑠+8)
16
CEP- Instrumentation & Control
Here,
kp = lim Gs (Gs is the Transfer Function)
(𝑠+1.8+1𝑗)(𝑠+1.8−1𝑗)
kp = lim
(𝑠+3)(𝑠+2)(𝑠+8)
(4.24)
kp = = 0.0833
48
now, by putting the value of kp, we get:
1
E(ss) = = 0.918
1+0.0833
So, the steady state error of 91.8% occurs in PID controller at this position of controller
poles and zeros.
Stability:
By using the Ruth table:
s3 + 13s2 + 46s + 48
s3 1 46
s2 13 48
s1 42.3 0
s0 48
Program:
%with PID controller
n=[1];
d=[1 10 16];
G=tf(n,d);
H=[1];
nc=[1 3.6 4.24];
dc=[1 3];
Gc=tf(nc,dc);
M=feedback(G*Gc,H);
step(M);
rlocus(M)
17
CEP- Instrumentation & Control
Root locus
See Fig.7.1 & Fig 7.5
Step response
See Fig.7.2
Bode plot
See Fig.7.3
Conclusion:
By observing the behavior of different controls and their response on stability time and
overshoot. It is concluded that the PI controller will be used when a car is moving upward on a hill
and this controller will increase the speed. And when it is moving downward from hill, we will use
the PD controller to derivate (slows down) its speed.
18
CEP- Instrumentation & Control
Bode Plot:
Bode plot of controlled system is:
19
CEP- Instrumentation & Control
Bode Plot:
Bode plot of controlled system is:
20
CEP- Instrumentation & Control
Bode Plot:
Bode plot of controlled system is:
21
CEP- Instrumentation & Control
𝑌(𝑠) 𝑠+1.75
T.F = =
𝑈(𝑠) 𝑠3 +10𝑠2 +11𝑠+17.75
Bode Plot:
Bode plot of controlled system is:
22
CEP- Instrumentation & Control
𝑌(𝑠) 𝑠+9
T.F = =
𝑈(𝑠) 𝑠3 +13𝑠2 +47𝑠+73
Bode Plot:
Bode plot of controlled system is:
23
CEP- Instrumentation & Control
Bode Plot:
Bode plot of controlled system is:
24
CEP- Instrumentation & Control
Bode Plot:
Bode plot of controlled system is:
25