0% found this document useful (0 votes)
5 views36 pages

Control System Assisgnment 11

This document outlines an assignment for a course on Engineering Control Systems at Kyambogo University, focusing on controllers for closed-loop control systems and steady-state errors. It includes detailed instructions on analyzing various controllers (P, PI, PD, PID) and their effects on a first-order plant, along with practical tasks involving transfer functions and MATLAB/Python simulations. The document also lists the names and registration numbers of the students who complied with the assignment.

Uploaded by

Jaden Savin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views36 pages

Control System Assisgnment 11

This document outlines an assignment for a course on Engineering Control Systems at Kyambogo University, focusing on controllers for closed-loop control systems and steady-state errors. It includes detailed instructions on analyzing various controllers (P, PI, PD, PID) and their effects on a first-order plant, along with practical tasks involving transfer functions and MATLAB/Python simulations. The document also lists the names and registration numbers of the students who complied with the assignment.

Uploaded by

Jaden Savin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 36

KYAMBOGO UNIVERSITY

Tel: 0414-285037 Fax: 9414-220464


E-mail: [email protected] or www.kyu.ac.ug
P.O.BOX 1, KYAMBOGO-KAMPALA, UGANDA
FACULTY OF ENGINEERING
DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING
BACHELOR OF ENGINEERING IN TELECOMMUNICATION
ENGINEERING
COURSE UNIT: ENGINEERING CONTROL SYSTMES (TETE 2204)
ASSIGNMENT: CONTROLLERS FOR CLOSED LOOP CONTROL
SYSTEMS AND STEADY STATE ERRORS
LECTURER: DR. DENNISE BIRABWA
DATE OF SUBMISSION: 24th /04/2025

COMPLIED BY

No Name Reg. No.


.
1 GWOLO CHARLES SAMUEL 23/U/ETE/05885/PE
2 ALENI SAVIOUR ONZUMA 23/U/ETD/03686/PD
3 MUYOMBA EDMOND 23/U/ETD/08891/PD
4 BATALA MEDDIE 23/U/ETD/074/GV
5 KIRABO SAMALE 24/U/ETD/18914/PD
QUESTION 1
a) Write notes on the operation, advantages and disadvantages of the
controllers below

(Clearly show the effect of the controllers below when the plant dynamics are first

Order- check Advanced Control System Engineering by Roland S Burns, ASME

Publishers, 2005, section 4.5 and other personal research):

I. P controller
II. PI controller
III. PD controller
IV. PID controller
b) Consider a simple mass, spring, damper problem below.

a. Determine the transfer function (open loop transfer function) of the system

b. Let m =1kg, b =10N.s / m, k = 20N / m, f =1N, determine the steady-state value


of the output, hence determine the corresponding steady state error. Use matlab or
python to plot the time response of the open loop transfer function. (Note since the
input is 1N, we consider its Laplace transform to be 1/s, therefore we are
considering a unit step input)
c. Determine the closed loop transfer function when the system is subjected to the
Controllers below (consider unit feedback).

I. Proportional Controller
II. PD Controller
III. PI Controller
IV. PID Controller
d. For each of the above controller, use matlab or python to sketch the time
response. Consider the gains as indicated below for the different sketches.
Hence comment on the rise time, maximum overshoot, settling time and
steady state gain in each case. (Compare these with the time response of the
open loop transfer function in b.
I. Proportional Controller: proportional gain = 300
II. PD controller: proportional gain = 300, and derivative gain = 10.
III. PI Controller: proportional gain = 30, and integral gain = 70
IV. PID Controller: proportional gain = 350, integral gain = 350, derivative
gain = 5500
a) I) The P controller
Operation.
The control signal is proportional to the error signal.
u ( t )=K p e (t)

Where K p is the proportional gain?


Taking the Laplace transform
U ( s )=K p E (s)

U (s )
=GP ¿ K p
E (s )

Hence Transfer function of the P controller, G P=K p


K
If the plant dynamics are first-order, G ( s )= 1+Ts

