Chapter 9 Controller Design u=-Kx - Computer Action...

22
1 Chapter 9 Controller Design Two Independent Steps: 1) Feedback Design – Control Law u=-Kx assumes all states are accessible (a lot of sensors are necessary) 2) Design of Estimator – (also called an Observer) which estimates the entire state vector given the outputs and inputs Control Law Design Assumed system for control law design u=-Kx for an nth order system there are n feedback gains K1,…,Kn. By choice of K the roots can generally be placed anywhere PLANT Bu Ax x x C y - + ˆ x r ESTIMATOR CONTROL LAW -K matrix of constants state vector estimate COMPENSATION Bu Ax x C y u=-Kx x

Transcript of Chapter 9 Controller Design u=-Kx - Computer Action...

  • 1

    Chapter 9

    Controller Design Two Independent Steps:

    1) Feedback Design – Control Law u=-Kx – assumes all states are accessible (a lot of sensors are necessary)

    2) Design of Estimator – (also called an Observer) which estimates the entire state vector given the outputs and inputs

    Control Law Design Assumed system for control law design u=-Kx

    for an nth order system there are n feedback gains K1,…,Kn. By choice of K the roots can generally be placed anywhere

    PLANT

    BuAxx

    x C y

    -

    +

    ˆ x

    r

    ESTIMATOR

    CONTROL LAW -K

    matrix of constants

    state vector estimate

    COMPENSATION

    BuAxx

    C y

    u=-Kx

    x

  • 2

    xBKAx

    Kxu

    BuAxx

    )(

    characteristic equation is

    I (ABK) 0

    Placing Roots

    Example: Undamped oscillator with freq. 0

    y(s)

    u(s)

    1

    s2 02

    state space description

    ux

    x

    x

    x

    1

    0

    0

    10

    2

    1

    2

    02

    1

    let's place the roots both at -20

    we want to double the natural frequency and increase

    damping from =0 to =1

    desired characteristic equation is

    212

    0

    00

    22

    0

    1

    0

    0

    10

    0

    0det)(det

    44)2()(

    KKs

    sBKAsI

    ssssd

    or

    s2 K2s02 K1 0

    equating same coefficients:

    K2 40

    02 K1 40

    2

    K1 302

    K2 40 02021 43 KKK

    n

    jn 12

    jn

    1 2

    -20 -j0

    j0

    j

    cos

    REVIEW

  • 3

    Use of Canonical Forms A simple way of calculating the gains when order is greater than three is to use special

    “canonical” forms of the state equations. The special structure of the system matrix is referred to as companion form. Example: Third order case: The characteristic equation is

    s3 a1s2 a2s a3

    Recall the phase variable form (a lower companion form)

    G(s) b1s

    n1 .... bn1s bn

    sn a1sn1 .... an

    11 ....

    1

    :

    0...100

    0...010

    aaa

    A

    nn

    1

    0

    :

    0

    B 11 ... bbbC nn 0D

    The closed loop system matrix is

    ABK Third order case:

    312213

    000

    000

    321

    123

    100

    010

    1

    0

    0

    100

    010

    321

    KaKaKa

    KKK

    aaa

    BKA

    KKK

    Characteristic equation

    sI (ABK) 0

    s3 (a1 K3)s2 (a2 K2)s (a3 K1) 0 (1)

  • 4

    if the desired pole locations result in the characteristic equation

    d (s) s3 1s

    2 2s3 0 (2) equating like coefficients of (1) and (2)

    K3 a1 1

    K2 a2 2

    K1 a3 3

    Example: Drill problem D9.1 page 635 of text

    u

    x

    x

    x

    x

    x

    x

    1

    0

    0

    763

    100

    010

    3

    2

    1

    3

    2

    1

    rx

    x

    x

    kkku

    3

    2

    1

    321

    1

    2

    3

    2 0 1

    x

    y x

    x

    Find ki to place the closed-loop system poles at s= -3, -4, -5 ANS desired characteristic polynomial

    d (s) (s 3)(s 4)(s 5)

    s3 12s2 47s 60

    1 12, 2 47, 3 60 we have

    k3 a1 1

    7 12 5

    k2 a2 2

    6 47 41

    k1 a3 3

    3 60 57

  • 5

    Design Procedure

    Given (A,B) and desired d(s), transform to (Ac, Bc) and solve for gains We then need to transform gain back to original state space note: the poles can only be placed arbitrarily if the system is fully controllable This procedure is encapsulated in Ackermann’s formula Ackermann’s Formula

    )(10...0 1 AMk dC

    where

    BABAABBM nC 12 ... (controllability matrix) where n is the order of the system or the number of states and

    d (A) is defined as

    IAAAA nnnn

    d ...)( 22

    11

    where the si ' are the coefficients of the desired characteristic polynomial

    d (s) sn 1s

    n1 ...n Example Apply the formula for the undamped oscillator

    2

    00

    2

    2

    0

    44

    )2()(

    ss

    ssd

    01 4 , 2

    02 4

    recall

    0

    102

    0A

    1

    0B

    2

    0

    3

    0

    0

    2

    0

    2

    02

    0

    02

    0

    2

    0

    34

    43

    10

    014

    0

    104

    0

    0)(

    Ad

    control canonical (companion) form i.e. phase variable form

  • 6

    also

    01

    10ABBM c

    01

    101cM

    2

    0

    3

    0

    0

    2

    021

    34

    43

    01

    1010

    KKK

    020 43 K which is the same as the result previously obtained.

    Tracking Problems

    For step input: Will find

    N to ensure zero steady-state error to step inputs

    rNKxu

    rNBxBKA

    BuAxx

    )(

    now

    rNBBKACy

    rNBBKAx

    rNBxBKAx

    ss

    ss

    ssss

    1

    1

    )(

    )(

    )(00

    A-BK is stable inverse exists now

    rNBBKAC

    rNBBKACryre ssss1

    1

    )(1

    )(

    to get zero steady state error

    N 1

    C(A BK)1B

    steady-state error

  • 7

    Integral Control (used to get zero steady state error) Integrator increases the system order by one, i.e. augment the plant model by an added state variable xi

    Cxrx

    dtCxrdtyredtx

    i

    i

    )()(

    Augmented systems becomes

    ruB

    x

    x

    C

    A

    x

    x

    ii

    1

    0

    00

    0

    Control law is

    i

    iiix

    xKKxKKxu

    The design now proceeds as before. Example

    Double Integrator

    G(s) 1

    s2

    xy

    uxx

    01

    1

    0

    00

    10

    Augment the plant

    zero matrices (compatible dimensions)

    integrator in the forward path

    R(s) E(s)

    1s

    U(s) X(s) + +

    + -

    Ki +

    + B

    1s C

    Y(s) Xi(s)

    A

    -K

  • 8

    xCy

    x

    xCy

    Cxy

    i

    0

    i

    ii

    x

    x

    y

    u

    x

    x

    x

    x

    001

    0

    1

    0

    001

    000

    010

    Select poles of the closed loop system to be at

    1 j,5 N.B. 3 poles because of extra state

    10712 K

    Steady state output to a unit step input can be derived as follows

    rCxx

    BuAxx

    i

    ruB

    x

    x

    C

    A

    x

    x

    dt

    d

    ru BB

    ii

    1

    0

    00

    0

    i

    ix

    xKKu

    rBxKBAx

    rBxKBxAx

    xKu

    rBuBxAx

    ru

    ru

    ru

    )(

    in steady state 0ssx

  • 9

    For the example

    011

    0

    00

    10

    CBA

    0011

    0

    0

    0

    1

    0

    001

    000

    010

    CBBA ru

    r

    r

    ry ss

    1

    1

    0

    0

    001

    10712

    010

    001

    1

    0

    0

    10712

    0

    1

    0

    001

    000

    010

    001

    1

    1

    det 112 10

    1 0

    10

    adj(A)13 1 0

    7 10

    10

    only term of interest

  • 10

    Observer Design

    We will estimate states rather than measure them Observer simulates the original system Original System

    Cxy

    BuAxx

    x(0) x0

    Observer

    )ˆ(ˆˆ xCyLBuxAx 0ˆ)0(ˆ xx

    (A,B)

    x(t) C y(t)

    -

    +

    ˆ x (t)

    (A,B)

    C

    ˆ y (t)

    L

    u(t)

    +

    + + -

    +

    + B C

    A

    B

    L

    A

    C

    1s

    1s

    U(s)

    Y(s)

    ˆ X (s)

    PLANT

  • 11

    Error between states and their estimates

    ˜ x x ˆ x

    0~)0(~~)(

    )ˆ(ˆ

    ˆ~

    xxxLCA

    xCyLBuxABuAx

    xxx

    Observer error will go to zero asymptotically A-LC is stable (i.e. eigenvalues are in the LHP)

    note: the eigenvalues of A-LC are the observer poles, which can be placed arbitrarily if the system is observable

    this can be done by choice of the observer gains L (a column vector for single output

    systems)

    Definition: 1) a system is detectable if the unstable modes are observable

    2) a system is stablizable if the unstable modes are controllable Duality

    Control Estimation Control Estimation

    A AT MC Mo

    T B CT K LT C BT

    Example

    MC B AB .... An1B

    duality

    11

    1

    1

    ::

    )(....)(

    ....

    n

    o

    T

    n

    TnTT

    TnTTTTTo

    CA

    CA

    C

    M

    CA

    CA

    C

    CACAC

    CACACM

  • 12

    Ackermann’s formula to find observer gains

    1

    :

    0

    0

    )( 1oe MAL

    DERIVATION USING DUALITY Ackermann’s Formula for control problem

    )(1.....0 1 AMK CC

    Duality

    T

    oe

    T

    e

    T

    o

    T

    MA

    AML

    1

    :

    0

    )(

    )(1.....0

    1

    1

    AT BTCT (CBA)T

    1

    :

    0

    )(1

    oe MAL

    Example Design an observer for

    xy

    uxx

    ssG

    01

    1

    0

    00

    10

    1)(

    2

    Note the system is completely observable

    Design the observer with poles at

    2 j2 Actual characteristic equation:

    21

    2

    2

    101

    00

    10

    10

    01)(

    lsls

    l

    lsLCAsI

  • 13

    Desired characteristic equation:

    (s 2 j2)(s 2 j2) s2 4s 8

    Equating coefficients

    l1 4

    l2 8

    8

    4L

    The observer equations are

    uxyx

    xyxx

    )ˆ(8ˆ

    )ˆ(4ˆˆ

    12

    121

    STRUCTURE OF OBSERVER

    + - +

    + 4

    1s

    1s

    u y

    ˆ x 1

    PLANT

    1s

    +

    + 8

    1s

    ˆ x 2

    2x 12 xx

    x1

  • 14

    Control Using Observers

    Plant: Cxy

    xxBuAxx

    0)0(

    Observer: 0ˆ)0(ˆ)ˆ(ˆˆ xxxCyLBuxAx

    Estimated state feedback:

    uKˆ x closing the loop

    x

    x

    LCBKALC

    BKA

    x

    x

    LCxxBKLCA

    LyxBKxLCAx

    xBKAxx

    ˆˆ

    ˆ)(

    ˆˆ)(ˆ

    ˆ

  • 15

    Separation Principle Introduce transformation

    1

    0

    ˆ

    0

    ˆ ˆ

    N N

    N N

    N N

    N N

    Ix zP where P

    I Ix w

    note P P

    Iz x x x

    I Iw x x x x

    Therefore using this transformation the old augmented state vector comprising

    x (the plant states) and

    ˆ x (the estimator sates) now becomes

    x and

    ˜ x (the estimator error). The new

    system matrix

    ˜ A P1AP

    x

    x

    LCA

    BKBKA

    x

    x~0~

    note

    ˜ A is block-triangular Eigenvalues of a block-triangular matrix are equal to the eigenvalues of the diagonal blocks. So

    the eigenvalues of the full system comprise the eigenvalues of the plant (i.e. eigenvalues of A-BK) and the observer (i.e. eigenvalues of A-LC).

    Alternative Approach

    xLCAx

    xLCAxLCA

    xLCBKALCxxBKAxxx

    xLCBKALCxx

    xBKAxx

    ~)(~

    ˆ)()(

    ˆ)(ˆˆ

    ˆ)(ˆ

    ˆ

    xBKAxx ˆ

    now

    ˜ x x ˆ x ˆ x x ˜ x

    xBKxBKA

    xxBKAxx~)(

    )~(

  • 16

    Compensator Transfer Function

    H(s) U(s)

    Y(s)

    we have

    )()()(

    )()()(ˆ

    ˆ)(

    ˆˆˆ)ˆ(ˆˆ

    ˆ

    )(

    1

    1

    sYLLCBKAsIKsU

    sLYLCBKAsIsX

    LyxLCBKA

    xLCLyxBKxAxCyLBuxAx

    xKu

    sH

    Design Issues

    1) Problem with pole placement is that there is no control over compenstor poles and zeros 2) Optimum choice for observer initial conditions is

    3) Choice of observer poles:

    i. Choose them to be faster than controller poles ii. Alternatively, choose them to be at plant zeros (if the sytem has RHP zeros,

    use their LHP images).

    Compensator output, which is the plant input

    Compensator input, which is the plant output

    u y PLANT

    OBSERVER -K

    ˆ x

    Compensator Input

    COMPENSATOR

    Compensator Output

  • 17

    Reduced-Order Observer Design If system has n states and m measurements, then an observer of order (n-m) will be sufficient. If

    y Cx we will assume C has the structure:

    ( )

    11 12 1

    21 22 2

    22 21 2

    0 , 0

    0

    ( )

    mxm mx n m

    m

    m

    u

    m m

    u u

    u u m

    known input

    C I I R R

    xy I x

    x

    x xA A Bu

    x xA A B

    x A x A x B u

    also u

    tmeasuremenknown

    um

    xAuByAy

    uBxAyAyx

    12111

    11211

    Summarizing:

    )1(

    )1(

    )1()(

    12111

    22122

    bxAuByAy

    auBxAxAx

    u

    tmeasuremenknown

    inputknown

    muu

    Recall for full-order observer:

    Plant: )2()0( 0

    Cxy

    xxBuAxx

    Observer: )3(ˆ)0(ˆ)ˆ(ˆˆ 0xxxCyLBuxAx comparing (1) and (2) shows the correspondence

    measured states

    unmeasured states

    dynamics of the unmeasured state

    output relationship

  • 18

    22

    21 2

    11 1

    12

    (4)

    u

    m

    x x

    A A

    Bu A x B u

    y y A y B u

    C A

    substituting (4) into (3) we get the reduced order equation

    12

    12

    22 21 2 11 1 12ˆ ˆ ˆ( ) (5)

    u

    u

    A x

    u u m u

    A x

    x A x A x B u L y A y B u A x

    let us now define the estimator error

    ˜ x u xu ˆ x u

    therefore subtracting (5) from (1a) and using (1b) (i.e. uxAuByAy 12111 ) we get

    )6(~)(~ 1222 uu xLAAx Design proceeds by, given an A22 and A12 we choose an L to place estimator poles. Rewriting (5) we have

    yLuLBByLAAxLAAx uu )()(ˆ)(ˆ 1211211222 (7)

    The presence of the derivative of the measurement (i.e. y ) is not good since this amplifies the noise. To get around this we introduce a new state z where

    Lyxz u ˆ (8)

    ˆ x u z Ly (9)

    substituting (9) into (7) leads to the final form of the reduced-order observer

    Lyzx

    GuFyDzz

    u

    ˆ

    where

    D A22 LA12

    F DL A21 LA11

    G B2 LB1

    the error dynamics are given by this

    equation

    z is the state of the estimator

  • 19

    The block diagram of the reduced order observer is shown below

    Example

    Double integrator

    G(s) 1

    s2

    Lyzx

    GuFyDzz

    u

    ˆ

    where

    D A22 LA12

    F DL A21 LA11

    G B2 LB1

    Dynamics of reduced order observer uu xLAAx~)(~ 1222

    ^

    1

    s

    1

    s

    u

    x2

    x1 y

    1

    s2 ^

  • 20

    Require observer pole at

    s2

    I A22 LA12 0 where 2

    I L 0

    L 2

    D 2

    F 4

    G 1

    Ackerman’s formula for reduced order observer gains

    1

    :

    0

    0

    0

    )(1

    022 MAL e

    for example:

    2

    )1)(1)(2(

    1

    20)(

    2)(

    120

    22

    L

    AM

    A

    ss

    e

    e

  • 21

    Reduced-Order Transfer Function

    Lyz

    u

    y

    m

    u

    mxKxK

    x

    xKKu

    ˆ

    ˆ2121

    now

    yLKKzKu

    LyzKyKu

    GuFyDzz

    )(

    )(

    212

    21

    also

    yLGKGKFzGKD

    yLKKzKGFyDzz

    )()(

    )(

    212

    212

    Transfer function:

    U(s)

    Y(s)C'(sI A')1B'D'

    where

    A' DGK2

    B' F GK1 GK2L

    C' K2

    D' (K1 K2L)

    When C is not of the form 0I ?

    BuQAQzQzBuAQzzQQzx

    DuCxy

    BuAxx

    11

    y CQzDu

    so find a transformation Q so that CQ is of form 0I

    let

    Q Q1 Q2

    so 1 2 0CQ CQ CQ I

  • 22

    let

    T

    CP be nonsingular

    arbitrary matrix

    if

    PQ I

    1 21 21 2

    1

    0

    0

    CQ CQC IPQ Q Q

    TQ TQT I

    Q P