Sie sind auf Seite 1von 74

Introduction to system identification

Jan Swevers
July 2006

0-0
Introduction to system identification 1

Contents of this lecture


• What is system identification
• Time vs. frequency domain identification
• Discrete time representation of continuous time systems
• Frequency domain interpretation of sampled data signals
• Discrete time input-output models for linear time-invariant systems
• Linear least squares parameter estimation
• Example
• Conclusion

Control Theory [H04X3a]


Introduction to system identification 2

What is system identification


• Definition of system identification : Selection of a model for a process
(i.e. studied system or device under test (DUT)), using a limited number of
measurements of the input and outputs, which may be disturbed by noise,
and a priori system knowledge.
• Definition of parameter estimation : The experimental determination
of values of parameters that govern the dynamic behaviour, assuming that
the structure of the process model is known

• 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

The data record


• determination of inputs and outputs
• choice of input signals:
– normal operation or specifically designed identification experiments
– persistency of excitation
– optimal excitation : maximally informative, minimal uncertainty
• data sampling rate: Nyquist frequency, aliasing/frequency folding, filtering:
10 time higher than highest frequency of interest

Control Theory [H04X3a]


Introduction to system identification 4

The model set


• specify within which collection of models we are going to look for a suitable
one
• very important but often difficult
• a priori available information : certain physical laws are known to hold true
for the system
• preliminary data analysis: step or frequency response
• black box or trial and error

Control Theory [H04X3a]


Introduction to system identification 5

The parameter estimation step


• determine within the set of models, the model that is the “best”
approximation or provides the “best” explanation of the observed data
• we need a criterion to measure the model quality : the estimation of the
model parameters corresponds to the minimization of the chosen criterion
• the choice of the criterion depends on the available information about and
the purpose of the model.
• conflicting requirements: a model that is as simple as possible, and that
explains as much as possible of the observed data

Control Theory [H04X3a]


Introduction to system identification 6

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)

Control Theory [H04X3a]


Introduction to system identification 7

The identification loop

Control Theory [H04X3a]


Introduction to system identification 8

Time vs. frequency domain identification


• Time domain identification: use measured data directly to estimate model
parameters.
• Frequency domain identification: first transform data to frequency domain
using DFT, then, estimate model parameter in the frequency domain.

Control Theory [H04X3a]


Introduction to system identification 9

Pros and cons of FDI and TDI


Frequency Domain Estimator Time Domain Estimator

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

Control Theory [H04X3a]


Introduction to system identification 10

Two possible measurement situations

Control Theory [H04X3a]


Introduction to system identification 11

Discrete time representation of continuous time


systems
• Output of a linear time-invariant system for a given input u(t) and impulse
response: Z ∞
y(t) = g(τ )u(t − τ )dτ
τ =0

• The Laplace transform of the impulse response {g(τ )}∞


τ =0 is called the
transfer function G(s):
c0 snc + c1 s(nc −1) + · · · + cnc
G(s) = ,
d0 snd + d1 s(nd −1) + · · · + dnd
with nc ≤ nd (due to the causality condition).
• We consider the output only at discrete times tk = kT , for k = 1, 2, ...:
Z ∞
y(kT ) = g(τ )u(kT − τ )dτ
τ =0

Control Theory [H04X3a]


Introduction to system identification 12

• Due to ZOH condictions, the input u(t) is kept constant between the
sampling instants:

u(t) = uk , kT ≤ t < (k + 1)T

• 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

where we define the (discrete) impulse response of that system:


Z lT
gT (l) = g(τ )dτ
τ =(l−1)T

Control Theory [H04X3a]


Introduction to system identification 13

• We omit T :

X
y(t) = g(k)u(t − k), for t = 1, 2, ...
k=1

k=1 is called the


• The z-transform of the discrete impulse response {g(k)}∞
discrete time transfer function G(z):

b0 z nb + b1 z (nb −1) + · · · + bnb


