Beruflich Dokumente
Kultur Dokumente
Jan Swevers
July 2006
0-0
Introduction to system identification 1
• 3 basic steps:
1. collecting useful data,
2. choosing a convenient model set,
3. computing the (best) model within the model set, possibly following a
certain identification criterion, i.e. parameter estimation.
Control Theory [H04X3a]
Introduction to system identification 3
Model validation
• how do you know if the model is satisfactory: use it and check if it serves
its purpose
• this is often too dangerous: model validation criteria to get some feeling on
the accuracy, confidence on its value
– simulate and compare with different sets of measurements
– compare parameter estimates with expectations or values found using
other measuring techniques (if available)
PROS
- convenient frequency domain noise properties - usually linear in the parameters
- compact data set - no leakage problems
- clear insight into the effect of nonlinear distortions - on-line estimation is possible
- applicable to discrete time as well as continuous
time systems
- measurements in time domain as well as frequency
domain
CONS
- non-linear in the parameters - large data set
- limited set of input signals (cf. leakage errors) - exact representation of continuous
time systems ?
- often off-line processing only - correlated time domain noise ?
- nonlinear distortions ?
- time domain measurements only
• Due to ZOH condictions, the input u(t) is kept constant between the
sampling instants:
• This yields:
Z ∞ ∞ Z
X lT
y(kT ) = g(τ )u(kT − τ )dτ = g(τ )u(kT − τ )dτ
τ =0 l=1 τ =(l−1)T
ÃZ !
∞
X lT ∞
X
= g(τ )dτ uk−l = gT (l)uk−l
l=1 τ =(l−1)T l=1
• We omit T :
∞
X
y(t) = g(k)u(t − k), for t = 1, 2, ...
k=1
Example
• Consider:
ωn2
G(s) = 2
s + 2ζωn s + ωn2
Assume that ζ < 1. This corresponds to the continuous time transfer
function with:
nc = 0
nd = 2
c0 = wn2
d0 = 1
d1 = 2ζωn
d2 = wn2
Example (2)
• The zoh-discrete time equivalent of this transfer function equals :
b 0 z + b1
G(z) =
z 2 + a1 z + a2
with
a1 = −2e−σT cos(ωT )
a2 = e−σT
b0 = 1 − e−σT (cos(ωT ) + γ sin(ωT ))
b1 = e−σT (e−σT − cos(ωT ) + γ sin(ωT ))
and with
p
σ = ζωn , ω = ωn 1 − ζ 2
ζ
γ = p
1 − ζ2
T is the sampling period.
Control Theory [H04X3a]
Introduction to system identification 17
Example (3)
• The relation between the continuous-time and discrete-time poles is:
λd = e−λc T
• The numbers of transfer zeros differ, and their relation is much more
complex than the relation between the poles.
Introduction of disturbances
• We assume that the disturbances and noise can be lumped into an additive
term v(t) at the output:
∞
X
y(t) = g(k)u(t − k) + v(t)
k=1
• Sources of disturbances:
– Measurement noise: the sensors that measure the signals are subject to
noise and drift.
– Uncontrollable inputs: the system is subject to signals that have the
character of inputs, but are not controllable by the user.
• This model does not consider input disturbances, for example noise on the
measurements of the input data sequence.
Shorthand notation
•
qu(t) = u(t + 1)
•
q −1 u(t) = u(t − 1)
•
∞
X ∞
X
y(t) = g(k)u(t − k) + h(k)e(t − k)
k=1 k=0
X∞ ∞
X
= g(k)q −k u(t) + h(k)q −k e(k)r
k=1 k=0
" ∞
# " ∞
#
X X
= g(k)q −k u(t) + h(k)q −k e(t)
k=1 k=0
= G(q)u(t) + H(q)e(t)
• Remark that:
– ZN (ω) is periodic with period 2π:
ZN (ω + 2π) = ZN (ω)
Transformation of periodograms
• Let {s(t)} and {w(t)} be related by a stable system G(q).
s(t) = G(q)w(t)
• The input w(t) for t ≤ 0 is unknown, but obeys |w(t)| ≤ Cw for all t.
• Define
N −1
1 X
SN (ω) = √ s(t)e−jωt
N t=0
N −1
1 X
WN (ω) = √ w(t)e−jωt
N t=0
y(t)+a1 y(t−1)+. . .+ana y(t−na ) = b1 u(t−nk )+. . .+bnb u(t−nk −nb +1)+e(t)
• If we introduce:
we get:
A(q, θ)y(t) = B(q, θ)u(t − nk ) + e(t)
Control Theory [H04X3a]
Introduction to system identification 29
• ARX model: AR refers to the autoregressive part A(q, θ)y(t) and X to the
extra input B(q, θ)u(t − nk ) (called the eXogeneous variable in
econometrics).
Linear regressors
• One-step-ahead prediction of the output: predict the output at time t,
using only input-output data prior to t,
• e(t) is not known, so we take the most likely value, i.e. E{e(t)} = 0.
u(t) : t = 1, . . . , N
y(t) : t = 1, . . . , N
• Define
T
Z N = [y(1), u(1), y(2), u(2), . . . , y(N ), u(N )]
• Estimate the best set of model parameters θ such that, for the given data
set Z N , the output prediction errors are minimal according to the least
square cost function.
N
1 X 1 2
VN (θ, Z N ) = ε (t, θ)
N t=1 2
• Take the DFT of the prediction error and apply Parseval’s theorem:
N −1
1 1 X
VN (θ, Z N ) = |EN (2πk/N, θ)|2
N2
k=0
N −1
1 X 1
= |ĜN (ej2πk/N ) − G(ej2πk/N , θ)|2 QN (ej2πk/N , θ) + RN
N 2
k=0
with
|UN (ej2πk/N )|2 C
QN (2πk/N, θ) = RN ≤√
|H(ej2πk/N , θ)|2 N
• and
ŷ(t|θ) = ϕT (t)θ
with
h iT
ϕ(t) = −y(t − 1) . . . −y(t − na ) u(t − nk ) . . . u(t − nk − nb + 1)
• Criterion:
N
N
X 1£ T
¤2
VN (θ, Z ) = y(t) − ϕ (t)θ
t=1
2
ŷ(θ) = Φθ
Example
• Consider the following model with output measurement noise e(t) (not an
ARX model !!!):
B(q)
y(t) = u(t − 1) + e(t)
A(q)
with
A(q) = 1 + a1 q −1 , B(q) = b1 + b2 q −1
which can be rewritten as:
Example (2)
• In matrix form:
y(3) −y(2) u(2) u(1) ν0 (3)
a1
y(4) −y(3) u(3) u(2) ν0 (4)
= b1 +
.. .. .. .. ..
. . . . .
b2
y(N − 2) −y(N − 1) u(N − 1) u(N ) | {z } ν0 (N − 2)
| {z } | {z } θ
y Φ
• LSE:
LS
θ̂ N = Φ+ y
with
QN (2πk/N, θ) = |UN (ej2πk/N )|2 |A(ej2πk/N , θ)|2
and
j2πk/N YN (ej2πk/N )
ĜN (e )=
UN (ej2πk/N )
or
Bk (q)Bu (q, θ) 1
y(t) = u(t) + e(t)
Ak (q)Au (q, θ) Ak (q)Au (q, θ)
with
QN (2πk/N, θ) = |UN
∗
(ej2πk/N )|2 |Au (ej2πk/N , θ)|2 ,
• This yields:
c g Tc0 ∆Tc
∆θ̈ + ∆θ̇ + (sin(θ0 ) + cos(θ0 )∆θ) = +
I l I I
• Subtract equilibrium conditions
• yielding:
c g ∆Tc
∆θ̈ + ∆θ̇ + cos(θ0 )∆θ =
I l I
0.5 4
Input [Nm]
Input [Nm]
0 3.5
−0.5 3
−1 2.5
0 500 1000 1500 2000 2500 3000 3500 4000 0 500 1000 1500 2000 2500 3000 3500 4000
Samples Samples
0.4 1.2
0.2 1
Output [rad]
Output [rad]
0 0.8
−0.2 0.6
−0.4 0.4
0 500 1000 1500 2000 2500 3000 3500 4000 0 500 1000 1500 2000 2500 3000 3500 4000
Samples Samples
20
amplitude [dB]
−10
−20
−30
−40
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
−100
−150
−200
−250
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
frequency [Hz]
20
amplitude [dB]
−10
−20
−30
−40
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
−100
−150
−200
−250
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
frequency [Hz]
amplitude [dB]
−10
−20
−30
−40
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
−100
−150
−200
−250
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
frequency [Hz]
20
amplitude [dB]
−10
−20
−30
−40
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
−100
−150
−200
−250
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
frequency [Hz]
20
discrete time model
identified discrete time model
10 estimated FRF
amplitude [dB] 0
−10
−20
−30
−40
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
50
discrete time model
identified discrete time model
0 estimated FRF
phase [degrees]
−50
−100
−150
−200
−250
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
frequency [Hz]
0.3
measured
predicted
0.2
0.1
Output [rad]
0
−0.1
−0.2
−0.3
0 20 40 60 80 100 120 140 160 180 200
Samples
0.3
0.2
Prediction error [rad]
0.1
−0.1
−0.2
amplitude [dB]
−10
−20
−30
−40
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
−100
−150
−200
−250
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
frequency [Hz]
0
amplitude [dB]
−10
−20
−30
−40
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
0
discrete time model
identified discrete time model
−50
phase [degrees]
−100
−150
−200
−250
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
frequency [Hz]
0
amplitude [dB]
−10
−20
−30
−40
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
0
discrete time model
−50 identified discrete time model
phase [degrees]
−100
−150
−200
−250
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
frequency [Hz]
20
discrete time model
10 identified discrete time model
estimated FRF
amplitude [dB] 0
−10
−20
−30
−40
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
50
−50
−100
−150
−200
−250
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
frequency [Hz]
0.3
measured
predicted
0.2
0.1
Output [rad]
0
−0.1
−0.2
0.3
0.2
Prediction error [rad]
0.1
−0.1
−0.2
20
10 model at 0 degrees
0 model at 45 degrees
−20
−30
−40
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
model at 45 degrees
−100
−150
−200
−250
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
frequency [Hz]
Conclusion
• Presented time domain identification method is only one example of many
existing methods
• Simple to use (only measurement data is required), but it has bad
properties
• Simple ’tricks’ to improve model accuracy are presented
• You have to be able to perform a time domain identification for systems
similar to the one presented here...