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

Academic year 2023/2024

FACULTY OF ENGINEERING AND TECHNOLOGY

DEPARTMENT OF ELECTRICAL AND ELECTRONICS


ENGINEERING

POWER SYSTEMS ENGINEERING

BACHELOR OF ENGINEERING PROGRAM

EEF460: FEEDBACK SYSTEMS LABORATORY

INSTRUCTORS: Dr. Engr. Musong Louis K.

Dr. BASIL

NAME : SUH CHEO AMANWI DAVID

MATRICLE: FE21A434

EXPERIMENT 5: Tuning of Controllers (Proportional, PI, PD,

and PID controllers)


INTRODUCTION

Controllers in feedback systems constantly analyze the system's output and compare it to a de-
sired state. This difference called the error, is what the controller uses to adjust the system's in-
put, ensuring it steers toward the target.
The different types of controllers include:
 Proportional (P) Controller: This is the simplest type. It directly adjusts the input based on the
error's magnitude. Bigger error, bigger adjustment. Easy to understand, but may lead to a persis-
tent error (the system might not quite reach the target).
 Integral (I) Controller: This one focuses on eliminating the overall error over time. It accumu-
lates the error and factors it into the input adjustment. Great for getting the system to exactly
match the target, but can be slow to react to initial changes.
 Derivative (D) Controller: This controller anticipates future errors by considering the rate of
change of the error. It helps the system respond quickly to changes and disturbances. However, it
can be sensitive to noise in the system.
 PID Controller: It combines the best of all previously mentioned controllers for a robust and
versatile solution. By adjusting the weightage of each term, we can fine-tune the controller for
optimal performance in a specific system.

Each controller goes into do a certain change in the system, the table below summarizes this;
Each question under this lab will contain 3 parts, the analytical analysis, the MATLAB
code, and finally our conclusion

Question 1

ANALYSIS

Design a proportional (P) controller to satisfy the following conditions:


 The steady-state error to step inputs should not be more than 1%.
 The settling time should be at most 2 seconds.
To do this, we start by finding the closed loop TF with respect to the proportional controller;
1
G ( s )=
1+20 S
KpG (s)
T(s) =
1+ KpG ( s ) H (s )
But H(s) = 1
Kp
∗1+20 S
1+20 S
T ( s )=
1+20 S + Kp
Kp
T ( s )=
1+ Kp+20 S

1) Now to find the value of Kp for a steady state error of a step input;

For the step input 𝑅(𝑠)=1/𝑠, the steady-state error 𝑒𝑠𝑠 for a unity feedback system is given by:
1
ess = lim
1+ KpG ( s )
s→0
1
= lim 1
1+ Kp( )
1+20 S
s→0
1
=
1+ Kp

Given that the steady-state error must be less than or equal to 1%;
 ess ≤ 0.01

1
≤ 0.01
1+ Kp

1+Kp ≥ 100

Kp ≥ 99
2) Settling Time Analysis;

For a first-order system, the settling time is approximately;

Ts = 4 / pole

The closed-loop transfer function has a pole at 𝑠=−(1+𝐾𝑝/ 20)


therefore, for Ts< = 2

4
2 ≥ 1+ Kp
20

80
2≥
1+ kp

1+kp ≥ 40

kp ≥ 39

But using Kp as 99 and verifying if this value meets our required conditions;
From ess = 1/1+Kp

ess = 1 / 1+99

= 0.01

And S = -(1 + 99/ 20)


= -5
Tss = 4/5
= 0.8
Therefore Kp = 99

MATLAB CODING
Output
CONCLUSION
By using the value of Kp obtained from our calculation within our Matlab code, we can see that
the settling time of the system becomes greatly improved and lies within our required condition
margins indicating that our analysis is correct
Question 2

ANALYSIS
Using the same system from question 1, for designing a proportional integrator controller we
have;
1
G ( s )=
1+20 S
The controller now has the function
Ki
C(s) = Kp+
S
C ( s)G (s)
Now T(s) =
1+ C(s)G ( s ) H ( s)

But H(s) = 1

T ( s )=
( Kp+ )(
S 1+ 20 S )
Ki 1

1+ ( Kp+ )(
S 1+20 S )
Ki 1

To meet the settling time requirement (𝑇𝑠 ≤ 4 seconds), we need to ensure the dominant pole of
the closed-loop system places the system's response within the desired settling time.
Characteristic Equation and Pole Placement
Taking the denominator in order to get the characteristic equation of the closed loop TF:

(
1+ Kp+
Ki
S )( 1+ 120 S )=0
( )
Ki
Kp+
S
1+ =0
1+ 20 S

20S2 + (Kp + 1)S + Ki = 0


