time domain models - tu delft ocw · bode plot of zero order hold circuit 0 0.5 1 1.5 2 2.5 3 3.5...

34
1 Delft University of Technology Delft University of Technology Time domain models Course: Wb2301 Lecture 6 Erwin de Vlugt March 16 2010

Upload: others

Post on 03-Nov-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

1

Delft University of TechnologyDelft University of Technology

Time domain modelsCourse: Wb2301

Lecture 6

Erwin de Vlugt

March 16 2010

Page 2: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 2

Delft University of Technology

Contents

• Distortion from Sample and hold circuits• The Z-transformation• Discrete time-domain identification• Model structures and parameterization• Open and closed loop identification using

discrete models

Page 3: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 3

Delft University of Technology

Signal Reconstruction

0 1 2 3 4 5 6 7 8 9−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

sample instants k

sam

ple

valu

es

Discrete signal

discrete signalsample an hold

Zero order hold (ZOH)Sample time ∆t = 1s

Page 4: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 4

Delft University of Technology

ZOH FRF

0 0.5 1 1.5 2 2.5 3 3.50

0.2

0.4

0.6

0.8

1

Gai

n [−

]

Bode plot of Zero Order Hold circuit

0 0.5 1 1.5 2 2.5 3 3.5−3.5

−3

−2.5

−2

−1.5

−1

−0.5

0

Frequency [ω / ωs]

Pha

se [r

ad]

FRF = L (IRF):

Hzoh(s) =1

s−

e−s∆t

s

Hzoh(jω) =

e−1

2jω∆t

(

e1

2jω∆t

− e−1

2jω∆t

)

=e−

1

2jω∆t

· 2j sin 1

2ω∆t

=∆t sin 1

2ω∆t· e−

1

2jω∆t

1

2ω∆t

Page 5: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 5

Delft University of Technology

Signal Distortion• Signal distortion due to sampling

and hold circuit

• Reduce distortion by increasingsampling frequency