G(z) = n (n
,
a0 z + a1 z
a a −1) + · · · + ana
with nb < na (due to the strict causality condition, i.e. g(k) = 0, for
k = 0).

Control Theory [H04X3a]


Introduction to system identification 14

• The relationship between the parameters of the transfer function of


continuous time system and the parameters of its zoh-discrete time
equivalent can be calculated using published tables or CACSD (MATLAB)
software.

Control Theory [H04X3a]


Introduction to system identification 15

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

Control Theory [H04X3a]


Introduction to system identification 16

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.

Control Theory [H04X3a]


Introduction to system identification 18

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.

Control Theory [H04X3a]


Introduction to system identification 19

Introduction of disturbances (2)


• Time domain identification approach to model disturbances:

X
v(t) = h(k)e(t − k)
k=0

where e(t) is a sequence of independent (identically distributed) random


variables with a certain probability density function, and h(0) = 1.
• The mean value of e is equal to zero, yielding:

X
E{v(t)} = h(k)E{e(t − k)} = 0
k=0

Control Theory [H04X3a]


Introduction to system identification 20

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)

Control Theory [H04X3a]


Introduction to system identification 21

Shorthand notation (2)




X
G(q) = g(k)q −k
k=1
X∞
H(q) = h(k)q −k
k=0

• G(q) is the transfer operator or transfer function of the linear system.


• H(q) is the transfer function of the disturbance process.

Control Theory [H04X3a]


Introduction to system identification 22

Frequency domain interpretation of sampled


data signals
• Periodograms of signals over finite intervals
• Transformation of periodograms

Control Theory [H04X3a]


Introduction to system identification 23

Periodograms of signals over finite intervals


• Consider the finite sequence of a signal z(t), t = 0, 1, · · · , N − 1.
• DFT:
N −1 N −1
1 X 1 X
ZN (ω) = √ z(t)e−jωt = √ z(t)WN−kt
N t=0 N t=0
with ω = 2πk/N , for k = 0, 1, · · · , N − 1, and WN = ej2π/N .
• Inverse DFT:
N −1
1 X 2πk j2πkt/N
z(t) = √ ZN ( )e
N k=0 N

• Remark that:
– ZN (ω) is periodic with period 2π:

ZN (ω + 2π) = ZN (ω)

– since z(t) is real:


ZN (−ω) = ZN

(ω)
Control Theory [H04X3a]
Introduction to system identification 24

Periodograms of signals over finite intervals (2)


• This inverse DFT represents the signal z(t) as a linear combination of ejω
for N different frequencies ω.
• The number ZN ( 2πkN ) tells us the “weight” that the frequency ω = 2πk/N
carries in the decomposition of the sequence z(t).
• |ZN ( 2πk 2
N )| is therefore a measure of the energy contribution of this
frequency to the signal.

2πk 2
|ZN ( )|
N
is known as the periodogram of the signal z(t), t = 0, 1, ..., N − 1.

Control Theory [H04X3a]


Introduction to system identification 25

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

Control Theory [H04X3a]


Introduction to system identification 26

Transformation of periodograms (2)


• Then
SN (ω) = G(ejω )WN (ω) + RN (ω)
where P∞
k=1 k|g(k)|
|RN (ω)| ≤ 2Cw √
N
• If {w(t)} is periodic with period N , then RN (ω) is equal to zero for
ω = 2πk/N .

Control Theory [H04X3a]


Introduction to system identification 27

Discrete time input-output models for linear


time-invariant systems
• Different parametrizations of G(q) and H(q) which are finite.
• Rather than h(k) and g(k) : an infinite number of parameters.
• Correspond to those used in the Matlab System Identification Toolbox.
• Extend the model with a parameter vector θ:

y(t) = G(q, θ)u(t) + H(q, θ)e(t)

• In this course, we restrict ourselves to the most simple parametrization:


the ARX model structure

Control Theory [H04X3a]


Introduction to system identification 28

