Week10 11 Controllers SteadyState Errors
Week10 11 Controllers SteadyState Errors
1
EXAMPLE CONTROLLER DESIGN PROBLEM:
Suppose we have a simple mass, spring and damper problem.
Input: Force F
Output:
Displacement x
The transfer function between the displacement X(s) and the input
F(s)
then becomes
Let M=1kg ; b=10 N.s/m ; k=20 N/m ; F(s)=1. Plug these values
into
the above transfer function.
X( s )
=
F( s ) s2 + 10s + 20
The goal of this problem is to show you how each of Kp, Ki and
Kd
contributes to obtain
• Fast rise time
characteristic equation
are (-7.2361, -2.7639).
• Minimum overshoot
What does that mean?
• No steady-state error
2
Let’s first view the open-loop step response. (We apply 1 Newton
forceto see what happens.)
X( s ) 1
G (s)= =
F( s )
The DC Gain (Static Gain) of the plant transfer function :
1
K = limG ( s ) = = 0.05
3
The DC gain of the plant transfer function is 1/20, so 0.05 is the final value of
the output to an unit-step input.
Proportional Control:
U(s) 1 Y(s)
_
P Controller Plant
The closed-loop transfer function of the above system with a P controller is:
Kp
Y( s ) s + 10s + 20
2
=
R( s )
1+
From the Table 1, we see that the P controller (Kp) reduces rise time, increases
the overshoot and reduces the steady-state error.
4
Let the proportional gain Kp equals 300. The below plot shows that the P
controller reduced both the rise time and the steady-state error, increased
the overshoot and decreased the settling time by small amount.
P CONTROL
Plant
PD Controller
The closed-loop transfer function of the above system with a PD controller is:
K p + Kd s
Y( s ) + 10s + 20
s2 K p + Kd s
=
R( s ) K + Kd s s2 + ( 10 + Kd )s + ( 20 + K p )
1+ 2 p
s + 10s + 20
From the Table 1, we see that the derivative (D) controller (Kd) reduces both the
overshoot and the settling time.
10
5
Let the proportional gain Kp equals 300 as before and let Kd equals 10.
The below plot shows that Derivative (D) control action reduced both
the overshoot and the settling time, and had small effect on the rise time
and the steady-state error.
P control PD control
Plant
PI Controller
The closed-loop transfer function of the above system with a PI controller is:
Ki
K +
s
Y( s ) K p s + Ki
= s + 10s + 20 =
2
R( s ) K s3 + 10s2 + ( 20 + K p )s + Ki
K + i
1+ 2 s
s + 10s + 20
From the Table 1, we see that an integral (I) control action (Ki) decreases the rise time,
increases both the overshoot and the settling time, and eliminates the steady-state error.
12
6
Let’s reduce the proportional gain Kp to 30 and let Ki equals to 70. We
have reduced the proportional gain Kp because the integral controller also
reduces the rise time and increases the overshoot as the proportional
controller does (double effect). The below response shows that the
integral controller eliminated the steady-state error.
Closed-Loop Kp=30; Ki=70
Displacement (m)
Plant
PID Controller
The closed-loop transfer function of the above system with a PID controller is:
K
K + +K s
s
Y( s ) s 2
+ 10s + 20 Kd s2 + K p s + Ki
= =
R( s ) K + K i +K s s3 + ( 10 + Kd )s2 + ( 20 + K p )s +
1+ 2 s K
s + 10s + 20
14
7
Y( s ) K d s2 + K p s + K i
=
R( s ) s3 + ( 10 + Kd )s2 + ( 20 + K p )s + Ki
After several trial and error runs, the gains Kp=350, Ki=300, and Kd=50
provided the desired response. Now we have obtained the system with no
overshoot, fast rise time and no steady-state error.
Closed-Loop Step Response (PID) Kp=350, Ki=300, and Kd=50
Displacement (m)
Comparison of
controllers
1
MAK333E System Dynamics and Control Course
8
Example: Modeling a Cruise Control System
https://instruct.uwo.ca/engin-sc/391b/CTM/examples/cruise/cc.html
https://instruct.uwo.ca/engin-sc/391b/CTM/examples/cruise/ccPID.html
https://www.mathworks.com/products/matlab-online.html
17
9
TUNING RULES FOR PID CONTROLLERS
The figure below shows a PID control of a plant. If a mathematical model of the plant
can be derived, then it is possible to apply various design techniques for determining
parameters of the controller that will meet the transient and steady-state specifications
of the closed-loop system.
However, if the plant is so complicated that its mathematical model cannot be easily
obtained, then an analytical approach to the design of a PID controller is not possible.
Then we must resort to experimental approaches to the tuning of PID controllers.
The process of selecting the controller parameters to meet given performance
specifications is known as controller tuning. Ziegler and Nichols suggested rules for
tuning PID controllers ( meaning to set values Kp , Ti ,Td ) based on experimental step
responses or based on the value of Kp that results in marginal stability when only
proportional control action is used.
19
20
10
ZIEGLER-NICHOLS RULES FOR TUNING PID CONTROLLERS
Ziegler and Nichols proposed rules for determining values of the proportional gain
Kp , integral gain Ti and derivative time Td based on the transient response
characteristics of a given plant.
There are two methods.
First Method: In the first method, we obtain experimentally the response of the
plant to a unit-step input.
Procedure:
1. Apply unit-step
input
2. Obtain L and T
3. Use Table to
determine
constants
21
MAK333E System Dynamics and Control Course
Lecture Notes, Dr. E. Altuğ
If the plant involves neither integrator (s) nor dominant complex-conjugate poles, then
such a unit-step response curve may look S-shaped as shown in the Figure above.
This method applies if the response to a step input exhibits an S-shaped curve. Such
step response curves may be generated experimentally or from a dynamic simulation of
the plant.
The S-shaped curve may be characterized by two constants, delay time L and time
constant T (or τ). The delay time and time constant are determined by drawing a
tangent line at the inflection point of the S-shaped curve and determining the
intersections of the tangent line with the time axis and line c(t)=K, as shown in the
figure above. 22
11
The transfer function C(s)/U(s) may then be approximated by a first-order
systemwith a transport lag as follows:
U(
Ziegler and Nichols suggested to set the values of Kp , Ti and Td according to the
formula shown in Table 1.
23
Thus, the PID controller has a pole at the origin (s=0) and
doublezeros at s= -1/L .
24
12
Example: A plot of the measured signal is shown below. Determine the PID
coefficients using Z-N method.
150 450
25
Second Method: In the second method, we first set Ti=∞ and Td =0. Using the
proportional control action only (see the first Figure below.), increase Kp from 0 to a
critical value Kcr at which the output first exhibits sustained oscillations. (Note: If
the output does not exhibit sustained oscillations for whatever value Kp may take,
then this method does not apply.)
Procedure:
1. Use P control and try
Kp from 0 to Kcr.
2. Kcr is where there is
c(t)
sustained oscillations
3. Determine
corresponding period
4. Use Table to
determine constants
t
Thus, the critical gain Kcr and the corresponding period Pcr are experimentally
determined (see the second Figure above). Ziegler-Nichols suggested that we set the
values of the parameters Kp , Ti and Td according to the formula shown in Table 2.
26
13
Ziegler-Nichols suggested that we set the values of the parameters Kp , Ti
and Td according to the formula shown in Table 2.
27
Notice that the PID controller tuned by the second method of Ziegler-
Nichols rules gives
2
æ 4 ö
÷
1 Pcr ø
+ 0.125Pcr s ) = 0.075Kcr Pcr è
Tis 0.5Pcr s
Thus, the PID controller has a pole at the origin (s=0) and double
zeros at s= -4 / Pcr .
Note: Ziegler-Nichols tuning rules have been widely used to tune PID
controllers in process control systems where the plant dynamics are not
precisely known.
Over many years, such tuning rules proved to be very useful. Ziegler-Nichols
tuning rules can, of course, be applied to plants whose dynamics are known. If
the plant dynamics are known, many analytical and graphical approaches to the
design of PID controller are available, in addition to Ziegler-Nichols tuning
rules. See Example 10-1, page 686, Ogata 4th Edition!
28
14
Example:
We are asked to find PID coefficients for a control system. It has been
observed that as we implemented P controller and increased it to 3,33,
the oscillations have started. The oscillations have a period of 500 mili-
seconds. What are the suitable values for the controllers?
Procedure:
1. Use P control and try
Kp from 0 to Kcr.
2. Kcr is where there is
sustained oscillations
3. Determine
4. Use Table to
determine constants
29
Example: Consider the following system. Apply a Ziegler–Nichols tuning rule for the
determination of the values of parameters and Then obtain a unit-step response curve
and check to see if the designed system exhibits approximately 25% maximum
overshoot.
30
15
31
32
16
33
34
17
Additional note about ZN metods
Controller Tuning using Computational Method
Remember ZN 2nd method proposes the following PID controller:
1
G (s) = K (1+
(s +
This is in the form: Gc (s) = K
Alternatively we can write a Matlab code that searches suitable K and
a values for the required overshoot and settling time.
35
36
18
37
38
19
39
Controller = pid(Kp,Ki,Kd)
20
Example: Remember DC motor modeling example
J=0.5;B=0.1;Kt=0.1;Kb=0.5;Ra=1;La=0.5;
s=tf('s');
num=[Kt];
den=[La*J J*Ra+B*La B*Ra+Kt*Kb];
DCmotor=tf(num,den);
step(DCmotor);
C=pid(100,2,2)
41
Motor=feedback(C*DCmotor,1);
step(Motor)
Step response looks
stable, but oscillatory and
with overshoot.
C=pid(100,2,10)
Motor=feedback(C*DCmotor,1);
step(Motor)
The respone has been improved.
42
21
Continue CONTROLLER TUNING USING MATLAB
Alternatively we can let Matlab design controllers using the following
command
[C_pid,info] = pidtune(plant,'PID')
If you like, you can tune this controller (change any controller gains) such as
C_pid.Kp=100;
43
22
Format: Control System Tuner opens, set to tune this default
architecture. Next, specify the values of the blocks in the
architecture. Click to open the Standard feedback configuration
dialog box.
45
Type pidTuner(plant)
You can choose controller type, and adjust transient specs with two sliding
control buttons, and see its affect on step response.
46
23
Example: See this on the previous DC motor example
Adjust transient specs with two sliding control buttons, and see
itsaffect on step response.
47
• Interactive Bode, root locus, and Nichols graphical editors for adding, modifying, and removing controller
poles, zeros, and gains.
• Analyze control system designs using time-domain and frequency-domain responses, such as step responses
and pole-zero maps.
24
You can also click
edit architecture to
change settings
inside the App.
49
Type controlSystemDesigner(plant)
Same Example:
type
controlSystemDesigner(DCmotor)
50
MAK333E System Dynamics and Control Course
25
Click tuning methods and choose PID for automatic tuning.
51
52
MAK333E System Dynamics and Control Course
Lecture Notes, Dr. E. Altuğ
26
JAVA BASED CONTROL EXERCISES
http://janismac.github.io/ControlChallenges/
53
MAK333E System Dynamics and Control Course
Lecture Notes, Dr. E. Altuğ
27
CLASSIFICATION OF CONTROL SYSTEMS
Control systems may be classified according to their ability to follow
step inputs, ramp inputs, parabolic inputs and so on.
This is a reasonable classification scheme because actual inputs may
frequently be considered combinations of such inputs.
The magnitudes of the steady-state errors due to these individual
inputs are indicative of the goodness of the system.
Consider the unity-feedback control system with the following open-loop
transfer function G(s):
28
As the type number is increased, accuracy is improved; however,
increasing the type number aggravates the stability problem. A
compromise between steady-state accuracy and relative stability is
always necessary.
We will see that, if G(s) is written so that each term in the
numerator
and denominator, except the term sN , approaches unity as s
approaches 0, then the open-loop gain K is directly related to
thesteady-state error.
Let us investigate and fill the Table below, the steady-state errors for
type0, type 1, and type 2 systems when they are subjected to various
inputs.
STEADY-STATE Step Input Ramp Input Acceleration
ERRORS r(t) =1 r(t) =t Input r(t) =t2/2
Type 0 system ? ? ?
Type 1 system ? ? ?
Type 2 system ? ? ?
57
The transfer function between the error signal e(t) and the input signal
r(t) is
E( s ) C( s )
= 1- =
R( s ) R( s ) 1 + G( s )
where the error e(t) is the difference between the input signal and the
output signal.
58
29
The Final-Value Theorem provides a convenient way to find the
steady-state performance of a stable system. Since E(s) is
R( s ) R( s )
The steady-state error is
sR( s )
e = lime( t ) = limsE( s ) = lim
The static error constants defined in the following are figures of
merit of control systems. The higher the constants, the smaller the
steady- state error.
In a given system, the output may be the position, velocity, pressure or
temperature, or the like. The physical form of the output, however, is
immaterial to the present analysis. Therefore, in what follows, we will
call the output ‘position’, the rate of change of the output ‘velocity’ and
so on.
59
sR( s ) 1
ess = lim sE( s ) = lim = lim s =
s®0 s®0 1 + G( s ) s®0 1 + G( s ) s 1 + G( 0
)
The static position error constant Kposition is defined by
K position = limG( s ) = G( 0 )
s®0
Thus, the steady-state error in terms of the static position error constant Kposition
is given by
1 + K position
60
30
For a type 0 system,
p
s®0
K( Tas + 1 )( Tb s + 1 )...
p = lim = ¥, for N ³ 1
1 2
61
62
31
q If small errors for step inputs can be tolerated, then a type 0 system
may be permissible, provided that the gain K is sufficiently large. If the
gain K is too large, however, it is difficult to obtain reasonable relative
stability.
q If zero steady-state error for a step input is desired, the type of the
system must be one or higher!
63
Static Velocity Error Constant Kv: The steady-state error of the system
with a unit-ramp input is given by
1
= lime( t ) = limsE( s ) = lim s = lim
1 + G( s ) s2 s®0 sG( s )
The static velocity error constant Kv is defined by
Kv = limsG( s )
s®0
1
ess =
K
64
32
Thus, the steady-state error in terms of the static velocity error constant
Kv is given by
1
ss =
The term velocity error is used here to express the steady-state error
for a ramp input. The dimension of the velocity error is the same as
the system error. That is, velocity error is not an error in velocity,
but it is an error in position due to a ramp input!
65
ess =
Kv
1
ess = = , for type 1 systems
Kv
ess =
Kv
66
33
e
K
1 1
e = = , for type
K K
1
ess =
The type 2 or higher system can follow a ramp input with zero error at
steady state.
68
34
ess =
a
Note that the acceleration error, the steady-state error due to a
parabolic input, is an error in position.
The values of Ka are obtained as follows:
70
35
For a type 2 system,
s 2 K( Tas + 1 )( Tbs + 1 )...
Ka = lim
s®0 s ( T1s + 1 )( T2s + 1 )...
ess
72
36
Summary: The Table below summarizes the steady-state errors for type
0, type 1, and type 2 systems when they are subjected to various inputs.
K = limsG( s ) K = lims2G( s )
s®0 s®0
STEADY-STATE Step Input Ramp Input Acceleration
ERRORS r(t) =1 r(t) =t Input r(t) =t2/2
Type 0 system 1/(1+Kp) ∞ ∞
The finite values for steady-state errors appear on the diagonal line.
Above the diagonal, the steady-state errors are infinity, below the
73
diagonal, they are zero.
37
Example:
Figure 5-58
75
z =
76
38
B 2z
ess = = , z = , w =
K w 2 KJ
77
78
39
79
80
40
81
82
41
42