Sie sind auf Seite 1von 41

SYSTEM IDENTIFICATION

The System Identification Problem is to estimate a model of a


system based on input-output data.
Basic Configuration
v(t) disturbance (not observed)
continuous

u(t) System y(t)


input (observed) output (observed)

discrete {v(k)}

{u(k)} System {y(k)}


1
We observe an input number sequence (a sampled
signal)
{u(k)} = {u(0), u(1), ..., u(k), ..., u(N)}
and an output sequence
{y(k)} = {y(0), y(1), ..., y(k), ..., y(N)}

If we assume the system is linear we can write:-

Y( z )  G ( z ) U( z )  V( z )

using standard z-transform notation


2
V(z)

U(z) G(z) + Y(z)

The disturbance v(k) is often considered as generated by


filtered white noise :-
(z) H(z)
white noise V(z)
filter disturbance
U(z) G(z) + Y(z)
input output
process

giving the description:


Y( z )  G ( z ) U( z )  H ( z )  ( z )
3
Parametric Models
ARX model (autoregressive with exogenous variables)

1
(z) A( z 1 )
V(z)
H(z)

B( z 1 )
U(z) z  n + Y(z)
A ( z 1 )

G(z)
where
1 1  na
A ( z )  1  a1z  ana z
B( z 1 )  b1z 1  b2 z 2 bnb z  nb 4
giving the difference equation:

y ( k )  a1 y ( k  1)  ana y ( k  na ) 
b1u( k  n  1)  b2 u( k  n  2) bnb u( k  n  nb )   ( k )
 n
and z represents an extra delay of n sampling instants.

identification problem
determine n, na, nb (structure)
estimate a1 , a2 , , ana
b1 , b2 , , bnb (parameters)
5
ARMAX model (autoregressive moving average with
exogenous variables)

(z) C ( z 1 )
A ( z 1 )
V(z)
H(z)

U(z) B( z 1 ) Y(z)
z  n
A ( z 1 )
+

G(z)
where A ( z 1 )  1  a1z 1  ana z  na
B( z 1 )  b1z 1  b2 z 2 bnb z  nb
1 1  nc
C( z )  1  c1z  cnc z 6
giving the difference equation:
y ( k )  a1 y ( k  1)  ana y ( k  na ) 
b1u( k  n  1)  b2 u( k  n  2) bnb u( k  n  nb ) 
 ( k )  c1 ( k  1)  cnc  ( k  nc )
identification problem
determine n, na, nb, nc (structure)

estimate a1 , a2 , , ana
b1 , b2 , , bnb (parameters)
c1 , c2 , , cnc 7
General Prediction Error Approach
u(t) y(t)
Process
-
e(t,)

Predictor with +
adjustable
parameters 


Algorithm for
minimising some
function of e(t,)

Predictor based on a parametric model


Algorithm often based on a least squares method.
N
min  e (k )2
8

k 0
Consistency
A desirable property of an estimate is that it
converges to the true parameter value as the number
of observations N increases towards infinity.
This property is called consistency
Consistency is exhibited by ARMAX model
identification methods but not by ARX approaches
(the parameter values exhibit bias).

9
Example of MATLAB Identification Toolbox Session

Input and Output Data of Dryer Model


OUTPUT #1
2

-1

-2
0 5 10 15 20 25
INPUT #1

-1

0 5 10 15 20 25
10
input and output data
MATLAB statements and results:
(ARX n, na = 2, nb = 2)

t h = a rx(z2,[2 2 3]); % z2 con ta in s da t a


t h = set t(t h ,0.08); % Set th e corr ect sa mplin g in terva l.
pr esen t (th )

Resu lts:

Loss fcn : 0.001685