ARX model structure


• The most simple input-output model: a linear difference equation

y(t)+a1 y(t−1)+. . .+ana y(t−na ) = b1 u(t−nk )+. . .+bnb u(t−nk −nb +1)+e(t)

• The white-noise term e(t) enters as a direct error in the difference


equation: equation error model.
• The model parameters:
h iT
θ = a1 a2 . . . ana b1 . . . bnb

• If we introduce:

A(q, θ) = 1 + a1 q −1 + . . . + ana q −na


B(q, θ) = b1 + . . . + bnb q −nb +1

we get:
A(q, θ)y(t) = B(q, θ)u(t − nk ) + e(t)
Control Theory [H04X3a]
Introduction to system identification 29

ARX model structure (2)


• This corresponds to:
B(q, θ) 1
G(q, θ) = q −nk
, H(q, θ) =
A(q, θ) A(q, θ)

• 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).

Control Theory [H04X3a]


Introduction to system identification 30

Linear regressors
• One-step-ahead prediction of the output: predict the output at time t,
using only input-output data prior to t,

ŷ(t|θ) = −a1 y(t − 1) − a2 y(t − 2) . . . − ana y(t − na )


+ b1 u(t − nk ) . . . + bnb u(t − nk − nb + 1)
= B(q, θ)u(t − nk ) + [1 − A(q, θ)]y(t)

• e(t) is not known, so we take the most likely value, i.e. E{e(t)} = 0.

Control Theory [H04X3a]


Introduction to system identification 31

Linear regressors (2)


• Now introduce the vector:
h iT
ϕ(t) = −y(t − 1) . . . −y(t − na ) u(t − nk ) . . . u(t − nk − nb + 1)

ŷ(t|θ) = θ T ϕ(t) = ϕT (t)θ

• Model is linear in the parameters: linear regression model.


• The vector ϕ(t) is known as the regression vector.

Control Theory [H04X3a]


Introduction to system identification 32

Linear least squares parameter estimation


Section overview
• Minimizing prediction errors
• Frequency domain interpretation
• Implementation of the least squares estimate (LSE)
• Properties of the LSE
• Example
• Frequency domain interpretation of the result
• How to improve the result
• Identification of a partly known system
• Data filtering to improve the LSE

Control Theory [H04X3a]


Introduction to system identification 33

Minimizing prediction errors


• Given: Sampled data sequence of inputs u(t) and outputs y(t):

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 )]

Control Theory [H04X3a]


Introduction to system identification 34

Minimizing prediction errors (2)


• Determine the model parameters such that it provides the “best”
approximation or the the “best” explanation of the observed data
• Therefore define the prediction error:

ε(t, θ) = y(t) − ŷ(t|θ)

• 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

• Then the estimate θ̂ N corresponds to:

θ̂ N = arg minθ VN (θ, Z N )

• This approach is called a prediction error identification method (PEM)


Control Theory [H04X3a]
Introduction to system identification 35

Frequency domain interpretation


ε(t, θ) = H −1 (q, θ) [y(t) − G(q, θ)u(t)]


= A(q, θ)y(t) − B(q, θ)u(t) = e(t)

• 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

Control Theory [H04X3a]


Introduction to system identification 36

Frequency domain interpretation (2)


• ĜN (ej2πk/N ) is called the empirical transfer function estimate (ETFE) and
equals:
j2πk/N YN (ej2πk/N )
ĜN (e )=
UN (ej2πk/N )

Control Theory [H04X3a]


Introduction to system identification 37

Implementation of the least squares estimate (LSE)


ε(t, θ) = y(t) − ŷ(t|θ)

• 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

• (least squares) solution


" N
#−1 N
LS 1 X 1 X
θ̂ N = arg minθ VN (θ, Z N ) = ϕ(t)ϕT (t) ϕ(t)y(t)
N t=1
N t=1

Control Theory [H04X3a]


Introduction to system identification 38

