Control Exp 9 Student Manual

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

Experiment 9 Student Manual

American International University- Bangladesh


Department of Electrical and Electronic Engineering
EEE 4101: Control Systems Laboratory

Title: Design of a PI, PD controller and tuning of PID Controller.

Introduction:

A controller is one which compares controlled values with the desired values and has a function
to correct the deviation produced. Among many controllers, Proportional-integral-derivative
controllers are widely used in industrial control systems because of the reduced number of
parameters to be tuned. Besides, they provide many other advantages as mentioned below.

1. Controllers improve steady state accuracy by decreasing the steady state errors.
2. As the steady state accuracy improves, the stability also improves.
3. They also help in reducing the offsets produced in the system.
4. Maximum overshoot of the system can be controlled using these controllers.
5. They also help in reducing the noise signals produced in the system.
6. Slow response of the over damped system can be made faster with the help of these
controllers.

The transient response of a practical control system often exhibits damped oscillation before
reaching steady state value. In specifying the transient response characteristics of control
system to unit step input, it is common to specify the following

i) Delay Time (Td)


ii) Rise Time (Tr)
iii) Peak Time (TP)
iv) Maximum Overshoot (MP)
v) Settling Time (TS)

To fulfill the above properties and to meet the various conflicting and demanding design
specification, a control system usually requires some adjustment. This adjustment is called
tuning. There are many techniques available in literature for designing & tuning a Proportional-
Integral (PI) and Proportional-Derivative (PD) controller. In this experiment, designing of a PI
and PD controller will be discussed.

The main objectives of this experiment are following-


1. Design a PI controller
2. Design a PD controller
3. Tuning both PI and PD controller for faster response
4. Learn about PID controller tuning tool in MATLAB

Theory and Methodology:

Feedback Systems are very useful and widely used in amplifier circuits, oscillators, process
control systems as well as other types of electronic systems. But for feedback to be an effective
tool it must be controlled as an uncontrolled system will either oscillate or fail to function. Fig.
1 represents a cascade compensation system where PI or PD controller can be used as
compensator. The purpose of compensator is to make the error [E(s)] zero at steady state.

© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 1


Fig. 1. Cascade Compensation

PI Controller:

As the name suggests it is a combination of proportional and an integral controller the output
is equal to the summation of proportional and integral of the error signal.

Output of Controller = 𝐾𝑃 𝑒(𝑡) + 𝐾𝑖 ∫ 𝑒(𝑡)𝑑𝑡

𝐾𝑖 𝐾
Taking Laplace = 𝐾𝑃 𝐸(𝑠) + 𝐸(𝑠) = 𝐸(𝑠) [𝐾𝑃 + 𝑠𝑖 ]
𝑠

𝐾
Hence the transfer function of such controller is [𝐾𝑃 + 𝑠𝑖 ] and can be realized as shown in
Fig.2.

Fig.2. PI controller

Steady-state error can be improved by placing an open-loop pole at the origin, because this
increases the system type by one. For example, a Type 0 system responding to a step input with
a finite error responds with zero error if the system type is increased by one.

To see how to improve the steady-state error without affecting the transient response, look at
Fig. 3(a). Here we have a system operating with a desirable transient response generated by the
closed-loop poles at A.

© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 2


Fig. 3. Pole at A is (a) on the root locus without compensator; (b) not on the root locus with
compensator pole added; (c) approximately on the root locus with compensator pole and zero
added.

Now, if we add a pole at the origin to increase the system type, the angular contribution of the
open-loop poles at point A is no longer 180 degree and the root locus no longer goes through
point A, as shown in Fig. 3(b). To solve the problem, we also add a zero close to the pole at
the origin, as shown in Fig. 3(c). Now the angular contribution of the compensator zero and
compensator pole cancel out, point A is still on the root locus, and the system type has been
increased. Furthermore, the required gain at the dominant pole is about the same as before
compensation, since the ratio of lengths from the compensator pole and the compensator zero
is approximately unity. Thus, we have improved the steady-state error without appreciably
affecting the transient response. A compensator with a pole at the origin and a zero close to the
pole is called an ideal integral compensator.

© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 3


Hence, PI controller has following characteristics:
𝒔+𝒂
i) Generalized transfer function of PI compensator, 𝑮𝑪 = 𝒔
ii) It increases order of the system
iii) It increases TYPE of the system
iv) Zero at –a is small and negative
v) Active circuits are required to implement
vi) Steady state error reduces tremendously for same type of inputs.

In general this controller improves steady state part affecting the transient part.

PD Controller:

A controller in the forward path, which changes the controller output corresponding to
proportional plus derivative of error signal is called PD controller.
𝑑𝑒(𝑡)
i.e. Output of controller = 𝐾𝑃 𝑒(𝑡) + 𝐾𝑑 𝑑𝑡
Taking Laplace = 𝐾𝑃 𝐸(𝑠) + 𝑠𝐾𝑑 𝐸(𝑠) = 𝐸(𝑠)[𝐾𝑃 + 𝑠𝐾𝑑 ]

The transfer function of such controller is [𝐾𝑃 + 𝑠𝐾𝑑 ]. This can be realized as shown in fig.3.

Fig. 3. PD Controller

𝑛 𝜔 2
Let consider the plant, 𝐺(𝑠) = 𝑠(𝑠+2𝜉𝜔
𝑛)

Assuming KP =1, it can be written as follows.


(1 + 𝑠𝐾𝑑 )𝜔𝑛 2
𝐺(𝑠) =
𝑠(𝑠 + 2𝜉𝜔𝑛 )
𝐶(𝑠) (1+𝑠𝐾𝑑 )𝜔𝑛 2
And = 𝑠2 +𝑠[2𝜉𝜔 2 𝐾 ]+𝜔 2
𝑅(𝑠) 𝑛 +𝜔𝑛 𝑑 𝑛

Comparing denominator with standard form,


2𝜉 ′ 𝜔𝑛 = 2𝜉𝜔𝑛 + 𝜔𝑛 2 𝐾𝑑
𝜔𝑛 𝐾𝑑
𝜉′ = 𝜉 + 2
𝜔𝑛 𝐾𝑑
Because of this controller, damping ratio increases by factor 2
Steady state error,

𝐾𝑃 = lim 𝐺(𝑠)𝐻(𝑠) = ∞
𝑠→0

© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 4


𝜔𝑛
𝐾𝑉 = lim 𝑠𝐺(𝑠)𝐻(𝑠) =
𝑠→0 2𝜉

As there is no change in coefficients, error also will remain same.

Hence PD controller has following characteristics.

i) Generalized transfer function of PD compensator, 𝑮𝑪 = 𝒔 + 𝒁𝒄


ii) Zero at −𝑍𝐶 is selected to put design point on the root locus.
iii) It increases 𝜔𝑛 .
iv) ‘Zeta’ for system remains unchanged.
v) ‘TYPE’ of the system remains unchanged.
vi) It reduces settling time.
vii) Steady state error remains unchanged.
viii) Active circuits are required to implement.

In general PD controller improves transient part without affecting steady state.

Design Process:

PI Controller:

➢ First add a pole at origin.


➢ Now add a zero very close to the origin.
𝒔+𝒂
➢ Generalized transfer function of PI compensator, 𝑮𝑪 (𝒔) = 𝒔

PD Controller:

1. First evaluate the performance of the uncompensated system:

(a) ξ (zeta) is given, find dominant pole (old) from the root locus of uncompensated system,
𝑆𝑑𝑜𝑙𝑑 = −ξ𝜔𝑛 + 𝑗𝜔𝑛 √1 − ξ2
𝑆𝑑𝑜𝑙𝑑 = −𝜎𝑑 + 𝑗𝜔𝑑

4 4
(b) Now find old settling time, 𝑇𝑆𝑜𝑙𝑑 = ξ𝜔 = 𝜎
𝑛 𝑑

2. Evaluate the performance of the compensated system:

(a) From the question, find new 𝑇𝑆𝑛𝑒𝑤 and new 𝜔𝑛 [ξ will remain unchanged]
(b) Find dominant pole (new), 𝑆𝑑𝑛𝑒𝑤 = −ξ𝜔𝑛 + 𝑗𝜔𝑛 √1 − ξ2
𝑆𝑑𝑛𝑒𝑤 = −𝜎𝑑 + 𝑗𝜔𝑑
(c) Design the location of compensating zero, −𝑍𝐶
➢ Finding necessary angle (𝛳𝑍 ) to locate 𝑆𝑑𝑛𝑒𝑤 on root locus.
𝜔𝑑
➢ tan 𝛳𝑍 = 𝑍 −𝜎 then find, −𝑍𝐶
𝑐 𝑑

© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 5


Pre-Lab Homework:

You must solve the following questions and make a short report on that before the start of the
lab-
1. Different configurations of controllers and their applications
2. Get all the theoretical basics on active circuit and passive circuit realization of PI and
PD controller.

Apparatus:

Computer and MATLAB software installed in the Computer

Precautions:

Students should take the following precautions while conducting the experiment –

1. Check the computer if it is working; otherwise inform lab instructor,


2. Be careful while handling the power supply buttons of computers and to keep them off
when they are not needed,
3. Check if MATLAB is working correctly and beware of typing mistakes.

Experimental Procedure:

Problem Statement 1:
A unity negative feedback system which is operating with a closed loop response that has 58%
overshoot and the following transfer function:
𝑲
𝑮𝒖 (𝒔) = (𝒔+𝟏)(𝒔+𝟐)(𝒔+𝟏𝟎);
Now-
(a) Find the steady state error for a unit step input
(b) Design a PI controller to make the steady state error to zero.
(c) By using both theoretically and MATLAB codes show that steady state error becomes
zero?

Solution:

Fig. 4. Close loop feedback with PI controller


𝐾𝑖 𝑠+𝑎 𝐾
𝐺𝐶 (𝑠) = 𝐾𝑃 + = 𝐾𝑝 , where 𝑎 = 𝐾 𝑖
𝑠 𝑠 𝑝

As percentage of overshoot should be less than 15%,


© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 6
−𝜋𝜉
( ⁄ )
%𝑂. 𝑆 = 𝑒𝑥𝑝 √1−𝜉 2 ×100

|ln(0.58)|
𝜉= ≈ 0.174
√|ln(0.58)|2 + 𝜋 2

164.6
It is a type – 0 system, 𝑂𝑙𝑑 𝑜𝑟 𝑝𝑟𝑒𝑣𝑖𝑜𝑢𝑠 𝐾𝑃𝑜 = lim 𝑮𝒖 (𝒔) = = 8.23
𝑠→0 20
1 1
Thus, 𝑒𝑜𝑙𝑑 (∞) = 1+𝐾 = 1+8.23 = 0.1083
𝑃𝑜
Arbitrarily selecting, −𝑎 = −0.1
𝒔+𝟎.𝟏
Finally, transfer function of PI compensator, 𝑮𝑪 = 𝒔

Generalized transfer function for PI controller is


𝐾𝑖
𝐺𝐶 (𝑠) = 𝐾𝑃 +
𝑠
Comparing the above two equation,
KP = 1 Ki = 0.1

𝐾𝑃𝑁 = lim 𝐺𝑒 (𝑠) = 𝐺𝐶 (𝑠)×𝐺𝑢 (𝑠) = ∞


𝑠→0
1
𝑒𝑛𝑒𝑤 (∞) = =0
1 + 𝐾𝑃𝑁

Fig. 5. Root locus for the designed system

Now, implement the controller in MATLAB Simulink and plot the output and error signal.

© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 7


Fig. 6. Close loop feedback system with PI controller in Simulink

Fig. 7. PI block parameters in MATLAB Simulink

© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 8


Fig. 8. Input command and output values of the designed system

Fig. 9. Error signal as an input of PI controller

© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 9


Fig. 10. Comparison of Input command and output values
for compensated and uncompensated system

Fig. 11. Error signal as an input of PI controller


for compensated and uncompensated system

© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 10


Problem Statement 2:

A unity negative feedback system has forward transfer function,


𝐾
𝐺(𝑠) =
𝑠(𝑠 + 4)(𝑠 + 6)

Find the location of compensating zero for designing a PD compensator to yield a 16%
overshoot, with a threefold reduction in settling time. [Uncompensated System has ωn= 2.391
rad/s].

Solution:

Fig. 12. Close loop feedback with PD controller

Transfer function of PD controller,


𝐾
𝐺𝐶 (𝑠) = 𝐾𝑃 + 𝑠𝐾𝑑 = 𝐾𝑑 (𝑠 + 𝑎) Where, 𝑎 = 𝐾𝑃
𝑑

1. First evaluate the performance of the uncompensated system:

−𝜋𝜉
( ⁄ )
We know, %𝑂. 𝑆 = 𝑒𝑥𝑝 √1−𝜉 2 ×100

Hence
|ln(0.16)|
𝜉= ≈ 0.504
√|ln(0.16)|2 + 𝜋 2

Now, find dominant pole (old) from the root locus of uncompensated system,

© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 11


Fig. 13. Root locus for the uncompensated system

𝑇ℎ𝑢𝑠, 𝑆𝑑𝑜𝑙𝑑 = −1.2 + 𝑗2.06


4
(b) Now find old settling time, 𝑇𝑆𝑜𝑙𝑑 = ξ𝜔 = 3.33 sec
𝑛

2. Evaluate the performance of the compensated system:

(a) From the question, find new 𝑇𝑆𝑛𝑒𝑤 and new 𝜔𝑛 [ξ will remain unchanged which is 0.504]
3.33 ξ𝜔𝑛 ×3 1.2×3
𝑇𝑆𝑛𝑒𝑤 = = 1.11 𝑠𝑒𝑐 and new 𝜔𝑛 = = ≈ 7.14 𝑟𝑎𝑑/𝑠
3 ξ 0.504

b) Find dominant pole (new), 𝑆𝑑𝑛𝑒𝑤 = −ξ𝜔𝑛 + 𝑗𝜔𝑛 √1 − ξ2


Therefore, the real part of the compensated system’s dominant, second-order pole is
4 4
𝜎= = = 3.604
𝑇𝑠 1.11
Fig. 14 shows the designed dominant, second-order pole, with a real part equal to -3.604 and
an imaginary part of
𝜔𝑑 = 3.604 tan(180° − 120.26° ) = 6.193

𝑆𝑑𝑛𝑒𝑤 = −𝜎𝑑 + 𝑗𝜔𝑑 = −3.604 + 𝑗6.193

© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 12


120.260

Fig. 14. Root locus for the uncompensated system

Fig. 15. Root locus for the designed system

(c) Design the location of compensating pole, −𝑍𝐶


➢ Finding necessary angle (𝛳𝑍 ) to locate 𝑆𝑑𝑛𝑒𝑤 on root locus.
𝜔𝑑
➢ tan 𝛳𝑍 = 𝑍 −𝜎 then find, −𝑍𝐶
𝑐 𝑑

Calculation:

−𝜽𝒁 + 𝜽𝑷𝟎 + 𝜽𝑷−𝟒 + 𝜽𝑷−𝟔 = 𝟏𝟖𝟎°


6.193 6.193
−𝜃𝑍 + {1800 − 𝑐𝑜𝑠 −1 (0.504)} + 𝑡𝑎𝑛−1 ( ) + 𝑡𝑎𝑛−1 ( ) = 180°
4 − 3.604 6 − 3.604
Thus, 𝜃𝑍 = 95.6°

© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 13


𝜔𝑑
Now, 𝑡𝑎𝑛𝜃𝑍 = 𝑍 so, −𝑍𝐶 = −3.006 Finally, 𝑮𝑪 = 𝒔 + 𝟑. 𝟎𝟎𝟔
𝑐 −𝜎𝑑
Generalized transfer function for PI controller is
𝐺𝐶 (𝑠) = 𝐾𝑃 + 𝑠𝐾𝑑
Comparing the above two equation,
KP = 3.006 Kd = 1

