Continuous-time and discrete-time systems Comparison similarities - - PowerPoint PPT Presentation

continuous time and discrete time systems
SMART_READER_LITE
LIVE PREVIEW

Continuous-time and discrete-time systems Comparison similarities - - PowerPoint PPT Presentation

Continuous-time and discrete-time systems Comparison similarities and differences Continuous-time systems Discrete-time systems signals = functions signals = sequences ODE:s difference equations Operator: p = d qy ( k ) = y ( k + 1) dt


slide-1
SLIDE 1

Continuous-time and discrete-time systems

Comparison — similarities and differences

Continuous-time systems Discrete-time systems signals = functions signals = sequences ODE:s difference equations Operator: p = d

dt

qy(k) = y(k + 1)

  • ˙

x = Ax + Bu y = Cx

  • qx = Fx + Gu

y = Hx S =

  • B

AB . . . An−1B

  • S =
  • G

FG . . . F n−1G

  • O =

      C CA . . . CAn−1       O =       H HF . . . HF n−1      

1 / 13 hans.rosth@it.uu.se Sampling 1

slide-2
SLIDE 2

Continuous-time and discrete-time systems

Continued

Continuous-time systems Discrete-time systems L-transform Z-transform G(s) = C(sI − A)−1B = b(s)

a(s)

G(z) = H(zI − F)−1G = d(z)

c(z)

Poles: 0 = det(sI − A) = a(s) Poles: 0 = det(zI − F) = c(z) Static gain = G(0) Static gain = G(1) Stability region: Left half plane Interior of the unit circle

2 / 13 hans.rosth@it.uu.se Sampling 1

slide-3
SLIDE 3

Sampled data control

Continuous-time system and discrete-time controller

Sampling Controller Hold System

✲ ✲ ✛ ✛ ✛

r(t) y(t)

r(ti)

y(ti) u(ti) u(t)

2 4 6 0.5 1 1.5 2

y(t) t

2 4 6 −8 −6 −4 −2 2 4

u(ti) t

2 4 6 0.5 1 1.5 2

y(ti) t

2 4 6 −8 −6 −4 −2 2 4

t u(t)

The controller operates in discrete time.

◮ Sampling: Convert continuous-time signal to discrete-time

signal.

◮ Hold circuit: Convert discrete-time signal to continuous-time. ◮ Notation (mild abuse of): y(k) = y(kh) = y(t)|t=kh, where

h = sampling time/interval/period.

3 / 13 hans.rosth@it.uu.se Sampling 1

slide-4
SLIDE 4

Sampled data control

Continuous- and discrete-time domains — how do we deal with that?

The hold circuit: Typically we use zero-order-hold (ZOH), u(t) = u(kh) for kh ≤ t < kh + h. Two ways to proceed: I: Work in continuous time: Design a continuous-time controller F(s). For implementation (in a computer), approximate F(s) by use of a discrete-time controller, Fd(z). II: Work in discrete time: Produce a discrete-time model of the system, and design a discrete-time controller F(z) directly.

4 / 13 hans.rosth@it.uu.se Sampling 1

slide-5
SLIDE 5

Method I

Work in continuous time

Use a continuous-time model and your favourite control design method ⇒ a continuous-time controller F(s). The approximation of F(s) with a discrete-time controller Fd(z) is called discretization, and there are several approaches:

◮ Impulse-invariant mapping ◮ Pole-zero matching ◮ Frequency response matching (e.g. by least squares) ◮ Zero-order-hold (ZOH) — we will get to this soon ... ◮ Approximation of the time derivative (numerical

differentiation and/or integration)

5 / 13 hans.rosth@it.uu.se Sampling 1

slide-6
SLIDE 6

Method I: Discretization

Approximation of the time derivative

Three methods for approximation of the time derivative:

◮ Forward difference (Euler’s method):

d dty(kh) ≈ y(kh + h) − y(kh) h ⇔ s ← z − 1 h

◮ Backward difference:

d dty(kh) ≈ y(kh) − y(kh − h) h ⇔ s ← z − 1 hz

◮ Tustin’s approximation: d dty(kh) ≈ ∆y(kh)

∆y(kh + h) + ∆y(kh) 2 = y(kh + h) − y(kh) h ⇔ s ← 2(z − 1) h(z + 1)

(Tustin’s approximation ⇔ trapezoidal rule in numerical integration.)

6 / 13 hans.rosth@it.uu.se Sampling 1

slide-7
SLIDE 7

Method I: Performance

How well does it work?

For sufficiently fast sampling the performance with these techniques will be almost as good as for the continuous-time controller (if it could be implemented). But how fast should the sampling be?