Implementation of the least squares estimate (LSE) (2)


• Introduce the following N -dimensional column vectors:
h iT
ŷ(θ) = ŷ(1|θ) ŷ(2|θ) . . . ŷ(N |θ)
h iT
y = y(1) y(2) . . . y(N )

• Introduce following N × d matrix:


 
ϕT (1)
 
 T 
 ϕ (2) 
Φ=
 ..



 . 

ϕT (2)

• The vector containing the output predictions then equals:

ŷ(θ) = Φθ

Control Theory [H04X3a]


Introduction to system identification 39

Implementation of the least squares estimate (LSE) (3)


• The prediction errors:
ε(θ) = y − ŷ(θ)

• The LSE criterion:


1
VN (θ, Z N ) = ε(θ)T ε(θ)
2
• The LSE : h i−1
LS T
θ̂ N = Φ Φ ΦT y
| {z }
Φ+
• The the output predictions for the LSE:
LS
h i−1
T
ŷ(θ̂ N ) = Φ Φ Φ ΦT y

• Calculate the pseudo inverse using the singular value decomposition.

Control Theory [H04X3a]


Introduction to system identification 40

Properties of the LSE


• The LSE gives an unbiased estimate if e(t) is a sequence of independent
(identically distributed) zero-mean Gaussian random variables (i.e.
e(t) ∈ N (0, σ 2 )).
• What if e(t) does not satisfy these conditions? BIAS.

Control Theory [H04X3a]


Introduction to system identification 41

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:

y(t) + a1 y(t − 1) = b1 u(t − 1) + b2 u(t − 2) + e(t) − a1 e(t − 1)

• It can be written as: y(t) = ϕT (t)θ + ν0 (t), with:


h iT
ϕ(t) = −y(t − 1) u(t − 1) u(t − 2)
ν0 (t) = e(t) − a1 e(t − 1)

• The sequence ν0 (t) is not a sequence of independent random variables !!


Control Theory [H04X3a]
Introduction to system identification 42

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

Control Theory [H04X3a]


Introduction to system identification 43

Frequency domain interpretation of the result



N −1
N 1 X 1 j2πk/N B(ej2πk/N , θ) 2 j2πk/N
VN (θ, Z ) ≈ |ĜN (e )− j2πk/N
| QN (e , θ)
N 2 A(e , θ)
k=0

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 )

Control Theory [H04X3a]


Introduction to system identification 44

How to improve the result


• The frequency domain representation of the LS error clearly shows that the
difference between the empirical transfer function estimate and the
frequency response function of the model is weighted by two terms:
periodogram of the input and the frequency response of the denominator of
the model.
• Remedy 1: Excite only in the frequency band that interests you, i.e. limit
periodogram of the input to the frequency band of interest
• Remedy 2: Try to compensate the frequency weighting introduced by the
denominator of the model: this is a high-pass characteristic that
emphasizes the higher frequencies. This is unwanted because in most cases:
– more noise is present at high frequencies
– we are interested in a good model at low frequencies
So compensate this using a low-pass data filter.

Control Theory [H04X3a]


Introduction to system identification 45

How to improve the result (2)


• Filtering the input and output data with a (digital) low pass filter W (z),
and using the filtered input and output data for the LSE yields the
following weighting function in the frequency domain expression of the
least square criterion:

QN (2πk/N, θ) = |W (ej2πk/N )|2 |UN (ej2πk/N )|2 |A(ej2πk/N , θ)|2

• The filter W (z) must be selected to compensate the high-frequency


emphasis caused by the denominator of the estimated model.

Control Theory [H04X3a]


Introduction to system identification 46

Identification of a partly known system


• Assume that part of the system model is known:

G(q, θ) = Gk (q) ∗ Gu (q, θ)


| {z } | {z }
known unknown
Bk (q) Au (q, θ)
= q −nk
Ak (q) Au (q, θ)

• Then we have in our ARX model structure:

