Lecture Notes Lecture Notes

Fundamentals of Control Systems Fundamentals of Control Systems

Instructor: Assoc. Prof. Dr. Huynh Thai Hoang Department of Automatic Control Faculty of Electrical & Electronics Engineering Ho Chi Minh City University of Technology Ho Chi Minh City University of Technology Email: hthoang@hcmut.edu.vn

huynhthaihoang@yahoo.com Homepage: www4.hcmut.edu.vn/~hthoang/ Homepage: www4 hcmut edu vn/ hthoang/

6 December 2013 © H. T. Hoang - www4.hcmut.edu.vn/~hthoang/ 1

Chapter 9 Chapter 9

DESIGN OF DESIGN OF

DISCRETE CONTROL SYSTEMS DISCRETE CONTROL SYSTEMS

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 2

Content Content

 Introduction  Introduction  Discrete lead – lag compensator and PID controller  Design discrete systems in the Z domain  Design discrete systems in the Z domain  Controllability and observability of discrete systems  Design state feedback controller using pole  D i

db k

ll

f

t

t

i

l

t placement

 Design state estimator  Design state estimator

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 3

Discrete lead lag compensators Discrete lead lag compensators

and PID controllers and PID controllers

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 4

Control schemes Control schemes

 Serial compensator  Serial compensator

R(z)

Y(z)

ZOH

G(z)

GC(z) C

+ 

T T

H(z) H( )

 State feedback control  State feedback control

u(k)

r(k)

x(t)

y(k)

Cd C

x

( (

k k

k )( )( k

ku )( )( k

)1 )1 

xA A d

B B d

+ +

K K

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 5

Transfer function of discrete difference term Transfer function of discrete difference term

u(k) u(k)

e(k) e(k)

D

 Differential term:

tu

)( 

)( tde )( td dt

( kTe

)1

T

]

)

 Discrete difference:

( kTu

)

)( zE

)( zU

[( ke T 1 )( zEz T

 Transfer function of the discrete difference term:

1

)(  )( zGD G

1 z  zT

6 December 2013

© H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/

6

Transfer function of discrete integral term Transfer function of discrete integral term

e(t) e(t)

u(t) u(t)

Integral I t l

t

 Continuous integral:  Continuous integral:

)( t tu )(

e

)(  d  d )(

 

0

kT

(

k

kT

( kTu

)

e

)(  d

 Discrete integral: l t

Di

t

i

 

 )1 T )( e d   

0

(

0

k

)( d e    T )1 

kT

 

=

-

t

u kT ( ( kT

) )

u k [( [( k

1) 1)

T T

] ]

e

dt ( ) ( ) d

=

-

+

-

+

u k [( [( k

1) 1)

T T

] ]

e k [( [( k

1) 1)

T T

] ]

e kT ( ( kT

) )

( (

+ ò + ò

T T 2

-

(

k

1)

T

U

zU )( )(

1 1  zUz )( )( U

  1 1  zEz )( )( E

)( )( zE E

T T 2

 TF of discrete integral term:  TF of discrete integral term:

zGI G )( )(

1 1

zT z 2 

6 December 2013

© H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/

7

Transfer function of discrete PID controller Transfer function of discrete PID controller

 Continuous PID controller:

C ti

PID

ll

t

G

K

)( )( s

PID PID

P P

sK D D

K s

 Discrete PID controller:

1

z

G

)( z

K

PID

P

1 1

zTK I 2 z

K D T

 z

 

P

D

I

z

1 1

G

K

z )(

or

PID

TK I

P

z

1

K K D T

 z

z 

I

D

P

6 December 2013

© H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/

8

Digital PID controller Digital PID controller

r(k) (k)

e(k)

u(k)

y(k)

+

D/A

G(s)

PID

A/D

1

G

)( )( z

K

PID PID

P P

)( zU )( )( zE

zTK I 2 2 z

1 1 1

zK D T

 z

 

ku )( )( k

ku ( ( k

)1 )

ke ( ( k

)]1 )

keK )([ k )( P

ke )([ )([ ke

ke ( ( ke

)]1 )]1

)1 )1

ke ke ( (

)]2 )]2

 

 

ke (2)([ ke (2)([ ke ke 

 

TK I 2

K D T

6 December 2013

© H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/

9

Digital PID control programming Digital PID control programming

float PID control(float setpoint float measure) float PID_control(float setpoint, float measure) { ek_2 = ek_1; ek_1 = ek; ek = setpoint – measure; uk_1 = uk; uk = uk 1 + Kp*(ek ek 1) + Ki*T/2*(ek+ek 1) + uk = uk_1 + Kp (ek-ek_1) + Ki T/2 (ek+ek_1) +… Kd/T*(ek – 2ek_1+ek_2);

If uk > umax, uk = umax; If uk < umin, uk = umin; return(uk)

_

;

}} Note: Kp, Ki, Kd, uk, uk_1, ek, ek_1, ek_2 must be declared as _ _ , g global variables; uk 1, ek 1 and ek e must be initialized to be zero; umax and umin are constants.

6 December 2013

© H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/

10

of discrete phase lead/lag compensator TF TF of discrete phase lead/lag compensator

 Continuous phase lead/lag compensator:  Continuous phase lead/lag compensator:

K

)(

sGC

phase lead g phase lag p

b b

a  a 

as  bs bs 

 Discretization using trapezoidal integral:

K K

zGC )( )( G

( ( (

aT bT

) )2 )2

z z

( ( (

aT bT

) )2 )2

 

 

 

 Denote

and

zC

pC

( ( (

)2 )2 )2

aT aT aT 

( ( (

)2 )2 )2

bT bT bT 

TF f di

d/l

h

t

t

l

TF of discrete phase lead/lag compensator

phase lead

K K

)( zG zG )( C C

C C

z z

 

phase lag

z C p C

z  C z  C

p C p C

1Cz 1Cp

6 December 2013

© H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/

11

Approaches to design discrete controllers Approaches to design discrete controllers

a

Fi

design d i

 Indirect design: First  I di t t d i

ti

p

continuous controller, then discretize the controller to have a discrete control system. The performances of the discrete control system The performances of the obtained discrete control system are approximate those of the continuous control system provided y that the sample time is small enough.

 Direct design: Directly design discrete controllers

in Z domain.

Methods: root

locus, pole placement, analytical

,

method, …

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 12

Design discrete controllers in the Z domain D i Design discrete controllers in the Z domain D i

th Z d th Z d

di di

ll ll

t t

t t

i i

i i

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 13

Procedure for designing discrete lead compensator using the RL Procedure for designing discrete lead compensator using the RL

Lead compensator:

K

(

)

zG )( C

C

z C

p C

z z

  

z C p C

 Step 1: Determine the dominant poles from desired

* 2,1z

transient response specification:

(POT)

2 j 1 

 n

n

* s  2,1

ts

Overshoot    g time Settling  

   n  n 

*Tse

* z 2,1

*

T n

r

z

e

*

z z  

 

2 nT 1  T 1 

         

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 14

Procedure for designing discrete lead compensator using the RL Procedure for designing discrete lead compensator using the RL

 Step 2: Determine the deficiency angle so that the  St th d fi i

th t th

2 D t

l

i

* 2,1z dominant poles lie on the root locus of the system after compensated: after compensated:

n

m

0

180

arg(

)

arg(

z

)

* 



p i

i

* z 1

* z 1

i

i

1 

1 

where pi and zi are poles and zeros of G(z)

Geometry formula:

0

180

ngles

from

poles

of

zG

* 



a

o )( t

* z 1

ngles

from

oserz

of

zG

a

* * 1o)( z t

  

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 15

Procedure for designing discrete lead compensator using the RL Procedure for designing discrete lead compensator using the RL

* 1z

 Step 3: Determine the pole & zero of the lead compensator  Step 3: Determine the pole & zero of the lead compensator Draw 2 arbitrarily rays starting from the dominant pole such that the angle between the two rays equal to *. The intersection between the two rays and the real axis are the positions of the pole and the zero of the lead compensator. Two methods often used for drawing the rays: Two methods often used for drawing the rays:  Bisector method Pole elimination method  Pole elimination method

 Step 4: Calculate the gain KC using the equation:

zGzG )( )( )( )( zGzG

1 1

 

C

* zz 1

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 16

Example Design discrete lead compensator using RL –– Example Design discrete lead compensator using RL

R(s)

Y(s)

ZOH

G(s)

GC(z)

+

T

)( sG

sec1.0T

ss (

)5

50 

 Design the compensator GC(z) so that the compensated system

has dominant poles with

707.0

10n , (rad/sec)

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 17

Example (cont’) Design discrete lead compensator using RL –– Example (cont’) Design discrete lead compensator using RL

 Solution:  Solution:

 The open-loop discrete TF:

)( )( sG

)5

50 ss (

1(

z

)( zG 

1 Z )

)( sG s

1(

1  z Z )

2

s

)5

    50 s ( 

  

      

5.0

5.0

5.0

z

15.0[(

e 5.0

)]



1 

1(10

z

)

5.0

e (5 (5

z z

) )

z e ) 1(  2  z z e e ()1 ()1  

   

   

aT

aT

aT

aTe

1 

 aTz (

)

 

zG zG )( )(

)

e za (

)

(

z

z ) 1(  2 z ()1 

e aTe 

21.0 z z )(1 

18.0   a Z Z   607.0 )  2 as ( s  

    

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 18

Example (cont’) Design discrete lead compensator using RL –– Example (cont’) Design discrete lead compensator using RL

j

 The desired poles:

re

* z 2,1

where where

707

.01.0 

10 

T n

r

e

e

493.0

1

1.0

10

707

.0

707

.01 

2

707.0

493.0

je 

* z 2,1

375.0

j

320.0

* z 2,1

2 nT 

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 19

Example (cont’) Design discrete lead compensator using RL –– Example (cont’) Design discrete lead compensator using RL

Im z Im z

 The deficiency angle  The deficiency angle

0.375+j0.320

+j

180

)

* 



(  2 3

1

0

152

9.

 1

0

P

125

9.

 2

0

2

*

1

6.14

Re z

3

3

0

+1

1

084 * 84 0

A pc

B zc

j j

6 December 2013

© H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/

20

Example (cont’) Design discrete lead compensator using RL –– Example (cont’) Design discrete lead compensator using RL

 Determine the pole and the zero of the compensator  Determine the pole and the zero of the compensator

using the pole elimination method:

607

.0

 Cz

607.0Cz C

OA

OB

AB

pC

607 578

.0OB .0AB

029.0Cp

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 21

Example (cont’) Design discrete lead compensator using RL –– Example (cont’) Design discrete lead compensator using RL

i K

t

l

1 1

* 

 Calculate the gain KC:  C l th

zGzG G )( G )( )( )( C

zz

1 1

K K

C

( (

z z

.0 .0

607 029

) ()

)18.0 .0 607

)

 

z 21.0( z z )(1 

 

z

375.0

j

.0

320

1

KC

320

)1

.0(

375

j

j

.0(21.0[ 0(210[ .0 320 

j j ]180)320 375 375 .0 0 ]18.0)320   029 .0 .0)( 375 .0 

1

CK

24.1CK

.0 471

.0

702

267 .0 

Conclusion: The TF of the lead compensator is:

241)( 24.1)( 

zGC G

.0 .0

607 029

z z 

6 December 2013

© H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/

22

Example (cont’) Design discrete lead compensator using RL –– Example (cont’) Design discrete lead compensator using RL

Root locus of the uncompensated system t

t d

Root locus of the compensated system t d

t

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 23

Procedure for designing discrete lag compensator using the RL Procedure for designing discrete lag compensator using the RL

K

(

)

The discrete lag compensator:

sG )( C

C

z C

p C

z  z  z 

z z C p C

 Step 1: Denote . Determine  to meet the steady-  Step 1: Denote Determine  to meet the steady

 

C

p Cp1 C 1 z  state error requirement:

or

or







K K

K K

K K

P * P

a * a

V * V

 Step 2: Chose the zero of the lag compensator:

1Cz

 Step 3: Calculate the pole of the compensator: p

1(

z

)

1 

C

C

 Step 4: Calculate KC satisfying the condition:

)( zGHzG

)(

1

C

* zz

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 24

Example Design discrete lag compensator using RL –– Example Design discrete lag compensator using RL

R(s) R(s)

C(s) C(s)

+

ZOH

G(s)

GC(z)

T

sG )(G )(

sec1.0T 10 T

ss (

)5

50 

 Design the lag compensator GC(z) so that the compensated system has the velocity constant and the closed

100

* VK

poles are nearly unchanged.

C

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 25

Example (cont’) Design discrete lag compensator using RL –– Example (cont’) Design discrete lag compensator using RL

 Solution:  Solution:

 The discrete transfer function of the open-loop system:

sG )(

z

)( zG 

1( 

ss (

)5

50 50 

1( 1( 

2

s

)5

)( sG sG )(    s  50 50 s ( 

    

5.0

5.0

5.0

[( 15.0[( z

e 5.0

)] )]



1 1 

z

1(10 1(10

5.0

e (5

z

e  e

 )

) ) ( z 1(  2 z ()1  

  1 Z 1  )     1 1 Z   z Z ) )       ) ) 

   

 

zG )( )( G

18.0 607.0

)

(

z

21.0 )(1 

z z 

aT

aT

aT

aTe

1 

 aTz (

)

2

)

s

(

e za (

)

a as 

z ) 1(  2 z ()1 

e aTe 

 Z Z   

    

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 26

Example (cont’) Design discrete lag compensator using RL –– Example (cont’) Design discrete lag compensator using RL

 The characteristic equation of the uncompensated system:  The characteristic equation of the uncompensated system:

1

zG )(

0

0

1

18.0 607.0

) )

( (

z

z 21.0 )( )(1 z 

 

 Poles of the uncompensated system:

699.0

j

.0

547

z 2,1

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 27

Example (cont’) Design discrete lag compensator using RL –– Example (cont’) Design discrete lag compensator using RL

 Step 1: Determine   Step 1: Determine 

The velocity constant of the uncompensated system:

1(

1  ) )( zGz

K V

lim 1 z 

1 1 

z

) )

K K V

9.9VK

lim li 1( 1( z 1 

18.0 607.0

)

(

z

1 1 T 1 1.0

z 21.0 z )(1 

 

The desired velocity constant: The desired velocity constant:

100 100

*K VK

Then: Then:

 

9.9 100

VK V *  K V

099,0 099,0

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 28

Example (cont’) Design discrete lag compensator using RL –– Example (cont’) Design discrete lag compensator using RL

 Step 2: Chose the zero of the lag compensator:  Step 2: Chose the zero of the lag compensator:

Chose:

99.0Cz

 Step 3: Calculate the pole of the lag compensator:

1(

z

)

1 

999

.01

099

)99.01(



p C

C

.0Cp

K

zG )( C

C

z 99,0  s 999,0 

 Step 4: Determine the gain of the compensator

1

zGzG )( )(

* 

C

1

K

C

)18.0 607.0

)

(

21.0( z )(1 z z 

 

z

699.0

j j

.0

547

007.1

1

zz ( )99.0 z  ( )999.0 z  CK

6 December 2013 © H. T. Hoàng - ÐHBK TPHCM 29

Example (cont’) Design discrete lag compensator using RL –– Example (cont’) Design discrete lag compensator using RL

Root locus of the uncompensated system uncompensated system

Root locus of the compensated system compensated system

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 30

Design discrete PID controller using analytical method Design discrete PID controller using analytical method

R(s) R( )

C(s) C( )

ZOH

G(s)

+

GC(z)

T

H(s)

sG )(

sec2T

05.0

)( sH

1

10

10 s 

Design the controller GC(z) so that the closed– loop system has the poles with =0.707, n=2 loop system has the poles with =0 707  =2 rad/sec and steady state error to step input is zero.

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 31

Design discrete PID controller using analytical method Design discrete PID controller using analytical method

 The controller to be designed is a PI controller (to meet  The controller to be designed is a PI controller (to meet

the requirement of zero error to step input):

K

zG )( )( C

P

1 1 1

zTK zTK I  I z 2 

 The discrete TF of  The discrete TF of

the open-loop system: the open-loop system:

)( zGH

z

1( 

1( 

10  s 10( 10(

05.0 s  )1 )1 

 1z Z )   

   

 1 Z )   

    2.0

1 

z

) )

( 1( 

z

1 1

(1.0

sHsG )( )( s z 1(05.0  z z )(1  G

K

) 

e ) 2.0 20 e z )( PID

P

zTK I 2 z

1 1 1

K D T

 z

 

zGH )( zGH )( 

P P

I I

D D

091 .0

)819

(

z

.0 

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 32

Design discrete PID controller using analytical method Design discrete PID controller using analytical method

 The characteristic equation of the closed-loop system:  The characteristic equation of the closed-loop system:

1

)(

0

zGHzGC )(

K

0

1

P

z

zTK I z 2

1 1

819.0

091.0 

 

   

      

   

2

z

.0(

091

K

.0

091

K

.1

)819

z

.0(

091

K

.0

091

K

.0

)819

0



P

I

P

I

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 33

Design discrete PID controller using analytical method Design discrete PID controller using analytical method

j j 

 The desired poles:  The desired poles:

re

* z 2,1

where

707.02 02 707

2 2



T T n

r

e

e

059.0

2

1

707

.2

828

22 

.01 

2 nT 

.2

828

.0

059

je 

* z 2,1

.0

056

j

.0

018



* z 2,1

 The desired characteristic equation:  The desired characteristic equation:

(

z

056.0

j

.0

018

)(

z

.0

056

j

.0

0)018

z 2 2

112.0

z

.0

0035

0

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 34

Design discrete PID controller using analytical method Design discrete PID controller using analytical method

 Balancing the coefficients of the system characteristic  Balancing the coefficients of the system characteristic

equation and the desired characteristic equation, we have:

091 091

K K

.0 0

091 091

K K

.1 1

819 819

.0 0

112 112

 

P K 091

.0

.0

 I K 091

  819.0

.0

0035

P

I

.0 0    

P

09.15 13.6

K K

 

I

  

Conclusion

09.15

13.6

zGC )(

z z

1 1

 

2

.0(

091

K

.0

091

K

.1

)819

z

.0(

091

K

.0

091

K

.0

)819

0

z



P

I

P

I

2

z

112.0

z

.0

0035

0

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 35

es g o d sc ete co t o syste s Design of discrete control systems es g o d sc ete co t o syste s Design of discrete control systems

in state space domain in state space domain

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 36

Controllability Controllability

)1 )1

k )( )( k

ku )( )( ku

 

B B d d

 Consider a system:

C

xA xA d d k )(

k k ( ( x x   ky )( 

 xC d

   

y

( 0)

 The system is complete state controllable if there exists  The system is complete state controllable if there exists an unconstrained control law u(k) that can drive the system from an initial state x(k0) to a arbitrarily final y state x(kf) in a finite time interval k0  k kf . Qualitatively, the system is state controllable if each state variable can be influenced by the input. be influenced by the input

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 37

Controllability condition Controllability condition

( (

k k

)1 )1

k )( )( k

ku )( )( k

B B d

 System:

x  ky )(

xA A d k )(

xC d

   

 Controllability matrix

] ]

C C

B [ [ B d

BA BA d d

2 BA BA d

n BA 1  BA d d

 The necessary and sufficient condition for the

controllability

rank

n

)

( C

 Note: we use the term “controllable” instead of

“complete state controllable” for short.

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 38

Discrete state feedback control Discrete state feedback control

u(k) u(k)

r(k) r(k)

x(k) x(k)

y(k) y(k)

C

x

(

k

)1

k )(

ku )(

xA d

B d

+ 

K

ku )(

k )(

k

(

B d

 Consider a system described by the state-space equation:  Consider a system described by the state space equation: xA d k )( )( k

x  ky )( )( k

)1  d xC C

   

 The state feedback controller:

ku )(

kr )(

k )(

Kx

)(] )(] k

) )1

k

( (

[ [

)( )( kr

xKB

d d

 The state equation of the closed-loop system: B  d d )

x y(k

A d d k )(

 xC d

   

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 39

Pole placement method Pole placement method

If the system is controllable then it is possible to If the system is controllable, then it is possible to determine the feedback gain K so that the closed-loop system has poles at any location.

 Step 1: Write the characteristic equation of the closed-

( ) (1)

loop system p y

det[ det[

0] 0]  

z AIz AI  d

 KB KB  d

(2)

0

)

ip

i

1 

n )1 ),1

i (i ( ,

 Step 2: Write the desired characteristic equation: n  z ( are the desired poles th d i d

l

pi

 Step 3: Balance the coefficients of the equations (1) and

(2), we can find the state feedback gain K. (2) t t

fi d th

db k

i K

f

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 40

Example 1 Discrete pole placement design –– Example 1 Discrete pole placement design

 Given the control system:  Given the control system:

u(k)

r(k)

x(k)

y(k)

C

x

( (

k

) )1

)( )( k

)( )( ku

xA d d

B d d

+ 

K K

0

dA

 10dC

dB

316.01 01 316       .00 368  

092.0  092 0   316.0 

   

the Determined the state feedback gain K so that closed-loop system has a pair of complex poles with =0.707, n=10 rad/sec  0 707 10 rad/sec

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 41

Example 1 (cont’) Discrete pole placement design –– Example 1 (cont’) Discrete pole placement design

det[

 The closed-loop characteristic equation:  The closed-loop characteristic equation: 0] 

z AI  d

316.01 01 316

KB d 092 092

.0 0

det

z

k

0

 k 1

2

10

.00

316.0

   

   368 

01 01    

   

   

   

    

     

.01

.0

316

.0

092

z

k 1

det

0

 .0

316

 368

.0

.0

316

 z

k 2 k

092 k 1

2

   

   

    

    

z (

.01

092

368.0

316.0

k

)

z

)(



.0 0

316 316

316 316

.0 0

k 1

 

2 0( .0( 

k k 1

   

2

z

.0(

316

k

.1

368

)

z

.0

092

k 1

.0(

066

.0

316

k

  .0

0

2 

dB B 

316.01   k 092 ) 0 092 k ) 0  A A   2 d .00 368  092.0       368 )  316.0  

k 1

2

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 42

Example 1 (cont’) Discrete pole placement design –– Example 1 (cont’) Discrete pole placement design

j j 

 The desired poles:  The desired poles:

re

* z 2,1

707.01.0

10 

T n

where:

r

e

e

493.0

2

1

1.0

10

707

.0

707

.01 

2 nT 

707.0 0 707

* * 2,1

z

.0

493

je j 

* 2,1 21

375.0 375 0

.0 0

320 320

z z

j j

 

 

 The desired characteristic equation:

(

z

.0

375

j

.0

320

)(

z

.0

375

j

.0

320

)

0

2 2

z

75.0 750

z

.0 0

243 243

0 0

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 43

Example 1 (cont’) Discrete pole placement design –– Example 1 (cont’) Discrete pole placement design

 Balancing the coefficients of the system characteristic  Balancing the coefficients of the system characteristic

equation and the desired characteristic equation, we have:

316.0 316 0

k k

)368.1 1 )368

75.0 750

 

 

2

066.0(

.0

316

k

.0

)368

  .0

243

k k 1 k 1

2

092.0( 0( 092    

12.3

k 1 k

.1

047

2

  

Conclusion:

047.1

 12.3K

2

.0(

092

.0

316

k

.1

368

)

z

.0(

066

.0

316

k

.0

368

)

0

z

k 1

k 1

2

2

2

z

75.0

z

.0

243

0

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 44

Example 2 Discrete pole placement design –– Example 2 Discrete pole placement design

 Given the control system:  Given the control system:

r(k)

u(k)

uR(t)

y(k)

x2

x1

10

ZOH

T=0. T=0

1 s s

1 1s s 1

1

k2

++

k1

1. Write the state equations of the discrete open loop system 2. Determine the state feedback gain K = [k1 k2] so that the closed loop system has a pair of complex poles with =0.5, closed loop system has a pair of complex poles with =0 5 n=8 rad/sec. 3. Calculate the response of the system to step input with the 3 Calculate the response of the system to step input with the value of K obtained above. Calculate the POT and settling time.

+

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 45

Example 2 (cont’) Discrete pole placement design –– Example 2 (cont’) Discrete pole placement design

 Solution:  Solution: 1. Write the state equations of the discrete open loop system

Step 1: State space equations of open loop continuous system: Step 1: State space equations of open loop continuous system:

sX sX

s )( )( s

 tx )( )( tx 1 1

tx )( )( tx 2 2

1 1

sX )( )( sX 2 2

sX )( )(1 sX 1





)1

sUsX )(

)(

 ( s

tx )( 2

tx )( 2

tu )( R

R

2

sX )(2

)( sX 2 s sU )( R 1s 1 s 

0 0 0

tx )( 1 tx )( )( 2

    

1    1 1  

0    1 1  

 tu )( )( R R  

  tx )( 1     tx )( )(  2

    

    

    

uR(t)

y( ) y(t)

x2 2

x1 1

10 10

ty )( )( t

10 10

0 0

  10 10

tx )( )( t 1

1 s

1 1s

1 tx )( tx )( 2

     

   

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 46

Example 2 (cont’) Discrete pole placement design –– Example 2 (cont’) Discrete pole placement design

Step 2: Transient matrix: Step 2: Transient matrix:

1 

1 

-

s

)( s 

AI 

 1

s 0

 s 

0 0 0

   

1   1  

01   10 10  

   

   

1   1 1  

    

    

   s   

    

1 s s

)1 )1

 

s )( )(  

0

s

1

1 ss ( ( ss   1 

      

      

1 

1 

L

L

1 s

  

  

1 s

)1

  

  

1 [

(

s

)]

t )( 

L

1L  

1 

0

0

L

s

1

1 ( ss  1 1  as

      

      

      

      

1 ss (  1 1     

)1    

      

      

te

)

)( )( t t  

0

 te

 1(1   

   

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 47

Example 2 (cont’) Discrete pole placement design –– Example 2 (cont’) Discrete pole placement design

Step 3: State space equation of the open loop system: Step 3: State space equation of the open loop system:

k )(

ku )(

B d

xA d k )( )( k

)1  d xC xC  d

k ( x   kc )( )( kc  

1.0

)

)(T

d A

dA

e 1.0 1.0 

0 0

 e

095.01    905.00 00 905  

    

 1(1   

   

 

 

T

)

d)( )( d  B  B

B B d d

e  

e  

   

0

 e

1.0   0

0

1.0   0

   

  1(   e 

   

  d d     

    

  d d     

1.0

  1(1          1.0 10

t

)

 1

1.0e   e  1.0e  

0)       1      1 1  

   

     e  e     e  

     

0

e t 

 e

   

 C

 10

0

Cd

T

 005.0    dB   095.0  1(1   )( t   0   1.0

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 48

Example 2 (cont’) Discrete pole placement design –– Example 2 (cont’) Discrete pole placement design

2. Calculate the state feedback gain K: 2 Calculate the state feedback gain K:

The closed loop characteristic equation:

det[

0] 

z AI  d

KB d

det

0

z

k

  k 1

2

10

.00

   

01 01    

01 .01    

095 095    905 

   

005 005.0 0    095.0 

     

       

005.01

095.0

005.0

z

k



k 1

det

0

095.0

 905

.0

095.0

 z

2 k

k 1

2

  

  

   

   

.01

005

)(

z

.0

905

.0

095

k

905

095

.0

005

k

)

0



.0) 

.0( 

z (

k 1

k 1

2

2

2

z

k 095.0

)905.1

z

.0(

k 095.0

)905.0

0

k 005.0( 1

2

k 0045 1

2

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 49

Example 2 (cont’) Discrete pole placement design –– Example 2 (cont’) Discrete pole placement design

j j 

The desired dominant poles: Th d i d d

t

l

i

z

re

* 2,1

85.01.0 

T n

r r

e e

e e

67.0 67.0

1

2 5.0181.0

693.0

2 nT 

693.0

* 2,1

67.0

z

je 

* 2,1

z

.0 0

516 516

.0 0

428 428

j j 

The desired characteristic equation:

(

z

.0

516

j

.0

428

)(

z

.0

516

j

.0

)428

0

z

03.12

z

.0

448

0

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 50

Example 2 (cont’) Discrete pole placement design –– Example 2 (cont’) Discrete pole placement design

Balancing the coefficients of the closed loop characteristic Balancing the coefficients of the closed loop characteristic equation and the desired characteristic equation, we have:

.0 0

k 095 095 k

.1 1

)905 )905

03.1 031

.0( 0(



.0(

2 k 095

.0

.0

)905

.0

448

k 005 005 k  1 k 0045 1

2

   

0.44

.6

895

k  1  k  2  2

Conclusion:

.60.44K

895

2

z

.0(

005

.0

095

k

.1

)905

z

.0(

0045

.0

095

k

.0

)905

0

k 1

k 1

2

2

03.12

z

z

.0

448

0

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 51

Example 2 (cont’) Discrete pole placement design –– Example 2 (cont’) Discrete pole placement design

3. Calculate system response and performances: 3 Calculate system response and performances:

k )(

k

(

kr )(

)1 

  xKB

B d

d

A d k )( )(

State space equation of the closed-loop system:   xC d d

x    kc )( )(  

Student continuous to calculate the response and performance by themselves following the method performance by themselves following the method presented in the chapter 8.

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 52

Design of discrete state estimators D i Design of discrete state estimators t t D i

f di f di

t t t t

ti ti

t t

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 53

The concept of state estimation The concept of state estimation

 To be able to implement state feedback control  To be able to implement state feedback control

system, it is required to measure all the states of the system. system

 However, in some application, we can only measure the output, but cannot measure the states of the system.

 The problem is to estimate the states of the system

from the output measurement. from the output measurement

 State estimator (or state observer) ) (

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 54

Observability Observability

)1 )1

( (

k k

k )( )( k

ku )( )( ku

 

B B d

 Consider the system:

x x   ky )(

xA xA d k )(

  xC d

   

 The system is complete state observable if given the control law u(k) and the output signal y(k) in a finite control law u(k) and the output signal y(k) in a finite time interval k0  k kf , it is possible to determine the initial states x(k0).

 Qualitatively, the system is state observable if all

state variable x(k) influences the output y(k). (k)

(k) i

i bl

th

fl

t

t

t

t

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 55

Observability condition Observability condition

)1 )1

( (

k k

k )( )( k

ku ku )( )(

 

B B d d

 System

x x   ky )(

xA xA d d k )(

  xC d

   

)(ˆ kx )(kx

It is require to estimate the state from mathematical It is require to estimate the state from mathematical model of the system and the input-output data.

 Observability matrix:  Observability matrix:

O O

         

y

y

rank

n

)

C  C  d  AC  d 2 2  AC d AC  d    1n 1   d AC d  The necessary and sufficient condition for the observability: (O

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 56

Example Observability –– Example Observability

( (

k k )( )(

ku ku )( )(

k k

)1 )1  

 

B B d

 Given the system

x x ky )(

xA xA d k )(

xC d

    967 967

.0 0

.0 0

148 148

31dC 

dB

where:

dA

.0

297

.0

522

.0  231 231 0      .0 264  

   

   

Analyze the observability of the system.

 Solution: Observability matrix:  Solution: Observability matrix:

O

1 077.0 0 077

3 714.1 714 1

   

   

C  d   d AC AC   d

 O   

 Because

rank

(

2

det(

484.1)

) O

O

 The system is observable

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 57

State estimator State estimator

u(k) u(k)

x(k) x(k)

y(k) y(k)

x

(

k

k )(

ku )(

)1 

Cd

xA d

B d

L

+ 

)(ˆ kx )(kx

)1 )1

(ˆ kx ( kx

Bd

Cd

1z

+ + + +

)(ˆ ky

Ad

)1 )1

)) ))

)(ˆ )(ˆ k k

ku k )( )(

ky k )(( )((

(ˆ (ˆ ky k

L L

B B d

 State estimator:

(ˆ (ˆ k k x  )(ˆ ky

xA A d )(ˆ k

 xC d

   

where:

[

T ]

l

L

nl

l 1

2

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 58

Design of state estimators Design of state estimators

 Requirements:  Requirements:

 The state estimator must be stable, estimation error should

approach to zero.

 Dynamic response of the state estimator should be fast

enough in comparison with that of the control loop.

LC

zI

)

d

0  All the roots of the equation i

A d l

t

i

 It is required to chose L satisfying: det( th i  The roots of are further from the LC )  d ( det( zI

0

) )

0 

it locates inside the unit circle in the z-plane. l l id th A zI det(   d e oo s o a unit circle than the roots of u

c c e

A d d

KB d d

 Depending on the design of L, we have different state estimator:

g

 Luenberger state observer  Kalman filter

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 59

Procedure for designing the Luenberger state observer Procedure for designing the Luenberger state observer

 Step 1: Write the characteristic equ. of the state observer i ti

1 W it

f th

t t

St

th

h

b

t

(1)

det[

0] 

z AI  d

LC d

 Step 1: Write the desired characteristic equation: n

(2)

)

0

ip

 z (

i 1

( , (

i i

n )1 ),1 n

 

are the desired poles of the state estimator are the desired poles of the state estimator

pi p

3 B l

 Step 3: Balance the coefficients of the characteristic ffi

f th

i ti

th

h

t

i

t St equations (1) and (2), we can find the gain L.

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 60

Example Design of state estimators –– Example Design of state estimators

 Problem: Given a system described by the state  Problem: Given a system described by the state

equation:

)1 )1

k )( )( k

ku )( )( k

B B d

k k ( ( x  ky )( 

xA A  d k )( xC d

   

967

.0

148

dA

dB d

 31dC  

d

.0 0

297 297

.0 0

522 522

.0     

    

231 .0       .0 0  264 264   

 Assuming that the states of the system cannot be directly  Assuming that the states of the system cannot be directly measured. Design the Luenberger state estimator so that the poles of the state estimator lying at 0.13 and 0.36. the poles of the state estimator lying at 0 13 and 0 36

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 61

Example (cont’) Design of state estimators –– Example (cont’) Design of state estimators

 Solution  Solution

 The characteristic equation of the Luenberger state estimator:

det[ det[

 

0] 0]  

z z AI AI d

LC LC d

967.0

148.0

det

z

0

l 1 l l

10 10

.0 0

297 297

.0 0

522 522

2

01     

    

    

    

    

    

    

      31   

967

z

l 1

 

det det

0 0

 l

 .0

.0 297

3 l 1 l 3

 z 

148.0  .0 522 

2

2

   

   

     

     

2

(1) (1)

z z

l 3 3 l

.1 1

489 489

) )

z z

.1( 1(

.2 2

l 753 753 l

.0 0

549 549

) )

0 0

 

 

 

 

 

 

 

l ( ( l 1

2

l 413 413 l 1

2

 The desired characteristic equation:

(2)

z

z

.0

0468

0

49.02 

(

z

)(13.0

z

0)36.0

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 62

Example (cont’) Design of state estimators –– Example (cont’) Design of state estimators

 Balancing the coefficients of the equations (1) and (2):  Balancing the coefficients of the equations (1) and (2):

489.1

49.0  l 753.2

549.0

.0

0468

l 3 2   l 413.1 1

2

l  1    

 Solve the above set of equations, we have:  Solve the above set of equations we have:

653.2

  544.1

1l    2l 

 Conclusion

653

.1

544

  .2L

T T

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 63

Simulation of discrete state estimator Simulation of discrete state estimator

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 64

State estimation simulation result State estimation simulation result

6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 65