You are on page 1of 35

Practical aspects in adaptive control

-Automatic tuning of standard controllers


-Gain scheduling
-Nonlinear transformations
-Relay methods
-Identification
Identification of the process model

„ step response test


„ impulse response test
„ stochastic methods (FIR model etc.)
„ recursive identification (parametric method)

G(s)
Fitting to a parametric model

K
K − sL
G ( s) = e
1 + sT
0.632 K

Different methods to
fit the model parameters
exist (area method,
L method of moments etc.)
T1

T2
Fitting to a parametric model (cont.)

„ Basic models:
K
G1 ( s) = e − sL Identification of the process model
1 + sT
Approximation of a low order
K model
G2 ( s ) =
(s + a)
n
Design of an adaptive controller
K
G3 ( s ) =
(1 + α1s )(1 + α 2 s )(1 + α 3 s )

K (1 − α s )
G4 ( s ) =
(s + a)
n
Fitting to a parametric model (cont.)

1
„ Example: GP ( s ) =
(1 + s )(1 + 0.2s )(1 + 0.05s )(1 + 0.01s )

Appr 1. 1
GP ( s ) ≈ , τ = τ 1 + τ 2 + τ 3 + τ 4 = 1.26
1+τ s

1
Appr 2. GP ( s ) ≈
(1 + s )(1 + 0.26s )
Fitting to a parametric model (cont.)

Appr 1.

dB

w
1 10

w
1 10
Fitting to a parametric model (cont.)

Appr 2.

dB

w
1 10

w
1 10
Autotuners

„ Auto mode (tuning operation on; parameters are


continuously identified)
„ Monitoring mode (controller parameters are held
constant. The error of the real and predicted process
output is observed. Validation of the controller and its
parameters.)
„ Pretune mode (initialisation of identification and the
calculation of the controller parameters, if the operator
cannot provide this information.)
„ Auto-tuning mode (tuning on demand of the operator,
disconnects automatically)
Autotuners (cont.)

„ Standard PID

⎡ 1
t
de(t ) ⎤
y (t ) = K p ⎢e(t ) + ∫ e(τ )dτ + Td ⎥
⎣ Ti 0 dt ⎦
⎡ 1 ⎤
Y ( s ) = K p ⎢1 + + Td s ⎥ E ( s )
⎣ Ti s ⎦

• Different modifications exist, e.g.


⎡ 1
t
dy (t ) ⎤
y (t ) = K p ⎢e(t ) + ∫ e(τ )dτ − Td ⎥
⎣ Ti 0 dt ⎦
Autotuners (cont.)

⎡ ⎤
⎢ 1 Ts ⎥
Y ( s ) = K p ⎢1 + + d ⎥ E ( s ), N ≈ 3 − 10
T
⎢ Ti s 1 + d s⎥
⎣ N ⎦

In Ziegler-Nichols tuning
1.2T
Kp = K p = 0.6 K u
KL
Ti = 2 L Ti = 0.5Tu
Td =
L Td = 0.125Tu
2
Modifications of the PID algorithm

”Non-interacting
P
u
form”
e
I +
⎡ 1 ⎤
Y ( s) = K p ⎢1 + + Td s ⎥ E ( s )
⎣ Ti s ⎦
D