Ak (q)Au (q, θ)y(t) = Bk (q)Bu (q, θ)y(t) + e(t)

or
Bk (q)Bu (q, θ) 1
y(t) = u(t) + e(t)
Ak (q)Au (q, θ) Ak (q)Au (q, θ)

Control Theory [H04X3a]


Introduction to system identification 47

Identification of a partly known system (2)


• Define a new input signal:
Bk (q)
u (t) =

u(t)
Ak (q)
and perform the identification using u∗ (t) and y(t) instead of u(t) and y(t),
i.e. restricting the identification to the unknown part of the model
Bu (q, θ) ∗ 1
y(t) = u (t) + e(t)
Au (q, θ) Ak (q)Au (q, θ)

Control Theory [H04X3a]


Introduction to system identification 48

Identification of a partly known system (3)


• Several alternative exist:
– Filter y(t) with inverse of known model:
Ak (q)
y (t) =

y(t)
Bk (q)
and perform the identification with u(t) and y ∗ (t).
– or filter both y(t) and u(t):

y ∗ (t) = Ak (q)y(t), u∗ (t) = Bk (q)u(t)

Control Theory [H04X3a]


Introduction to system identification 49

Identification of a partly known system (4)


• These different alternative approaches yield different error sequences:
1.
1
Au (q, θ)y(t) = Bu (q, θ)u (t) +∗
e(t)
Ak (q)
2.
1
Au (q, θ)y ∗ (t) = Bu (q, θ)u(t) + e(t)
Bk (q)
3.

Au (q, θ)y ∗ (t) = Bu (q, θ)u∗ (t) + e(t)

Control Theory [H04X3a]


Introduction to system identification 50

Identification of a partly known system (5)