Closed loop transfer function, T (s ):

GP (s)G(s)
T ( s )=
1+G P (s)G (s)

K p∗K
1+Ts
T ( s )=
K ∗K
1+ p
1+Ts

Multiplying the numerator and denominator by 1+Ts


The closed-loop transfer function is:
K pK
T ( s )=
1+ K p K +Ts

Effect
 For a first-order plant, the closed-loop system of a P controller remains a
first-order.
 Steady state error remains due to lack of integral action.
 Response is faster but may have offset.
Advantages:
 Simple to implement.
 Improves response speed.
Disadvantages:
 The steady state error persists for step inputs.
 High K p can cause oscillations.

II) Proportional-integral (PI) Controller.


Operation.
The control signal includes proportional and integral forms:
t
u ( t )=K p e ( t ) + K I ∫ e (t ) dt
0

Taking the Laplace transform


KI
U ( s )=K p E ( s ) + E (s )
s
U (s ) KI
=GPI ¿ K p +
E (s ) s
KI
Hence Transfer function of the PI controller, G PI ¿ K p +
s
K
If the plant dynamics are first-order, G ( s )= 1+Ts

Closed loop transfer function, T ( s ):

GP (s)G(s)
T ( s )=
1+G P (s)G (s)

KI
( K p+ )∗K
s
1+Ts
T ( s )=
K
( K p+ I )∗K
s
1+
1+Ts

Multiplying the numerator and denominator by 1+Ts

The closed loop transfer function is:


K p Ks+ K I K
T ( s )= 2
T s + ( 1+ K p K ) s+ K I K

Effects
 For a first-order plant, the closed-loop system of a PI controller changes to a
second-order.
 Eliminates steady state error due to the integral action.
 It has low transient response which may introduce overshoot.
Advantages.
 Zero steady state error for the step unit.
 It has better disturbance rejection.
Disadvantages.
 Can cause overshoot and instability if K i is too high.
 It has slower initial response compared to P-only.

III) Proportional-Derivative (PD) controller.

Operation.
The control signal includes proportional and derivative forms:
d
u ( t )=K p e ( t ) + K d e(t)
dt

Taking the Laplace transform


U ( s )=K p E ( s ) + K d s E (s)

U (s )
=GPD ¿ K d s+ K p
E (s )

Hence Transfer function of the PD controller, G PD=K d s+ K p


K
If the plant dynamics are first-order, G ( s )= 1+Ts
Closed loop transfer function, T ( s ):

GP D (s)G(s)
T ( s )=
1+G P D (s )G( s)

( K d s+ K p )∗K
1+Ts
T ( s )=
( K d s + K p )∗K
1+
1+ Ts

Multiplying the numerator and denominator by 1+Ts

The closed-loop transfer function is:


( K ¿¿ d s + K ¿¿ p)K
T ( s )= ¿¿
(K ¿¿ d s + K ¿¿ p)K
Ts+1+( K ¿¿ d s + K ¿¿ p)K = ¿¿¿¿
(T + K d K) s +1+ K p K

Effects
 For a first-order plant, the closed-loop system of a PD controller remains a
first-order.
 Improved damping and therefore reduces overshoot.
 No steady state error elimination as it lacks integral action.
Advantages.
 It has a faster response and therefore reduces rise time.
 It reduces oscillations and therefore improves stability.
Disadvantages.
 There is no elimination of steady state error and therefore it still needs
integral action.
 Oise amplification due to derivative term.
IV) Proportional-Integral-Derivative (PID) controller.

Operation
This one combines the P, I and D actions:
t
de (t)
u ( t )=K p e ( t ) + K i∫ e ( t ) dt + K d
0 dt

Taking the Laplace transform


KI
U ( s )=K p E ( s ) + E ( s ) + K d s E( s)
s
U (s ) KI
=GPD ¿ K d s+ + K
E (s ) s p

KI
Hence Transfer function of the PID controller, G PID=K d s+ +K
s p

