2015-Im-25 Ic Cep

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

University of Engineering and Technology, Lahore

CEP - Instrumentation & Control

Submitted by:
Zaib Hassan
2015-IM-25
Submitted to:
Dr. Prof. Mohammad Pervez Mughal

Department of Industrial &Manufacturing Engineering


CEP- Instrumentation & Control

`“CEP- Instrumentation & Control”


Cruise Control System

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

Fig.(a) Schematic Block Diagram of Cruise Control System.

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

Case I: A system without controller with no disturbance


Block diagram:

Ds
+
Us K + 1
+
Ys
(𝑠 + 2)(𝑠 + 8)
-

Fig.(b) Block Diagram of Cruise Control System

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

Control Conical Form


Let,
X1 = y ; X2 = X1’

X1’ 0 1 X1 0
+ [Us]
X2’ -16-K -10 X2 1

Output Equation:
X1
𝑌(𝑠) K 0 X2 + 0 * [Us]

Signal Flow Diagram:


The signal flow diagram of “Control Conical Form” is:
1 1/s 1/s K
Us Ys
X2’ X2 X1

-10

-16-K

Steady State Error:


As, we have an TYPE “0” system with unity feedback system,
𝑌(𝑠) 𝐾
= 2
𝑈(𝑠) 𝑠 + 10𝑠 + 16 + 𝐾
So,
1
Ess =
1+𝐾𝑝

4
CEP- Instrumentation & Control

Here,
Kp = lim G(s) (G(s) is the Transfer Function)
𝐾
Kp = lim
𝑠2 +10𝑠+16+𝐾
𝐾
Kp =
16+𝐾

Steady state error for different vale of K are:

Steady State Percentage


Error constant
K Error Steady State
(Kp)
(Ess) Error

1 5 0.23 0.81 81%


2 20 0.55 0.65 65%
3 50 0.75 0.57 57%

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

Case II: System without controller with disturbance


Transfer Function:
Now, we have an disturbance D(s) and the transfer function will be calculated from block
diagram by using Mason’s Rule, which is:
1
𝑌(𝑠) (𝑠 + 2)(𝑠 + 8)
=
𝑈(𝑠) 1 + [𝐾 ∗ 1
]
(𝑠 + 2)(𝑠 + 8)
𝑌(𝑠) 1
= 2
𝑈(𝑠) 𝑠 + 10𝑠 + 16 + 𝐾

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

ii- Observer Conical Form

Control Conical Form:


Let.

X1 = y ; X2 = X1’

X1’ 0 1 X1 0
+ [Us]
X2’ -16-K -10 X2 1

Output Equation:
X1
+ 0 * [Us]
𝑌(𝑠) 1 0 X2

Signal Flow Diagram:


Here, we have the signal flow diagram of Control Conical form,

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).

Steady State Error:


As we have an TYPE “0” system with unity feedback:
𝑌(𝑠) 𝐾
= 2
𝑈(𝑠) 𝑠 + 10𝑠 + 16 + 𝐾

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

1 5 0.05 0.95 95%


2 20 0.03 0.97 97%
3 50 0.015 0.98 98%

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

Case III: System with PI controller


There are different controllers which are used to get different responses in different
situations, like:
1. PI controller
2. PD controller
3. PID controller
The use of these controllers depends upon the system and desired output (speed) which we
want.
As from the step response and root locus of Case-I. We come to know that, our system is
already stable with greater steady state error. We need to reduce the error less than 1%
with overshoot <5%. We will use the PI controller for our automobile system to get a
constant speed for certain interval of time.

- Addition of PI Controller:
Here the controller will be:
G(c) = Kp + (Ki/s)
Let set some values which we want,

 Change the system type from “0” to “1”


 Steady State Error = 25%
 Overshoot = < 5%
 Ts < 1.5
 Centroid should be less than 2.6 (if any)
These set constraints will give us the specific output (speed) and at the end we will come to
know that at what values of Kp and Ki in PI controller we will fulfill our all requirments.
As, from the schematic diagram we will get a new block diagram with PI controller,

1
Us Kp+(ki/s) Ys
+ (𝑠 + 2)(𝑠 + 8)
-

Fig.(c) Block Diagram of PI controlled System

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,

Ѡ𝒏 = 𝟑. 𝟕𝟕

As, we are using the PI controller, so:


𝐾𝑝∗𝑠 + 𝐾𝑖
G(c) =
𝑠

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+𝐾𝑝)𝑠+𝐾𝑖

Steady State Error:

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

from here we get that,


Ki >0 ; Kp>0
and
160+10𝐾𝑝−𝐾𝑖
=0
10
160 + 10Kp - Ki =0 …………(2)

As, from steady state error:


Kv = 4
and Kv = lim s*G(c)*G(s) = 4
(𝐾𝑝∗𝑠 + 𝐾𝑖) 1
Kv = lim s* ∗
𝑠 (𝑠+2)(𝑠+8)

By putting the limit s approaches to 0,


𝐾𝑖
Kv = =4
(2)(8)

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

Let, we add a zero at location of 2.5 and pole at origin. So,


𝐾𝑝(𝑠+2.5)
1 + ( 𝑠(𝑠+2)(𝑠+8)) = 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

Case IV: System with PD controller


Here the controller will be,

G(c) = Kp + Kds
So, the block diagram will be:

1
Us Kp+kds Ys
+ (𝑠 + 2)(𝑠 + 8)
-

Fig.(d) Block Diagram of PD Controlled System


Now, as we the type “0” system. And by using PD controller, we added one zero.

Transfer Function:
𝑌(𝑠) 𝐾𝑝+𝐾𝑑𝑠
T.F = =
𝑈(𝑠) 𝑠2 +(10+𝐾𝑑)𝑠+16+𝐾𝑝

Steady State Error:


As we have the system of Type “0”. So, there will be apposition error,
1
E(ss) =
1+𝑘𝑝
Here,
kp = lim Gs (Gs is the Transfer Function)
𝐾𝑝+𝐾𝑑𝑠
kp = lim
𝑠2 +(10+𝐾𝑑)𝑠+16+𝐾𝑝
𝐾𝑝
kp =
16+𝐾𝑝

14
CEP- Instrumentation & Control

so by putting different values of kp we will the behavior of PD controller.

Percentage
Error constant Steady State Error
Kp Steady State
Kp Ess Error

1 1 0.05 0.95 95%


2 5 0.23 0.80 80%
3 8 0.33 0.75 75%

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

from here we get that,


Kd > -10 ; Kp> -16

By setting Kd=Kp=1, so:


It will be unconditionally stable.
Program:
%with PD controller
n=[1];
d=[1 10 16];
G=tf(n,d);
H=[1];
Kp=5;
Ki=0;
Kd=1;
Gc=pid(Kp,Ki,Kd);
M=feedback(G*Gc,H);
step(M)

15
CEP- Instrumentation & Control

Root locus
See Fig.6.1

Step response
See Fig.6.2

Bode plot
See Fig.6.3

Case V: System with PID controller

Here the controller will be,

G(c) = Kp + Kp/s + Kds


Here, the block diagram will be,

1
Us Kp+Ki/s+kds Ys
+ (𝑠 + 2)(𝑠 + 8)
-

Fig.(e) Block Diagram of PID Controlled System


Now, as we have the type “0” system. And by using PID controller, we may change its type
by adding a pole on (0) at origin. But here we let type “0” as it is by adding a pole at -3 and
we added the complex zero’s at (s + 1.8 + 1j).

Transfer Function:
𝑌(𝑠) (𝑠+1.8+1𝑗)(𝑠+1.8−1𝑗)
T.F = =
𝑈(𝑠) (𝑠+3)(𝑠+2)(𝑠+8)

Steady State Error:


As we have the system of Type “0” with unity feedback system. So, there will be a position
error
1
E(ss) =
1+𝑘𝑝

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

As, no sign changes so it is unconditionally, stable.

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

Figures for Case I


 Step Response: Root Locus:
Step Response of transfer function: Root locus of controller function:

Fig 1.1 Step Response Fig 1.2 Root Locus

 Bode Plot:
Bode plot of controlled system is:

Fig 1.3 Bode Plot Fig.1.4 Simulink Time Response

Fig. 1.5 Operating Parameters

19
CEP- Instrumentation & Control

Figures for Case II


 Step Response: Root Locus:
Step Response of transfer function: Root locus of controller function:

Fig 2.1 Step Response Fig 2.2 Root Locus

 Bode Plot:
Bode plot of controlled system is:

Fig 2.3 Bode Plot

20
CEP- Instrumentation & Control

Figures for Case III


 Step Response: Root Locus:
Step Response of transfer function: Root locus of controller function:

Fig 3.1 Step Response Fig 3.2 Root Locus

 Bode Plot:
Bode plot of controlled system is:

Fig 3.3 Bode Plot Fig.3.4 Simulink Time Response

Fig. 3.5 Operating Parameters

21
CEP- Instrumentation & Control

Figures for Case III-A


 Step Response: Root Locus:
Step Response of transfer function: Root locus of controller function:

𝑌(𝑠) 𝑠+1.75
T.F = =
𝑈(𝑠) 𝑠3 +10𝑠2 +11𝑠+17.75

Fig 4.1 Step Response Fig 4.2 Root Locus

 Bode Plot:
Bode plot of controlled system is:

Fig 4.3 Bode Plot

22
CEP- Instrumentation & Control

Figures for Case III-B


 Step Response: Root Locus:
Step Response of transfer function: Root locus of controller function:

𝑌(𝑠) 𝑠+9
T.F = =
𝑈(𝑠) 𝑠3 +13𝑠2 +47𝑠+73

Fig 5.1 Step Response Fig 5.1 Root Locus

 Bode Plot:
Bode plot of controlled system is:

Fig 5.3 Bode Plot

23
CEP- Instrumentation & Control

Figures for Case IV


 Step Response: Root Locus:
Step Response of transfer function: Root locus of controller function:

Fig 6.1 Step Response Fig 6.2 Root Locus

 Bode Plot:
Bode plot of controlled system is:

Fig6.3 Bode Plot Fig.6.4 Simulink Time Response

Fig. 6.5 Operating Parameters

24
CEP- Instrumentation & Control

Figures for Case V


 Step Response: Root Locus:
Step Response of transfer function: Root locus of controller function:

Fig 7.1 Step Response Fig 7.2 Root Locus

 Bode Plot:
Bode plot of controlled system is:

Fig 7.3 Bode Plot Fig.7.4 Simulink Time Response

Fig. 7.5 Operating Parameters

25

You might also like