• Frequency domain interpretation of all these different approaches:
N −1 j2πk/N
N 1 X 1 j2πk/N B u (e , θ) 2 j2πk/N
VN (θ, Z ) ≈ |ĜN (e )− j2πk/N , θ)
| QN (e , θ)
N 2 A u (e
k=0

with
QN (2πk/N, θ) = |UN

(ej2πk/N )|2 |Au (ej2πk/N , θ)|2 ,

j2πk/N YN∗ (ej2πk/N )


ĜN (e ) = ∗ j2πk/N
UN (e )
and
– for the first scheme : u∗ = (Bk /Ak )u and y ∗ = y,
– for the second scheme: u∗ = u and y ∗ = (Ak /Bk )y,
– and for the third scheme: u∗ = Bk u and y ∗ = Ak y.

Control Theory [H04X3a]


Introduction to system identification 51

Data filtering to improve the LSE


• Data filtering is required to improve the accuracy of the LSE: compensate
the high frequency weighting of |A(ej2πk/N , θ)| or |Au (ej2πk/N , θ)|.
• In some situations, also low frequency distortions are present (DC-offset
and/or drift on measurements), also on inputs! These can be amplified by
the pre-filtering with the known part of the model, e.g. if the system
contains a pure integration or differentiation ... Then, apply band-pass
filters to remove these low frequency distortions.
• Perform data filtering on both input and output data (except to remove
the effects of the known parts of the system), using the same digital filters
in Matlab.

Control Theory [H04X3a]


Introduction to system identification 52

Example: linearization and identification


Section overview
• System description and linearization
• Discrete time model
• Available data sets
• Time domain identification for θ0 = 0◦
• Time domain identification for θ0 = 45◦
• Comparison of models for θ0 = 0◦ and 45◦

Control Theory [H04X3a]


Introduction to system identification 53

System description and linearization


• Consider the following pendulum:

• Nonlinear system with the following dynamics:

Tc = I θ̈ + cθ̇ + mgl sin(θ)

with I = ml2 , l = 0.5m, m = 1kg, c = 0.05N ms/rad, and the input is a


driving torque Tc [N m].
• Problem: identify a linear model for this system that is a linear
approximation of the system dynamics around θ0 = 0◦ and θ0 = 45◦ .
Control Theory [H04X3a]
Introduction to system identification 54

System description and linearization (2)


• Linearize the system dynamics around an equilibrium point θ0 : define
θ = θ0 + ∆θ and Tc = Tc0 + ∆Tc , and

sin(θ) = sin(θ0 + ∆θ) ≈ sin(θ0 ) + cos(θ0 )∆θ

• This yields:
c g Tc0 ∆Tc
∆θ̈ + ∆θ̇ + (sin(θ0 ) + cos(θ0 )∆θ) = +
I l I I
• Subtract equilibrium conditions

mlg sin(θ0 ) = Tc0

• yielding:
c g ∆Tc
∆θ̈ + ∆θ̇ + cos(θ0 )∆θ =
I l I

Control Theory [H04X3a]


Introduction to system identification 55

System description and linearization (3)


• In Laplace domain:
1
∆θ(s) ml2
= g cos(θ0 )
∆Tc (s) s2 + c
ml2 s + l

• This is a second order system with an undamped natural frequency at


r
g cos(θ0 )
ωn =
l
which corresponds to a resonance frequency of 0.70Hz around θ0 = 0◦ and
of 0.59Hz around θ0 = 45◦ .

Control Theory [H04X3a]


Introduction to system identification 56

Discrete time model


• Discrete time model structure (orders of numerator and denominator) can
be derived in several ways: published tables, via Matlab.
• Matlab: use random numbers:
B = [0 0 1]; A = [1 2 3]; Ts=1/10;
[Bd,Ad]=c2dm(B,A,Ts,’zoh’)
Bd = 0 0.0047 0.0044
Ad = 1.0000 -1.7916 0.8187
• yielding
B(q) b1 q −1 + b2 q −2
=
A(q) 1 + a1 q −1 + a2 q −2
or

∆θ(t) + a1 ∆θ(t − 1) + a2 ∆θ(t − 2) = b1 ∆Tc (t − 1) + b2 ∆Tc (t − 2)

Control Theory [H04X3a]


Introduction to system identification 57

Available data sets


• We excited the system with a broad band random signal with an
appropriate DC value to keep the system at θ0 = 0◦ and 45◦ , and measure
the response. Sampling frequency is fs = 10Hz. N = 4000. Excitation and
measured responses:
Excitation at 0 degrees Excitation at 45 degrees
1 4.5

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

Control Theory [H04X3a]


Introduction to system identification 58

Time domain identification for θ0 = 0◦


• Identification with noise-free measurements:
 
−θ(2) −θ(1) Tc (2) Tc (1)
 
 
 −θ(3) −θ(2) Tc (3) Tc (2) 
Φ =   .. .. .. ..



 . . . . 

−θ(3999) −θ(3998) Tc (3999) Tc (3998)
h iT
Y = θ(3) θ(4) . . . θ(4000)
θ̂ = Φ+ Y
A = 1 + θ̂(1)q −1 + θ̂(2)q −2
B = θ̂(3)q −1 + θ̂(4)q −2

Control Theory [H04X3a]


Introduction to system identification 59

Time domain identification for θ0 = 0◦ (2)


• In Matlab:
phi = [-theta(2:end-1) -theta(1:end-2) Tc(2:end-1) Tc(1:end-2)];
Y = theta(3:end);
mod = pinv(phi)*Y;
A1 = [1 mod(1:2)’];
B1 = [0 mod(3:4)’];

Control Theory [H04X3a]


Introduction to system identification 60

Time domain identification for θ0 = 0◦ (3)


• Model validation: compare FRFs of the identified model and of the exact
continuous time model (presented above):

20

10 continuous time model


identified discrete time model
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

continuous 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]

Remark: error because the data is obtained in a ’ZOH’ situation.


Control Theory [H04X3a]
Introduction to system identification 61

Time domain identification for θ0 = 0◦ (4)


