lect13handout.pdf

22
Control Theory (035188) lecture no. 13 Leonid Mirkin Faculty of Mechanical Engineering Technion — IIT Outline Motivating example Sampling in frequency domain The Sampling Theorem (Whittaker-Kotel’nikov-Shannon) Sampled-data controllers with ZOH in frequency domain Antialiasing filtering

Upload: pp

Post on 30-Sep-2015

4 views

Category:

Documents


1 download

TRANSCRIPT

  • Control Theory (035188)lecture no. 13

    Leonid Mirkin

    Faculty of Mechanical EngineeringTechnion IIT

    Outline

    Motivating example

    Sampling in frequency domain

    The Sampling Theorem (Whittaker-Kotelnikov-Shannon)

    Sampled-data controllers with ZOH in frequency domain

    Antialiasing filtering

  • Deadbeat controller for double integrator

    Let P.s/ D 1s2

    . Its discretized (nonminimum-phase) version is

    NP ./ D h2

    2

    C 12 2C 1:

    Consider the design of deadbeat controller by pole placement and Sylvestermatrix (like in Lecture 5). We choose bi-proper 1-order controller, assigningNcl./ D 3 (always possible), via solving for controller parameters2664

    1 0 0 0

    2 1 h2=2 01 2 h2=2 h2=20 1 0 h2=2

    3775

    MS2

    26641010

    3775 D26641

    0

    0

    0

    3775 :

    This results in 1 D 1, 0 D 34 , 1 D 52h2 , 0 D 32h2 , so that the controller is

    NC./ D 2h25 34C 3:

    Deadbeat controller for double integrator: 2DOF design

    The discrete complementary sensitivity is then

    NT ./ D .5 3/.C 1/43

    (poles are roots of Ncl./ and zeros are zeros of NP ./ and NC./) with staticgain NT .1/ D 1. Stable zero at D 0:6 can be canceled by prefilter

    NF ./ D 25 3

    (we want to keep NF .1/ D 1), which corresponds to the (analysis) scheme

    h2

    2

    C1.1/2

    2

    h2534C3

    2

    53NrNuNy

  • Noise-free simulation

    1

    s2HZOH

    SIdl

    2

    h2534C3

    2

    53NrNuuy

    Then,

    0 1 2 3 4 5 6 7 8 9 100

    0.2

    0.4

    0.6

    0.8

    1

    Time

    Plan

    t out

    put,

    y(t)

    0 1 2 3 4 5 6 7 8 9 10

    0.5

    0.4

    0.3

    0.2

    0.1

    0

    0.1

    0.2

    0.3

    0.4

    0.5

    Time

    Cont

    rol s

    igna

    l, u(t

    )

    Simulations with measurement noise

    1

    s2HZOH

    SIdl

    2

    h2534C3

    2

    53NrNuuy

    n

    Now,

    0 10 20 30 40 50 60 70 80 90 1000.2

    0

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    Time, t

    Plan

    toutpu

    t,y.t/,an

    dno

    ise,

    n.t/

    0 10 20 30 40 50 60 70 80 90 1000.2

    0

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    Time, t

    Plan

    toutpu

    t,y.t/,an

    dno

    ise,

    n.t/

    n.t/ D sin. 2ht / n.t/ D sin. 2:2

    ht /

  • Simulations with measurement noise (contd)

    0 10 20 30 40 50 60 70 80 90 1000.2

    0

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    Time, t

    Plan

    toutpu

    t,y.t/,an

    dno

    ise,

    n.t/

    0 10 20 30 40 50 60 70 80 90 1000.2

    0

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    Time, t

    Plan

    toutpu

    t,y.t/,an

    dno

    ise,

    n.t/

    Oops,I steady-state output response has different frequencies than input.

    This is impossible in continuous-time LTI systems. Explanations?

    Outline

    Motivating example

    Sampling in frequency domain

    The Sampling Theorem (Whittaker-Kotelnikov-Shannon)

    Sampled-data controllers with ZOH in frequency domain

    Antialiasing filtering

  • A weird function

    Consider analog signal f .t/ with spectrum (Fourier transform) F.!/:

    F.!

    /

    !0 !s!s 2!s2!s

    and define, for some h > 0, function

    Fh.!/ 1h

    Xk2Z

    F.! C !sk/; where !s 2h

    Fh.!

    /

    !0 !s!s 2!s2!s

    A weird function: Fourier series

    Fh.!

    /

    !0 !s!s 2!s2!s

    As Fh.!/ is !s-periodic,Xk2Z

    F.! C !s C !sk/ DXk2Z

    F.! C !s.k C 1// DXk2Z

    F.! C !sk/;

    we can bring in its Fourier series expansion

    Fh.!/ DXk2Z

    ckej 2!s k! D

    Xk2Z

    ckejkh! ;

    where Fourier coefficients are calculated as

    ck D 1!s

    Z !s=2!s=2

    Fh.!/e jkh!d!:

  • A weird function: calculating Fourier coefficients

    With some extra efforts:

    ck D 1!s

    Z !s=2!s=2

    1

    h

    Xi2Z

    F.! C !si/e jkh.!C!si/d!

    D 12

    Xi2Z

    Z !s=2!s=2

    F.! C !si/e jkh.!C!si/d!

    D 12

    Xi2Z

    Z !siC!s=2!si!s=2

    F.!/e jkh!d!

    D 12

    Z 11

    F.!/e jkh!d! (remember, f .t/ D 12

    Z 11

    F.!/e j!td!)

    D f .kh/:

    A weird function: Fourier series (contd)

    Thus, we end up with

    Fh.!/ DXk2Z

    f .kh/e jkh! DXk2Z

    f .kh/e jkh! :

    Comparing this with DTFT of sequence f Nfkg,NF ./ D

    Xk2Z

    Nfke jk ;

    we conclude that

    Fh.!/ D 1h

    Xk2Z

    F.! C !sk/; where !s D 2h is sampling frequency;

    is the DTFT of the sampled signal Nfk f .kh/ modulo scaling, D !h:NF ./ D Fh.!h/:

    Occasionally, we also write NF .!/, understanding by ! scaled , i.e., h.

  • Spectrum of sampled signal

    By spectrum of a discrete signal Nf we understand itsI DTFT, NF ./, in 2 ;

    (as DTFT periodic, there is no new information outside this range anyway).

    In other words, spectrum of sampled signals is NF .!/ in ! 2 !s=2; !s=2:

    N F.!/

    !0 !s!s 2!s2!s !n!n

    Frequency

    !N !s2D h

    called the Nyquist frequency.

    Spectrum of sampled signal: aliasing

    N F.!/

    !0

    NF .0/

    !0 !1!1 !2!2

    Spectrum of Nf at each discrete frequency 0, i.e., NF .0/, is aI blend of analog frequency responses at !k 0h C !sk, 8k 2 Z.

    Blending means information lost as we can no longer tell F.!i / from F.!j /in their effect on NF .0/ (unless we know their dependencies).

    We say thatI every discrete frequency 0 2 ; is an alias of all !k, k 2 Z.

    and call this phenomenon aliasing.

  • Examples of aliasing

    Consider signals f1.t/ D sin4t

    and f2.t/ D sin94t

    sampled at h D 1:

    0 1 2 3 4 5 6 7 8 9 10

    1

    0

    1

    !

    0 1 2 3 4 5 6 7 8 9 10

    1

    0

    1

    Sampling frequency is !s D 2 , so thatI both !0 D 4 and !1 D 94 D !s C !0 have aliases at 0 D !0

    and, consequently, produce the same sampled signal.

    Deadbeat control (contd)

    Return to our example at the beginning:

    0 10 20 30 40 50 60 70 80 90 1000.2

    0

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    Time, t

    Plan

    toutpu

    t,y.t/,an

    dno

    ise,

    n.t/

    0 10 20 30 40 50 60 70 80 90 1000.2

    0

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    Time, t

    Plan

    toutpu

    t,y.t/,an

    dno

    ise,

    n.t/

    n.t/ D sin. 2ht / n.t/ D sin. 2:2

    ht /

    Now we see thatI frequency ! D 2

    hhas alias at ! D 0 and

    I frequency ! D 2:2h

    has alias at ! D 0:2h

    .

  • Examples of aliasing (contd)

    Wagon-wheel effect:0rpm

    (shot with 12 FPS frame rate)

    Moire pattern:downsampling!

    Frequency folding

    N F.!/

    !0 !s!s 2!s2!s !n!n

    If F.!/ 2 R for all ! (and F.!/ D F.!/), we may consider only ! 0 andthen NF .!/ can be produced through folding procedure:

    0 !N

    F.!/

    2!N 3!N 4!N 5!N

    !

    0 !N 3!N 5!N

    !

    NF .!/

    0 !N

  • Instability of the ideal sampler

    Let f .t/ be a signal with

    F.!/ D 1p!2 C 1:

    By Parseval,

    Ef D 12

    Z 11

    1

    !2 C 1d! D1

    2:

    Frequency response of Nfk D f .kh/ is

    NF ./ D 1h

    Xk2Z

    1p.=hC 2=h k/2 C 1 D

    Xk2Z

    1p. C 2k/2 C h2 D1

    for every 2 ; . This means that Nf is unbounded, i.e., thatI the ideal sampler SIdl is (energetically) unstable1.1In fact, SIdl bounded only for signals with sufficiently fast decay of their spectra (faster

    than 1=j!j at high frequencies for real-valued spectra), i.e., with vanishing high-frequencyharmonics.

    Outline

    Motivating example

    Sampling in frequency domain

    The Sampling Theorem (Whittaker-Kotelnikov-Shannon)

    Sampled-data controllers with ZOH in frequency domain

    Antialiasing filtering

  • Reconstruction from sampling

    Let analog signal f .t/ be sampled with period h. We want to know

    1. can f .t/ be precisely reconstructed from Nfk D f .kh/?2. if yes, how f .t/ can be reconstructed?

    Bandlimited signals

    One class of signals, for which the reconstruction question can be certainlyanswered, is the class of bandlimited signals, i.e.,I signals having zero spectrum 8j!j > !b for some !b > 0

    (the smallest such !b called the signal bandwidth).

    Example 1:

    F.!

    /

    !0 !b!b

    Example 2:

    F.!

    /

    !0 !b!b

  • What happens when sampled with !N < !b

    F.!

    /

    !0 !b!b

    #

    N F.!/

    !0 !n!n

    I frequency responses at aliased frequencies might blend in NF .!/I precise reconstruction impossible (at least, in general)

    What happens when sampled with !N !b

    F.!

    /

    !0 !b!b

    #

    N F.!/

    !0 !n!n

    I F.!/ is preserved in NF .!/ with no distortionI no information lost under sampling H) F.!/ reconstructable

  • What happens when sampled with !N !b (contd)

    F.!

    /

    !0 !b!b

    #

    N F.!/

    !0 !n!n

    I F.!/ is still preserved in NF .!/ with no distortionI no information lost under sampling H) F.!/ reconstructable

    How to reconstruct bandlimited signal

    Let y.t/ be bandlimited signal with !b !N. Then F.!/ D h NF .!/ and

    f .t/ D 12

    Z 11

    F.!/e j!td!

    D h2

    Z !N!N

    NF .!/e j!td! D h2

    Z !N!N

    Xk2Z

    f .kh/e jkh!e j!td!

    DXk2Z

    f .kh/1

    2!N

    Z !N!N

    e j.tkh/!d! DXk2Z

    f .kh/sin.!N.t kh//!N.t kh/

    DXk2Z

    f .kh/ sinc.!N.t kh//:

    The function

    sinc.!N t / Dt

    1

    h h

    is the impulse response of the ideal low-pass filter with bandwidth !N.

  • The Sampling Theorem

    Theorem (Whittaker-Kotelnikov-Shannon)Let f .t/ be analog bandlimited signal with bandwidth !b. If !b !N, f .t/can be perfectly reconstructed from its sampled measurements Nfk D f .kh/and then the reconstructor (hold or D/A device) is

    f .t/ DXk2Z

    Nfk sinc.!N.t kh//:

    Thats how it works:

    N f kk3 2 1 1 2 3

    #f.t/

    t3h 2h h h 2h 3h

    The Sampling Theorem: some observations

    Reconstruction of sampled signals using the Sampling Theorem is not quitepractical for many applications. Indeed:I ideal reconstructor is not causal

    (i.e., we have to collect all data before processing; impossible in feedback loops)

    I signals we deal with are never bandlimited

    For these reasons different methods used various applications:

    Control applications typically use simple ZOH-like reconstructors becausereconstructorsI must be causal,I should not introduce too much phase lag,I should be simple (for on-line implementation).

    Signal/image processing applications use more complicated reconstructors,like polynomial splines etcetera because reconstructorsI may have some degree of non-causality (delays tolerable)

  • For curious: perfect reconstruction with !N < !b

    F.!

    /

    !0 !b!b

    #

    N F.!/

    !0 !n!n

    I F.!i / D 0 for all i but one (either i D 0 or i D 1) H) no blendingI hence, F.!/ reconstructable (consider this a homework assignment)

    Outline

    Motivating example

    Sampling in frequency domain

    The Sampling Theorem (Whittaker-Kotelnikov-Shannon)

    Sampled-data controllers with ZOH in frequency domain

    Antialiasing filtering

  • Sample-and-hold circuit

    Consider cascade of ideal sampler (SIdl) and zero-order hold (HZOH):

    SIdlHZOH yNyu

    In time domain, it acts as

    u.khC / D y.kh/; 8k 2 ZC; 2 0; h/:

    Impulse-train interpretation

    Consider now yet another system:

    1eshs

    yy

    P

    u

    Herey.t/ D

    Xi2Z

    .t ih/y.t/ DXi2Z

    .t ih/y.ih/

    called impulse-train modulated signal.

    Because the response of 1eshs

    to .t kh/ is 1.t kh/ 1.t kh h/,

    u.khC / DXi2Z

    1. C .k i/h/ 1. C .k i 1/h/y.ih/

    D 1./ 1. h/y.kh/D y.kh/; 8k 2 Z; 2 0; h/;

    which is exactly the i/o map of the sample-and-hold circuit.

  • Impulse-train model

    SIdlHZOH yNyu 1eshs

    yy

    P

    u

    Advantage:I we can use continuous-time machinery (transform models)

    in analysis of sampled-data (hybrid continuous/discrete) systems.

    Fourier transform of impulse-train modulated signal is

    Y.!/ DXk2Z

    e j!khy.kh/ D Yh.!/ 1h

    Xk2Z

    Y.! C 2!Nk/:

    Hence, for both schemes

    U.!/ D 1 e j!h

    j!Yh.!/ D 1 e

    j!h

    j!h

    Xk2Z

    Y.! C 2!Nk/:

    Sample-and-hold circuit in frequency domain

    SIdlHZOH yNyu

    Thus, in frequency domain it acts as

    U.!/ D 1 e j!h

    j!Yh.!/;

    whereI Yh.!/ is 2!N-periodic and

    I the magnitude of the frequency response 1e j!hj! of ZOH is

    !0 !n!n 2!n2!n 4!n4!n

    h1 e j!h

    j!

  • Sample-and-hold circuit in frequency domain: example 1

    SIdlHZOH yNyu

    Y.!/:

    Y.!

    /

    !0 !n!n

    Yh.!/:

    Yh.!

    /

    !0 !n!n 2!n2!n 4!n4!n

    U.!/:

    jU.!

    /j

    !0 !n!n 2!n2!n 4!n4!n

    Sample-and-hold circuit in frequency domain: example 2

    SIdlHZOH yNyu

    Y.!/:

    Y.!

    /

    !0 !n!n

    Yh.!/:

    Yh.!

    /

    !0 !n!n 2!n2!n

    U.!/:

    jU.!

    /j

    !0 !n!n 2!n2!n

  • Sample-and-hold circuit in frequency domain: example 3

    SIdlHZOH yNyu

    Y.!/:

    Y.!

    /

    !0 !n!n

    Yh.!/:

    Yh.!

    /

    !0 !n!n 2!n2!n 4!n4!n

    U.!/:jU

    .!/j

    !0 !n!n 2!n2!n 4!n4!n

    Including discrete-time system

    General sampled-data controller is

    SIdlNC./HZOH yNyNuu

    It can be shown that in this case

    U.!/ D 1 e j!h

    j!NC.e j!h/Yh.!/:

    Thus, NC./ processes each period of Yh.!/ in the same fashion, so thatI NC.e j!h/Yh.!/ is still a 2!N-periodic function of ! 2 R

  • Outline

    Motivating example

    Sampling in frequency domain

    The Sampling Theorem (Whittaker-Kotelnikov-Shannon)

    Sampled-data controllers with ZOH in frequency domain

    Antialiasing filtering

    Sample-and-hold circuit: sources of distortion

    Y.!/:

    Y.!

    /

    !0 !n!n

    Yh.!/:

    Yh.!

    /

    !0 !n!n 2!n2!n 4!n4!n

    U.!/:

    jU.!

    /j

    !0 !n!n 2!n2!n 4!n4!n

    Transformation y.t/ 7! u.t/ introduces distortions caused byI blending, because of aliasing during samplingI reshape in the reconstruction stage

  • Antialiasing filtering: idea

    The problem is thatI aliasing causes high-frequency signals (e.g., measurement noise) to

    appear in low-frequency range.

    To prevent this,I antialiasing low-pass filter must be places between measured signal

    and A/D converter

    with the purpose to filter out signal spectrum above !N.

    SIdlHZOH Fa.s/ yyfNyu

    Antialiasing filtering in action

    SIdlHZOH Fa.s/ yyfNyu

    Y.!/: Y.!/

    !0 !n!n

    Yf .!/:

    Y f.!

    /

    !0 !n!n

    Yh.!/:

    Yh.!

    /

    !0 !n!n 2!n2!n 4!n4!n

    U.!/:

    jU.!

    /j

    !0 !n!n 2!n2!n 4!n4!n

  • Antialiasing filtering in action (contd)

    Non-control examples of antialiasing filtering:

    w/o antialiasing filter with antialiasing filter

    Antialiasing filtering (contd)

    Antialiasing filters, however,I introduce additional phase lag,

    so we have to balance filtering out frequencies above !N and phase lag atcrossover frequency. This means that the need to use antialiasing filterI imposes limitation on attainable closed-loop bandwidth.

    Motivating exampleSampling in frequency domainThe Sampling Theorem (Whittaker-Kotel'nikov-Shannon)Sampled-data controllers with ZOH in frequency domainAntialiasing filtering