You are on page 1of 33

Ministry of Higher Education

Egyptian Academy for Engineering & Advanced Technology (EAEAT)


Affiliated by Ministry of Military Production

Department Mechatronics department


Academic Year 2019 -2020
Course name Digital Control
Course code MEC356

Final Research Project

By
Name ID
1 Mohammed Ahmed Riad 2016159
2 Karim Tarek Mohammed 2016147
3
4 Ahmed Amr Ahmed 2016032

Supervised By: Dr . Amin Danial

Abstract
Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

Table of Contents

Subject / section Page


Introduction
Literature Review
Problem statement
Design procedure
Results
Conclusion
References

List of Figure

N.O Description page N.O Description page


Figure1 Figure15

Doc Name Page | 1


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

Figure2 Figure16
Figure3 Figure17
Figure4 Figure18
Figure5 Figure19
Figure6 Figure20
Figure7 Figure21
Figure8 Figure22
Figure9 Figure23
Figure10 Figure24
Figure11 Figure25
Figure12 Figure26
Figure13 Figure27
Figure14 Figure28

Introduction

PID controller is by far the most popular control algorithm. Most feedback loops It is controlled
by this algorithm or slight differences. It is implemented in many Various formats, such as PC
standalone controller, PLC, DCS and mini controller As part of a DDC (Direct Digital Control)

Doc Name Page | 2


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

package or distributed hierarchical process Control system. Several thousand instrumentation and
control engineers around the world These consoles are used in daily work. The PID algorithm
can be approached In many different directions. It can be seen as a device that can be operated
with Some general rules, but can also be dealt with through analysis. Implement a PID control
The law consists of applying the sum of three types of control procedures correctly and they are a
Proportional, integrated and derived.

PID Stands for :


 P :Proportional
 I :Integral
 D :Derivative

 The advantage of PID controls is their general applicability to most control systems.

 In particular, when the factory mathematical model is unknown and therefore analytical

design methods cannot be used, PID controls prove to be very useful.

 In the field of process control systems, it is well known that basic and modified PID control

schemes have proven useful in providing satisfactory control, although they may not provide

optimal control in many situations.

 It is interesting to note that more than half of the industrial controllers used today are PID

controllers or modified PID controllers.

 Since most of the on-site PID controllers have been modified, many different types of tuning

rules have been suggested in the literature.

Doc Name Page | 3


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

 With these tuning rules, precise and accurate PID control can be performed on-site.

PD Control:

Proportional Plus Derivative control (PD)

The stability and overshoot problems that arise when a proportional controller is used at high gain can be

reduced by adding a term proportional to the time-derivative of the error signal. The value of the damping

can be adjusted to achieve a critically damped response.

Figure (1)

 The higher the error indication change rate, the faster the final control will be placed over the

required value.

Doc Name Page | 4


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

 The added derived procedure reduces the initial bypass of the measured variable, and thus

helps stabilize the process sooner.

 This control method is called relative control in addition to the derivative (PD) because the

derivative section responds to the rate of error signal variation.

 You can think of derivative control as a raw prediction of a future error, based on the current

tendency of the error.

Literature Review

PI and PID controllers have been at the heart of Control Engineering practices for the last seventy
five years. The first setting rule for setting up console parameters It was defined in 1934 by
Callender. The historical work of Callendar is not Available to readers and referenced in. Method
0f includes Relative-control (PD) controller for a precisely designed process by means of a
merge tool In addition to the delay time. Later, Calendar and co-authors suggested graphs to
allow Adjust PID controllers, assuming the process is precisely engineered by FOPDT Form. The
adjustment procedure suggested by Callendar et al. As follows, consider A process designed as
FOPDT as,

K −t s
G p ( s) = e d

Ts+1

where, K, t d and T represent gain, delay time and time constant of the process respectively. The
design of PID controllers was performed using the ideal structure of controller

Problem statement

We have a plant of system. The system need a controller that should satisfy the following
condition for the dominate poles; maximum overshoot is 5%, the settling time ≤ 2, and the static
velocity error Kv≥ 5 sec-1

Doc Name Page | 5


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

Design procedure

The system consist of two main parts:

1-The plant of system 2-The controller

First step we need to substitute with av=6 in the plant, then get value initial value of(K P) of the
controller by mathematical method, then simulating the continuous system on MATLAB, and
tuning the curve to get the suitable values of (KP), (KD) of (PD controller) to get maximum over
shoot =5% and settling time >=2sec.