K
If the plant dynamics are first-order, G ( s )= 1+Ts

Closed loop transfer function, T ( s ):

GP I D (s )G(s)
T ( s )=
1+G P I D (s)G(s )
KI
( K d s+ + K )∗K
s p
1+Ts
T ( s )=
K
( K d s + I + K )∗K
s p
1+
1+Ts

Multiplying the numerator and denominator by 1+Ts

The closed loop transfer function is:


2
K p Ks+ K I K + K d K s
T ( s )= 2
T s + ( 1+ K p K + K d K ) s + K I K

Effects
 For a first-order plant, the closed-loop system of a PID controller changes to
a second-order
 Zero steady state error due to the integral.
 Improved transient response due to the derivative.
Advantages.
 It offers the best performance as it combines benefits for P, I and D.
 Robust to disturbances and parameter variations.
Disadvantages.
 Tuning complexity as it has 3 parameters to adjust.
 Derivative noise sensitivity.
a)
Free body diagram

d
f −kx ( t )−b x ( t )=ma
dt
2
d ( ) d
f −kx ( t )−b x t =m 2 x (t)
dt dt

Taking Laplace transform


2
F ( s )−kX ( s )−bsX ( s )=m s X ( s )

F ( s )=( m s 2+ bs+k ) X ( s)
X (s ) 1
Hence the transfer function, F ( s ) = 2
ms +bs+ k

b)
s 20 N
Given m=1 kg , b=10 N . ,k= , f =1 N
m m
X ( s) 1
Transfer function , = 2
F ( s ) m s +bs +k
X (s ) 1
= 2
F ( s ) s +10 s+20
1
X ( s) = 2
∗F ( s )
s +10 s+20
1
Considering a unit step input, F ( s )= s

1
X ( s) = 2
s(s +10 s+20)

Steady state value, X ss


The steady state value, X ss of the output can be got using the final value theorem
X ss =lim sX ( s )
s →0

1
X ss =lim s∗¿ ¿
s →0 s ( s +10 s+20 )
2

lim 1
s→0 1
X ss = =
( s +10 s+20 ) 20
2

X ss =0.05 m

Hence, steady state value, X ss of the output is 0.05 m

Steady state error, e ss


For a unit step input, the steady state error, e ss is:
e ss =input −X ss

e ss =1−0.05=0.95 m

Hence, steady state error, e ssis 0.95 m


Python code to plot the time response of the open loop transfer function,
1 1
G ( s )= 2 a unit step input, , F ( s ) =
s +10 s +20 s

Explanation of the code


Importing Necessary Libraries

 numpy: Used to create arrays and handle numerical calculations.


 matplotlib.pyplot: For plotting graphs.
 scipy.signal: Provides tools for analyzing and simulating signal processing
systems, such as transfer functions.

Defining System Parameters


 These parameters represent the physical properties of the mass-spring-
damper system:
 m : The mass of the system.
 b : The damping coefficient, which governs how much resistance the system
experiences when it moves.
 k : The spring constant, which determines the stiffness of the spring.

Defining the Transfer Function

1
 The transfer function, G ( s )= 2 models how the system responds to
s + 10 s+ 20
an input force.
 The numerator is represented as [1] because there's no scaling factor and the
denominator is represented as[mb k ].
 The transfer function is given by sys =
signal.TransferFunction(numerator, denominator)
 The sys = signal.TransferFunction function creates the transfer function of
the system in the Laplace domain.

Defining the Time Vector

 t = np.linspace(0, 2, 500). Creates a time array from t=0 to t = 2 seconds


with 500 evenly spaced points. The fine resolution ensures a smooth graph.

Calculating the Step Response

 t, y = signal.step(sys, T=t). The signal.step function computes the step


response of the system, which shows how the system's displacement x (t)
changes over time when subjected to a unit step input.
 sys is the transfer function defined earlier, and T=t specifies the time points
for evaluation.