”Interacting
D I
form”
e u
⎛ 1 ⎞
G '( s ) = K ' ⎜ 1 + ⎟ (1 + sTd ' )
+ P +

⎝ sTi ' ⎠
Modifications of the PID .. (cont.)

„ Interacting Æ Non-interacting Ti '+ Td '


K =K'
Ti '
Ti = Ti '+ Td '
Ti ' Td '
Td =
Ti '+ Td '

K'=
K
2
(1 + 1 − 4Td / Ti )
„ Non-interacting Æ Interacting T
(
Ti ' = i 1 + 1 − 4Td / Ti )
2
(assume Ti ≥ 4Td )
Ti
(
Td ' = 1 − 1 − 4Td / Ti
2
)
Setpoint weighting

„ Ordinary PID gives a bad step response, if it is tuned for


a load disturbance.
„ Solution: set a weight to the reference signal (more
generally: use a pre-filter)

⎡ 1
t
dy ⎤
u = K c ⎢ β yr − y + ∫ e(τ )dτ − Td ⎥ , β ∈ [ 0,1]
⎣ Ti 0 dt ⎦

„ The step response does not deteriorate, even if the


controller has been tuned to give an optimal response to a
step in the load.
Relay tuning methods

„ The Ziegler-Nichols tuning methods are not always


practical, because: 1. the process test must be run open
loop or 2. the process must be driven to the stability
limit in closed loop.
„ Solution: By using a nonlinear element the process can
in closed loop establish a limit cycle operation, where the
oscillations are much smaller. However, measuring the
amplitude and period of the oscillations gives the
necessary process information to tune the controller.
„ The theory of describing functions can be used to study
oscillations created by nonlinear elements in a closed-
loop system.
Relay tuning methods (cont.)

Linear process + relay


F(a) is the describing
function of the relay.

Limit cycle oscillations


Actually, nonlinear
elements are used to
identify one point of the
frequency response of the
process.
Relay tuning methods (cont.)

1 Note: for a relay the



F (a ) describing function
F (a )G ( jω ) = −1 F(a) is real.
⎧arg G ( jω ) = −π
G ( jω ) ⎪
⎨ πa
⎪⎩ G ( jω ) =
4d

The intersection point of the describing function curve and


the frequency response curve identify the characteristics of
oscillation.
Relay tuning methods (cont.)

-Normal operation mode


-Tuning mode
Relay tuning methods (cont.)

Sometimes the following result can be used. Consider the


negative feedback connection of a linear process and a relay.
G : x (t ) = Ax(t ) + Bu (t )
y (t ) = Cx(t )
⎧d , e > 0
R : u (t ) = ⎨
⎩− d , e < 0
e(t ) = uc (t ) − y (t )
Relay tuning methods (cont.)

Assume that the closed-loop system has a symmetric limit


cycle with period T. Then T > 0 is the smallest value
that satisfies

⎪C ( I + Φ ) −1 Γ = 0 Proof: see exercises


⎨Φ = e
AT / 2

⎪ T /2
⎪Γ = e As ds B
⎪⎩ ∫0
Identification: method of moments

K
Ex. G (s) = e − sL A three-parameter model:
1 + sT K gain, T time constant,
L dead time

The step response is

s (t ) = K ⎡⎣1 − e − (t − L ) / T ⎤⎦ , t ≥ L
Method of moments (cont.)

The average residence time is


∫ ( s(∞) − s(t ) ) dt
Tar = 0
= L +T
K

The normalized dead time (sometimes called


controllability ratio) is
τ=
L
=
L
0 ≤τ ≤1 the larger τ is, the more
L + T Tar difficult the process is to
control
Method of moments (cont.)

K Tar

s(t)
A1 = ∫0
s (t )dt = KTe −1
0.632 K

A1 eA1
T=
A0 K

A0 eA1
L = Tar − T = −
L
K K
T1

Tar Area methods


Method of moments (cont.)

Let h(t) be the impulse response corresponding to G(s).



G ( s ) = ∫ e − st h(t )dt
0

Taking derivatives with respect to s gives



d nG ( s) ( n)
( ) ∫
n − st n
n
= G ( s ) = −1 e t h(t )dt so that
ds 0


G ( ) (0) = ( −1) ∫ h(t )dt
n n n
t
0
Method of moments (cont.)

The residence time distribution is


h(t )
f (t ) = ∞

∫ h(t )dt
0

The average residence time is the mean value


∞ ∫ th(t )dt
Tar = ∫ tf (t )dt = 0

0
∫ h(t )dt
0
Method of moments (cont.)

Let g (t ) = s (∞) − s (t ) so that dg (t ) = −h(t )


dt

and it follows
∞ ∞
and assuming the first
∫ th(t )dt = [ −tg (t )] + ∫ g (t )dt

0
0
0
term to be zero

∫ ( s(∞) − s(t ) ) dt
Tar = 0

s (∞ )
Method of moments (cont.)

Ex. A three-parameter model

K
G ( s) = e − sL
1 + sT

K = G (0) = ∫ h(t )dt
0

Taking logrithms gives log G ( s ) = log K − sL − log (1 + sT )


G '( s ) T
= −L −
G(s) 1 + sT
2
G ''( s ) ⎛ G '( s ) ⎞ T2
−⎜ ⎟ =
G ( s ) ⎝ G ( s ) ⎠ (1 + sT )2
Method of moments (cont.)

Hence G '(0) ∫ th(t )dt


Tar = − = L +T = 0

G (0)
∫ h(t )dt
0

∫ t h(t )dt
2

G ''(0)
T2 = − Tar2 = 0

− Tar2
G (0)
∫ h(t )dt
0

K, Tar and T can be computed. Finally


L = Tar − T
Method of moments (cont.)

1
If, for example G ( s) = s + 1 8
( )
8 72
G '( s) = − , G ''( s ) =
( s + 1) ( s + 1)
9 10

G (0) = 1, G '(0) = −8, G ''(0) = 72

K = 1, Tar = 8, T 2 = 72 − 64 = 8
T = 2 2 ≈ 2.8, L = 8 − 2 2 ≈ 5.2
Nonlinear transformations

„ Sometimes a control problem can be simplified by


changing the nonlinear equations into a linear form and
then doing control design by traditional methods.
„ The control algorithm will then be converted back to the
original coordinates.
„ The method is known as exact linearization.
„ It is not totally general. Furthermore, it involves
sophisticated mathematics.
„ An example is shown to introduce the method.
Nonlinear transformations (cont.)

θ A pendulum is controlled by
l a horizontal force.
Fcosθ Governing equations: Basic
θ equation of motion (circular
mg sinθ
F
θ orbit)
θ I (moment of inertia),
mg M (moments)
Iθ = ∑ M ⇒ ml 2θ = −mg sinθ ⋅ l + F cosθ ⋅ l
 g F
⇒ θ = − sinθ + cosθ
l ml
Nonlinear transformations (cont.)

By using the variables x1 = θ , x2 = θ, u = F


y = θ = x1

we get
⎧ x1 = x2

⎪ g u
⎨ 2
x = − sin( x1 ) + cos( x1 ) = −sin( x1 ) + u cos( x1 )
⎪ l ml
⎪⎩ y = x1

where g =l, m = 1/l has been assumed for simplicity.


Nonlinear transformations (cont.)

Introduce the control

v(t ) = −sin x1 (t ) + u (t ) cos x1 (t )

which linearizes the system equations to


⎧ ⎡0 1 ⎤ ⎡0⎤
⎪ x = ⎢ ⎥ x+ ⎢ ⎥v
⎨ ⎣0 0 ⎦ ⎣1 ⎦
⎪y = 1 0 x
⎩ [ ]
Assuming that the states are measured, use the control
Nonlinear transformations (cont.)

v(t ) = −l1 ' x1 (t ) − l2 ' x2 (t ) + m ' uc (t )

leading to the closed loop


m'
uc → y :
s 2 + l2 ' s + l1 '

If the desired characteristic equation is

s 2 + p1s + p2 it follows l1 ' = p2 , l2 ' = p1 , m ' = p2


Nonlinear transformations (cont.)

The controller algorithm is then realized as


v(t ) + sin x1 (t ) 1
u (t ) = = [ − p2 x1 (t ) − p1 x1 (t ) + p2uc (t ) + sin x1 (t )]
cos x1 (t ) cos x1 (t )

Simulation results can be seen on the next slide.


a. Nonlinear controller
b. Linear controller with constant coefficients
Nonlinear transformations (cont.)

You might also like