Then we need to discretize the system this operation is done in many steps:

1) Discretize the plant by using the Zero order hold method


2) Discretize the controller by using three different ways
a) Backward approximation
b) Bilinear approximation
c) Forward approximation

Then, implement the system for each kind of approximation with the digital controller for each

sample time. the sample time need is (T=10, 1, 0.1, 0.01, 0.001). And realize the digital

controller with by digital programming and implement the system one more time.

The plant:

av 6
G(s)plant= @av=6 G(s)plant=
s¿¿ s (s +0.6 √ 6)

The controller (PD controller):

The PD controller in continuous phase is(KP+KDs)

Should have achieve to the system max over shoot=5%, the settling time =<2 and kv >5 sec-1

Doc Name Page | 6


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

6
Gs =
s (s +0.6 √ 6)

6
G s ( s) 2
s + 0.6 √ 6 s 6
Tf = = = 2
1+ G s ( s) 6 s + 0.6 √ 6 s+ 6
1+ 2
s +0.6 √ 6 s

ω n2
Tf = 2 2
s + 2ζ ω n s+ ωn

ω n= √ 6 , 2 ζ ωn = 0.6√ 6

ζ = 0.3

4 4∗2
settling time = t s= = = 5.44 s
ζ ωn 0.6 √ 6

−ζπ −0.3 π
Maximum overshoot : M p= e √ 1−ζ = e √ 1−(0.3) =37.23%
2 2

6
Static velocity error : k v = lim ¿s → 0 ¿ sG s = lim ¿s → 0 ¿ s * = 4.082 sec−1
s (s +0.6 √ 6)

Gc = k p+k ds

6(k p +k d s)
G ¿s)=Gc *G s =
s (s +0.6 √ 6)

6(k p +k d s)
k v = lim ¿s → 0 ¿ sG ¿s) = lim ¿s → 0 ¿ s* >5
s (s +0.6 √ 6)

6kp
> 5 → k p> 1.23
0.6 √ 6

G(s) 6(k p + k d s)
Tf = = 2
1+ G(2) s + ( 0.6 √ 6+6 k d ) s+6 k p

Doc Name Page | 7


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

2 ζ ωn = 0.6√ 6 +6k d

4∗2
t s= < 2 → k d > 0.422
0.6 √ 6+6 k d

Mos


ln 2 ⁡(
)
Ƞ= 100
2 2 Mos
π +ln ⁡( )
100

6kp=wn2 kp= wn2/6 =2.8982/6 KP =1.399734

2Ƞwn=6kD+1.47 KD= (2ȠWn – 1.469)/6 KD=0.4217

KV: to check if it in the range of (KV)>=5 sec-1

G(s)open loop=6(KP+KDs) /s(s+1.47)

2.5302 s+ 8.04
KV=limS→0sG(s) =lims→0 s( ) KV=5.872 so, it is in the range
s ( s+1.369 )

By applying this system on MATLAB and using the tuner to get a more suitable KP & KD values

The new KP & KD: KP=1.4743 & KD=0.63813

G(s)controller=KP+KDs= 1.4743+0.63813s

Doc Name Page | 8


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

Figure (2)

1) Discretizing the plant


Discretizing the plant by using the zero order hold method
6
1/s * G(s)plant = = A/s + B/s2 + C/(s+1.469)
s 2(s+ 1.469)
@ s=0 B=4.08 @s=-1.469 c=2.7770 @s=1 A=-2.775

Then convert it to Z- domain:


-2.77z/(z-1) + 4.08Tz/(z-1)2 +2.77z/(z-e-1.469T)
Then the G(z)plant= [1-z-1]*[ -2.77z/(z-1) + 4.08Tz/(z-1)2 + 2.77z/(z-e-1.469T)]
4.08 T 2.77( z−1)
G(z)plant= -2.77 + +
(z −1) (z−exp ⁡(−1.469 T ))
2) Discretizing the controller (PD controller):
The discretizing of the controller is made by using three types of approximations
1. Backward approximation
2. Bilinear approximation

Doc Name Page | 9


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

3. Forward approximation

First type, discretizing by Backward approximation:

To discretizing by the backward approximation substitute with [ S=(z-1)/zT ]in the G(s)controller

where (T):is the time sample and substitute with (T)=10,1,0.1,0.01,0.001 sec.

0.638 z −0.638
G(s)controller=KP+KDs= 1.4743+0.63813s ====== G(z)controller=1.4743+( )
zT