To achieve the desired settling time, we set the dominant poles to achieve critical damping or
slight under-damping. For 𝑇𝑠=4 seconds:
𝑇𝑠=4 / 𝜁𝜔𝑛
4 / 𝜁𝜔𝑛 ≤ 4
⇒𝜁𝜔𝑛≥1
Assuming critical damping (𝜁=1):
𝜔𝑛 ≈ 4 / 𝑇𝑠
=1 rad/s
Solving for 𝐾𝑝 and 𝐾𝑖
To approximate the natural frequency 𝜔𝑛 and solve for 𝐾𝑝 and Ki :
Taking the characteristics equation With 𝑠 =−1 as an approximation for critical damping:
20(−1)2+(1+𝐾𝑝)(−1)+𝐾i=0
𝐾𝑖=𝐾𝑝−19
Given 𝜔𝑛=1:
𝜔𝑛2=𝐾𝑖
1 = Kp - 19 (Substitute 𝐾𝑖 from before)
𝐾𝑝 ≈ 20
𝐾𝑖=𝐾𝑝−19
𝐾𝑖≈(20)−19
𝐾𝑖≈ 1
MATLAB
CONCLUSION
Now we implement the previous system by making use of a PI controller. We calculate a new
value for Kp and the value of Ki and simulate these values into our Matlab code. From the step
response, we see that the settling time criteria of at most 4s is not violated however, the zero
steady-state error was not met as the ess is equal to 1
Question 3

ANALYSIS

Given:
100
G(s) =
s (s+2)

Desired specifications:
- Zero steady-state error to a step input.
- Damping ratio of 0.5
PD Controller Design
A PD controller has the form:
C(s) = Kp + Kds
For this system, the closed-loop transfer function with the PD controller is:

T ( s )=
( Kp+ Kds )
( 100
2
s +2 s )
1+ ( Kp+ Kds )
( s100+2 s )
2

100 ( k d . s +k p )
T ( s) = 2
s + ( 2+100 k d ) s+100 k p

For a second-order system with a damping ratio (𝜁) of 0.5 the desired characteristic equation is:
S2 + 2𝜁ωnS + ωn2 = 0
 S2 + ωnS + ωn2 = 0

Assuming a natural frequency 𝜔𝑛 that satisfies the design criteria such as ωn = 2


The characteristic equation of the closed-loop system is:
2
s + ( 2+100 k d ) s +100 k p
Equating Characteristic Equation with Desired Closed-Loop Poles
S2 + 2S +4 = 0
Comparing coefficients we get
2+ 100Kd = 2
Kd = 0
100Kp = 4
Kp = 0.04
But these values don’t make sense so using ωn = 5 rather;
 Kd = 0.03

 Kp = 0.25

MATLAB CODING
CONCLUSION
Using the calculated values for our controller in our MATLAB code we get the exact desired
output implying our analysis and code coincide with each other perfectly.
Question 4

ANALYSIS

Given:
100
G(s) =
s (s+2)
a)

Desired specifications:
- 𝜁 = 0.7
- ωn = 400 rad/s
For a second-order system, the characteristic equation is:
S2 + 2𝜁ωnS + ωn2 = 0
 S2 + 2(0.7)(400)S + (400)2 = 0

S2 + 560s + 160000 = 0

PID Controller Design


Here,
Ki
C(s) = Kp+ + Kds
S
Therefore,

( S ( s +2s )
Kp+ Kds+ )
Ki 100
2
T ( s )=

S ( s +2 s )
1+ ( Kp+ Kds+ )
Ki 100
2
And simplifying to get the characteristic equation then comparing the coefficients we get;
S2 +(2+100Kd)s + 100Kp + 100Ki = S2 + 560s + 160000
 Kd = 5.58

 100(Kp+Ki) = 160000

 Kp = 800

 Ki = 800

b)

MATLAB CODING
Simulink block connection

Initial PID controller values


Output of simulation

Using the tuner tool and varying the response time to 2s and transient behavior to 5%
New step plot

New values for the PID


New scope output
C)
The Ziegler-Nichols continuous cycling method is a popular approach for tuning PID controllers,
especially for processes that can't be run in an open-loop environment (where the control loop is
disconnected). Here's a breakdown of the key steps:
1. Plot the step response of the original system
2. Draw a line to represent the tangent
3. Measure the values L,T,K from this plot as seen from the diagram below
4. Finally we use Ziegler-Nichols tuning rules to calculate the PID parameters:
a=K*L/T;
Ti=2*L;
Td=L/2;

Kp=1.2/a;
Ki=Kp/Ti;
Kd=Kp*Td;
Step response with tangent plotted

From;

 T = 0.28
 L = 0.05

 K = 1.8

Output

Therefore
Kd =0.0767
Kp = 3.07
Ki = 30.7
Step response

CONCLUSION
From this question’s analysis we can see that all the different methods we used to calculate the
parameters of the controller yields different results. By comparing these results we can see that
only the values gotton by use of the Simulink tuner actually provides us with a good step
response output, Therefore our parameters shall be;
Kd =0.00192
Kp = -0.0219
Ki = -0.004
END

You might also like