◮ The sampling frequency ωs = 2π h . ◮ The Nyquist frequency ωn = ωs 2 = π h. ◮ Aliasing: For a sampled signal the frequency components for

frequencies ω > ωn will be interpreted as components for frequences in [0, ωn[. (Measure at least twice in a period.) Rule of thumb: For acceptable performance, choose ωs ≥ 20ωB, where ωB is the desired bandwidth of the closed loop system.

7 / 13 hans.rosth@it.uu.se Sampling 1

slide-8
SLIDE 8

Method II

Work in discrete time

Find a discrete-time model representation of the system. Then use your favourite control design method to obtain a discrete-time controller, which can be implemented directly as it is. We have the continuous-time model

  • ˙

x(t) = Ax(t) + Bu(t), y(t) = Cx(t) ZOH sampling ⇒ u(t) is piecewise constant We want to obtain a discrete-time model

  • x(k + 1) = Fx(k) + Gu(k),

y(k) = Hx(k) (x(k) = x(kh) etc) If possible, we also want x(k) = x(t)|t=kh, k = 0, 1, . . .

8 / 13 hans.rosth@it.uu.se Sampling 1

slide-9
SLIDE 9

System sampling

A.k.a. ZOH sampling

Use the solution of the continuous-time state equation (eq. (3.2)): x(t) = eA(t−t0)x(t0) + t

t0

eA(t−τ)Bu(τ)dτ Here we have u(t) = u(kh) for kh ≤ t < kh + h. Set t0 = kh and t = kh + h ⇒ x(k + 1) = x(kh + h) = eAhx(kh) + kh+h

kh

eA(kh+h−τ)Bu(τ)dτ = [s = kh + h − τ] = eAhx(kh) +

h

eAsBu(kh)(−ds) = eAhx(kh) + h eAsBds

  • u(kh)

9 / 13 hans.rosth@it.uu.se Sampling 1

slide-10
SLIDE 10

ZOH sampling

Theorem 4.1

Consider the continuous-time system

  • ˙

x(t) = Ax(t) + Bu(t), y(t) = Cx(t), with u(t) = u(kh) for kh ≤ t < kh + h. Then x(k) = x(t)|t=kh, ∀k ∈ Z, where x(k) is given by the discrete-time system

  • x(k + 1) = Fx(k) + Gu(k),

y(k) = Hx(k), where F = eAh, G = h eAtBdt and H = C.

10 / 13 hans.rosth@it.uu.se Sampling 1

slide-11
SLIDE 11

Examples of sampled systems

The harmonic oscillator

◮ Continuous-time system:

Y (s) = 1 s2 + 1U(s) ⇔        ˙ x =

  • −1

1

  • x +
  • 1
  • u,

y =

  • 1
  • x

◮ Discrete-time state space model:

       x(k + 1) =

  • cos(h)

− sin(h) sin(h) cos(h)

  • x(k) +
  • sin(h)

1 − cos(h)

  • u(k),

y(k) =

  • 1
  • x(k).

◮ Discrete-time transfer function:

G(z) = H(zI − F)−1G = (1 − cos(h))(z + 1) z2 − 2 cos(h)z + 1

11 / 13 hans.rosth@it.uu.se Sampling 1

slide-12
SLIDE 12

Examples of sampled systems

The double integrator

◮ Continuous-time system:

Y (s) = 1 s2 U(s) ⇔        ˙ x =

  • 1
  • x +
  • 1
  • u,

y =

  • 1
  • x

◮ Discrete-time state space model:

       x(k + 1) =

  • 1

h 1

  • x(k) +
  • h

0.5h2

  • u(k),

y(k) =

  • 1
  • x(k).

◮ Discrete-time transfer function:

G(z) =

  • 1

z − 1 −h z − 1 −1 h 0.5h2

  • = 0.5h2(z + 1)

(z − 1)2

12 / 13 hans.rosth@it.uu.se Sampling 1

slide-13
SLIDE 13

Examples of sampled systems

DC motor

◮ Continuous-time system:

Y (s) = 1 s(s + 1)U(s) ⇔        ˙ x =

  • −1
  • x +
  • 1

1

  • u,

y =

  • 1

−1

  • x

◮ Discrete-time state space model:

       x(k + 1) =

  • 1

e−h

  • x(k) +
  • h

1 − e−h

  • u(k),

y(k) =

  • 1

−1

  • x(k).

◮ Discrete-time transfer function:

G(z) = H(zI − F)−1G = (h − 1 + e−h)z + 1 − (1 + h)e−h (z − 1)(z − e−h)

◮ Zero in z′ = − 1−(1+h)e−h h−1+e−h , and −1 < z′ < 0 for h > 0.

13 / 13 hans.rosth@it.uu.se Sampling 1