Now, implement the controller in MATLAB Simulink and plot the output and error signal.

Fig. 16. Close loop feedback system with PD controller in Simulink

Now, the calculated value of KP and Kd is set to MATLAB PD block.

© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 14


Fig. 17. PD controller block in Simulink

Fig. 18. Input command and output values of the designed system

Fig. 19. Error signal as an input of PD controller

© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 15


Fig. 20. Comparison of Input command and output values
for compensated and uncompensated system

Fig. 21. Error signal as an input of PD controller


for compensated and uncompensated system

© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 16


Additional Task:

In this part, students will learn how to tune a PID controller using MATLAB PID controller
tuning tool. In practice, there may be a situation where the plant transfer function is unknown.
For this type of scenario MATLAB PID controller tuning toolbox is more useful. The following
example illustrate the method of tuning a PID controller for a DC motor speed control
application.

Transfer function of a DC motor can be expressed as


𝐾
𝐺(𝑠) =
(𝐽𝑠 + 𝑏)(𝐿𝑠 + 𝑅) + 𝐾 2

Where,

𝑘𝑔.𝑚2
J= Moment of Inertia of the Rotor [0.01 ( 𝑠2 )]
b= Damping Ratio of the Mechanical System [0.1 𝑁𝑚𝑠]
𝑁𝑚
K= Electromotive Force Constant [0.01 𝐴𝑚𝑝]
R= Electric Resistance [1Ω]
L= Electric Inductance [0.5𝐻]

Using the above-mentioned values, the close loop feedback system of a DC motor with PID
controller is designed in MATLAB Simulink, which is shown in fig. 22.

Fig. 22. Close loop feedback system of a DC motor with PID controller in Simulink

Fig. 23. Inside the Speed Sub system


© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 17
Fig. 24. Transfer function block for DC motor

Fig. 25. Random Noise Generator Block

Now click on the PID controller block. Fig. 26 represents the default values for PID controller
block.
© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 18
Fig. 26. PID controller block before tuning

Now, click on ‘Tune’ and the following window will pop-up.

Fig. 27. MATLAB PID controller tuning dialog box

© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 19


In fig. 27, MATLAB PID controller tuning block is suggesting the values for PID controller
and the associated response curve is plotted in fig. with solid line. The dotted line plot
represents the response of the system using current values. Now click on ‘Update Block’.

Now, all the values of PID controller is automatically updated as shown in fig. 26.

Fig. 26. PID controller block after tuning

Fig. 27 represents the desired and measured speed of DC motor.

Fig. 27. Desired and measured speed of DC motor

© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 20


Now, if we want to make the response faster, then click again in PID controller box and a PID
controller tuning window will pop-up.

Fig. 28. MATLAB PID controller tuning dialog box

To make the response faster, slide the Response time and Transient Behavior slider as per your
requirement. You will see the corresponding plot in the window. After tuning as per your
requirement, click ‘Update Block’.

Fig. 29 represents the desired and measured speed of DC motor after tuning for faster response.

Fig. 29. Desired and measured speed of DC motor after tuning for faster response

© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 21


Questions for report writing:

1. Explain and comment Fig. 8,9,11,12 and 17,18,20,21 of the experiment briefly.
2. A unity negative feedback system which is operating with a closed loop response that has
𝟏
15% overshoot, setting time 1.5 sec and the following transfer function: 𝑮(𝒔) = 𝒔(𝒔+𝟐)(𝒔+𝟕);
Now design a PI and PD controller for the system.

Discussion and Conclusion:

Interpret the data/findings and determine the extent to which the experiment was successful in
complying with the goal that was initially set. Discuss any mistake you might have made while
conducting the investigation and describe ways the study could have been improved.

Reference(s):

[1] Norman S. Nise, “Control Systems Engineering”, available Edition, John Wiley & Sons
Inc.
[2] Farid Golnaraghi, Benjamin C. Kuo, “Automatic Control Systems”, 9th Edition, Prentice-
Hall, 1982

© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 22

You might also like