0.638 z −0.638
@T=10 ==== G(z)controller=1.4743+( )
10 z

0.638 z −0.638
@T=1 ==== G(z)controller=1.4743+( )
z

0.638 z −0.638
@T=0.1 ==== G(z)controller=1.4743+( )
0.1 z

0.638 z −0.638
@T=0.01 ==== G(z)controller=1.4743+( )
0.01 z

0.638 z −0.638
@T=0.001 ==== G(z)controller=1.4743+( )
0.001 z

Then the system when simulated on the MATLAB

@T=10

Doc Name Page | 10


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

Figure (3)

@T=1

Figure (4)

Doc Name Page | 11


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

@T=0.1

Figure (5)

Doc Name Page | 12


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

@T=0.01

Figure (6)

@T=0.001

Figure (7)

Realizing the digital controller (Backward Approximation) by direct programming method:


0.638 z −0.638
G(z)controller = [1.4743+( )]*(z-1/z-1) = ¿)*( z-1/z-1)
zT
Doc Name Page | 13
Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

1.4743T +0.638−0.638 z −1 1.4743T +0.638 0.638 -1


= = - z
T T T
0.63813 0.63813 -1
= 1.4743+ - z
T T

Then, substitute with (T)=10,1,0.1,0.01,0.001 sec. And simulate the system on MATLAB

@T=10

Figure (8)

@T=1

Doc Name Page | 14


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

Figure (9)

@T=0.1

Figure (10)

Doc Name Page | 15


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

@T=0.01

Figure (11)

@T=0.001

Figure (12)

Doc Name Page | 16


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

Second type, discretizing by Bilinear approximation:

z−1
To discretizing by the backward approximation substitute with S=(2/T)( ) in the G(s)controller
z+ 1

where (T):is the time sample and substitute with (T)=10,1,0.1,0.01,0.001 sec.

z−1
G(s)controller=KP+KDs= 1.4743+0.63813s ====== G(z)controller=1.4743+(1.27626/T) )( )
z+ 1

1.27626 z−1.27626
G(z)controller=1.4743+( )
Tz+T

1.27626 z−1.27626
@T=10 G(z)controller=1.4743+( ) , @T=0.01 G(z)controller=1.4743+(
10 z+10

1.27626 z−1.27626
)
0.01 z+ 0.01

1.27626 z−1.27626
@T=1 G(z)controller=1.4743+( ) , @T=0.001 G(z)controller=1.4743+(
z+ 1

1.27626 z−1.27626
)
0.001 z+0.

1.27626 z−1.27626
@T=0.1 G(z)controller=1.4743+( )
0.1 z+ 0.1

Then, simulate the system on MATLAB

@T=10

Doc Name Page | 17


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

Figure (13)

@T=1

Figure (14)
Doc Name Page | 18
Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

@T=0.1

Figure (15)

Doc Name Page | 19


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

@T=0.01

Figure (16)

Doc Name Page | 20


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

@T=0.001

Figure (17)

Realizing the digital controller (Bilinear Approximation) by direct programming method:

1.27626 z−1.27626 1.4743 [ Tz +T ] +1.27626 z−1.27626


G(z)controller=1.4743+( ) =( )*(z-1/z-1)
Tz+T Tz +T

1.4743 [ T +T ( z−1 ) ] +1.27626−1.27626( z−1) 1.27626


= = (1.4743+ +[1.27626-
T +T ( z−1 ) T
1.27626 -1
]z ) / (1+z-1)
T

Then, substitute with (T)=10, 1, 0.1, 0.01, 0.001 sec. And simulate the system on MATLAB

Doc Name Page | 21


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

Figure (18)

@T=10

Figure (19)

@T=1

Doc Name Page | 22


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

Figure (20)

@T=0.1

Figure (21)

Doc Name Page | 23


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

@T=0.01

Figure (22)

@T=0.001

Figure (23)

Doc Name Page | 24


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

Third type, Discretizing by Forward approximation:


z−1
To discretizing by the forward approximation substitute with [S= T ]in the
G(s)controller
where (T):is the time sample and substitute with (T)=10,1,0.1,0.01,0.001 sec.
Z−1
G(S) = KP + KDs =========== G(Z)=KP +KD( T )

0.638 z −0.638
@T=10 ===== G(z)controller=1.4743+( 10
)

0.638 z −0.638
@T=1 ===== G(z)controller=1.4743+( 1
)