Plotting the Step Response

 plt.figure(figsize=(10, 6)). Create a plot with a specific size


 plt.plot(t, y). Plot the time (t) vs. the displacement (y)
 plt.title('Step Response of Mass-Spring-Damper System'). Adds the Title
of the plot
 plt.xlabel('Time (s)'). Adds X-axis label
 plt.ylabel('Displacement (m)'). Adds Y-axis label
 plt.grid(True). Enable grid for better readability
 plt.show(). Display the plot

Graph for the time response of the open loop transfer function,
1
G ( s )= 2
s +10 s +20
c)

I. Proportional Controller

Closed loop transfer function, GCL (s):

G P (s )G(s)
GCL ( s )=
1+G P (s)G(s )

K p∗1
2
s + 10 s+ 20
GCL ( s )=
K p∗1
1+ 2
s +10 s +20

Multiplying the numerator and denominator by s2 +10 s +20

Kp
GCL ( s )= 2
s + 10 s+ 20+ K p

For a second-order plant, the closed-loop system of a P controller remains a


second-order
II. PD Controller

Closed loop transfer function, GCL ( s):

G PD (s )G( s)
G CL ( s )=
1+G PD ( s)G(s )

(K p + K d s)∗1
2
s +10 s +20
GCL ( s )=
(K p + K d s)∗1
1+ 2
s +10 s+20

Multiplying the numerator and denominator by s2 +10 s +20

K p+ K d s
GCL ( s )= 2
s + 10 s+ 20+ K p + K d s

For a second-order plant, the closed-loop system of a PD controller remains a


second-order
III. PI Controller

Closed loop transfer function, GCL ( s):

G PI (s)G(s)
G CL ( s )=
1+G PI (s)G (s)

KI
(K p + )∗1
s
2
s +10 s+20
GCL ( s )=
KI
(K p + )∗1
s
1+ 2
s +10 s +20

Multiplying the numerator and denominator by s2 +10 s +20

KI
K p+
s
GCL ( s )=
KI
s 2+ 10 s+ 20+ K p +
s

Multiplying the denominator and numerator by s

K p s+ K I
GCL ( s )= 3 2
s + 10 s +20 s+ K p s+ K I

For a second-order plant, the closed-loop system of a PI controller becomes third-


order.
IV.PID Controllers

Closed loop transfer function, GCL (s):

G PID (s)G(s)
GCL ( s )=
1+G PID (s)G(s)

KI
(K p + ++ K d s)∗1
s
2
s +10 s+20
GCL ( s )=
KI
(K p + ++ K d s )∗1
s
1+ 2
s +10 s +20

Multiplying the numerator and denominator by s2 +10 s +20

KI
K p+ +Kd s
s
GCL ( s )=
K
s 2+ 10 s+ 20+ K p + I + K d s
s

Multiplying the denominator and numerator by s


2
K d s + K p s+ K I
GCL ( s )= 3 2
s + s (K d +10)+20 s+ K p s + K I

For a second-order plant, the closed-loop system of a PID controller becomes


third-order or higher, depending on the specific implementation and tuning.
d)

I. Proportional Controller

K P=300

Transfer function of Proportional Controller, GP ( s ) =K P =300

1
Transfer function of the system, G ( s )= 2
s +10 s +20

Closed loop transfer function, GCL ( s):

300∗1
G P (s )G(s) 2
s +10 s+20
GCL ( s )= =
1+G P (s)G(s ) 300∗1
1+ 2
s + 10 s+ 20

Multiplying the numerator and denominator by s2 +10 s +20

300
G CL ( s )= 2
s + 10 s+320
Python code for the time response of the Proportional controller

Graph for the time response of the P controller


Comment
The above plot shows that the proportional controller reduced both the rise time
and the steady-state error, increased the overshoot, and decreased the settling time
by a small amount

II. PD controller
K P=300∧K d =10

Transfer function of PD Controller, GPD ( s ) =K P + K d s=10 s +300

1
Transfer function of the system, G ( s )= 2
s +10 s +20