• Model validation: compare FRFs of the identified model and of the ’exact’
discrete time model (derived using zoh equivalent):

20

discrete time model


10
identified discrete time model

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

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]

Remark: Very accurate model because no noise ...


Control Theory [H04X3a]
Introduction to system identification 62

Time domain identification for θ0 = 0◦ (5)


• Repeat the identification with noisy output data (variance of noise is 10%
of the RMS of signal):
• Model validation: compare FRFs of the identified model and of the ’exact’
discrete time model:
20

discrete time model


10
identified discrete time model

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

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]

Remark: inaccurate model: improve the model accuracy by filtering the


input/output data!
Control Theory [H04X3a]
Introduction to system identification 63

Time domain identification for θ0 = 0◦ (6)


• Repeat the identification with same noisy output data, but first filter the
data:
[Bf,Af]=butter(4,2/fs);
Tcf = filter(Bf,Af,Tc);
thetaf = filter(Bf,Af,theta);

Control Theory [H04X3a]


Introduction to system identification 64

Time domain identification for θ0 = 0◦ (7)


• Model validation: compare FRFs of the identified model and of the ’exact’
discrete time model:

20

discrete time model


10 identified discrete time model

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

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]

Remark: model is again very accurate ...


Control Theory [H04X3a]
Introduction to system identification 65

Time domain identification for θ0 = 0◦ (8)


• Model validation: compare FRFs of the identified model and of the ’exact’
discrete time model, with the empirical transfer function estimate:

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]

Control Theory [H04X3a]


Introduction to system identification 66

Time domain identification for θ0 = 0◦ (9)


• Time domain model validation: compare measured output with predicted
output (using model identified with filtered noisy measurement)

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

0 20 40 60 80 100 120 140 160 180 200


Samples

Remark: another data set is used (only short section is shown)!


Control Theory [H04X3a]
Introduction to system identification 67

Time domain identification for θ0 = 45◦


• Repeat the whole procedure with the other data set: first identification
with noise-free measurements
• Model validation: compare FRFs of the identified model and of the ’exact’
discrete time model:
20

discrete time model


10
identified discrete time model

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

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]

Remark: bad results due to DC-offset in both input and output


measurements
Control Theory [H04X3a]
Introduction to system identification 68

Time domain identification for θ0 = 45◦ (2)


• Remove the DC-offset of both signals and repeat the identification with
noise-free data
• Model validation: compare FRFs of the identified model and of the ’exact’
discrete time model:
20
discrete time model
10 identified discrete time model

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]

Control Theory [H04X3a]


Introduction to system identification 69

Time domain identification for θ0 = 45◦ (3)


• Identification with noisy output data: filter i/o-data with same low-pass
filter, remove the DC-offset of both signals and repeat the identification
• Model validation: compare FRFs of the identified model and of the ’exact’
discrete time model:
20
discrete time model
10 identified discrete time model

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]

Control Theory [H04X3a]


Introduction to system identification 70

Time domain identification for θ0 = 45◦ (4)


• Model validation: compare FRFs of the identified model and of the ’exact’
discrete time model, with the empirical transfer function estimate:

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

discrete time model


0
identified discrete time model
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]

Control Theory [H04X3a]


Introduction to system identification 71

Time domain identification for θ0 = 45◦ (5)


• Time domain model validation: compare measured output with predicted
output (using model identified with filtered noisy measurement)

0.3
measured
predicted
0.2

0.1

Output [rad]
0

−0.1

−0.2

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

0 20 40 60 80 100 120 140 160 180 200


Samples

Again another data set is used (only short section is shown)!


Control Theory [H04X3a]
Introduction to system identification 72

Comparison of models for θ0 = 0◦ and 45◦

20

10 model at 0 degrees

0 model at 45 degrees

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

−50 model at 0 degrees


phase [degrees]

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]

Control Theory [H04X3a]


Introduction to system identification 73

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...

Control Theory [H04X3a]

Das könnte Ihnen auch gefallen