Control System Assisgnment 11
Control System Assisgnment 11
COMPLIED BY
(Clearly show the effect of the controllers below when the plant dynamics are first
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
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)
U (s )
=GP ¿ K p
E (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
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.
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
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.
Operation.
The control signal includes proportional and derivative forms:
d
u ( t )=K p e ( t ) + K d e(t)
dt
U (s )
=GPD ¿ K d s+ K p
E (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
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
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
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
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
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)
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
e ss =1−0.05=0.95 m
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.
Graph for the time response of the open loop transfer function,
1
G ( s )= 2
s +10 s +20
c)
I. Proportional Controller
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
Kp
GCL ( s )= 2
s + 10 s+ 20+ K p
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
K p+ K d s
GCL ( s )= 2
s + 10 s+ 20+ K p + K d 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
KI
K p+
s
GCL ( s )=
KI
s 2+ 10 s+ 20+ K p +
s
K p s+ K I
GCL ( s )= 3 2
s + 10 s +20 s+ K p s+ K I
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
KI
K p+ +Kd s
s
GCL ( s )=
K
s 2+ 10 s+ 20+ K p + I + K d s
s
I. Proportional Controller
K P=300
1
Transfer function of the system, G ( s )= 2
s +10 s +20
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
300
G CL ( s )= 2
s + 10 s+320
Python code for the time response of the Proportional controller
II. PD controller
K P=300∧K d =10
1
Transfer function of the system, G ( s )= 2
s +10 s +20
(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
10 s +300
G CL ( s )= 2
s + 20 s+ 320
Python code for the time response of PD controller
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
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
30 s+70
G CL ( s )= 3 2
s + 10 s +50 s+70
Python code for the time response of PI controller
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
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
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
1
(1) G ( s )= s +2
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)
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).
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
0
E ss =lim ¿ s →0 ¿
1200
E ss =0sss