Closed loop transfer function, GCL (s):

(10 s+ 300)∗1
G PD (s )G( s) s 2+10 s+20
GCL ( s )= =
1+G PD ( s)G(s ) (10 s+300)∗1
1+ 2
s +10 s +20

Multiplying the numerator and denominator by s2 +10 s +20

10 s +300
G CL ( s )= 2
s + 20 s+ 320
Python code for the time response of PD controller

Graph for the time response of the PD controller


Comment
This plot shows that the addition of the derivative term reduced both the overshoot
and the settling time, and had a negligible effect on the rise time and the steady-
state error.

III. PI controller
K P=30∧K I =70

K I s K P + K I 30 s+ 70
Transfer function of PI Controller, GPI ( s )=K P + = =
s s s

1
Transfer function of the system, G ( s )= 2
s +10 s +20

Closed loop transfer function, GCL ( s):

30 s+70
( )∗1
s
G PI (s)G(s) 2
s +10 s +20
GCL ( s )= =
1+G PI (s)G (s) 30 s+ 70
( )∗1
s
1+ 2
s +10 s+20

Multiplying the numerator and denominator by s2 +10 s +20

30 s+70
G CL ( s )= 3 2
s + 10 s +50 s+70
Python code for the time response of PI controller

Graph for the time response of the PI controller


Comment
The above response shows that the integral controller eliminated the steady-state
error, reduces the rise time and increases the overshoot.

IV.PID controller
K P=350 , K I =350∧K d=5500

2
K K s +s K P + K I
Transfer function of PID Controller, GPID ( s )=K P + I + K d s= d
s s

2
5500 s +350 s+350
G PID ( s )=
s

1
Transfer function of the system, G ( s )= 2
s +10 s +20

Closed loop transfer function, GCL (s):


2
5500 s +350 s +350
( )∗1
s
G PI (s)G(s) 2
s +10 s+20
GCL ( s )= =
1+G PI (s)G (s) 2
5500 s +350 s+350
( )∗1
s
1+ 2
s +10 s+ 20

Multiplying the numerator and denominator by s2 +10 s +20


2
5500 s +350 s +350
G CL ( s )= 3 2
s + 5510 s +370 s+350

Python code for the time response of PID controller


Graph for the time response of the PID controller

Comment
The graph shows a closed-loop system with no overshoot, fast rise time, and no
steady-state error
QUESTION 2
a) What is meant by the term Steady-state error

Steady-state error is the difference between the input and the output for a
prescribed test input as t →∞. The test inputs used for steady-state error analysis
and design can be step, ramp or parabolic.
Consider the following unity feedback system

The system output can then be expressed as


C ( s )=E ( s ) G (s)
The error, E(s), between the system input, R(s), and the system output, C(s) is
E ( s )=R ( s )−C ( s )
E ( s )=R ( s )−E ( s ) G ( s )
E ( s ) [ 1+ G ( s ) ] =R ( s )
R (s )
E ( s )=
1+G ( s )
Using the final value theorem, the steady-state error, e ss is
e ss =lim sE ( s )
s→0

s R (s )
e ss =lim
s→0 1+G ( s )

b) Evaluate the steady-state error for the following system if the system input is
a step.
1
Open-loop transfer function, G ( s )= (s+ 2)(s+3)

The output is obtained as the product of the reference input and the open-
loop transfer function.
C ( s )=R ( s ) G(s)
1
As the system input is a step, R ( s )= s

1 1
C ( s )= .
s (s+ 2)(s+ 3)
1
C ( s )=
s (s +2)(s +3)
1
C ( s )= 3 2
s +5 s +6 s

Obtaining the error E(s)


E ( s )=R ( s )−C (s)

Substituting for R(s) and C(s) we obtain;


1 1
E ( s )= − 3
s s + 5 s 2+ 6 s
2
s +5 s+5
E ( s )= 2
s( s +5 s+6)

To find the steady-state error, e ss we apply the final value theorem


