Tutorial PID Control
Tutorial PID Control
A tutorial on PID-control1
Katrien De Cock, Bart De Moor, Willem Minten, Wim Van Brempt, Herman Verrelst2
January 1997
1
5 Control Laws 40
5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.2 On-O Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.2.1 General Working Principle . . . . . . . . . . . . . . . . . . . . . . . . 41
5.2.2 Hysteresis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
5.3 PID-Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
5.3.1 Open Loop performance of a PID-controller : the control law . . . . . 44
5.3.2 Closed Loop performance of a PID-controller . . . . . . . . . . . . . . 45
P-action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
I-action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
PI-action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
PD-action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
PID-action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.3.3 Technical Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.3.4 PID-Control in Processes with dead-time . . . . . . . . . . . . . . . . 52
5.3.5 Anti Wind-Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
6 Control Con gurations 58
6.1 Master-Slave Control (Cascade Control) . . . . . . . . . . . . . . . . . . . . . 58
6.2 Feed-forward Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
6.3 Split-Range Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
6.4 Ratio Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
7 Tuning Methods 63
7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
7.2 Heuristic Tuning Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
7.2.1 Trial-and-Error tuning method . . . . . . . . . . . . . . . . . . . . . . 63
7.2.2 Ziegler-Nichols Tuning Rules . . . . . . . . . . . . . . . . . . . . . . . 64
7.3 Stability Limits (Routh-Hurwitz) . . . . . . . . . . . . . . . . . . . . . . . . . 68
7.4 Root Locus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
7.5 Bode Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
7.5.1 P-control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
7.5.2 I-control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
7.5.3 D-control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
7.5.4 PI-control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
7.5.5 PD-control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
7.5.6 PID-control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
7.6 Auto-Tuners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
7.7 Optimal Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
7.7.1 Output feedback optimum control strategies . . . . . . . . . . . . . . . 82
Classical time-domain performance measures . . . . . . . . . . . . . . 83
Some important guidelines . . . . . . . . . . . . . . . . . . . . . . . . 90
Response shape time domain performance measures . . . . . . . . . . 92
7.7.2 State feedback optimum control strategies . . . . . . . . . . . . . . . . 94
2
8 Seminar tasks 96
8.1 Zitting 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
8.2 Zitting 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
8.3 Zitting 3, 4 en 5: De electromagnetische YoYo . . . . . . . . . . . . . . . . . . 108
8.3.1 Algebrasche beschrijving . . . . . . . . . . . . . . . . . . . . . . . . . 109
Niet-lineair toestandsruimtemodel . . . . . . . . . . . . . . . . . . . . 109
Linearisatie . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
8.3.2 Simulatie . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
8.3.3 Opdracht . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
8.3.4 Verslag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
3
Chapter 1
Introduction
1.1 Why Control?
Control-engineers face two main problems:
The regulator problem: The aim is to keep the system's output as close as possible to
a xed set-point (to keep the system in an operating point), in the presence of distur-
bances. Such disturbances are e.g. measurement noise, additional inputs, etc.
E.g. we want to maintain the temperature inside a room at 17 degrees.
The tracking problem: The aim of tracking control is to let the output and/or the states
track a desired trajectory or reference signal as close as possible.
E.g. We desire a robot arm that follows as close as possible a certain path in space.
Generically, both problems must be solved simultaneously: we would like to track a reference
trajectory/signal (including a good steady state accuracy), even if there are disturbances and
process uncertainties.
The goal of this seminar is to present a method for designing control systems. The emphasis
will be on control laws and control con gurations that are frequently used in today's industrial
applications.
4
Once the system is analysed, the desired performance must be expressed in terms of the
di erent performance measures that are chosen. The importance of a certain perfor-
mance measure depends on the type of control problem to solve. We must stress that
control is not the one and only way to achieve some goals. Analysis of the problem
can reveal some structural design problems in the system under consideration. Again
referring to the heating problem, the inside temperature can be controlled such that it
is not very sensitive for perturbations in the outside temperature. But one might as
well think of putting a better thermal isolation such that the problem will not rise that
easily.
Control Con guration: which signal(s) are used to calculate the control signal?
Depending on the plant, the desired performance speci cations and the allowed com-
plexity of the control system, a control con guration must be chosen. Depending on
the type and the number of input signal(s) to the controller di erent con gurations are
recognised.
Control Law: which algorithm is used to calculate the control signal?
Once the control con guration is xed, the control law must be chosen. When the
designer is experienced and familiar with a speci c control law, it is good practice to
choose that law rst!
Parameter Design (Tuning): which are the parameters of the algorithm to calculate the
control signal?
Once a control law is chosen, the di erent control parameters must be tuned. For each
control law, di erent quantitative techniques and/or qualitative rules are known.
Evaluation: how will the controlled system behave in theory?
As soon as the controller is tuned on a computer, the controlled system must be evalu-
ated by means of e.g. test-simulations. When the speci cations are met, the controller
can be implemented. In the other case, when not all speci cations are met, di erent
actions may be undertaken, respecting the following order:
{ Change the control law, for example by adding or changing a controller parameter
(e.g. from PI- to PID- or PD-control).
{ Change the control con guration.
{ Relax the design speci cations.
Implementation and Veri cation: how will the control system be realized? How does
the controlled system behave in practice?
The controller will be implemented and one will verify whether the system is controlled
as expected.
From the foregoing analysis, one can conclude that the classical controller design process is an
iterative process. In the next sections, the di erent steps are described in detail. Besides this
classical way of designing a control system, also a new 'mechatronic' way of design is under
development. The main di erence with the sequential design lies in the fact that both system
design and control design aspects are treated simultaneously. This is however not treated in
this text.
5
Figure 1.1: A possible procedure to develop a control system.
6
Chapter 2
Plant Modelling
2.1 Introduction
In order to be able to design a controller for the system under concern, we must know which
system we are dealing with. Two di erent methods exist to obtain a model (in the form of a
transfer function): physical modelling and identi cation.
7
p
v
amax A m
q k
valve R
q pump
where all these (and the following) physical values are in S.I. (i.e. q [ ms3 ], and
[ mkgs ]).
The second term in the right half of the equation represents the increased volume
due to a change in postion x. The third term represents a mass accumulation
8
which is re ected by an increased pressure and isothermal compressibility index
. V1 (x) is the total instantaneous volume. We assume for simplicity reasons that
V1 (x) can be regarded as constant in this equation (in reality V1 = Vo + Ax).
The ow in the valve can be written as:
r
qvalve = Cd amax v 2p
100 (2.3)
(T ) = o (1 T)
This disturbance will not be taken into account though.
The pump ow qpump may be assumed to be constant. However it might uctuate.
These changes could be modelled as steps. We will model the pump ow as a
pulsating ow. Then it is written as:
n
qpump = Npump 1 + sin Npump
60 t
The sinusoid represents the ow variations due to the pump construction with n
chambers. Npump is the nominal number of revolutions per minute. and are
proportional values.
Summarising:
The input variable is the percentual valve aperture v.
The variables to observe are: x, x_ and p.
Disturbances are qvalve and temperature T .
Next step is the linearisation of the equations. we notice that the equation that de-
scribes qvalve is a nonlinear function of p and v. We have:
qvalve = f (p; v)
We'll approximate this function by its rst order Taylor expansion in the operation
point (q; v; p).
9
One nds:
K = @f
@v = Cd a100 p
max 2
(2.4)
p;v
L = @f
@p = Cd amax v
100
1
2p (2.5)
p;v
0 , v0
In the operating point (qvalve ; v; p) it is easier to work with deviation variables qvalve
and p0 , which indicate the deviation from the operation point:
0
qvalve = qvalve qvalve
p0 = p p
v0 = v v
In this way the equation is completely linearised:
0
qvalve = Kv0 + Lp0 (2.6)
Also the ow equation can be reduced since in equilibrium state
x_ = 0; p_ = 0
qvalve = qpump
Thus:
0
qpump 0
= qvalve + Ax_ 0 + V1 p_0 (2.7)
H (s) = X (s) =
V (s ) V1
AK
m s3 + Lm + V1 R s2 + LR + V1 k + A2 s + kL
qvalve = Cd amax v 2p
100
qvalve = qpump
kx = pA
For a pump with N = 2000rpm and valve opening v = 50%, one calculates easily that
in steady state:
p = 20bar
Q valve = 34:5 min
l
x = 0:5m
If we take this steady state as operating point, K and L can be calculated:
K = Cd a100
max 2 p = 1:15 10 5 m3
s
r
L = Cd amax v
100
1 = 1:44 10
2p
10 m3
s Pa
The linearised transfer function is now:
First the nonlinearised system was simulated in Simulink. This simulink diagram is
shown in Figure 2.2.
A step-response of this positioning system to a change in valve opening together with
the approximated linearised response is given in Figure 2.3.
12
t
Clock To Workspace1
Spring
R v
Friction To Workspace4
− 1/m x
− 1/s 1/s
A + Integrator Integrator + To Workspace
Gain −
Sum a−>v v−>x x0
Pressure Sum2
Lenght A +
+ beta/u
Surface Total Volume Compressibility
V0
Dead Volume
A −
− * 1/s Cd*amax/100*sqrt(2/ro*u) *
Gain5
pump + Qvalve1 Integrator
dp/dt−>p Fcn Qvalve
Pump Flow Sum1 qv
p To Workspace3
Step Input
To Workspace2 Valve position
13
a
0.5
0 b
0.50 5 10 15 20 25 30 35 40 45 50
0.45
0.4 c
0.50 5 10 15 20 25 30 35 40 45 50
0.49
0.48 d
0.520 5 10 15 20 25 30 35 40 45 50
0.5 e
0 5 10 15 20 25 30 35 40 45 50
0.6
0.5 f
0 5 10 15 20 25 30 35 40 45 50
1
0.5
0 5 10 15 20 25 30 35 40 45 50
Figure 2.3: Step Response of the Hydraulic Positioning System to a change in valve position. The
step takes place after 5 seconds and starts at 50% valve opening. The response is given in solid, while
the linearised response is given in dashed. 0.5m is added to the linearised response, which corresponds
with the operating point. Notice the deviation from the true response when the input gets big. Notice
the nonlinearity in the true response. The step input is a) 70%, b) 55%, c) 51%, d) 49%, e) 45%, f)
30%.
14
2.3 Identi cation
2.3.1 Introduction
A completely di erent way to obtain a system model, is to use identi cation methods. This
is called 'black box' modelling, since one is not interested anymore in all internal working
mechanisms, but only in input-output relationships. In very complex systems (e.g. chemical
process plants etc.) this can be the only way to obtain a somewhat decent model. The
procedure is to gather input-output data sets and to try to t a mathematical model that
relates the output signal with the input signal. This method is extensively treated in the
course on 'Identi cation and Multi-variable Systems'.
Some graphical identi cation methods that are quite common in industrial practices will be
presented here. These so-called eye-ball methods are very quick methods which deliver a
rst-order or second-order system, based on a simple step-test. They're susceptible to noise,
and will hardly ever give as good results as numerical methods. They are very handy though
for having a quick idea about your system. The idea is to interpret the system response as if
it were a rst order or second order system. Higher order dynamics are neglected, and this
can give a good result if the remaining time constants are very small compared with the two
dominant ones.
The model is formed after the evaluation of a step test. Depending on the type of system, a
response to a step input can di er signi cantly. In Figure 2.4 various typical responses are
shown. Notice especially the second order under-damped response (a) and the rst order or
second order over-damped response (b). For a second order response, the transfer function
G(s) can be written as:
2 e s
G(s) = s2 +K!
2!s + !2
For > 1 one can show that the response has no overshoot; it is called an over-damped
system. For < 1 the system is called under-damped, since overshoot will be present.
2.3.2 Graphical tting of rst order processes using step-tests
Tangent Method
If a step input is applied to a rst order process, a typical output is shown in Figure 2.5. It
is easily found that a rst order process with gain K and time constant
G(s) = sK+ 1
can be deduced from the plot. K is the ratio of the steady state value of the response to the
step amplitude (s = 0). is the value of t at which the response is 63% complete. It is also
the time at which the tangent of the step response in t = 0 intercepts the nal value.
15
a b
1.5 1
1
0.5
0.5
0 0
0 5 10 0 5 10
c d
10
5
0
0
0 5 10 0 5 10
e f
1 1
0.5 0.5
0 0
−0.5 −0.5
0 5 10 0 5 10
Figure 2.4: Typical Step Responses: a.oscillatory b. rst order c.integrator d.unstable e.non minimum
phase f.dead-time.
In ection Method.
Very few experimental plots of the step response show purely rst order behaviour because:
The true process is neither rst order nor linear.
It is dicult to form a perfect step input. Usually process equipment cannot change from
one setting into another instantaneously, but must be ramped. If the ramp time is small
though compared with the system's time constant, the approximation is reasonable.
Due to measurement noise or non-uniformities in the variables, the data will be cor-
rupted.
To account for higher order dynamics that are neglected in the simple rst-order model,
a time delay is introduced. This extra time delay will improve the agreement between the
experimental data and the obtained model. The model under concern is given by:
s
G(s) = Ke
s + 1
This model will not only be used for rst order plants with delay, but also for higher order
systems. To nd the delay (see also Figure 2.6):
The gain K is the steady state value of the step response divided by the input amplitude.
A tangent is drawn at the point of in ection (steepest slope) of the step response. The
intersection of the tangent line and the horizontal axis is the time delay .
Where the tangent intersects the steady-state value of the step response, the time
elapsed corresponds to t = + . So time constant can be found.
16
4
3.5
yss
2.5
0.63yss
1.5
0.5
0
0 0.5 τ
1 1.5 2 2.5 3 3.5 4 4.5 t5
Figure 2.5: Tangent Method.
2.5
1.5
0.5
0
0 1 2 3 4 5 6
θ τ
Figure 2.6: Eye Ball Method for rst order process with dead-time.
17
35%-85%-Method
The major disadvantage of the time-delay estimation method discussed above, is the diculty
to nd the point of in ection due to measurement noise or small graphs. Therefore an
alternative method has been proposed that uses two time instants in order to estimate and
. The time t1 and t2 correspond to respectively 35% and 85% response. and are then
found using the following equations:
= 1:3t1 0:29t2
= 0:67(t2 t1 )
As an example, the in ection method and the 35%-85%-method are applied to the next
system:
e 0:1s
P1 (s) = (s + 1)212
(s + 2)(s + 3)
With the in ection method, one obtains K = 2, = 1 and = 3:1, which gives the
simulated response of Figure 2.7).
2.5
1.5
0.5
−0.5
0 1 2 3 4 5 6 7 8
Figure 2.7: In ection Method. The noisy curve is the measurement, the other one the step response
of the identi ed system.
With the 35% 85% -time response method, one gets t1 = 2:2 and t2 = 4:3, resulting in
= 1:41 and = 1:61 with simulation shown in Figure 2.8.
2.3.3 Graphical Fitting of second-order models using step-tests
A better approximation to the step response can be expected using second-order models.
Three methods will be treated: Harriot's, Smith's and a model for oscillatory systems. In all
these methods the delay is determined by visual inspection or with the in ection method.
18
2.5
1.5
0.5
−0.5
0 1 2 3 4 5 6 7 8
Figure 2.8: 35%-85%-time method. The noisy curve is the measurement, the other one the step
response of the identi ed system.
19
Harriot's Method
In Harriot's method one tries to t an over-damped model without numerator dynamics. The
transfer function is given by:
s
G(s) = ( s +Ke
1)(2 s + 1)
1
In Figure 2.9 Harriot plotted the range of shapes that can occur in the over-damped case
with two time constants 1 and 2 . As can be seen in Figure 2.9, all curves seem to pass
approximately through the 73%-of-steady-state-value at the same point. This led to a rst
equation:
1 + 2 = t173%
:3
y/yss 1
0.9
0.8
0.7
0.6 τ2/τ1=0
0.5
τ2/τ1=1
0.4
0.3
0.2
0.1
0
0 0.5 1 1.5 2 2.5 3
t /(τ1+τ2)
Figure 2.9: Step Response for several over-damped second-order systems
In Figure 2.9 one also notices that the deviation between the di erent curves is largest
for t=(1 + 2 ) = 0:5. Therefore Harriot plotted the output value at this point, for di erent
values of 1 =(2 + 1 ). The result can be found in Figure 2.10. Based on the former equation
and this Figure, one determines 1 and 2 . If the response is less than 26 % or more than
39 % of the steady state value at t=(1 + 2 ) = 0:5, this indicates that the process requires a
higher order model, or that the process is under-damped.
Harriot's method executed on the previous example, results in: = 0:6, K = 2, t73% =
3:6 0:6 = 3:0, and thus 1 + 2 = 2:3. For t=(1 + 2 ) = 0:5, corresponding with t = 1:15.
On the graph, one nds for t = 1:15 + 0:6 that y = 0:5=K = 0:25. In Figure 2.10 one nds
nally that 1 = 2 = 1:15. The simulation is shown in Figure 2.11.
20
y/yss 0.4
0.38
0.36
0.34
0.32
0.3
0.28
0.26
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
τ2/τ1
1.8
1.6
1.4
1.2
0.8
0.6
0.4
0.2
0
0 1 2 3 4 5 6 7 8
Figure 2.11: Simulation of model obtained with Harriot's method. The noisy curve is the measure-
ment, the other one the step response of the identi ed system.
Smith's Method
Smith's method uses the model transfer function
s
G(s) = 2 s2 Ke
+ 2s + 1
that can be used for both over-damped and under-damped systems. The model makes
use of two points : the 20% and the 60% of steady-state value. First the apparent dead time
is removed with the in ection method or by visual inspection. Based on Figure 2.12, and the
21
estimation of t20 % and t60 % one nds and . Figure 2.12 was developed by Smith.
1.5
0.5
−0.5
0 1 2 3 4 5 6 7 8
Figure 2.13: Simulation of model obtained with Smith's method. The noisy curve is the measurement,
the other one the step response of the identi ed system.
22
Model for systems with oscillatory step response
For oscillatory systems the model
2 e s
G(s) = s2 +K!
2!s + !2
can be used. Dead time can be found with e.g. the in ection method and K can be found
as the ratio between steady state value of the step response and step input value.
From Figure 2.14 one nds logarithmic decrement d and period Tp .
d = aa2
1
=q 1
1 + (2=logd)2
!= 2
p
Tp 1 2
1.5
a
a1 aad
1 2
Tp
0.5
0
1 2 3 4 5 6 7 8 9 10
Figure 2.14: Graphical determination of parameters for plants with oscillatory step response.
23
2.3.4 Model for Integrating Systems
Recall that integrating systems have a transfer function with a pure integrator 1=s factor.
The response of such a system to a step input, is a ramp. A steady-state value is never
reached. Two eye-ball methods are treated.
Impulse Response
If an impulse is applied to an integrating process, a steady state is obtained though. It can
be compared to applying a step to a non-integrating process. After normalising the response
by dividing by the pulse area (since an ideal impulse can not be made in practice), previous
methods for step tests can be applied. The transfer function of the integrating system is then
obtained by multiplying with 1=s.
Step Test
A model can be:
G(s) = s(1 K
+ s ) e
s
K and ( + ) can be found as indicated in Figure 2.15. This gives two equations for 3
unknowns. The response of the given system to a step input, can be found as (by calculation
of the inverse Laplace transform):
(t )= ))
y(t) = K (t (1 e
This is the missing equation. If one knows one y(t) value, and can be calculated.
y3
00
−1
K (τ+θ)
−2
−3
00 0.5 1 1.5
τ+θ 2 2.5 3 3.5 t4
24
Chapter 3
Plant Analysis
For control design purposes, we're mainly interested in dynamic analysis of the plant. This
means that we are not only interested in the steady-state response of a plant. Also the
transient response is of great importance. So, when we refer to the plant's dynamics, we are
talking about the transients that occur in a process output, caused by a change in process
input.
A plant is said to be static when a change in input variable results in an immediate change
in output value - which however does not change anymore after that very moment, if the input
also remains constant. No transient response occurs.
Nearly all processes have dynamics, but some of them can be neglected in the presence of
other processes. For example, in a slow thermal process, in which a room is heated, the
opening of some valves in the burner can be regarded as static since their transient response
is so fast compared with the heating so that this aspect can be regarded as an immediate
transition.
In classical analysis, various characteristics are used to analyse a plant. Depending on the
needs, di erent plots are used to visualise speci c properties:
1. Pole-zero plots express stability properties.
2. Nyquist and Bode plots can be used to study the in uence of sinusoidal inputs. Also
stability can be analysed.
3. Time responses can be used to characterise the plant's behaviour for speci c input
signals.
Although each plot visualises its related properties quantitatively, it also predicts various
other plant properties qualitatively. In fact, the di erent plots can be seen as complementary
information (Figure 3.1).
the complex variable s. This transfer function relates the Laplace transform U (s) of the input
signal u(t) to the Laplace transform Y (s) of the output signal y(t) by:
= min
i
[ real(pi )]
Negative values of correspond to an unstable plant, while positive values correspond
to a stable one. The absolute stability of a plant grows with . When decreases, the
velocity of the system decreases also.
Furthermore, the stability ratio r of two stable plants P1 (s) and P2(s), with respective
stability degrees 1 and 2 , is de ned as:
r = 1
2
If r is larger than one, plant P1 (s) is the most stable one, if r is smaller than one,
plant P2 (s) is the most stable one.
Another important property of stable plants, the damping degree , is determined by
the 'most diagonal' pole (the least damped):
= min j real(pi) j
i imag(p ) i
If decreases, the velocity of the system increases (positive e ect), but the tendency to
oscillate increases (negative e ect).
But not only the poles determine the plants properties, the plants behaviour is also in uenced
by the position of the zeros.
If one or more zeros of the plant are in the right-half plane, the system is said to be non-
minimum phase. In all other cases, the system is a minimum phase system. It can be proven
that only non-minimum phase systems can give rise to undershoot.
Example 1 Consider the following plants (normalised DC-gain):
P1 (s) = (s + 3)(s26+ 2s + 2)
P2 (s) = (s + 0:1)(0s:22+ 2s + 2)
27
P3 (s) = (s + 3)(s290+ 2s + 30)
28
10
Imag Axis
x
0 x
x
-5
-10
-6 -5 -4 -3 -2 -1 0 1 2
Real Axis
0.6 1.5
0.4
Amplitude
Amplitude
1
0.2
0.5
0
-0.2 0
0 2 4 6 8 0 5
Time (secs) Time (secs)
Figure 3.2: Pole-zero plot, impulse response and step response for the plant P1 (s).
10
5
Imag Axis
x
0 x
x
-5
-10
-6 -5 -4 -3 -2 -1 0 1 2
Real Axis
0.1 1
0.08 0.8
Amplitude
Amplitude
0.06 0.6
0.04 0.4
0.02 0.2
0 0
0 50 0 50
Time (secs) Time (secs)
Figure 3.3: Pole-zero plot, impulse response and step response for the plant P2 (s).
10
5 x
Imag Axis
0 x
-5 x
-10
-6 -5 -4 -3 -2 -1 0 1 2
Real Axis
3 1.5
2
Amplitude
Amplitude
1
1
0.5
0
-1 0
0 5 0 5
Time (secs) Time (secs)
Figure 3.4: Pole-zero plot, impulse response and step response for the plant P3 (s).
29
10
5 x
Imag Axis
0 o x o
-5 x
-10
-6 -5 -4 -3 -2 -1 0 1 2
Real Axis
20 4
3
10
Amplitude
Amplitude
2
0
1
-10
0
-20 -1
0 5 0 2 4 6 8
Time (secs) Time (secs)
Figure 3.5: Pole-zero plot, impulse response and step response for the plant P4 (s).
10
5 x
Imag Axis
0 o x o
-5 x
-10
-6 -5 -4 -3 -2 -1 0 1 2
Real Axis
20 4
10 2
Amplitude
Amplitude
0 0
-10 -2
-20 -4
0 5 0 2 4 6 8
Time (secs) Time (secs)
Figure 3.6: Pole-zero plot, impulse response and step response for the plant P5 (s).
P (j!) = P (s)js=j!
Furthermore, it is known that each input signal can be written as a sum of sinusoids (using
the Fourier transform). Therefore, for linear systems, it is sucient to analyse the plant for
sinusoidal inputs.
To do the analysis for sinusoidal inputs, consider the input signal u(t) = sin(! t). It can be
proven that the output signal y(t) becomes in steady state (i.e. after the transient behaviour):
y(t) = Msin(! t + )
30
These calculations can be repeated for di erent frequencies ! . The Nyquist plot and the
Bode plot are two plots that visualise P (j! ) as a function of ! .
The Nyquist plot shows the complex function Pr + jPi in the complex plane (with ! as a
parameter), while the Bode plot shows the gain M and the phase shift as a function of the
frequency ! . Examples are given in Figures 3.7 and 3.8.
40
30
20
10
Imag Axis
-10
-20
-30
-45 -40 -35 -30 -25 -20 -15 -10 -5 0 5
Real Axis
40
20
Gain dB
-20
10 -1 10 0 10 1 10 2 10 3 10 4
Frequency (rad/sec)
-100
Phase deg
-200
-300
-400
-500
10 -1 10 0 10 1 10 2 10 3 10 4
Frequency (rad/sec)
31
A pole in the left half plane (LHP) corresponds to a decreasing phase shift, a pole in
the right half plane to an increasing phase shift.
A zero gives rise to an increasing gain in the Bode plot, starting from the frequency
that corresponds with the zero.
A zero in the LHP corresponds to an increasing phase shift, a zero in the RHP to a
decreasing phase shift.
One should be extremely careful with Bode plots of unstable systems. The Bode plot
exists and will be drawn by simulation software (e.g. Matlab). It has however no real physical
meaning, since the slightest transient response results in an ever increasing output signal.
Theoretically one could choose initial conditions such that no transient occurs, and the bode
plot then shows the steady state response. In reality the system would however become
unstable due to inaccuracies, noise, disturbances etc. The question raises how one can check
whether a bode plot corresponds with an unstable system. Take care: if one checks gain and
phase margin, one is analysing stability of the closed loop system! To check stability of the
open loop system, one can take in account the following statements:
For a plant, to be stable, it is required that there is no frequency on the Bode plot where the
gain decreases and the phase shift increases!
Further, if there is a frequency where the gain and the phase shift decrease, the plant is
guaranteed to be non-minimum phase (thus undershoot is possible!)
32
However, for many practical plants, it is impossible to apply a unit impulse, but it is easy to
apply a step input. In that case, the response y(t) for a unit step u(t) (Laplace transform
U (s) = 1s ) will be observed. The Laplace transform Y (s) is:
Y (s) = P (s) 1s
From the nite value theorem, the output value for t ! 1 can be calculated:
33
Chapter 4
Figure 4.1: Classical feedback control: in this scheme, y denotes the plant output or sensor signal,
u denotes the plant input or actuator signal, r denotes the reference or command input signal and e
denotes the error signal.
The plant's transfer function is given by P (s), while the transfer function of the controller is
given by C (s). The open loop transfer function L(s) is:
H (s) = 1 +L(Ls()s)
The transfer function that describes the dynamics between the reference input and the
error, is given by:
E (s ) = 1
R(s) 1 + C (s)P (s)
4.1 Closed-loop stability
To guarantee absolute stability of the closed loop system H (s), the controller's parameters
need to be chosen such that all poles of H (s) are in the LHP. In practice, the stability degree
of the closed-loop system is required to be positive.
On the other hand, if the loop transfer L(s) itself is stable, the relative stability of the closed
loop system can be expressed by three di erent measures:
The positive gain margin (pgm) is the smallest increase in loop gain that results in an
unstable closed loop system. A positive gain margin smaller than 0 dB means that the
design yields an unstable closed loop system. In practice, a pgm of 2 dB is required in
order to guarantee sucient stability.
The negative gain margin (ngm) is the smallest decrease in loop gain that results in an
unstable closed loop system. A negative gain margin smaller than 0 dB means that the
design yields an unstable closed loop system. In practice, a ngm of 2 dB is required in
order to guarantee sucient stability.
The phase margin (pm) is the smallest decrease or increase in loop phase that results
in an unstable closed loop system. A phase margin lower then zero degrees means that
the design yields an unstable closed loop system. In practice, a pm of 45 degrees is
required in order to guarantee sucient stability.
Although it is sucient to check either phase margin or gain margin, it is advisable to meet
both speci cations. These measures can be visualised on the Nyquist plot and the Bode plot
(Figure 4.2).
−1 ϕ
−180
ω
Figure 4.2: Visualising the gain and phase margin on the Nyquist plot (l) and the Bode plot (r).
ω ω
∼
For frequencies below the bandwidth, j L(j!) j 1 and 1 + L(j!) L(j!), so:
H (j!) LL((j!
j!)
) =1
thus the system is able to track these signals. For frequencies above the cross-over
frequency, j L(j!) j 1 and 1 + L(j!) 1, thus:
H (j!) L(j!) 1
which implies that these higher frequencies are not 'followed' anymore: the system seems
to be 'insensitive' for them.
Output noise compensation can be studied by observing:
H (j!) = 1 + L1(j!)
For frequencies below the bandwidth, j L(j!) j 1 and 1 + L(j!) L(j!), so:
36
H (j!) L(1j!) 1
thus the system suppresses these noise components. For frequencies above the the
cross-over frequency, j L(j!) j 1 and 1 + L(j!) 1, thus:
H (j!) 1
which implies that these higher frequencies are not 'suppressed' anymore.
Figure 4.4: Quality measures for time domain performance, using the step response.
The steady state error ess is a measure for the steady state accuracy of a system. It is
the steady state di erence between a reference step input and the process output. Since
the relation between reference input and error is given by
E (s) = 1
R(s) 1 + C (s)P (s)
,
one obtains for a step input (R(s) = 1=s):
37
So ess is also equal to the DC sensitivity, i.e., for small changes in the open loop DC
gain, it gives the percentage change in closed loop DC gain divided by the percentage
change in the open loop DC gain. For example, if ess equals 0.1, a 10% change in open
loop DC gain will cause a change in the closed loop DC gain of about 1%.
Notice that the ess is zero when L(s) contains an integral term.
The steady state tracking error ess;tr is the di erence in steady state between a ramp
input to the system and a system's output.
One can calculate the steady state tracking error esss;tr as
Kv = slim sC ( s )P ( s ) = 1
!0 e
ss;tr
The rise time Tr is the smallest time at which the step response is at least 90% of its
asymptotic value (which is the closed loop DC gain). It can be veri ed experimentally
that this time is proportional to the inverse of the cross-over frequency !co: a system
with a high cross-over frequency will also have a high response speed.
The settling time Ts is the smallest time after which the step response stays within 5%
of its asymptotic value.
The overshoot os is the maximum amount by which the step response ever exceeds its
asymptotic value, expressed as a percentage of the asymptotic value.
The undershoot us is the maximum amount the step response dips below zero, expressed
as a percentage of the asymptotic value of the step response.
The required control e ort is the power needed in the actuator to realizeRthe control
action that is desired. Controllers can be optimised for minimising energy ( u2 dt) (e.g.
total heat generated in a motor) or for not exceeding a certain value of u (peak control).
In general an actuator's price reduces dramatically when less power is needed. Imagine
a crane positioning control: if a fast action is desired, speed is limited by the power of
the driving motor. It is pointless to get 100N-m out of a 10mN-m motor!
4.5 Conclusions
From the foregoing analysis, the following design criteria for a closed loop control system can
be derived:
In order to guarantee absolute stability, all closed loop poles are required to be in the
LHP. If the loop transfer L(s) is stable, a suciently high phase margin (positive or
negative) and gain margin guarantee a certain degree of stability (relative stability).
To obtain a high steady-state accuracy, L(s) should have a large DC -gain. This also
improves robustness of the controller. By adding integrating elements, this gain becomes
1.
To obtain a high bandwidth (good tracking, good disturbance compensation) and a
high response speed, the cross-over frequency must be high.
In order to obtain cheaper actuators, the control e ort must be minimised.
It is clear that these design criteria result in design con icts, so performance trade-o s must
be accepted.
39
Chapter 5
Control Laws
5.1 Introduction
The purpose of control is to generate input signals to a process (control signals) such that
relevant variables in the process behave in a desired way. In output control, only the output
variables are relevant (cfr. in state control, not only the outputs but also the system's states
are important).
It is clear that we shall try to obtain a desired output by introducing a well-chosen input into
our system. If the temperatures drops too much inside, we will put on the heating system.
On the other hand, if it gets too warm, we'll close the radiator a bit. Intuitively we relate the
input to the system to the deviation of our variable temperature from the desired value. On
the road you'll turn the steering wheel when you see you're leaving the road! The input into
the system, also called the 'control action', will be function of the deviation error. We will
open the radiator more when it is really icy then when the temperature is considerably warm.
This function will be called the 'control law'. It is interesting to notice already that some
systems need a control input though no set-point error occurs: we need to heat continually a
house in order to maintain the same temperature. An output that equals the desired set-point,
does not automatically imply a zero control action.
At this very moment we repeat the concept of open-loop and closed-loop systems.
We're talking about open loop if we're applying an input to a system and examine the output.
We close the loop when we apply an input to the system in function of the output (e.g. the
deviation of the output from a reference value). From the temperature example above (which
is a regulator problem) it is easily understood why to close the loop: we like to apply a
control action to the system that is function of the set-point error. It is also clear that it is
advantageous to measure the variable you want to control - though it is not a must.
When the reference value is varied (tracking), one must take into account that the closed-loop
system varies in a considerably di erent way than the open-loop system. Even more, this will
be the goal of the feedback design: to obtain a feedback system that responds faster, in a
more stable way, ... than the open loop system. It can be seen that a very slow system can
be made faster by applying a very strong control action (and thus requiring more energy). In
the heating problem a house can be warmed up 10 degrees in half a minute if you put enough
heating power - which will of course result in giant burners and convectors!
Although the impression may be given that the only way to control a system's output, is to
apply a function of the deviation error to the input, this is not the one and only truth. If
40
the system and the disturbances are known completely, one can calculate exactly what input
is to be generated to obtain the desired output. If you dispose of a model that describes the
relation between heating and temperature, you might calculate how much power you need to
put into the house - without measuring the actual temperature. In this case you're only using
a feed-forward block instead of a feedback controller.
In general a mixed con guration of feed-forward and feedback might exist. The goal of this
seminar is to present a method for designing control systems. The emphasis will be on control
laws and control con gurations that are frequently used in today's industrial applications.
0.6
y2
0.4 θ
0.2
0
0 1 2 3 4 5 6 7 8
1.5
u t off t on
0.5
0
0 1 2 3 4 5 6 7 8
5.2.2 Hysteresis
Whenever the process value to be controlled passes the reference level, the actuator is
switched. In processes with a short dead-time or in case of measurement noise on the con-
trolled variable, the controller will be switched on and o continuously (Figure 5.3). This is
often very harmful for the switching contacts and/or the actuators.
Therefore often hysteresis is introduced such that one switching point is replaced by a high
and a low switching point. Only when the process value gets higher than the high switching
point, the actuator is turned o . The controller only switches on when the process value
decreases under the lower limit (Figure 5.4).
By these means the switching frequency can be limited, though a lower frequency will always
result in a larger oscillation amplitude.
42
0.7
0.6
0.5
0.4
0.3
0.2
0.1
−0.1
0 0.5 1 1.5 2 2.5 3
Figure 5.3: The on-o controller with a noisy process. Both process value and control action are
shown.
0.7
0.6
0.5
0.4
0.3
0.2
0.1
−0.1
0 0.5 1 1.5 2 2.5 3
43
5.3 PID-Control
5.3.1 Open Loop performance of a PID-controller : the control law
In industrial environments, the PID-controller is still the most favourite feedback controller:
a vast amount of practical experience learns that the PID-controller has a structure which is
suciently versatile to cope in an excellent way with a multitude of process control problems.
Other advantages of the PID-law are the low number of design parameters and the fact that
the controller parameters can easily be related to performance measures.
The PID-controller is a linear controller. It transforms the error signal e(t) into the control
signal u(t). Since it is a linear controller, it can be studied in the time domain and in the
frequency domain.
In the time domain, the ideal control signal looks like:
u(t) = Kp e(t) + T1
Z
i
After Laplace transformation, this becomes:
44
where tc must be small compared to Td , to have a derivative action. When tc is chosen too big,
the third term becomes a proportional one, even for low frequencies. A possible PID-scheme
is given in Figure 5.5.
The open loop time response of a PID controller to a step error input, is shown in Fig-
ure 5.6. The P-action is fast since it reacts immediately to a change in process value. A
constant error results in a constant control action due to the P-term. The I-action causes the
control action to keep on growing if the error keeps the same. Therefore the error will always
decrease using a I-controller. Compared to the P-controller, the I-controller is rather slow.
The D-action reacts very fast when an error appears. It is only active at the moment that
the error changes.
Remark: In order to obtain a P-control action, a deviation must exist. Thus, if the
process needs some control action to maintain a certain position, a P-controller will never
obtain the desired value, since only a deviation can provide the action. It must be understood
that this happens in most cases: although the desired value is obtained, one must keep on
acting on the system. If we want a certain temperature at home (e.g. 20o C ), while the outside
temperature is 5o C , we need the radiators to give heat although the inside temperature is
already 20o C . Exactly, we need as much heat as heat that is lost to the outside world. So we
need a non-zero constant control action to maintain our desired value.
5
4.5
3.5
3
D
2.5
2
I
1.5
0.5
P
0
0 0.5 1 1.5 2 2.5 3 3.5 4
Figure 5.6: The PID-controller response to a step input in open loop. The P-action results in a
constant when the error is constant. The I-action keeps on growing, while D-action is only active at
the moment that the step is applied.
45
P-action
If we assume a plant with a DC-gain equal to K and a P-controller with gain Kp , one can
readily calculate that after the controller transients, the process output will not converge to
a reference r. An equilibrium will be found between output and error (Figure 5.7).
At equilibrium one obtains (see also paragraph 3.3):
e = 1 + 1K K r
p
r + e u y
Kp K
-
Figure 5.7: Static equilibrium between error and output with a proportional controller.
Only with an in nite DC-gain K or Kp , the error will be zero. So, a DC-o set between
reference value and process output will always exist with a pure P-controller. The error can
be made smaller by increasing Kp . Notice that, if the plant contains a pure integrator (a
1=s-factor), no o set will occur since the DC-gain of the plant is 1.
In order to understand better another e ect of the P-controller, we introduce the concept
'proportional band'. Since a controller is physically limited in its output (saturation), the
controller only reacts in a proportional way to its input in a certain region. That region is
the proportional band. If Kp is very large, the controller almost immediately reaches the
limits of the band when an error occurs. The proportional band is very small. Outside the
proportional band, the output is constant and not function anymore of the error. This is
shown in Figure 5.8.
46
u
umax
r y
umin
proportional
band
In Figure 5.9 this e ect is shown for a plant with transfer function P (s). The controller is
saturated on ( 3; +3). A step with unitary magnitude is applied to the closed loop function.
P (s) = s2 +1s + 1
1.4 1.4
1 1 1
0 0 0
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10
3 3 3
2 2 2
1 1 1
0 0 0
−1 −1 −1
−2 −2 −2
−3 −3 −3
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10
a b c
Figure 5.9: E ect of gain Kp on a response to a unit step in reference value. Above the process output
is shown, below the control action. a. Kp = 0:5. Notice the large steady state error. b. Kp = 5. The
steady state error is reduced, and there is some oscillation. c. Kp = 100. Nearly no steady state error,
but too many oscillations.
47
I-action
As already mentioned above, the P-action alone results in a steady state error. This can be
avoided by introducing an in nite DC-gain, realized by an integrator. The integrator action
is thus added in order to abolish DC o set. This can be understood since an integrator can
provide a non-zero output although the input error is zero. This is in contrary to the P-action
which cannot provide an action if the error is zero.
Since the I-action is not changing at all when the error is zero (an integral remains constant
when the input is zero), there is a real risk for overshoot. When the output value crosses
the reference value, the I-action is maintained (integral!). Thus the I-action will continue
in the same direction, which results in overshoot. The I-action will decrease however due
to the negative error, until it is zero. From that moment on the process-value will start
decreasing too (90o phase delay between control and error signal). The resulting oscillation
has a relatively large period. See also Figure 5.10.
a
1.5
0.5
0
0 5 10 15 20 25 30
b
1.5
A
1
B
C
0.5
0
0 5 10 15 20 25 30
Figure 5.10: E ect of an integrator control action. a. The reference value and the process output. b.
The control action. In point A the error becomes negative, nevertheless the I-action is its maximum
value! In point B the error is maximally negative, the integral is changing quickly. In C the error
is zero again and will become positive, thus the integral will grow again... Remark the 90o phase
di erence.
Decreasing the integration time Ti slows down the response even more, resulting in a more
oscillatory behaviour. It can be found that the integration time equals the time needed to
obtain (in open loop, applying a step input) the same control action as a unit proportional
control action. A short integration time results therefore in a strong I-action.
48
PI-action
Compared with the P-controller, the PI-controller eliminates the steady-state error. Com-
pared with the I-controller, the PI-controller is faster with a smaller oscillation period.
PD-action
In contrary to the I-action, the D-action is most active when the output crosses the reference
value. Since it is proportional to the derivative of the error, it can 'predict' how the error will
change in the near future, and will act in that way. Therefore it has a damping e ect and
one can choose a larger Kp value, which will result in less o set. The meaning of derivation
time (better: lead time) Td is the following: if we apply a unit ramp in open loop to a PD
controller, the P-controller will provide the same value as the D-controller, only after Td
seconds. The D-action is therefore Td seconds faster, or 'leads' the P-action by Td . The larger
Td , the stronger is the D-action compared to the P-one. This will be discussed later. See also
Figure 5.14.
PID-action
The I-action is added to eliminate steady-state error, the P-action to make the response faster,
and the D-action is added to provide damping.
5.3.3 Technical Terms
In reality, the terms P, I and D are not used. Gain, percentual proportional band, reset rate,
reset time, rate time, pre-act, derivative action .... are used instead.
With respect to the P-action the quantity gain or percentual proportional band (PB) is
used.
Gain = Kp.
The percentual proportional band is related to the proportional band. Remember
that the proportional band was that interval in process values that made the P-
action (output of the P-controller) go from one point of saturation to the other
one (y to u). The measurement range is de ned as the range of process values that
can be obtained using the full control span (u to y). Notice that this is the other
way round! Notice also that the proportional band need not to be equal to the
measurement range. See Figure 5.11 and Figure 5.12.
r r-y u u y
Controller K Plant K
p
+ -
PB (%) = K100K %
p
r y
umin
proportional
band
Measurement Range
Tn = 1r = KpTi
In Figure 5.13 one observes the open loop response of a PI-controller to a unitary step
input at the reference value. The P-action results in an immediate constant control
action. Moreover, the control action keeps on growing due to the I-action. One notices
that after one minute the control action has tripled the initial P-action. The reset rate
is thus 3.
50
u
reset rate
P-action
t
1 min
Figure 5.13: Reset Rate. The I-action repeats the P-action 3 times per minute, resulting in a reset
rate of 3.
With respect to the D-action one uses lead time, rate time and pre-act (Tv ). They all
have the same meaning, de ned as follows: if we apply a unit ramp in open loop to
a PD controller, the P-controller will provide the same value as the D-controller, only
after Tv seconds. It compares the proportional action with the derivative one. One can
nd:
Tv = Td
See also Figure 5.14.
20
18
16
14
12
10
0
0 1 2 3 4 5 6 7 8 9 10
Figure 5.14: Lead Time. Dashed is the ramp input, solid is the PD controller open loop output.
Notice the transient response due to the non-ideal derivative action. Lead Time is 10, since the ramp
due to the P-controller needs 10 seconds to increase as much as the immediate o set due to the
D-controller.
51
5.3.4 PID-Control in Processes with dead-time
The dead-time control problem is a very classic one. Everybody already tried to control the
water temperature when taking a shower. The problem consists in the fact that when the
control action is executed (when you open the tap slightly more), the process e ect takes a
time to feel the action. The water still has to move on in the tubes before the new temperature
gets out of the shower. This problem is frequently encountered in industry, where transport
delays are very common. It is not easy to tune these processes: the extra time delay results in
an additional phase shift, which decreases the relative stability. More overshoot and a more
oscillatory behaviour will be observed. Before implementing a controller, one must always
try to optimise the design in order to minimise the delays. If a PID-controller is chosen to
control the process, some rules of thumb exist that can help you to tune.
It will be supposed that the process to be controlled can be approximated by a second-
order process with dead time. In a lot of cases this assumption is valid. First a pure dead
time and an integrator with dead time will be analysed. The other cases will afterwards be
reduced to that same form.
In the case of a pure time delay with a proportional control (see Figure 5.15), one
can easily verify by hand that closed loop stability is very sensitive to the gain factor
(Figure 5.16) . With small gains, the feedback system is stable but the steady state
error becomes unreasonably large though.
e
r + Kp u e−θ s y
-
1 1 1
0 0 0
−1 −1 −1
0 5 10 0 5 10 0 5 10
Figure 5.16: Response of pure dead-time process with varying Kp: a. Kp = 0:7, b. Kp = 1, c.
Kp = 1:1. The output is solid, the reference input dashed.
52
In the case of a dead time together with an integrator , one sees that the process value
becomes smoother, and no o set error is presented. See Figure 5.17 and 5.18.
e Kp
r + u e−θ s y
Ti s
-
0.5
0
0 1 2 3 4 5 6 7 8 9 10
b
1.5
0.5
0
0 1 2 3 4 5 6 7 8 9 10
Figure 5.18: Response of pure dead-time process to integral control. a. Process output(solid) and
reference value(dashed) b. Control value. Notice the 25% overshoot characteristic.
In order to obtain 25% overshoot, it can be proven that one should choose the gain Kp such
that it satis es
Kp;25% = 4 Ti
where Ti is the integration time and the dead-time.
The instability region can be proven to start at Kp , being the double of the value obtained
for 25% overshoot:
Kp;instable = 2 Ti
Both a rst order and a second order process will be reduced to the previous case, resulting
in the 25% overshoot characteristic.
53
A rst order plant with transfer function P(s) can be transformed into the previous form
with a PI-controller. If the plant is given by
s
P (s) = 1Ke
+ sT 1
Kp (1 + sT + s2 T T )
C (s) = Kp(1 + sT1 + sTd ) = sT i i d
i i
If we equal
Ti = T1 + T2
Td = TT1 T2
i
we obtain again the integrator with time delay. Kp must be adapted such that the 25%
speci cation is obtained.
In general these conclusions can be simpli ed.
If T2 is much smaller than T1, the process can be approximated by a rst order
system, thus PI-control is sucient.
If the dead-time becomes bigger than the two time constants T1 and T2, the process
can be assumed as a pure time delay, resulting in a I-controller.
If the largest time constant T1 is much bigger than the dead-time, the process can
be assumed without dead-time, so a P-action might do the job.
These conclusions are summarised in Figure 5.19.
Notice that these PID-tuners tune for 25% overshoot. If one is interested in other design
goals, other tuning methods must be used.
54
100
10
PID PD T2
θ
I PI P
0.1
0.1 1 10 30 100
T1
θ
55
Summarised: the actuator will be saturated during a longer time. Further, during satu-
ration, the feedback is actually not working: it can be replaced by a xed-level input, which
gives rise to undesirable overshoots for processes with a low stability degree. The previous
e ect is called integrator wind up.
This phenomenon can be avoided by stopping the integration when the actuator saturates.
A clever way to do so is to force the output of the controller u to stay at the saturation limit
ul as long as the actuator is saturated. This can be done by implementing an extra feedback
loop which forces the di erence between actuator input and actuator output to be zero at all
times. The integral part of the controller can be used for this purpose (Figure 5.21). As long
as there is no saturation, ew = 0 and the PID-controller works in the normal way. As soon as
ew 6= 0, the extra loop tries to bring ew back to zero, to a rate which is inversely proportional
to Ta . This may drastically reduce the saturation time and improve the step response! Be
careful to take Ta not too small, if there is an active D-action (Td 6= 0), as spurious peaks
originating from it may drive the actuator into saturation for a short time: too quick resetting
during this short peak results in an unnecessary small value for the integrator
p output after
the peak has vanished. As a rule of thumb it is suggested to take Ta = Ti Td .
− +
56
0.35
0.3
0.25
0.2
0.15
0.1
0.05
−0.05
0 2 4 6 8 10 12 14 16 18 20
Figure 5.22: E ect of anti-wind-up on hydraulic positioning system.Solid: the response without
anti-windup (Ta = inf). Dashed: Ta = 1. Dotted Ta = 1000.
57
Chapter 6
Figure 6.1: Master-slave con guration. The outer loop represents the master, the inner loop the
slave.
Two control loops are distinguished: an inner loop and an outer loop. The inner loop
tries to control the fast modes of the system, while the outer loop controls the parameter we
are really interested in. The inner loop is also called the secondary loop or the slave loop,
while the outer one is called the primary or master loop.
Example 2 We try to keep the temperature in a vessel constant. The vessel contains an
exothermic process, so the temperature is controlled by the right amount of cooling uid. The
rst idea might be to use a single control loop, in which the temperature is controlled by the
position of the cooling uid input valve. This is shown in Figure 6.2.
However, it results that due to pressure changes the input ow is not constant. So one
tries rst to control the valve position such that a desired ow is guaranteed (slave). The valve
position is controlled by the slow temperature process (master). This is shown in Figure 6.3.
In order to tune master-slave loops, one has to take into account that:
One should rst tune the inner loop, while the outer loop is operating. Then the outer
loop is tuned.
Problems can arise if both loops are equally fast. As a rule of thumb the inner loop must
be at least 5 times faster than the outer one.
58
TT
Outlet
Cooling
Fluid
y
Reactor Vessel
r
TC
TC
TT
Outlet
Cooling
Fluid
r
slave
Reactor Vessel
FC
FT
For the inner loop in most cases a D-controller will be sucient, sometimes I-action
is added to lter high-frequent noise components. For the outer loop PI-action often
serves.
4
59
on beforehand. A distinction is made between reference feed-forward control and disturbance
rejection feed-forward control.
1. In reference tracking feed-forward control, the output should follow a well de ned
path. The inverse of the plant gives us the input necessary to obtain that path, since:
Figure 6.4: Feed-forward Control Con guration for reference tracking purposes.
One should take care when taking the inverse of the plant. Since a plant will always be
causal (re ected by a higher degree in the denominator), the inverse plant will be anti-
causal. Therefore, some extra poles should be introduced that limit the high frequency
behaviour. This results in a deteriorated high frequency response { but that's not too
dramatic since in most cases we're mainly interested in low frequency behaviour.
2. In disturbance rejection feed-forward control, one tries to compensate for distur-
bances to come. The disturbances are modelled by a transfer function H (s), and are
additive to the process output. If the disturbances can be measured, a feed-forward
scheme shown in Figure 6.5 is able to reject them.
-1 H(s)
C(s)=P (s)H(s)
- +
r + u + y
P(s)
60
The main disadvantage of feed-forward control is its disability to avoid steady-state errors.
Ideally, this never occurs. But with the slightest error in the plant/disturbance model, the
output won't exactly be what was planned. Since the error is not fed back, the controller
doesn't 'know' there is an o set.
Therefore a combination of feed-forward with feedback to eliminate steady-state errors is
mostly used. This is shown in Figure 6.6. Here feed-forward is used for tracking capabilities,
and feedback for steady-state accuracy. In normal working operation ideally only the feed-
forward would be active (inverse of the plant). If an error results however, the feedback loop
will cancel it.
r uff
C2(s)
+ e ufb + + u y
C1(s) P(s)
-
61
TC
TT
Figure 6.7: Example of split range con guration in vessel temperature control.
FC
FT
cold mixed water outlet
water
inlet
TT
FT
hot
water
inlet
Figure 6.8: Control Strategy for controlling water temperature by Ratio Control.
62
Chapter 7
Tuning Methods
7.1 Introduction
Once a control con guration and a control law have been chosen, the parameters must be
tuned in order to reach the speci cations. The tuning methods will be applied to PID-
controllers, though some of them are more general and can be used with other controllers
too.
1. Proportional Action
Put Ti = 1 and Td = 0. Take a small gain Kp or a large PB (nearly 100%). Apply
a small step. Damping will be very small due to the limited gain. Double the gain,
damping will decrease and oscillation will increase. Keep on doubling till the oscillation
exceeds your requirements.
2. Derivative Action
Once the P-action is tuned, add D-action to damp the system. Increase pre-act Td
till the system is too damped. Once a good point has been found, P-action can be
increased. On its turn D-action must improve the necessary damping for the new P-
action. If addition of D-action makes the system response nervous and oscillatory on
higher frequencies, drop D-action.
63
3. Integral Action
First tune P and D. Decrease reset time Ti a bit. The in uence of the I-action will still
be limited; the output tends slowly to the set-point though. Halve reset time in order
to obtain a faster set-point settling. Keep on halving, till the response gets oscillatory
with a low frequency. It is possible to decrease P-action to remove the oscillatory re ex,
increase pre-act, and optimise the I-action again.
Advantage of this method is the intuitive approach. It is very elaborate though and
doesn't guarantee success. It turns out to be a very time consuming method when the main
time constants of the plants are in order of some minutes.
7.2.2 Ziegler-Nichols Tuning Rules
All the variables of the PID must be tuned such that the overall closed-loop system response
behaves like is stated in the speci cations. In industry, a lot of times the famous 'Ziegler-
Nichols' rules are applied, because it is not necessary to have a complete, dynamic model
of the plant. Only a few, fairly simple experiments are required to nd suitable controller
parameters. Since these rules are empirical rules, it should be recognised that problems can
occur. However, in many cases, these rules give rise to a control system with very acceptable
performance trade-o s.
Transient response method (Ziegler-Nichols) To apply this method, it is required that
the plant's step response has a similar shape as the one given in gure 7.1. From this
step response, the time delay or lag L and the steepest slope or reaction rate R = K
can easily be derived (after a delay of L seconds, the output increases K units in
seconds).
Figure 7.1: The time delay L and the reaction rate R = K are easily calculated from a step response.
Once these parameters are computed, the controller parameters are selected from ta-
ble 7.1.
Remark: If the plant's step response di ers drastically from that in gure 7.1, this
method is not applicable anymore, since L and R can't be measured/computed anymore.
64
Ziegler
& Kp Ti Td
Nichols
P-control RL
1
0:9
PI-control RL 3:3L
PID-control 1:2 2L L
RL 2
−0.005
−0.01
Amplitude
−0.015
−0.02
−0.025
0 10 20 30 40 50 60 70 80 90 100
Time (secs)
65
Td.s
Td/10.s+1
D−action
+ 1 +
+ Kp + num
− Ti.s + + y
Sum den
Saturation
I−action Sum1 P−action Sum2
Transfer Fcn
To Workspace
−1/K Hydraulic
Positioning
Disturbance System
Gain2
Pump
t
Clock To Workspace1
Figure 7.3: The PID control con guration for the linearised hydraulic positioning system.
1. The results for a P-controller are shown in gure 7.4. Notice the steady state
deviation and the saturation in control value u.
2. For a PI-controller, the Ziegler-Nichols results are shown in gure 7.5. Observe
the zero-steady state error, the overshoot due to the integrator, and the excellent
disturbance rejection.
3. For a PID-controller, the responses are shown in gure 7.6.
a
0.2
0.1
0
0 5 10 15 20 25 30 35 40 45 50
b
−5
−10
−15
0 5 10 15 20 25 30 35 40 45 50
c
50
−50
0 5 10 15 20 25 30 35 40 45 50
Figure 7.4: The P-controller according to Ziegler-Nichols for the linearised hydraulic positioning
system. a. Reference signal (m) (dotted) and Process output (m) (solid). b. Pump ow disturbance
(litres/minute) c. Control e ort u (%)
66
a
0.2
0.1
0
0 5 10 15 20 25 30 35 40 45 50
b
−5
−10
−15
0 5 10 15 20 25 30 35 40 45 50
c
20
0
−20
−40
−60
0 5 10 15 20 25 30 35 40 45 50
Figure 7.5: The PI-controller according to Ziegler-Nichols for the linearised hydraulic positioning
system. a. Reference signal (m) (dotted) and Process output (m) (solid). b. Pump ow disturbance
(litres/minute) c. Control e ort u (%)
a
0.4
0.3
0.2
0.1
0
0 5 10 15 20 25 30 35 40 45 50
b
0
−5
−10
−15
0 5 10 15 20 25 30 35 40 45 50
c
20
0
−20
−40
−60
0 5 10 15 20 25 30 35 40 45 50
Figure 7.6: The PID-controller according to Ziegler-Nichols for the linearised hydraulic positioning
system. a. Reference signal (m) (dotted) and Process output (m) (solid). b. Pump ow disturbance
(litres/minute) c. Control e ort u (%)
Stability limit method (Ziegler-Nichols) First, the plant is controlled using proportional
control only (Ti = 1; Td = 0). Once a stable design is found (start with a very small
value for the gain Kp ), Kp must be increased slowly until a permanent oscillation occurs.
At this point, the gain Kp and the oscillation period Po are recorded ( gure 7.7).
If they are denoted by Ko and Po , the controller parameters are determined from ta-
ble 7.2.
The hydraulic positioning example doesn't work with this method, since it turns out that
it cannot be made unstable.
67
0.6
0.4
Amplitude
0.3
0.2
0.1
0
0 0.5 1 1.5 2 2.5
Time (secs)
Figure 7.7: The measured oscillation period Po for the stability limit method. The ultimate controller
gain Kp , responsible for this permanent oscillation, is denoted as Ko .
Ziegler
& Kp Ti Td
Nichols
P-control 0:5Ko
an sn + an 1 sn 1 + : : : + a1 s + a0
an array (table 7.3) is constructed.
68
1 an an 2 an 4
2 an 1 an 3 an 5
3 b1 b2 b3
4 c1 c2
.. ..
. .
n 1 z1
b1 = an 1 an a2 an an 3
n 1
b2 = an 1 an a4 an an 5
n 1
..
.
c1 = b1 an 3 b an 1 b2
1
c2 = b1 an 5 b an 1 b3
1
..
.
Routh's Stability Criterion now states that a sucient condition for all roots of the char-
acteristic equation to have negative real parts, is that the elements of the rst column in the
array have the same sign.
By using Routh-Hurwitz it is now possible to obtain stringent conditions on some param-
eters, in order to have a stable closed loop system.
69
Example: the hydraulic positioning system
We recall that the transfer function was given by
C (s) = Kp 1 + sT1
i
G(s) = 1 +C (Cs()sP)(Ps()s)
which results in
G(s) = T a s4 + T a s3 + bT0 K pTi s + b0 Kp
i 3 i 2 i a1 s2 + (Ti a0 + b0 Kp Ti )s + b0 Kp
Table 7.4: The Routh-Hurwitz table for the hydraulic positioning system
70
The elements c1 ; c2 ; d1 and e1 are calculated:
c1 = 1:032 10 4 + 1:677 10 10 Kp (7.1)
c2 = 1:15 10 7 KT p (7.2)
i
1:774 10 14 KTip
d1 = 5:748 10 6
1:15 10 Kp 1:032 10 4 + 1:677 10
7
10 Kp (7.3)
e1 = c2 (7.4)
Since the rst two elements in the rst column of table 7.4 are positive, all elements in
this column must be positive. This implies:
(7:1)
c1 > 0 = ) Kp > 6:191 105 (7.5)
(7:4);(7:2)
e1 > 0 =) Kp < 0 (7.6)
8 r
14
1:18710 11 + 1:774T10 1:18710 11 + 1:774T10
14 2
>
> + +4:57610 26
(7:3)
>
>
<
i
3:85710 17
i
> Kp
d1 > 0 =) > r (7.7)
14
>
>
> :
1 187 10 11 + 1:774T10 :
1 187 10 11 + 1:774T10
14 2 :
+4 576 10 26
: i
:
3 857 10 17
i
< Kp
Equations 7.5 and 7.6 limit Kp between 6:19 105 and 0. Equation 7.7 connects Ti
with Kp. The region of Kp and Ti values that result in a stable controlled system, are
shown in Figure 7.8.
5
x 10
1
−1
−2
Kp
−3
−4
−5
−6
−7
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
Ti
Figure 7.8: The region of Kp and Ti values that make the controlled system stable in closed loop.
The region is bounded by the two solid curves. The dotted curve is the asymptote of the second curve
for large Ti values (soft integral action). Observe that with a very strong integral action (Ti small),
the system can be made unstable with a relative small proportional action.
4
71
7.4 Root Locus
Basically there are 3 concepts in Root Locus:
The position of the closed loop transfer function poles in the s-plane determine the
system's time response. Moreover, speci c time behaviour like overshoot and settling
time corresponds to a pole location in some well designated areas in the s-plane (for a
second order system).
If one parameter changes in the transfer function denominator, the poles will change
position. Root locus method presents a way to draw the trajectory of the poles in the
s-plane, when one parameter in the transfer function is varied.
So, varying one parameter, the position of the poles changes. We will look for the
parameter that makes the poles come into the required region that corresponds with
the time domain speci cations.
First the relation between pole position and time characteristic will be studied.
We'll start from the assumption that the system's response is basically determined by its
two dominant poles (this is: approximating the system as if it were second order). This
assumption is valid when
j dom j 101 j other j;
in which dom is the real part of the dominant poles and other is the real part of the other
poles.
Stability can easily be analysed, since the distance from the imaginary axis shows the
stability degree. It is dicult however to translate a certain pole con guration into a phase
and gain margin speci cation.
For a second order system H (s),
!n2
H (s) = s2 + 2! s+! n n2
p
with poles !n !n 2 1, one nds that
2% Settling Time Ts = !4 .
Since the real value of the complex pole pair is given by !n , the pole positions that
n
correspond with a settling time equal or less than Ts lie in a left half-plane.
p12
Percent Overshoot= 100e .
Since the angle (see Figure 7.9) is given by
p
tg( ) = (1 ) ;
2
one observes that poles corresponding with equal overshoot, have the same . Pole
con gurations with less or equal overshoot are therefore given by a cone in the s-plane.
p
Oscillation frequency !d = !n 2 1 This corresponds with the imaginary part of the
poles.
72
ω
2
ωn 1−ζ
α
− ζω n σ
−4
ζω n
2
− ωn 1−ζ
Given some constraints on settling time, overshoot and oscillation frequency one can thus draw
some boundaries for pole location in the s-plane. We'll now study the in uence of a varying
parameter on the pole position. Consider a closed loop transfer function's denominator d(s),
given by
N
Y YM
d(s) = (s + pi ) + K (s + pj )
i j
with
M N:
We want to analyse the pole position for a varying K. The curve that describes the
location of the poles (zeros of d(s)) in the s-plane in function of the variable K is called a
root locus. These plots nowadays are very easily drawn with the aid of software packages.
Therefore, we're not longer interested in manual plotting hints. Nevertheless, some properties
are interesting when one analyses and designs a control system:
When K varies from 0 till 1, the poles of d(s) move from pi to pj . If there are more pi
than pj , the excess N M move towards in nity.
If the excess is N M , there will be N M asymptotes. Their angle with the real
axis can be calculated as
= 2q + 1
N M
73
The root locus will appear symmetrical with respect to the horizontal axis.
The root locus only lies on a section of the real axis if that section has an odd number
of pi and pj at his right hand side.
By placing extra poles and zeroes, one can thus in uence the root loci.
0.18 0.2
1000
0.16 0.18
0.16
0.14
500
0.14
0.12
0.12
Imag Axis
0.1
0
0.1
0.08
0.08
−500 0.06
0.06
0.04
0.04
a b c
Figure 7.10: Root Locus for a P-controller. a. Root Locus diagram, b. Response for Kp = 300, c.
Response for Kp = 600 (linear model : solid, with actuator saturation : dotted)
We observe 2 fast poles and one slow pole (the most right one). Notice the 3 asymptotes,
according to the pole-zero excess.
74
For Kp = 300, the root locus of the dominant pole crosses the 0:4 border
(corresponding with 10 seconds settling time). The system response for Kp = 300
is shown in Figure 7.10b.
Observe the steady state error (input reference step is 0:2m).
Doubling the gain (Kp = 600) results in an even more rapid response.
The question might rise why we don't increase Kp even more.The answer is twofold.
1. The rst reason is a general remark: the real plant isn't linear but presents
saturation in its actuators. A large Kp will nearly immediately result in a
large control signal, and thus in saturation. It has no sense to increase Kp
even more at this point.
In Figure 7.10c the response is shown for Kp = 600. Dotted: the system's
response with saturation included. Notice that saturation slows down the
response!
2. The second reason is that for large Kp values, the two other poles become
dominant and even unstable!
PI-controller Now we'll analyse the e ect of a PI-controller. In root locus diagrams unfor-
tunately, it is impossible to draw the trajectories for two changing parameters.
Therefore, we'll x the Kp value on 600 and we'll vary Ti.
The closed loop transfer function is
n(s) K 1 + 1
d(s) p Ti s
G(s) = n (s)
1 + d(s) Kp 1 + T1i s
G(s) = n(s)Kp (Ti s + 1)
n(s)Kp + Ti (d(s) + n(s)Kps)
In this way it is written in the standard root locus form, except for the fact that
the rst term of the denominator has a larger order than the second one. Therefore
we'll work with Ki = 1=Ti instead of Ti .
The transfer function can now be written as:
G(s) = (d(s) +nn((ss))KKp(ss)++Kni()s)K K
p p i
A root locus of this transfer function for varying Ti is shown in Figure 7.11a.
Due to the extra pole in zero, 4 asymptotes are now distinguished. The dominant
region (close to the imaginary axis) is not clear though.
In Figure 7.11b is zoomed in into that region.
A break-away point is noticed in 0:36. Therefore it is impossible to reach the
0:4 border, since always one of the two dominant poles will be right from the
0:36 point.
In Figure 7.11c the step response is plotted (with and without saturation) for Ti
corresponding with the Ki -value for both poles in 0:36.
75
40 0.25
1000
30
0.2
20
500
10
0.15
Imag Axis
Imag Axis
0 0
−10 0.1
−500
−20
0.05
−30
−1000
−40
−1000 −500 0 500 1000 −2 −1 0 1 2 3 4 0
Real Axis Real Axis 0 2 4 6 8 10 12 14 16 18 20
a b c
Figure 7.11: Root Locus for an I-controller. a. Root Locus diagram, b. Zoom into the dominant
region, c. Response for Kp = 600; Ti = 5 (linear model : solid, with actuator saturation : dotted).
Notice the zero steady-state error. The overshoot that is present (although all
the dominant poles are real) is completely due to the zero introduced by the PI-
controller. This shows that the formulas calculating overshoot, settling time etc.
are not completely right.
With Kp = 600, we couldn't nd a decent solution for Ti. Therefore we change
the Kp value to 1000. The root locus and a zoomed-in version are shown in
Figure 7.12a and 7.12b.
40
1000 0.3
30
0.25
20
500
10
0.2
Imag Axis
Imag Axis
0 0
0.15
−10
−500 0.1
−20
−30 0.05
−1000
−40
−1000 −500 0 500 1000 −2 −1 0 1 2 3 4 0
Real Axis Real Axis 0 2 4 6 8 10 12 14 16 18 20
a b c
Figure 7.12: Root Locus for an I-controller. a. Root Locus diagram, b. Zoom into the dominant
region, c. Response for Kp = 1000; Ti = 3 (linear model : solid, with actuator saturation : dotted)
With a larger Ti -value the overshoot is cancelled nevertheless (Ti = 15) as shown in
Figure 7.13. With saturation included, the response is worse, but with anti-windup
(Ta = 15000) it gets better again.
76
0.25
0.2
0.15
0.1
0.05
0
0 2 4 6 8 10 12 14 16 18 20
Figure 7.13: Step response for a larger Ti value (15) without saturation (solid). With satura-
tion: dashed. With saturation and anti-windup: dotted
Note: In Matlab the next functions can be used: rlocus, Since Mat- rlocfind, cloop.
lab calculates the root locus for positive gains, one has to work with the negative numerator.
0
GM (21 dB)
Gain dB
−20
−40
−60 −2 −1 0 1
10 10 10 10
Frequency (rad/sec)
−90
Phase deg
PM (125 o )
−180
−270
−2 −1 0 1
10 10 10 10
Frequency (rad/sec)
30
Gain dB
20
10
0
10 2 10 3 10 4
Frequency (rad/sec)
-50
Phase deg
-100
-150
-200
10 2 10 3 10 4
Frequency (rad/sec)
7.5.2 I-control
In case of integral control, the controller transfer function is just an integrator:
Kp
C (s) = sT
i
and the control signal is proportional to the integral of the control error.
From the Bode plot of an integral controller (Figure 7.16), it follows that the loop gain will
be multiplied by KTip at ! = 1 and that an additional phase shift of 90o will be introduced.
The purpose of integral control is to make the loop gain at DC equal to 1, in order to obtain
a zero steady state error. However, the additional phase shift forces the designer to decrease
the bandwidth, to ensure relative stability (so KTip is limited).
78
0
-20
Gain dB
-40
-60
10 -1 10 0 10 1
Frequency (rad/sec)
-80
-100
Phase deg
-120
-140
-160
-180
10 -1 10 0 10 1
Frequency (rad/sec)
7.5.3 D-control
In case of proportional control, the controller transfer function is just a derivative term:
C (s) = sKpTd
and the control signal is proportional to the derivative of the control error.
From the Bode plot of a derivative controller (Figure 7.17), it follows that the loop gain will
be multiplied by Kp Td at ! = 1 and that an additional phase shift of +90o will be introduced.
40
20
Gain dB
-20
-40
10 -1 10 0 10 1 10 2 10 3
Frequency (rad/sec)
100
0
Phase deg
-100
-200
10 -1 10 0 10 1 10 2 10 3
Frequency (rad/sec)
Figure 7.17: The Bode plot of a D-controller (Kp = 1; Td = 0:5; tc = 0:01). The derivative action is
bounded for frequencies ! t1c = 100.
The purpose of derivative control is to increase the response speed (decrease Tr ). However,
due to the ampli cation at high frequencies (noise sensitivity), the derivative action must be
limited. In theory, it would be sucient to place an extra low-pass lter stc1+1 before the
79
di erentiator, to 'remove' the high frequency components in the error signal. In practice, the
low-pass lter and the derivative action are implemented by a single lter. In that case, the
controller transfer function is:
sKpTd
C (s) = st +1 c
7.5.4 PI-control
In PI-control, the advantages of P- and I-control are combined. P-action is added for band-
width and speed, the I-action is added to guarantee a zero steady state error.
From the Bode plot of a PI-controller (Figure 7.18), it follows that a high loop gain is intro-
duced for lower frequencies, while the additional phase shift vanishes for higher frequencies.
The positive and the negative e ects of PI-control become more outspoken by making the
integration time Ti smaller: the high gain for low frequencies increases, but the phase margin
reduces.
50
40
Gain dB
30
20
10
0
10 -3 10 -2 10 -1 10 0 10 1
Frequency (rad/sec)
-50
Phase deg
-100
-150
-200
10 -3 10 -2 10 -1 10 0 10 1
Frequency (rad/sec)
Figure 7.18: The Bode plot of a PI-controller (Kp = 10; Ti = 100). The integral action is higher for
frequencies ! T1i = 0:01.
7.5.5 PD-control
In PD-control, the advantages of P- and D-control are combined. P-action is added for
bandwidth and speed, the D-action to further decrease the rise time (while P is limited by
stability requirements).
From the Bode plot of a PD-controller (Figure 7.19), it follows that a high phase lead and
a high gain are introduced for higher frequencies: the speed of response increases, together
with the sensitivity to noise. The positive and the negative e ects of PD-control become
more outspoken by making the integration time Td larger: the phase lead for high frequencies
increases, but the noise sensitivity increases also!
80
60
40
Gain dB
20
0
10 -1 10 0 10 1 10 2 10 3
Frequency (rad/sec)
100
0
Phase deg
-100
-200
10 -1 10 0 10 1 10 2 10 3
Frequency (rad/sec)
Figure 7.19: The Bode plot of a PD-controller (Kp = 10; Td = 0:5; tc = 0:01). The derivative action
is bounded for frequencies ! T1d = 2 or ! t1c = 100.
7.5.6 PID-control
An attempt to combine all the previous advantages, while accepting the corresponding dis-
advantages, is the PID-controller, which is described in a previous section. It is easy to un-
derstand that the relative sizes of the di erent controller parameters determine which e ects
become more/less important. By analysing the Bode plot of the PID-controller (Figure 7.20),
it is possible to do some predictions on the closed loop behaviour.
60
40
Gain dB
20
0
10 -3 10 -2 10 -1 10 0 10 1 10 2 10 3
Frequency (rad/sec)
100
0
Phase deg
-100
-200
10 -3 10 -2 10 -1 10 0 10 1 10 2 10 3
Frequency (rad/sec)
Figure 7.20: The Bode plot of a PID-controller (Kp = 10; Ti = 100; Td = 0:5; tc = 0:01).
81
7.6 Auto-Tuners
Recently controllers were developed that automatically tune their PID-values. After a xed
time (e.g. every hour) the controller is switched o , and a simple plant model is derived by
e.g. step-test. Based on that model, adequate values of Kp , Ti and Td are calculated (e.g.
with the Ziegler-Nichols tuning rules). Then the controller is connected again to the system.
This method is very advantageous in slightly time variant processes. A typical example of a
time variant process is the winding of cloth on a reel. Since the diameter of the cloth roll is
ever increasing, the moment of inertia changes too. This way the dynamics are continually
varying.
When the process becomes too time-variant, these auto-tuners do not work properly. The
system model is varying too fast between two 'tunes', such that the calculated PID-parameters
are only valid right after the tuning moment. It must be said though that these auto-tuners
do not always nd a satisfactory result. Normally there is few exibility in choosing your own
tuning rules and thus your own speci cations.
Instead of tuning every while, one can imagine that the identi cation part is done con-
stantly (real-time), hence resulting in an adaptive control scheme. This is the area of adaptive
tuners.
82
AH
s Ah
PID
sp C
H
h
A0 Al QRb
PI Q pC I p Rb
Qlim sp l
1
0 pC
plim
Figure 7.21: Control of a nonlinear hydraulic transport system. The control problem is a
tracking one: QRb should follow s.
control structure, is observing the measurable variable of the process, e.g. the output y(t),
or one related with it, e.g. e(t) = r(t) y(t). A calculable quality measure of the closed loop
system then has the following general form
Z T
J= f (r(t); y(t); e(t); t) dt (7.8)
0
This scalar quality measure J is also called the performance index, which can be used as a
basis for comparing the performance of the controlled system. Consequently the function f ()
must answer to this 'norm' criterion. Due to the de nition of J , this kind of optimization
belongs to the time-domain optimization methods. In this sub-section two classes of quality
measures in the time domain are outlined.
Classical time-domain performance measures
Below four well known performance indices are proposed:
The IAE index i.e. the integral of the absolute error:
Z T
J= je(t)j dt
0
83
The ITSE index i.e. the time weighted ISE:
Z T
J= t e(t)2 dt
0
The free controller parameters can be tuned by means of the following generic (con-
strained) optimization routine:
minimize: J
subject to: the closed loop system description
Some remarks:
1. The nal value of J , and consequently also the free controller parameters, depends
highly on the chosen index, the integral horizon time T , and the form of the input
signal r(t). Therefore it is useful to verify several 'possible good outcomes'.
2. Since in most cases the minimization problem is not convex, the outcome can be 'sub-
optimal'. Therefore it is a good habit to check this 'sub-optimal' result with di erent
optimization algorithms, start values and input shape values.
3. It can be proven that for a second order linear process the ITAE norm provides the best
selectivity with respect to the free controller parameters.
4. There exist no direct connection between these performance indices and the more com-
mon used design speci cations like 'settling time', 'percent overshoot', etc1 . On the
other hand, the I(T)AE and I(T)SE is often also of practical signi cance (energy re-
lated for example).
Some of these items will be illustrated by means of the following worked out example.
Example 3 Consider the nonlinear hydraulic transport system, shown in Figure 7.21. The
constituent relations of the basic hydraulic components are summarized below ( is the density
of the transported liquid):
A0 + pCAH A0
p_C = C1 QC with C = g
gH
(7.9)
Q_ Rb = I1 (pC p) with I = A l (7.10)
l
p = Rb QRb with Rb = 2 A2 jQRb j (Bernoulli dissipator) (7.11)
l
Q = f (sp; pC ) with f () the non-linear pump characteristic according to Figure 7.21
(7.12)
Consequently the hydraulic inertia I is the only linear component in the circuit. The SimuLink
block diagram of the closed loop system is shown in Figure 7.22.
The block diagram of Figure 7.22 (top) has been parameterized and saved as opt mod.m.
Once this has been done, three other .m les should be created:
1
These design speci cations will be recalled in the next subsubsection.
84
PSfrag replacements
Q
C
I
Rf
A0
Ah
AH
l
A
PSfrag replacements
l
h
H C
Rf replacements
PSfrag
A0 Q
Rb Clock
Mux yout
Ah sp To Workspace
p AH + C QRb
Outflow Mux
pC Outflow l I opt_hc
PI s Al
desired:
−
Sum R fPIDController of the nonlinear
S−Function
0 h A 0
process
1 Ah
Qlim
H A H
plim
s l ITAE index
sp A l nonlinear process
1
Rb in_1 h Q + pC + QRb
Outflow
H
2−D Look−Up −
1
Q
Table −
Rb
Sum
sp of flows C_nl of pressures Sum
I
PI QRb
0 Rb p
Qlim
p
plim
pC R_nl
PI ITAE index calculation
0 1
1
Abs
e Abs *
s 1
Qlim 2 ITAE
Integrator
lim p t
Figure 7.22: SimuLink diagram of the hydraulic transport system of Figure 7.21. View on
Product
the control con guration (top), view on the nonlinear hydraulic circuit (middle), and view on
the calculation of the Performance index ITAE.
85
1. The parameter le , e.g. opt par.m.
The following le assigns all the xed physical parameters in the Matlab workspace.
% opt_par.m
%calculation of the physical parameters
%
%%%%constants
%physical
g=10;
rho=1E3; %water
%non ideal pump 2Dtable Q(p_C,s_p)
plim=1.5e4;
qlim=1;
%compliance
A_0=0.15;
A_H=7.4;
H=2;
%pipe
l=7;
A_l=43E-4;
%
%%%%calculation
frag replacements %compliance C = C_k0 + C_k * p_C
C_k0=A_0/(rho*g);
PSfrag replacements
Q C_k=(A_H-A_0)/(((rho*g)^2)*H); Q
C %pipe C
I I=rho*l/A_l;
I
Rf R
%bernoulli resistance (free outlet) R_b = R_b_r * abs(Q_R_b)
R_b_r=rho/(2*A_l*A_l);
f
A0 A0
Ah A h loop hydraulic process of Figure 7.22
For convenience the step response of the open
AH A
(bottom) has been shown in Figure 7.23. H
l l
Al −3
x 10 Al
open loop step response. ITAE−index: 241.5 open loop step response. ITAE−index: 241.5
h h
4.5 700
pC
H 4 H p
s s
600
sp 3.5
sp
QRb QRb
500
3
Rb Rb
pressure (Pa)
flow (m^3/s)
2.5 400
p p
pC 2 300
PI 1.5
step input
pump flow PI 200
1
output flow
1 100
Qlim 0.5 Qlim
plim0 plim 00
p 0 10 20 30 40 50
time (s)
60 70 80 90
p
100 10 20 30 40 50
time (s)
60 70 80 90 100
Figure 7.23: SimuLink diagram of Step response of the open loop hydraulic transport system
of Figure 7.21.
86
2. The simulation le , e.g. opt fcn.m.
The following le simulates the SimuLink block diagram opt mod.m, without the neces-
sity to enter SimuLink interactively. It also plots the time response.
function [J,c]=opt_fcn(x)
%
%function opt_fcn.m simulates the simulink model (opt_mod.m)
%and plots the response
%
global K_P T_i T_d yout
%first simulate the nonlinear SimuLink model
%with the free controller parameters K_P, T_i and T_d,
% and calculate simultaneously the Performance Index
%
%assign the PID controller
K_P=x(1);
T_i=x(2);
T_d=x(3);
%assign the simulation time horizon
tf=100;
%initializations for integration algorithm
xi=[0,0,0,0,0]; % Initial conditions (outputs at t=0) of the integrators
options(1)=1e-8; %relative error
options(2)=1e-14; %minimal step size
options(3)=0.01; %maximal step size
options(5)=3; %display all warnings
options(6)=2; %plot off
%start simulation
rk45('opt_mod',tf,xi,options);
%assign the cost function
J=yout(length(yout(:,4)),4);
%assign the constraint function c<=0 (only necessary if invoked by 'constr')
%physical constraints on the PID parameters:
c(1)=-K_P+0.05;c(2)=K_P-0.2;
c(3)=-T_i+0.3;c(4)=T_i-0.7;
c(5)=-T_d+eps;c(6)=T_d-200;
%
%eventually plot the response and the ITAE-index
plot(yout(:,1),yout(:,[2]),'-',yout(:,1),yout(:,[3]),'--')
xlabel('time (s)');
ylabel('flow (m^3/s)');
legend('desired flow','actual flow');
title(['Process with PID controller (K_P=',num2str(K_P),...
',T_i=',num2str(T_i),',T_d=',num2str(T_d),'). ITAE-index: ',num2str(J)]);
grid
hold on
drawnow
To check the correctness of opt fcn.m this le is executed with controller parameters
Kp = 0:1, Ti = 0:2, Td = 100. To do this, type at the Matlab command prompt the
following:
opt_par;
K_P=0.1;T_i=0.2;T_d=100;
opt_fcn([K_P T_i T_d]);
87
C
I
Rf
A0
Ah
AH −3
x 10 Compensated Process (K_P=0.1,T_i=0.2,T_d=100). ITAE−index: 3.729
l 4.5
Al 4
h
H 3.5
s
sp 3
pC 1.5
PI desired flow
actual flow
1
0.5
Qlim
plim 00
p 10 20 30 40 50
time (s)
60 70 80 90 100
Figure 7.24: Step response of the closed loop system, Performance index calculated. Clearly
the system becomes unstable under the chosen controller parameters. If the hydraulic system
was linear, then an increase of only KP or a decrease of only Ti would result in an even more
unstable response.
88
This le should be run as follows:
global K_P T_i T_d yout
opt_go
After 61 iterations it turns out that the optimization yields the following result:
Kp = 0:2
Ti = 0:5268
Td = 100:6
with ITAE index about 0:174. If more re nement iterations are allowed (by increasing options(14)
in the m- le opt go.m) it turns out that after 143 iterations the second and sixth constraints
(c(2) and c(6)) are active:
Kp = 0:2
Ti = 0:3388
PSfrag replacements Td = 200
The ITAE indexQ becomes 0:135. These two optimizations reveal a rather small in uence of
Td on the ITAECindex.
I of the rst optimized PID setting is shown in Figure 7.25. This response
The step response
R f with Figure 7.23 (left).
should be compared
A0
Ah 3.5 x 10Compensated Process (K_P=0.2,T_i=0.5268,T_d=100.6). ITAE−index: 0.1738
−3
AH
l
Al 3
h 2.5
H
s desired flow
sp 2
actual flow
flow (m^3/s)
QRb
Rb 1.5
p
pC 1
PI
0.5
Qlim 00 10 20 30 40 50 60 70 80 90 100
plim time (s)
Figure 7.25: Step response of the closed loop system with optimized controller parameters.
Performance index calculated.
To be complete, a view of the ITAE-index in the free controller parameter space (KP ; Ti ; Td )
is given in Figure 7.26. This Figure shows that, within the physical relevant region of the free
controller parameter space, possibly only one global minimum of the ITAE index exist. 4
89
I I
Rf Rf
A0 A0
Ah Ah
AH AH
l minimal ITAE in *, value 0.1742, parameters (K_P,T_i,T_d)= (0.2,0.525) l minimal ITAE in *, value 0.1742, parameters (K_P,T_d)= (0.2,100)
Al Al
h 1.5 h
H H 3
s s
sp 1 sp
2.5
QRb QRb 2
Rb Rb
ITAE
ITAE
1.5
p p
pC 0.5
pC 1
PI PI 0.5
0.05
0
0.3 0.35
*
0.1
0.05
0 50
*
0.15
0.1
Figure 7.26: Performance index ITAE in the controller parameter space. Due to the calcula-
tion in discrete points of the parameter space the calculated optimal ITAE is an approxima-
tion. In the Figure left Td is kept constant to 100, in the Figure right Ti is kept constant to
0:53.
90
However it is convenient to set manually some of these boundaries. E.g. the Minimal
time step should be chosen according to (i.e. smaller than) the fastest poles of the
process to be simulated, the Relative tolerance should be chosen according to the
desired simulation accuracy, and the Maximal time step should be chosen to speed-up
the simulation when the system behaves smoothly.
In every case it should be veri ed that the obtained simulation results can be repeated
with di erent integration parameter settings! Therefore it is extremely important to
check possible dangerous locations in the free controller parameter space by single pre-
optimization simulations of opt fcn.m. As a rule of thumb large KP together with
small Ti values, or large Td values are of interest. However, the nonlinear behavior plays
in most cases also an important role. So be warned: never trust a simulation at
rst glance!
3. It is a good habit to simulate (and verify) the open loop process rst, thereafter the
compensated process can be observed. The starting values of the parameters of the PID
compensator can be obtained by means of the already mentioned classical identi cation
methods (eye-ball methods, exact Linearisation in a working point) and tuning methods
(stability limit method for example). Notice that for stable nonlinear systems the
obtained PID parameters can destabilize the closed loop system. However, as long as
only 'small' deviations of the input and state are allowed this should not be the case.
Therefore verify that the steady state input and state of a nonlinear system and its
linearized version can di er, even in the Linearisation point.
4. If one wants to use a simple PID compensator controlling a highly nonlinear process,
then an optimal PID is not always the one obtained from one kind of step input pro le
(as is done here). However, using the same optimization strategy as is outlined in
the previous guideline above one can optimize over a range of step inputs, eventually
including a weighting of certain important working points. Comparing with a 'one
step input' optimized PID controller, such an optimized PID controller has in general
a lower performance in one speci c working point, but on the other hand has a better
performance in a larger range of input signals. Computer simulations show that the
latter also has a higher robustness against nonlinear parameter changes. It is left for
the reader to verify this statement for this example.
5. In most cases the SimuLink description of the nonlinear process is not as exact as
it should be. As example the Bernoulli resistor (free outlet) of previous example is
given. In some cases it is not sucient to model this resistor as is done in Eqn. (7.11).
For example, in cases where QRb < 0. If this occurs, the SimuLink diagram should
be modi ed to prevent QRb from being negative since this is physically impossible.
Similarly, the actuator signals (the pump) should be veri ed also. The pump input signal
sp can have physical limitations, like saturation, which limits a lot the performance of
the compensator. If such saturation exist, then this should be build in the SimuLink
model of the pump. Such physical limitations are not always taken into account. But
since they are in fact the most dominant components in uencing the real closed loop
performance, they should be included in the model previously to any 'computer based'
optimization procedure. Notice that it is not sucient to verify all this with one 'after
optimization' simulation of the behavior of the controlled system, since the performance
measure J can be in uenced largely by such forgotten factors.
91
Al
h
H
s
s
Response shape time domain
p performance measures
It is rather straightforward
Rb to use other performance measures than the ones mentioned in
subsubsection 7.7.1. Again,p this is explained by example:
p
Example 4 Observe previous C
Example 3. Figure 7.27 shows the contours in which a step
PI
response should be shaped.
0
1 inadmissible sectors
QRb
5%
Qlim
plim
s (desired ow)
20 t (s )
PSfrag replacements Figure 7.27: shape design.
Q
This response
C shape corresponds with the following simultaneous time domain performance
measures:
I
Rf
A0 os = 0
Ah ess < 5%
AH Ts < 20sec
l
l input s at time tstep this can be formulated mathematically as follows:
For aAstep
h 8t > tstep : QRb < s
H
8t > (tstep + 20sec) : QRb > 0:95 s
These inequalities can be interpreted as soft bounds or hard bounds. Soft bounds can
be violated,
Rb hard bounds can not. In this example a soft bound implementation is given.
Therefore
p the SimuLink model can be modi ed slightly, the ITAE index has to be replaced
with panother
C one. This is shown in Figure 7.28.
PI
0 Clock Mux yout
1 s To Workspace
Qlim + p Outflow Mux
QRb
opt_hc
plim Outflow −
t(s) s desired: Sum PIDController S−Function
of the nonlinear process
5%
20 Mux MATLAB 1/s
inadmissible sectors
Function
s (desired ow)
shape index
Mux1 MATLAB Fcn
opt_shape
Figure 7.28: SimuLink diagram of the hydraulic transport system of Figure 7.21 with shape
index calculation. View on the control con guration.
The matlab function opt shape.m is given below.
92
function [y]= opt_shape(u)
%input u(1) should be s (desired flow)
% u(2) Q_R_b (output flow)
% u(3) time t
%calculates the instantaneous sum of os, ess and Ts
%no weighting will be used between os, ess and Ts
%it is assumed that the step input s occurs at t=5 sec
%
%calculation of weighted os (os should be 0)
os=0;
if (u(3)>5)&(u(2)>u(1))
os=u(2)-u(1);
PSfrag replacements
end
Q
%simultaneous calculation of instantaneous ess (ess should be lees than 5%)
%and Ts (Ts should be less than 20 sec)
ess=0; C
I
if (u(3)>25) %Ts specification (t_step=5sec)
R f
s_pct=0.95*u(1);
A
if u(2)<s_pct %ess specification
0
end A
ess=s_pct-u(2);
h
end A H
l
%calculate the weighted sum with relevant weights
A
y=100*os+u(3)*ess;
l
%summation over time is done in SimuLink diagram
h
H
s xCompensated
10
−3 Process (K_P=0.08307,T_i=0.7,T_d=43.87). shape−index: 0.006308
3.5
sp
QRb 3
Rb
p 2.5
pC desired flow
PI
actual flow
flow (m^3/s)
1.5
Qlim
plim 1
t(s)
5% 0.5
Figure 7.29: Step response of the closed loop system after 150 optimization steps. Shape
index calculated. Due to the soft bounds the Ts constraint is slightly violated. This error
can be reduced by increasing the number of iteration steps, increasing the appropriate weight
of the Ts -constraint (e.g. by modifying the penultimate line of opt shape.m), or by making
a hard constraint of the Ts -constraint (e.g. by managing the Ts as has been done with the
physical constraints of the controller parameters, cfr. opt fcn.m). This reponse should be
compared with the ones depicted in Figures 7.23 (left) and 7.25.
93
f
A0
Ah
AH
l
Al minimal index in *, value 0.007969, parameters (K_P,T_d)= (0.09,45)
h
H
s
sp 1
QRb
Rb 0.8
p 0.6
shape index
pC
PI 0.4
0.2
Qlim
plim 0 *
t(s) 40
5% 45
20 50 0.1
0.05
inadmissible sectors
0.15
55 0.2
s (desired ow) T_d K_P
Figure 7.30: Shape index in a part of the free controller parameter space, Ti = 0:7.
The result of the optimization (after 150 iterations) is depicted in Figure 7.29. For conve-
nience, in Figure 7.30 the shape index is visualized in a part of the achievable free controller
parameter space. 4
It should be clear that the same strategy can be used for linear systems. In that case the
SimuLink diagram has to be replaced by the transfer function or state space description of
the system. The problem formulation however remains in most cases non-convex. Hence such
exhaustive brute-force computer simulation e ort should be compared with the more classical
tuning rules.
The relative importance of a certain state component with respect to another one can be taken
into account with a so-called weighting matrix P . Besides the state, also the controller output
is a measurable quantity, and hence can be included (in a weighted form) in the performance
index.
Z tf
J= (x(t)t P x(t) + u(t)t Q u(t)) dt (7.15)
0
Such a problem is generally called a Linear Quadratic Regulator (LQR) related problem.
Linear because the process is assumed to be linear (Eqn.(7.13)), quadratic because the per-
formance index to be optimized is quadratic (Eqn.(7.15)), and regulator since the control
problem is a regulator problem (r = 0, i.e. tracking is not subject of interest). Because the
optimization is convex of nature (quadratic), the optimum is a global one.
It can be shown that if tf ! 1 this optimum control problem can be solved algebraically
by means of a Riccati equation. This however is beyond the scope of this text, but will be
exploited extensively in the next year.
A critical note: With regard to this introductory part on tuning a PID controller by
means of straightforward optimization, one should be convinced that a trade-o between
the simplicity of the control structure implementation (necessary hardware, etc.) and the
computational diculty of the tuning step should be made. This possibly also reveals why
academia are more familiar with the latter (obtaining nice mathematics), while industry relies
more on exploiting the former (obtaining easy implementations).
95
Chapter 8
Seminar tasks
8.1 Zitting 1
Oefening 1
G(s) is de transferfunctie van een SISO systeem van 5de orde.
- doorschot os = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
- onderschot us = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Verklaring (nullen): . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
96
- statische fout ess = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Volgens het eindwaarde-theorema: ess = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
::: .............................................................................
- de oscillatie-frequentie f = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Verklaring (polen): . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
bode Teken Bode-plot en Nyquist-plot van het gegeven systeem.
nyquist winst-marge gm = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
faze-marge pm = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Wat kan je hieruit a eiden ? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
::: ..................................................................................
tf2ss Zoek een toestands-ruimtemodel dat het systeem beschrijft.
aantal toestanden = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A=
B=
C=
D=
eig De eigenwaarden van A zijn: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Verband met transferfunctie: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
canon Bereken de modaal-canonieke vorm.
Wat is er typisch aan dit toestands-ruimtemodel ? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
::: ..................................................................................
97
Oefening 2: Gra sche identi catie
zp2tf, step Teken de stapresponsie van het systeem, beschreven door volgende polen en nullen:
nullen: 20
polen: 16 6i
7 3i
1 0:2i
4
Bepaal m.b.v. een gra sche identi catiemethode een benaderend model van lagere orde.
H (s ) = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
98
Oefening 3: Aan-uit regeling
simulink Start simulink in matlab.
File Open het bestand /users/sista1/decock/seminarie/matlab/HUIS.m
,! Open...
Er verschijnt een model voor een huis (genteresseerden vinden meer informatie hierover in
/software/matlab/toolbox/simulink/simdemos/thermdat.m).
Het model heeft twee ingangen:
- de warmtestroom afkomstig van het verwarmingstoestel (Qdot)
en
- de buitentemperatuur.
Het verwarmingselement kan enkel `aan' of `uit' staan. De ingang hiervan is dus 1 (aan) of 0
(uit).
De buitentemperatuur varieert sinusodaal (periode = 24 uur) met amplitude A rond een
gemiddelde Tm .
De initiele temperatuur in het huis is Tin .
De variabelen A, Tm en Tin kunnen ingesteld worden in het matlab-venster.
Gevraagd:
Sources 1. Ontwerp in simulink een aan/uit-regelaar die de temperatuur in het huis op 21 C houdt.
,!Constant Doe dit
Sinks
,!yout (a) zonder hysteresis
Linear (b) met hysteresis
,!Sum
Nonlinear Varieer de variabelen en de hysteresis-waarden en beschrijf kort uw bevindingen.
,!Sign,
Relay
Connections 2. Voeg witte ruis toe aan de temperatuursmeting. Welke aanpassingen moeten er gebeuren
,!Mux ?
Simulation
,!Parameters...
,!,!Gear Save de bekomen oplossing en mail die .m- le samen met wat uitleg (o.a. instelling van
variabelen) naar `decock@esat.kuleuven.ac.be'.
99
PSfrag replacements
Q
C
I
Rf
Oefening
A0 4: Stabiliteit
Ah
AH
l
Al
h
Hr u y
s G(s)
sp
QRb
Rb
p
pC
PI
0
1
Qlim
plim H(s)
Figure 8.1:
In guur 8.1 is G(s) het systeem uit oefening 1. De uitgang y wordt (negatief) teruggekoppeld
en een referentie-ingang r (gewenste uitgang) wordt aangelegd.
Bereken de transferfunctie van het gesloten-lus-systeem in functie van
de open-lus transferfunctie:
H (s) = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
frag replacements
Q
C
I
Rf
A0
Ah
AH
l
Al
h
H
s u y
sp r e K G(s)
QRb
Rb
p
pC
PI
0
1
Qlim
plim H(s)
Figure 8.2:
101
8.2 Zitting 2
Oefening 1
Een systeem G(s) heeft geen nullen en volgende polen:
2
2:5
13 3i
13 + 3i
Ontwerp volgens de `stability limit method' van Ziegler-Nichols drie regelaars (de ver-
sterking Ko die permanente oscillatie veroorzaakt ligt tussen 7000 en 8000):
- P-regelaar
- PI-regelaar
- PID-regelaar.
{ Ko = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
{ Po = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Ziegler
& Kp Ti Td
Nichols
P-regelaar
PI-regelaar
PID-regelaar
Simuleer het geregelde systeem in simulink, waarbij een stap-ingang moet gevolgd wor-
Sources den.
,!Step In-
put Vul in:
Sinks
,!yout
102
Linear
,!Sum
,!Transfer
Fcn
,!Zero-Pole
,!Gain
1. Vergelijking P { PI
(a) Een belangrijke verbetering van het PI-geregelde t.o.v. het
P-geregelde systeem is: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
::: .........................................................................
Meet het performantiekenmerk (Tr ; Ts ; os; us of ess ) dat
hiermee overeenstemt.
{ P-geregeld: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
{ PI-geregeld: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
(b) Welke nadelen heeft de integrerende term ?
::: .........................................................................
::: .........................................................................
::: .........................................................................
2. Vergelijking PI { PID
Welke invloed heeft de D-term op de inslingertijd ?
::: .............................................................................
{ Ts;PI = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
{ Ts;PID =. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Verklaring: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
::: .............................................................................
3. Waarom is de P-actie (Kp ) bij de PID-regelaar krachtiger dan bij de P-regelaar ?
::: .............................................................................
::: .............................................................................
103
{ PI-regeling: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
{ PID-regeling: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
104
Oefening 2
We benaderen het systeem uit oefening 1 door een 2de orde systeem. Daarvoor behouden
we de dominante polen en passen de versterking aan (zodat de stapresponsie van het
2de orde systeem dezelfde yss heeft als die van het 4de orde systeem).
{ dominante polen: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
{ nieuwe versterkingsfactor kn = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
zp2tf { a2 = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
{ a1 = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
{ a0 = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
k K s+k Kp
= a s3 +a s2n+(ap +k nKTi )s+k Kp
2 1 0 n p n T
i
105
{ Vul de Routh-Hurwitz-tabel in:
1
2
3
4
5
6
Simuleer het systeem voor een koppel (Kp2; Ti2 ) waarvoor het systeem juist
onstabiel wordt.
Kp2 = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
T i2 = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Nonlinear Voeg een dode tijd = 2 sec toe aan het proces.
,!Transport
Delay
106
{ Simuleer het systeem met dode tijd en de Ziegler-Nichols-parameters (referentie =
stap).
{ Wat merk je ? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
::: .............................................................................
{ Zoek een PID-regelaar die ervoor zorgt dat de stapresponsie van het gesloten-lus
systeem maximaal 5% doorschot vertoont en een kleine stijgtijd heeft.
Kp = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Ti = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Td =. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
stijgtijd Tr = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
107
Q
C
Rf
A
8.3 Zitting 3, 4 enAh05: De electromagnetische YoYo
AH
Het systeem waarop de regelopdracht
l moet uitgevoerd worden, is de elektromagnetische jojo
(Fig. 8.3). Een spanning V Aaangelegd
l
aan een spoel, wekt daarin een stroom I op, die op
zijn beurt een magnetisch veld B in de spoel induceert. De veldlijnen lopen door een massa
m van magnetisch materiaal,Hhdie zich in een mechanisch geleidende plastic buis bevindt.
s
sp
QRb m
Rb I
PSfrag replacements p
pC V 0
Q
PI
Rf 1
Qlim
A0 plim
B
x
Ah
AH Figure 8.3: Elektromagnetisch systeem
l
Door de veld Auxl wordt een kracht fe!m uitgeoefend op de massa, naast een gravitationele
h (G en ffr ). Het vrijmaken van de massa wordt getoond in Fig. 8.4.
en wrijvende kracht
Een bewegingHvan de massa induceert echter op zijn beurt een tegen-motorische spanning
em!e in de spoel.
s Het elektrische gedeelte wordt schematisch weergegeven in Fig. 8.4. Bemerk
sp nduktantie L, de spoel ook een weerstand R heeft.
dat naast de zel
QRb dx
Rb R I L C
dt
p+
pC
PI + m
0 V -
em->e = k
dx
1 dt
Qlim G x
plim
- f e->m = k I
Figure 8.4: Schematische weergave van elektrisch en mechanisch gedeelte
De grootte van zowel de elektromagnetische kracht fe!m als de tegen-motorische spanning
em!e , zijn evenredig met de grootte van de respectieve koppeling ke!m en km!e tussen elek-
trisch en mechanisch gedeelte. We beschouwen de koppeling symmetrisch te zijn tussen de
twee gedeelten (zelfde koppel-waarde aan de beide zijden of ke!m = km!e = k), maar nemen
de waarde niet-constant. We weten dat de verstrooingsverschijnselen belangrijker worden
naarmate de massa zich verder van het centrum van de spoel bevindt. Daarenboven is het
aantal veldlijnen dat door de massa loopt ook afhankelijk van de aangelegde stroom. We
modelleren deze beide e ecten door voor de koppeling de volgende formule te nemen:
k = I 2e
x2
2 ; (8.1)
108
Rf
A0
Ah
AH
l
waarin een empirisch bepaalde evenredigheidfactor is en een maat is voor de regio waarbin-
Al
nen de verstrooingsverschijnselen
h klein zijn (cfr. spreiding in statistische zin). Deze koppel-
ingskarakteristiek is weergegeven
H in Fig. 8.5.
s
sp
QRb 25
Rb 20
Coupling k[m.kg/C.s]
p 15
pC 10
PI 5
0
1
5
0
0.5
Qlim 0
plim Current i[A] −5 −0.5
Position X[m]
QRb
Rb
p
lineaire benadering
pC *
PI
f
werkingspunt (x*,f*)
0
1
Qlim x
plim
(o,o) x*
Let erop dat de (partiele) afgeleiden natuurlijk geevalueerd moeten worden in het werk-
ingspunt x? .
3. Co
0
ordinaten transformeren
0
naar werkingspunt Via een coordinatentransformatie
x = x x en door f (x) = f (x) f (x? ) te stellen, zetten we het systeem om in klein-
?
signaal (AC) vorm
f 0 (x0 ; y0 ; : : : ) = @f
@x x0 + @f
@y y0 ) + : : :
(x? ;y? ;::: ) (x? ;y? ;::: )
8.3.2 Simulatie
Let op de verschillen tussen simulatie van het reele systeem of van het gelineariseerde model.
Het ene werk in de absolute toestandsruimte, het andere is een kleinsignaal systeem. Bij het
vergelijken moet dus rekening gehouden worden met de DC-o sets. Ga dit steeds zorgvuldig
na. Controleer bvb. of de initiele waarden telkens goed gede nieerd zijn.
Afhankelijk van de gegeven parameters van de opdracht, moeten ook de simulatie-parameters
(zoals maximale tijdstap of tolerantie) aangepast worden. Voor meer uitleg hierover: zie de
Appendix in de begeleidende tekst.
110
Ga in de simulatie ook stapsgewijs tewerk. Probeer eerst in open loop consistente en repeteer-
bare resultaten te bekomen en schakel dan pas over op closed loop simulaties. Probeer ook
telkens de resultaten fysisch te interpreteren. Het heeft bvb. bij een spoel van slechts 10cm
groot geen zin uitwijkingen van tientallen meters te vragen. Bovendien heeft de linearisatie
bij zo'n grote uitwijkingen toch geen betekenis meer : : : .
8.3.3 Opdracht
Voor gegeven parameters (R, L, C , m, g, , ) en instelspanning vs,
1. analyseer het gedrag van het reele systeem, probeer de betekenis van de parame-
ter(waarden) te achterhalen,
2. bepaal de evenwichtspunten en lineariseer rond deze punten,
3. onderzoek in hoeverre deze linearisatie een goede benadering is,
4. ontwerp een PID-regelaar die rond het stabiele evenwichtspunt van het systeem een
goede tracking performantie heeft op stapvormige referentiesignalen,
5. maak hierbij eventueel gebruik van verschillende methodes en vergelijk hun respectieve
resultaten, zowel op reeel systeem als gelineariseerd model,
6. probeer zelf uit te maken wat de verschillende trade-o s zijn in het ontwerp. Onderzoek
bv. het werkingsgebied van de regelaar op het reele systeem en probeer dit zo groot
mogelijk te maken.
8.3.4 Verslag
Het verslag mag maximum 10 blz. lang zijn, guren inbegrepen. Blokschema's (Simulink)
en/of m-routines (Matlab) die essentieel zijn voor het begrijpen van het verslag, kunnen via
E-Mail (herman.verrelst@esat.kuleuven.ac.be) ingeleverd worden.
111