Aka ike`s F P E : 0.001731 Sa mplin g in terva l 0.08
Th e polyn omia l coefficien ts a r e
B= 0 0 0 0.0666 0.0445
A = 1.0000 -1.2737 0.3935
11
ARX Simulated (solid) and measured (dashed) outputs - error = 6.56
1.5

0.5

-0.5

-1

-1.5
64 65 66 67 68 69 70 71 72
Time

1
0. 0666  0 .0445 z
ARX model: G ( z )  z 3
1  12737
. z 1  0.3935z 2 12
MATLAB Demo

13
ADAPTIVE CONTROL

PERFORMANCE
ASSESSMENT &
UPDATING
MECHANISM
K J Astrom disturbances
regulator fast
parameters varying

REGULATOR PROCESS
ref + _
parameters slowly
varying

outputs (fast varying)


14
Adaptive control is a special type of nonlinear control
in which the states of the process can be separated
into two categories:-
(i) slowly varying states (viewed as parameters
(ii) fast varying states (compensated by standard
feedback)
In adaptive control it is assumed that there is feedback
from the system performance which adjusts the
regulator parameters to compensate for the slowly
varying process parameters.

15
Adaptive Control Problem
An adaptive controller will contain :-

•characterization of desired closed-loop performance


(reference model or design specifications)

•control law with adjustable parameters


•design procedure
•parameters updating based on measurements
•implementation of the control law (discrete or
continuous)
16
Overview of Some Adaptive Control Schemes
Gain Scheduling
operating
gain conditions
schedule
regulator
command parameters
signal y
u
regulator process
control output
signal

The regulator parameters are adjusted to suit different


operating conditions. Gain scheduling is an open-loop
17
compensation.
Auto-tuning
parameters K, Ti, Td

+ PID
controller Process
_
F
KG
1
1 I
 T sJ
H Ts Ki
d

PID controllers are traditionally tuned using simple


experiments and empirical rules. Automatic methods can be
applied to tune these controllers.
(i) experimental phase using test signals; then:-
(ii) use of standard rules to compute PID
parameters. 18
Model Reference Adaptive Systems MRAS

model
ideal
regulator ym output
parameters
adjustment
mechanism


uc u y
regulator process
actual
output

19
The parameters of the regulator are adjusted such that the
error e = y - ym becomes small. The key problem is to
determine an appropriate adjustment mechanism and a
suitable control law.
MIT rule adjustment mechanism

d e
  e
dt 
where  determines the adaptation rate. This rule changes
the parameters in the direction of the negative gradient of e2

20
Combining the MIT rule with the control law: u   (uc  y )
and computing the sensitivity derivatives
e
produces the scheme: 
ym
model

filter
integrator  e  _

s  e
multiplier +

+
 process
uc _ u y
multiplier

Note: steady-state will be achieved when the input to the integrator


21
becomes zero. That is when y = ym
Self Tuning Regulators STR

process parameters

design estimation
regulator
parameters 
uc u y
regulator process
actual
output

22
The process parameters are updated and the regulator
parameters are obtained from the solution of a design
problem. The adaptive regulator consists of two loops:-
(i) inner loop consisting of the process and a linear
feedback regulator
(ii) outer loop composed of a parameter estimator
(recursive) and a design calculation. (To obtain good
estimates it is usually necessary to introduce
perturbation signals)

Two problems:-
(i) underlying design problem
(ii) real time parameter estimation problem
23
Example - SIMULINK Simulation of MRAS

MODEL REFERENCE ADAPTIVE


CONTROL
2
s+2
reference
model -K-
filter

reference
error
1/s -K- * -
+
Integrator g1 mult e
1/s -K- * 1
Integrator1 g2 mult_ s+2
filter_

* + 0.5
- Mux
to s+1
feedback
Input error process Mux reference,
Mux output,
command
Mux1 *
so
parameters

24
Input, Reference and Actual Outputs

0.8

0.6

0.4

0.2

-0.2
0 50 100 150
Time (second) 25
MATLAB Demo

26
INTRODUCTION TO THE KALMAN FILTER
State Estimation Problem
w(t) v(t)

u(t) x(t) y(t)


x  Ax  Bu  Gw y  Cx  Du  v

SYSTEM

Vectors w(t) and v(t) are noise terms, representing


unmeasured system disturbances and measurement errors
respectively. They are assumed to be independent, white,
Gaussian, and to have zero mean. In mathematical terms:-
27
EF
v
G (t ) w T ( )I  0 for all t and 
J
H K
EF
w
G (t ) w T ( )I  Q (assumed constant)
JK
H
EF
v
G (t ) v T ( )I  R (assumed constant)
JK
H
where Q and R are symmetric and non negative definite
covariance matrices. (E is the expectation operator)
Only u(t) and y(t) are assessable.

The state estimation problem is to estimate the states x(t)


from a knowledge of u(t) and y(t). (and assuming we know
A, B, G, C, D, Q, and R).

28
Construction of the Kalman-Bucy Filter
u(t) SYSTEM y(t)
x(t)

A
x
z y(t )
x 
B + C + _
u(t) + y(t)

FILTER L(t)

x(t )
Filter equation :- x  Ax  Bu  L(t )(y  Cx  Du) 29
Filter equation :- x  Ax  Bu  L(t )( y  Cx  Du)
L(t) is a time dependent matrix gain.
The estimation problem is now to find L(t) such that
the error between the real states x(t) and the
x(t )states
estimated is minimized. This can be
formulated as: F I
min E G [x(t )  x
(t )] [x(t )  x
T (t )]J
L (t ) H K

R E Kalman

30
Duality Between the Optimum State Estimation
Problem and the Optimum Regulator Problem
It can be shown that the optimum state estimation problem:
min E F
[
Gx(t )  x
(t )]T [x(t )  x
(t )]I
J
L (t ) H K
subject to:
x  Ax  Bu  Gw
y  Cx  Du  v
xˆ  Axˆ  Bu  L(t )(y  Cxˆ  Du)
E(ww )=Q, E( vv )=R
T T

is the dual of the optimum regulator problem:


min
L (t )
1
zT
2 0
FxT GQGT x  uT RuIdt
G
H JK
subject to: x  AT x  CT u
u  L(t )x 31
Thus L(t) can be obtained by solving the matrix
Ricatti equation:
1
S  AS  SA  SC R CS  GQG
 T T T

1
L (t )  R CS(t )

Furthermore for large measurement times L(t)


converges to:
Lim L(t )  L
T

a constant matrix gain.

32
Linear Quadratic Estimator Design Using MATLAB

LQE Lin ea r qu a dr a t ic est im a t or design . F or t h e con tin u ou s-t im e syst em :


.
x = Ax + Bu + Gw {St a t e equ a t ion }
z = Cx + Du + v {Mea su r emen ts}
wit h pr ocess n oise a n d m ea su r em en t n oise cova r ia n ces:
E {w} = E {v} = 0, E {ww'} = Q, E {vv'} = R, E {wv'} = 0
L = LQE (A,G,C,Q,R) r et u r n s t h e ga in m a t r ix L su ch t h a t t h e
sta tion a r y Ka lm a n filt er :
.
x = Ax + Bu + L(z - Cx - Du )
pr odu ces a n LQG opt im a l estim a t e of x.

33
Example:
x 1  x2
x 2   x1  w(t ) , E ( w (t ))  1
2

y  x1  v (t ) , E (v (t ))  3
2

A=[0 1;-1 0];


G=[0;1];
C=[1 0];
Q=1;
R=3;
L=lqe(A,G,C,Q,R)
produces: L =

0.5562 34
0.1547
giving the filter equations:

x  x  l ( y  y )
1 2 1

x   x  l ( y  y )
2 1 2

y  x1

where l1 = 0.5562, l2 = 0.1547

35
w(t) v(t)

u(t) = 0 x2 x1 y(t)
1 1
+ +
s s

-1
SYSTEM

-1

1
x2 1
x1 _ +
+ +
s s
y y

l1
l2
FILTER
36
x2 ( t ) x1 (t )
SIMULINK SIMULATION
vt
WS1

wt
1.7
WS2
v(t) sqrt(R)

PLANT
1 + +
- 1/s 1/s +
sqrt(Q) - x2 x1 y
w(t) meas(y)
+ +
- - e1t
y-Cx e1 WS3

- 1/s + Mux
+ + 1/s
_ x2hat __ x1hat Mux1 x1/x1hat
+ e2t
-
0.556 e2 WS4
l1 Mux
0.155
Mux x2/x2hat
l2
KALMAN FILTER
37
Comparison of actual (solid) and measured (dash) states
6

2
x1
0

-2

-4

-6

265 270 275 280


38
Time (second)
Comparison of actual (solid) and measured (dash) states
6

2
x2
0

-2

-4

-6

265 270 275 280


Time (second) 39
Measurement signal y(t)

5
0
-5
-10
265 270 275 280

40
MATLAB Demo

41

Das könnte Ihnen auch gefallen