• No signal transfer at the Nyquistfrequency (ωh = 1

2ωs and samplefrequency (ωs)

Page 6: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 6

Delft University of Technology

Z-transformation

X(z) = Z{x[n]} =∞∑

n=−∞x(n)z−n

where n is an integer and z is, in general, a complex number:

z = Aejφ

= A(cosφ + jsinφ)

where A is the magnitude, and φ is the angle of z

Page 7: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 7

Delft University of Technology

Z-transformation

Example:

[x(1) x(2) x(3) ... x(N)] = [1 2 3 0 0 ... 0]

X(z) = 1z0 + 2z−1 + 3z−2

Page 8: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 8

Delft University of Technology

Continuous to discrete poles-zeros

z = es∆t

= eRe(s)∆teIm(s)∆t

−pi pi−pi

piS−plane

−1 0 1−1

−0.5

0

0.5

1Z−plane

Page 9: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 9

Delft University of Technology

Z-Laplace Mappings

Inverse mapping

s =1

∆tln(z)

Using the bilinear (Tustin) approximation (1st order Taylor coeff.):

s =2

∆t

z − 1

z + 1=

2

∆t

1 − z−1

1 + z−1

z =2 + s∆t

s − s∆t

Page 10: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 10

Delft University of Technology

Example

H(s) =1

s + 1H(z)tustin =

∆t

2 + ∆t

z + 1

z − 2−∆t2+∆t

10−1

100

101

10−2

100

Gai

n [−

]

fs = 10 Hz

H(s)H(z)

10−1

100

101

−100

−80

−60

−40

−20

0

Pha

se [d

eg.]

Frequency [Hz]

−1 −0.5 0−1

−0.5

0

0.5

1Pole−Zero Map

Real Axis

Imag

inar

y A

xis

−1 0 1−1

−0.5

0

0.5

1Pole−Zero Map

Real Axis

Imag

inar

y A

xis

Page 11: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 11

Delft University of Technology

Time domain identification

1. Digital acquisition: signals are represented bydiscrete numbers (sampling)

2. Systems are described by polynomials in thez-domain• Deterministic and stochastic parts can be

separated (noise models)• Appropriate for nonlinear identification• Disadvantage: a priori knowledge required

Page 12: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 12

Delft University of Technology

Time domain identification

• PurposeCapture system properties by a limited number ofparameters (n < N ) These n parameters (indirectly!)represent system dynamics, i.e. physical properties

• ApproachDiscriminate input related response from noise inoutput

Page 13: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 13

Delft University of Technology

Auto-regressive (AR) filter

y(k) =1

a1z−1 + a2z−2 + . . . + anz−nu(k)

Describes many physical processes due to feed-

back structure

Page 14: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 14

Delft University of Technology

Moving Average (MA) filter

y(k) =(

b0 + b1z−1 + b2z

−2 + . . . + bnz−n)

u(k)

Finite time integration structure

Page 15: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 15

Delft University of Technology

General Model

y(k) = G(z−1)u(k)+H(z−1)e(k)

• white noise e(k)

• goal: estimate G(z−1) from y(k), u(k)

Page 16: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 16

Delft University of Technology

System Identification

• Experimental system data• Choice of model structure• Optimization criterion• Validation

Page 17: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 17

Delft University of Technology

Finding the best model

System:

y(k) = G0(z−1)u(k) + H0(z

−1)e(k)

Assume a model (G,H, ǫ) can be found such that:

y(k) = G(z−1)u(k) + H(z−1)ǫ(k)

Then the model error is:

ǫ(k) = H−1(z−1)[

y(k) − G(z−1)u(k)]

Page 18: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 18

Delft University of Technology

Obtaining the model

System: G0(z−1), H0(z

−1)

Model: G(z−1), H(z−1)

ǫ(k) = H−1(z−1)[

y(k) − G(z−1)u(k)]

Optimal fit :

If G(z−1) ≈ G0(z−1)

and H(z−1) ≈ H0(z−1)

then ǫ(k) ≈ e(k)

Page 19: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 19

Delft University of Technology

Least squares (LS) Criterion

V (θ)N = minN∑

k=1

ǫ(k, θ)2

V cost functionθ model parameter vectorǫ model errorN number of data points

For the optimal solution: ǫ → e

Page 20: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 20

Delft University of Technology

Finite Impulse Response (FIR) structure

y(k) = B(z−1)u(k) + e(k)

e(k) = y(k) − B(z−1)u(k)

An FIR model is linear in its parameters.

Page 21: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 21

Delft University of Technology

Output Error (OE) structure

y(k) =B(z−1)

F (z−1)u(k) + e(k)

e(k) = y(k) −B(z−1)

F (z−1)u(k)

An OE model is nonlinear in its parameters.

Page 22: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 22

Delft University of Technology

ARX structure

y(k) =B(z−1)

A(z−1)u(k) +

1

A(z−1)e(k)

e(k) = A(z−1)y(k) − B(z−1)u(k)

An ARX model is linear in its parameters.

Page 23: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 23

Delft University of Technology

ARMAX structure

y(k) =B(z−1)

A(z−1)u(k) +

C(z−1)

A(z−1)e(k)

e(k) =A(z−1)

C(z−1)y(k) −

B(z−1)

C(z−1)u(k)

An ARMAX model is nonlinear in its parameters.

Page 24: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 24

Delft University of Technology

Box-Jenkins (BJ) structure

y(k) =B(z−1)

F (z−1)u(k) +

C(z−1)

D(z−1)e(k)

e(k) =D(z−1)

C(z−1)y(k) −

D(z−1)B(z−1)

C(z−1)F (z−1)u(k)

An BJ model is nonlinear in its parameters.

Page 25: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 25

Delft University of Technology

Optimizing the criterion (ARX)

ǫ(k) = A(z−1)y(k) − B(z−1)u(k)

with na, nb are the model orders according to:

na : A(z−1) = 1 + a1z−1 + . . . + anaz−na

nb : B(z−1) = b1 + b2z−1 . . . + bnbz−nb+1

Structured regression format:

ǫ(k) = y(k) + [A(z−1) − 1]y(k) − B(z−1)u(k)

= y(k) − φ(z−1)θ

where θ = [b1 b2 ... bn a1 a2 ... an]T

φ = [U − Y ]

Page 26: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 26

Delft University of Technology

Optimizing the criterion (ARX)

V (θ)N = min

N∑

k=1

ǫ(k, θ)T ǫ(k, θ) = ǫ(k)T ǫ(k)

δV (θ)

δθ= [y(k) − φθ]T φ = 0

θ = y(k)Tφ[φTφ]−1

Page 27: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 27

Delft University of Technology

Choice of model structure

Use system knowledge• Existence of feedback loops

• Noise sources

Page 28: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 28

Delft University of Technology

Closed loop systemGoal: estimate y(k)

u(k)

Take:

H1(z−1) =

N1

D1

H2(z−1) =

N2

D2

y =H1H2

1 + H1H2u +

1

1 + H1H2e

=N1N2

D1D2 + N1N2u +

D1D2

D1D2 + N1N2e

=B

Au +

C

Ae

This system has an ARMAX structure.

Page 29: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 29

Delft University of Technology

Analysis

Frequency response:

z−n = e−ns∆t with s = j2πf (f = [0...fs

2])

Impulse response:

u(k) = m with m = 1 for k = 0

m = 0 for k > 0

Page 30: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 30

Delft University of Technology

Example

10−5

10−3

10−1

Gai

n [N

/m]

Human Arm Admittance

Hxx

10−5

10−3

10−1

Gai

n [N

/m]

Hxy

−180

0

180

360

Pha

se [d

eg.]

−180

0

180

360

Pha

se [d

eg.]

10−5

10−3

10−1

Gai

n [N

/m]

Hyx

10−5

10−3

10−1

Gai

n [N

/m]

Hyy

100

−180

0

180

360

Pha

se [d

eg.]

Frequency [Hz]10

0−180

0

180

360

Pha

se [d

eg.]

Frequency [Hz]

2DOF arm admittance:

spectral (grey) ARX (black)

Page 31: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 31

Delft University of Technology

Closed loop algorithms

H2 q-1 y k

e k

H1 q-1 u kr k

Goal: estimate H2

1. Two stage method

2. Coprime factorization method

Page 32: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 32

Delft University of Technology

Two stage

System transferfunctions:

u(k) =H1

1 + H1H2r(k) +

H1

1 + H1H2e(k)

y(k) =H1H2

1 + H1H2r(k) +

1

1 + H1H2e(k)

Two stage:

1. Open loop from r(k) to u(k)

2. Simulate a ’noise free’ input u∗(k)

3. Open loop estimate from u∗(k) to y(k) gives the estimated systemH2

Drawback: only for stable (sub)systems because of the simulation step

Page 33: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 33

Delft University of Technology

Coprime factorization

System transferfunctions:

u(k) =H1

1 + H1H2r(k) +

H1

1 + H1H2e(k)

y(k) =H1H2

1 + H1H2r(k) +

1

1 + H1H2e(k)

Coprime factorization:

1. Open loop from r(k) to u(k) gives H1

1+H1H2

2. Open loop from r(k) to y(k) gives H1H2

1+H1H2

3. then, y(k)r(k)

r(k)u(k) gives H2

Drawback: high order because poles and zeros do not cancel out

Page 34: Time domain models - TU Delft OCW · Bode plot of Zero Order Hold circuit 0 0.5 1 1.5 2 2.5 3 3.5 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 ... • Disadvantage: a priori knowledge

March 16 2010 34

Delft University of Technology

Summary

• Time domain models use only a fewparameters (w.r.t. FRFs)

• Model structure required and must beselected a priori

• Optimum order must be selected• Parameterization by minimizing an error

criterion• Direct simulation/validation