0.638 z −0.638
@T=0.1 =====G(z)controller=1.4743+( 0.1
)

0.638 z −0.638
@T=0.01 ====G(z)controller=1.4743+( 0.01
)

0.638 z −0.638
@T=0.001 ====G(z)controller=1.4743+( 0.001
)

But before simulate the system we need combine the controller and the plant in one
fraction because; that the controller’s nominator is bigger than dominator.
4.08 T (Z−1) 2.78(Z−1)
= -2.77 + +
( Z−1)2 Z−e−1.469T

4.08 T 2.78(Z−1)
= -2.77 + +
( Z−1) Z−e−1.469T

4.08 T ( Z−e−1.469 T ) +2.77 (Z−1)2


= -2.77 +
( Z−1) ( Z−e−1.469 T )

−2.77 ( Z−1 ) ( Z−e−1.469 T ) + 4.08T ( Z −e−1.469T ) +2.77(Z−1)2


=
(Z−1) ( Z −e−1.469T )

(−2.77 Z+ 2.77) ( Z−e−1.469 T ) + 4.08 TZ−4.08 T e−1.469 T +2.77 (Z−1)2


=
(Z−1) ( Z−e−1.469 T )

Doc Name Page | 25


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

Where, y = -1.469T

Plant:

Z [ −2.777+2.777 e y +4.08 T ] + 2.777−4.08T e y −2.777 e y


z 2−z [ e y +1 ] +e y

Controller:

k p T + k d Z −k d [ 1.479 T −0.638 ] +0.638 Z


=
T T

System = plant * controller

Z [ −2.777+2.777 e y +4.08 T ] + 2.777−4.08T e y −2.777 e y [ 1.479 T −0.638 ] +0.638 Z


( )*( )
2 y
z −z [ e +1 ] +e y
T

=
z2 [ −1.772+1.772 e y +2.6033 T ]+ Z [ −6.697T +1.49 T e y + 6.015T 2 +3.544−3.544 e y ]+ 4.094 T −6.015 T 2 e y −1
T z 2−z [ Te y +T ] +T e y

Then the system when simulated on the MATLAB

@T=10

Doc Name Page | 26


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

Figure (24)

Doc Name Page | 27


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

@T=1

Figure (25)

Doc Name Page | 28


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

@T=0.1

Figure (26)

Doc Name Page | 29


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

@T=0.01

Figure (27)

@T=0.001

Figure (28)
Doc Name Page | 30
Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

Result
After presenting the graphs which is outcome from simulating the systems on MATLAB show

the following:

after discretizing the plant by zero hold method and discretize the controller

1. After discretizing the controller by Backward approximation and implement the system (with
realizing using digital controller or without realizing) the final graph is similar to the graph
which is outcome of the continuous system at all sample time except at sample time (T=1)
&(T=10), because the sample time is big. the system is un stable at sample time (T=10)
&(T=1).
2. After discretizing the controller by Bilinear approximation and implement the system (with
realizing using digital controller or without realizing) the final graph is similar to the graph
which is outcome of the continuous system at all sample time except at sample time (T=1)
&(T=10), because the sample time is big. The system is un stable at sample time (T=10)
&(T=1).
3. Discretizing by forward approximation.

Conclusion

In this paper we need to create a controller to a system, but the controller should satisfy some
Conditions for the poles the system (maximum overshoot is 5%, the settling time ≤ 2, and the static
velocity error Kv≥ 5 sec-1 ) .we create a PD controller suitable for this system .we choose PD controller;
when using a proportional controller the maximum over shoot of the system increased so, The added
derivative action reduces initial overshoot of the measured variable, and therefore aids in stabilizing the
process sooner. Then we discretize the system. we discretize the plant by using Zero-order hold method
and discretize the PD controller by three different ways (Backward approximation, Bilinear
approximation, forward approximation), then simulate these systems MATLAB at sample time (T=1, 1,
0.1, 0.01, 0.001), then compare between the output graph in each system, the graphs show that at
discretization by Backward & Bilinear approximation (at realizing using direct programing or without
realizing) the graph is similar to the graph at continuous phase. But because the sample time is big at
sample time (T=10 & T=1) the system is un stable so the graph is different of continuous phase
and at forward.

Doc Name Page | 31


Ministry of Higher Education
Egyptian Academy for Engineering & Advanced Technology
Affiliated to the Ministry of Military Production

References

Doc Name Page | 32

You might also like