e ss =lim ¿s → 0 sE (s )¿
2
s(s + 5 s+5) 5
e ss =lim ¿s → 0 = ¿
s(s 2+5 s+6) 6
5
Therefore, ( e ss )= 6
d) Evaluate the steady-state errors for the unity feedback systems with the open-
loop transfer functions of:
1 1 1
(1) G ( s )= s +2 (2) G ( s )= s (s+2) ( 3 ) G ( s )= 2
s (s +2)

If the system input is a unit step, ramp and parabola respectively

1
(1) G ( s )= s +2

For a step input,r ( t )=u ( t )


1
R ( s )=
s
sR (s) 1
Steady state error, e ss=lim s→0
=
1+G(s) 1+lim G(s)
s →0

1 1
e ss = =
1 1
1+lim ⁡(¿ s → 0 ) 1+
s+2 2
2
e ss =
3
1
(2) G ( s )= s (s+2)

For a ramp input,r ( t )=t u ( t )


1
R ( s )= 2
s
sR (s) 1
Steady state error, e ss=lim s→0
=
1+G( s) lim s G( s)
s →0

1 1
e ss = =
1 1
lim ⁡s (¿ s →0 )
s (s+2) 2
e ss =2
1
( 3 ) G ( s )= 2
s (s +2)
2
t
For a parabolic input,r ( t )= u ( t )
2
1
R ( s )= 3
s
sR (s) 1
Steady state error, e ss=lim
s → 0 1+G( s)
=
lim s 2 G(s)
s →0

1 1
e ss = =
1 1
lim ⁡s 2 (¿ s → 0 2 )
s (s +2) 2

e ss =2

c) For the unity feedback system shown in the following figure, find the steady-
state error if the input is 5tu (t).

For a ramp input,r ( t )=5 tu ( t )


5
R ( s )= 2
s
sR (s) 5
Steady state error, e ss=lim
s → 0 1+G( s)
=
lim sG( s)
s →0

5 5
e ss = =
100(s+2)(s+6) 1 00 (2)(6)
lim ⁡s (¿ s →0 )
s(s+3)(s+ 4) (3)(4)
5
e ss =
100

Hence the steady state error, e ss=0.05

Obtaining the closed-loop transfer function;


G(s)
T ( s )= , and since we are considering a unity feedback control system,
1+G ( s ) H (s)
we take H(s) as 1 thereby obtaining the closed-loop transfer function from;
G(s)
T ( s )=
1+G ( s )

Substituting for the open-loop transfer function G(s).


500 (s +2)(s +6)
s(s+3)(s+ 6)
T ( s )= .
500( s+ 2)(s+6)
1+
s (s +3)(s +6)

On simplifying, the closed-loop transfer function becomes;


2
100 s + 800 s +1200
( )
T s= 3 2 .
s +107 s + 812 s+1200

Obtaining the output, Y(s)


The output is obtained as the product of the reference input R(s) and the
closed-loop transfer function T(s).
Y ( s )=R ( s ) T (s)
5
R ( s )= , as the system input is a ramp.
s
2
5 100 s +800 s +1200
Y ( s )= . 3 .
s s + 107 s 2+ 812 s+1200
2
500 s + 4000 s+ 6000
Y ( s )= 4 3 2 .
s +107 s + 812 s +1200 s

Obtaining the error E(s)


E ( s )=R ( s )−Y (s), and substituting for R(s) and Y(s) we obtain;
2
5 500 s +4000 s+6000
E ( s )= − 4 ,
s s +107 s3 + 812 s2 +1200 s
2
5 s +530 s+60
E ( s )= 3 2 ,
s +107 s +812 s +1200

To find the steady-state error, E ss we apply the final value theorem


E ss =lim ¿ s →0 sE(s)¿
2
s(5 s +530 s+60)
E ss =lim ¿ s →0 ¿
s + 107 s 2+ 812 s+1200
3

0
E ss =lim ¿ s →0 ¿
1200
E ss =0sss

You might also like