Sie sind auf Seite 1von 95

1

Control Systems II (EEEN30041)

Lecturer: Zhengtao Ding Email: zhengtao.ding@manchester.ac.uk Webpage: http://personalpages.manchester.ac.uk/sta/Zhengtao.Ding

c 2008, 2007 Zhengtao Ding, University of Manchester

EEEN30041, School of E&EE, University of Manchester, 2008

Course Format and Assessment The course will be delivered in 20 lectures with 4 tutorials and a computer-based assignment. Assessment will be based on an assignment (10%) and examination (90%). Course material will include online lecture notes and handouts. Learning Outcomes Describe dynamic systems in continuous-time state space models, and dynamic models in discrete-time forms for industrial control applications. Design controllers in state space using state-feedback and output feedback methods including linear optimal control. Design and implement controllers in discrete-time using digital control including implementing PID in digital control. Appreciate important industrial control applications
EEEN30041, School of E&EE, University of Manchester, 2008 2

References Dorf and Bishop, Modern Control Systems Stefani, Shahian, Savant and Hostetter, Design of Feedback Control Systems Kailath, Linear Systems Ogata, Modern Control Engineering Kuo, Automatic Control Systems Nise, Control Systems Engineering

EEEN30041, School of E&EE, University of Manchester, 2008

Course Structure Part 1. State space model and control design Why state space control? Advantages and disadvantages of state space control design. Part 2. Digital control Why digital control?

EEEN30041, School of E&EE, University of Manchester, 2008

1. State Space Variables


The state variables describe the future response of a system, given the present state, the excitation inputs, and the equations describing the dynamics. Example 1. Consider a mass-spring-damper system d2 y dy M 2 + b + ky = u(t) dt dt where M is the mass, b the friction coecient, and k the spring constant. Taking the position and velocity as the state variables, ie: x1 = y dy x2 = dt
EEEN30041, School of E&EE, University of Manchester, 2008 5

(1)

the dynamics can then be written as dx1 dt dx2 dt Question: Why y and
dy dt

= x2 = b k 1 x2 x1 + u M M M

can be the state variables?

Example 2. RLC circuit dvc ic = C dt diL L dt = iL + u(t) = RiL + vc (2) (3)

with the voltage across R as the output, vo = RiL


EEEN30041, School of E&EE, University of Manchester, 2008 6

By taking x1 = vc and x2 = iL, we have dx1 dt dx2 dt y 1 1 = x2 + u(t) C C 1 R = x1 x2 L L = Rx2 (4) (5) (6)

Question: Is the set of state variables unique? Alternative choice can be x1 = vc and x2 = vL. Question: Consider a dierent RLC circuit and obtain its dynamic model.

EEEN30041, School of E&EE, University of Manchester, 2008

2. State Dierential Equations

State Space Equation

A set of rst order dierential equations can be written as

x1 = a11x1 + a12x2 + . . . + a1nxn + b11u1 + . . . + b1mum x2 = a21x1 + a22x2 + . . . + a2nxn + b21u1 + . . . + b2mum . . xn = an1x1 + an2x2 + . . . + annxn + bn1u1 + . . . + bnmum (7)
EEEN30041, School of E&EE, University of Manchester, 2008 8

We can put the above in the matrix form x1 a11 a12 d x2 a21 a22 . = . . . dt . . xn an1 an2 . . . a1n x1 b . . . b1m u1 . . . a2n x2 11 . ... . . (8) . + . . . . . ... . bn1 . . . bnm um . . . ann xn

The column vector consisting of the state variables is called state vector and it is written x1 x2 x= . . xn (9)

We may also write x Rn, as there are n state variables. Similarly we have the input vector. Using the state vector and input vector, we have the compact
EEEN30041, School of E&EE, University of Manchester, 2008 9

10

notation of the state dierential equation x = Ax + Bu where A is an n n matrix or A Rnn, and B is an n m matrix or B Rnm. We can also write the output in the compact form y = Cx + Du The dimensions of C and D depend on the dimension of the column vector y. Puting the above two equations together, we have the most common state space equation x = Ax + Bu y = Cx + Du (10) (11)

Therefore a dynamic system is characterised by the four matrices {A, B, C, D}.


EEEN30041, School of E&EE, University of Manchester, 2008 10

11

Example 3. Write down the state space equation for RLC system shown in Example 2. x = y For this example, we have A= 0
1 L 1 C R L

0
1 L

1 C R L

x+

1 C

u(t)

(12) (13)

= [0 R]x

, B=

1 C

, C = [0 R], D = 0

Question: Determine the state space matrices A, B, C, D for Example 1.

EEEN30041, School of E&EE, University of Manchester, 2008

11

12

Solution of state space equation Consider the rst order dierential equation x = ax + bu The solution is given by
t

(14)

x(t) = e x(0) +
0

at

ea(t )bu( )d

(15)

With the matrix exponential function dened by A2t2 Ak t k = I + At + + ... + + ... 2! k!

At

(16)
12

EEEN30041, School of E&EE, University of Manchester, 2008

13

we have the solution of the state space equation given by


t

x(t) = eAtx(0) +
0

eA(t )Bu( )d

(17)

Sometimes we denote (t) = eAt and (t) is referred to as the state transition matrix. Hence the above equation can be written as
t

x(t) = (t)x(0) +
0

(t )Bu( )d

(18)

It can be shown that (t) equals the inverse Laplace transform of (sI A)1.

EEEN30041, School of E&EE, University of Manchester, 2008

13

14

3. Transfer Functions from State Equations


We can obtain the transfer function for a single-input-single-output (SISO) system from its state space equation. Taking the Laplace transform of the state space equation x = Ax + Bu y we have sX(s) = AX(s) + BU (s) Y (s) = CX(s) From the rst equation, we have X(s)(sI A) = BU (s)
EEEN30041, School of E&EE, University of Manchester, 2008

(19) (20)

= Cx

(21) (22)

(23)
14

15

and X(s) = (sI A)1BU (s) Hence we have Y (s) = C(sI A)1BU (s) Therefore the transfer function G(s) =
Y (s) U (s)

(24)

(25)

is given by (26)

G(s) = C(sI A)1B Note that we can write G(s) = C(s)B, as (s) = (sI A)1 Example 4. Determine the transfer function of the RLC system in Example 3.
EEEN30041, School of E&EE, University of Manchester, 2008

15

16

Answer:
R LC R 1 s + LC L

G(s) =

s2

(27)

(s) := (sI A)1 is a matrix with elements of Laplace transformed functions. Therefore we can use inverse Laplace transform to obtain (t) which can be used to evaluate the time response. Example 5. Obtain the time respnse of the RLC system shown in Example 2, assuming R = 3, L = 1, C = 1/2, u(t) = 0 and x(0) = [1 1]T . Solution: When u(t) = 0, we have x(t) = (t)x(0)
EEEN30041, School of E&EE, University of Manchester, 2008

(28)
16

17

In this case, we have A= and (s) = 1 s2 + 3s + 2 s + 3 2 1 s (30) 0


1 L 1 C R L

0 2 1 3

(29)

From the inverse Laplace transform, we obtain (t) = and subsequently x(t) = (t)
EEEN30041, School of E&EE, University of Manchester, 2008

(2et e2t) (2et + 2e2t) (et e2t) (et + 2e2t)

(31)

1 1

e2t e2t

(32)
17

18

Remark: (t) can also be obtained by directly solving the dierential equations. Indeed, let z = T x with 1 1 . T = 1 2 It can be obtained that z = T AT 1z := Az, with A= With e we have (t) = T 1eAtT . Stability of State Variable Systems When we convert the state space model to the transfer function, we observe that
EEEN30041, School of E&EE, University of Manchester, 2008 18

1 0 0 2

At

et 0 0 e2t

19

the denominator of the transfer function is the determinant of (sI A), ie, d(s) = |sI A| (33)

Therefore the stability of the state space model depends on the characteristic polynomial of the state matrix A. The system is stable if all the poles are in the left half plane, ie, the solutions of d(s) = 0 are all with negative real parts (equivalent to the eigenvalues of A are all with negative real parts).

EEEN30041, School of E&EE, University of Manchester, 2008

19

20

4. State Space Realization and Canonical Forms


Given a transfer function, how to write its state space equations? For example, if the transfer function is given by G(s) = 6 s2 + 3s + 2 (34)

we know that its state space realization is, based on the previous RLC example, x = y = [0 0 2 1 3 3]x x+ 2 0 u(t) (35) (36)

Consider a general second transfer function b1s + b2 G(s) = 2 s + a1s + a2


EEEN30041, School of E&EE, University of Manchester, 2008

(37)
20

21

One realization is given by

x = y

0 1 a2 a1 b1]x

x+

0 1

u(t)

(38) (39)

= [b2

The state space realization is not unique. For the same transfer function, we can have another realization as x = y = [1 a1 1 a2 0 0]x x+ b1 b2 u(t) (40) (41)

Note that the state space variables in the two realizations are dierent. The rst realization is referred to as the controller canonical form, and the second as the
EEEN30041, School of E&EE, University of Manchester, 2008 21

22

observer canonical form, as one is convenient for controller design and the other is convenient for observer design. Controller Canonical Form For a general transfer function given by (assuming the numerator and the denominator are coprime) b1sn1 + b2sn2 + . . . + bn G(s) = sn + a1sn1 + . . . + an the controller canonical form is given by 0 1 ... 0 . . ... . . . . x = x + 0 0 ... 1 an an1 . . . a1 y = [bn bn1 ... b1]x 0 . . u(t) 0 1 (42)

(43)

(44)
22

EEEN30041, School of E&EE, University of Manchester, 2008

23

Observer Canonical Form For the above transfer function, the observer canonical form is given by a1 1 ... 0 b1 . . ... . . . . . . u(t) x = x+ an1 0 . . . 1 bn2 an 0 . . . 0 bn1 y = [1 0 ... 0]x

(45)

(46)

Example 5. Put the state space equation shown for the RLC system into the controller and observer canonical forms.

EEEN30041, School of E&EE, University of Manchester, 2008

23

24

5. Controllability and Observability


Controllability: A system is completely controllable if there exists a control input u(t) that can transfer any initial state x(0) to any other desired location x in a nite time. We can check the controllability of the system x = Ax + Bu y = Cx (47) (48)

by examining the algebraic condition rank[B AB . . . An1B] = n For a SISO system, we have B as a vector, and therefore if we dene Pc = [B AB . . . An1B]
EEEN30041, School of E&EE, University of Manchester, 2008

(49)

(50)
24

25

then Pc is an n n matrix. In this case, to check the controllability is equivalent to check if the determinant of Pc is nonzero. Example 6. Check the controllability of the system x = y where d is a constant. Observability: A system is completely observable if and only if there exists a nite time T such that the initial state x(0) can be determined from the observation history y(t) given the control u(t). For a SISO system x = Ax + Bu
EEEN30041, School of E&EE, University of Manchester, 2008

2 0 d 3 1]x

x+

1 0

u(t)

(51) (52)

= [0

(53)
25

26

= Cx

(54)

the system is completely observable is the determinant of the observability matrix C CA Po = . . CAn1 is nonzero. Example 7. Check the observability of the system x = y = [1 2 0 1 1 1]x x+ 1 1 u(t) (56) (57) (55)

EEEN30041, School of E&EE, University of Manchester, 2008

26

27

Tutorial 1
Question 1. An inverted pendulum can be described by the following set of dierential equations M y + ml u(t) = 0 ml + ml2 mlg = 0 y (58) (59)

where M is the mass of the cart, and m is the mass of the ball over the pendulum with m << M , y is the horizontal position of the cart, l is the length of the pendulum and is the angle of the pendulum, u is the control input. Write the state space equation of the this system. Question 2. A system is described by the following dierential equation x = 1 0 2 3 x+ 0 1 u(t) (60) (61)
EEEN30041, School of E&EE, University of Manchester, 2008 27

28

Determine (s) and (t) of the system. Question 3. Obtain the transfer function of the following state space system x = y = [1 1 0 2 3 0]x x+ 0 1 u(t) (62) (63)

Question 4. Write the state space equations in the controller and observer canonical forms for the following systems described by the transfer functions G1(s) = s+1 s+1 , G2 = 2 s2 + 5s + 5 4s + 4s + 1 (64)

Question 5. Determine the controllability and observability of the state space systems described in Question 3.
EEEN30041, School of E&EE, University of Manchester, 2008 28

29

Question 6. Determine the controllability and observability of the state space systems x = y = [1 3 1 2 0 0]x x+ 1 1 u(t) (65) (66)

If the system is not controllable or observable, can you explain why?

EEEN30041, School of E&EE, University of Manchester, 2008

29

30

6. Full State Feedback Design


In the rst step in the state variable design, we assume all the state variables are available for feedback control. In this case, we can design the control input as u = Kx (67)

where K is the gain matrix. The full state feedback design is to decide a suitable feedback gain matrix K. For the closed-loop control system, we have x = Ax + B(Kx) = (A BK)x (68)

The stability of the closed-loop system depends on the characteristic polynomial of (A BK) Pole Assignment. To assign the closed loop poles at given locations via full state feedback.
EEEN30041, School of E&EE, University of Manchester, 2008 30

31

Pole assignment can be achieved if the system is completely controllable. Example 8. Design a full state feedback control of the system described by d3 y d2y dy + 5 2 + 3 + 2y = u dt3 dt dt such that the closed-loop poles are at {1, 2, 3} respectively. Solution: The transfer function of the system is 1 G(s) = 3 s + 5s2 + 3s + 2 If we realize the system in the controller canonical form, we have 0 1 0 0 0 1 x + 0 u(t) x = 0 2 3 5 1
EEEN30041, School of E&EE, University of Manchester, 2008

(69)

(70)

(71)

31

32

= [1 0 0]x

(72)

If the control input is designed as u = [k1 k2 k3]x The closed-loop system is given by 0 1 0 0 1 x + x = 0 2 3 5 0 1 0 0 = (k1 + 2) (k2 + 3) (73)

0 0 ([k1 k2 k3]x) 1 0 x := (A BK)x 1 (k3 + 5)

(74)

(75)

The closed-loop characteristic polynomial is |sI (A BK)| = s3 + (k3 + 5)s2 + (k2 + 3)s + (k1 + 2)
EEEN30041, School of E&EE, University of Manchester, 2008

(76)
32

33

Comparing it with the desired characteristic polynomial (s + 1)(s + 2)(s + 3) = s3 + 6s2 + 11s + 6 we have k3 = 1, k2 = 8, k1 = 4, ie, K = [4 8 1] Therefore the control input is designed as u = [4 8 1]x = 4x1 8x2 x3 Note that for this realization we have x1 = y, x2 = input is then expressed as dy d2y u = 4y 8 2 dt dt
EEEN30041, School of E&EE, University of Manchester, 2008

(77)

(78)

(79)
d2 y . dt2

dy dt

and x3 =

The control

(80)
33

34

Question: Design a state feedback controller the RLC circuit described by x = 0 2 1 3 x+ 2 0 u(t) (81)

to place the closed-loop poles as {2, 2}.


1 Answer: u = [ 2 , 1 ]x = (x1 x2)/2. 2

Question: How to implement the feedback control if only the output y is available? From Example 8 we have seen the convenience of using the controller canonical form for the full state feedback design. In fact, for a given state space system, we can transform the system to the controller canonical form if the system is controllable. To avoid the state transform, we have Ackermanns formula for the full state feedback control design. Ackermanns Formula. For a system {A, B}, the state feedback control gain K for the closed loop control u = Kx to achieve the desired closed-loop characteristic
EEEN30041, School of E&EE, University of Manchester, 2008 34

35

polynomial d(s) = sn + 1sn1 + . . . + n is given by


1 K = [0 0 . . . 1]Pc d(A)

(82)

(83)

where d(A) = An + 1An1 + . . . + nI and Pc is the controllability matrix. Question: Applying Ackermanns Formula for state feedback control design for the RLC circuit shown in the previous question. Hint: d(s) = s2 + 4s + 4, and d(A) = A2 + 4A + 4I =
EEEN30041, School of E&EE, University of Manchester, 2008

(84)

2 2 1 1

.
35

36

7. Observer Design
Full state feedback control needs the values of all the state variables. In industrial systems, it is common that not all the state are available, and in this case, an observer can be designed to provide an estimate of the unknown state variables. Luenberger Observer. For a dynamic system x = Ax + Bu y a full-state observer is designed as x = A + Bu + L(y C x) x (87) = Cx (85) (86)

where x denotes the estimate of the state variable, and L is the observer gain.
EEEN30041, School of E&EE, University of Manchester, 2008 36

37

Dene the observer error as e=xx we have the error dynamics e = (Ax + Bu) (A + Bu + L(y C x)) x = (A LC)e (89) (88)

To ensure the error asymptotically converge to zero as t , we need the characteristic equation |sI (A LC)| = 0 to have all the roots in the left half of the complex plan. Example 9. Design a full state observer 5 1 x = 3 0 2 0
EEEN30041, School of E&EE, University of Manchester, 2008

for the dynamic system 0 0 1 x + 0 u(t) 0 1

(90)

37

38

= [1 0 0]x

(91) form. For L = [l1 l2 l3]T , (l1 + 5) 1 0 (l2 + 3) 0 1 (l3 + 2) 0 0 (92)

Solution: Note the system is in the observer canonical we have l1 5 1 0 A LC = 3 0 1 l2 [1 0 0] = l3 2 0 0 The characteristic polynomial is

|sI (A LC)| = s3 + (l1 + 5)s2 + (l2 + 3)s + (l3 + 2)

(93)

If we place the poles for the observer at {2, 2, 2}, the desired characteristic polynomial is (s + 2)3 = s3 + 6s2 + 12s + 8
EEEN30041, School of E&EE, University of Manchester, 2008

(94)
38

39

By comparing the polynomials we have l1 = 1, l2 = 9, l3 = 6, ie, L = [1 9 6]T The full state observer is given by 1 0 5 1 0 x x = 3 0 1 x + 0 u(t) + 9 (y [1 0 0]) 6 1 2 0 0 (95)

(96)

The observer canonical form makes the design of observer gain easier. For the system what is not in the observer canonical form, we can still evaluate the characteristic polynomial, and then by comparing the coecients with the desired one to obtain the observer gain matrix. For design observer gains, we also have Ackermanns formula. Ackermanns Formula. For a system {A, B, C}, the observer gain L to achieve the
EEEN30041, School of E&EE, University of Manchester, 2008 39

40

desired closed-loop characteristic polynomial d(s) = sn + 1sn1 + . . . + n is given by


1 L = d(A)Po [0 0 . . . 1]T

(97)

(98)

where d(A) = An + 1An1 + . . . + nI and Po is the observability matrix. (99)

EEEN30041, School of E&EE, University of Manchester, 2008

40

41

8. Compensator Design
We aim at design dynamic feedback control from the system output. There are three steps in the compensator design. Full state feedback design Full state observer design Compensator design using the state estimate to replace the state variable in the full state control design The nal control design is given by u = K x(t) Question: How to ensure the stability of the closed-loop system?
EEEN30041, School of E&EE, University of Manchester, 2008 41

(100)

42

The separation principle plays an important part. Consider the system x = Ax + Bu y with the observer x = A + Bu + L(y C x) x and the control law u = K x(t) The closed-loop system with the observer can be written as x = Ax BK x
EEEN30041, School of E&EE, University of Manchester, 2008 42

(101) (102)

= Cx

(103)

(104)

43

x = A BK x + LC(x x) x In terms of the state variable x and observer error e = x x, we have x = (A BK)x + BKe e = (A LC)e Treating [xT , eT ]T as the augmented state variable, we have d dt x e = A BK 0 BK A LC x e (105)

The characteristic polynomial of the augmented system is given by sI A BK 0 BK A LC = |sI (A BK)||sI (A LC)| (106)
43

EEEN30041, School of E&EE, University of Manchester, 2008

44

Therefore if |sI (A BK)| = 0 and |sI (A LC)| = 0 have all the roots in the left half of the complex plane, the augmented system is stable. This is the separation principle. Example 9. Design a dynamic output feedback control (compensator) for the system x = y 0 1 1 1 x+ 0 1 u(t) (107) (108)

= [1 0]x

The poles for the closed loop controller are at {1, 1} and the poles for the observer error dynamics are at {2, 2}.

EEEN30041, School of E&EE, University of Manchester, 2008

44

45

Tutorial 2
Question 7. Design a full state feedback control u = Kx for the dynamic system described by 0 0 1 0 (109) x = 0 0 1 x + 0 u(t) 1 1 0 2 such that the closed-loop system has the poles at {2, 1 2j}. Question 8. The dynamics of a rocket is described by x = y 0 0 1 0 x+ 1 0 u(t) (110) (111)

= [0 1]x

The control input is designed as u = 2x1 x2. Determine the roots of the characteristic equation.
EEEN30041, School of E&EE, University of Manchester, 2008 45

46

Question 9. For the dynamic system described in Question 8, how to change the control input such that the roots of the closed-loop systems are at {2 j}. Question 10. Consider a second order system x = y 1 0 3 1 x+ 1 0 u(t) (112) (113)

= [0 1]x

Design an observer such that the observer poles are at {1 j}. Question 11. Design a full state observer for the dynamic system described by 2 1 0 0 x = 2 0 1 x + 0 u(t) 1 0 0 1 y = [1 0 0]x

(114) (115)
46

EEEN30041, School of E&EE, University of Manchester, 2008

47

such that the observer has the poles at {2, 1 2j}. Question 12. Consider a state space compensator for the system x = y 1 0 3 2 x+ 1 0 u(t) (116) (117)

= [0 1]x

with the closed loop poles at {1 j}, and the observer poles at {2 j}.

EEEN30041, School of E&EE, University of Manchester, 2008

47

48

9. Tracking and Internal Model Design


Consider x = Ax + Bu y = Cx (118) (119)

We need to design a control input such that the output asymptotically tracks a given reference r, which can be written as the output for the reference state space model xr = Ar x r (120) (121)

r = dr xr

Consider the case of tracking a constant reference, we have the reference model as xr
EEEN30041, School of E&EE, University of Manchester, 2008

= 0

(122)
48

49

r = xr

(123)

Dene the tracking error e = y r. Taking the derivative of the tracking error gives e = y = Cx (124)

Let us use the notation z = x and v = u. Take e and z as the state variable of an augmented state space system d dt e z = 0 C 0 A e z + 0 B v (125)

If the augmented system is controllable, we can design a state feedback controller in the form v = k1e k2z
EEEN30041, School of E&EE, University of Manchester, 2008

(126)
49

50

where k2 is a matrix (vector) in general. The state feedback ensures the stability of the augmented system which implies the asymptotic tracking with e converging to zero. The control is input is given by integrating v as
t

u(t) = k1
0

e( )d k2x(t)

(127)

The integration in the above equation reects the dynamics of the tracking signal. It is clear to see in a block diagram that the controller acts as an internal model. Example 10. Internal model design for a unit step input for the system x = y 0 1 2 2 x+ 0 1 u(t) (128) (129)

= [1 0]x

by placing the pools of the augmented system at {1 j, 10}.


EEEN30041, School of E&EE, University of Manchester, 2008 50

51

The same control design can be extended to the case of tracking a polynomial of time. Question: How to design an internal model based controller to track a sinusoidal signal?

EEEN30041, School of E&EE, University of Manchester, 2008

51

52

10. Optimal Control


The performance of a control system can be represented by a performance index such as
tf

J=
0

g(x, u, t)dt

(130)

Optimal control is concerning with the control design to minimize a performance index. Consider a particular performance index
tf

J=
0

xT Qxdt

(131)

where Q is an n n positive denite matrix. To simplify the problem, we let tf tend to innity, that is, the index is given by

J=
0
EEEN30041, School of E&EE, University of Manchester, 2008

xT Qxdt

(132)
52

53

How to design a full state feedback law to minimise the index? Consider the control design u = Kx for x = Ax + Bu. The closed-loop system is x = (A BK)x := Hx If we have a positive denite matrix P such that d T (x P x) = xT Qx dt then substituting the above into the performance index, we have

(133)

(134)

J =
0

d T (x P x)dt = xT P x |0 = xT (0)P x(0) dt

(135)

where we assume that the closed-loop system is stable (x() = 0).


EEEN30041, School of E&EE, University of Manchester, 2008 53

54

A direct evaluation gives d T (x P x) = xT P x + xT P x dt = xT H T P x + xT P Hx = xT (H T P + P H)x From the dierential equation


d T dt (x P x)

(136)

= xT Qx we have (137)
T x Qxdt 0

H T P + P H = Q Therefore the optimal control design with the performance index J = can be carried out in two steps: Solve the matrix equation H T P + P H = Q
EEEN30041, School of E&EE, University of Manchester, 2008

(138)
54

55

to obtain matrix P that depends on the control gain K. Minimize the index J = xT (0)P x(0) to determine the control gain or other parameters in the system. Example 11. Design the state feedback control K = [k1 k2] by restricting k1 = 1 with the optimal control index of Q = I and x(0) = [1 1]T for the system x = 0 1 0 0 x+ 0 1 u(t) (140) (141) Example 12. Continue from Example 11 by restricting the control gain as K = [k k] (ie., k1 = k2) and x(0) = [1 0]T .
EEEN30041, School of E&EE, University of Manchester, 2008 55

(139)

56

Solution: Solving the matrix equation H T P + P H = I gives p11 = 1 + 2k 2k (142)

It is easy to see the control index is given by J = xT (0)P x(0) = p11 = 1 + 1 2k (143)

The minimum value of J is obtained when k tends to innity.

EEEN30041, School of E&EE, University of Manchester, 2008

56

57

11. Linear Quadratic Regulator


Consider the solution of Example 12. The bigger the controller gain, the smaller the performance index; there is no optimal solution of the control gain. This is due to the fact that we did not consider the control eort in the performance index. In engineering systems, the bigger control input eorts often mean the bigger energy consumption. To consider the input in the performance index, we often dene

J=
0

[xT Qx + uT Ru]dt

(144)

where R is a positive denite matrix. For SISO case, we have R as a constant scaler. Consider the full state feedback control u = Kx, the performance index can be
EEEN30041, School of E&EE, University of Manchester, 2008 57

58

written as

J=
0

[xT Qx + xT K T RKx]dt :=
0

xT Sxdt

(145)

where S = Q + K T RK (146)

Similar to the case with no control in the performance index, we need to solve a matrix equation H T P + P H = S and the performance index is then given by

(147)

J=
0

[xT Qx + xT K T RKx]dt :=
0

xT Sxdt = x(0)T P x(0)

(148)
58

EEEN30041, School of E&EE, University of Manchester, 2008

59

Example 13. Repeat Example 12 with the new performance index

J=
0

[xT x + ru2]dt

(149)

General Solution for Linear Quadratic Regulator: Consider a dynamic system described by x = Ax + Bu The optimal control input for the performance index

(150)

J=
0

[xT Qx + uT Ru]dt

(151)

is given by u = R1B T P x
EEEN30041, School of E&EE, University of Manchester, 2008

(152)
59

60

where P satises AT P + P A P BR1B T P + Q = 0 (153)

This equation is often referred to as the matrix algeraic Riccati equation, and it can be easily solved using Matlab.

EEEN30041, School of E&EE, University of Manchester, 2008

60

61

Tutorial 3
Question 13. Consider a dynamic system x = y 0 1 3 2 x+ 0 1 u(t) (154) (155)

= [1 0]x

Design a state feedback controller such that the system output tracks a constant r. Question 14. Consider a rst order dynamic system x=x+u The control input is designed as u = kx
EEEN30041, School of E&EE, University of Manchester, 2008

(156)

(157)
61

62

such that the system is stale. Evaluate the performance index

J=
0

x2dt

(158)

with x(0) = 2, and hence obtain an optimal value of k such that J is minimum. Question 15. Repeat the optimal control design in Question 14, with the control performance index

J=
0

[x2 + ru2]dt

(159)

where r is a constant. Question 16. consider a dynamic system described by x = 0 1 0 0 x+ 0 1 u(t) (160)
62

EEEN30041, School of E&EE, University of Manchester, 2008

63

The initial value is given as x(0) = [1, 1]T . With the feedback control in the form of u = kx1 kx2 obtain the relation between the performance index given by

(161)

J=
0

xT xdt

(162)

and the controller gain k. Question 17. Re-design the optimal control gain k in Question 16 using the optimal control index

J=
0
EEEN30041, School of E&EE, University of Manchester, 2008

(xT x + u2)dt

(163)
63

64

Question 18. Determine the roots of the closed-loop control systems obtained in Questions 15, 16 and 17.

EEEN30041, School of E&EE, University of Manchester, 2008

64

65

12. Digital Control and Sampled Data System


Question: Why digital control? Due to the application of digital computers in industrial control systems. [There are also some inherently discrete-time systems.] Sampled Data. Sampled data (or a discrete signal) are data obtained for system variables only at discrete time intervals. We assume the sampling at the same xed period, T , which is called the sampling period. The sampled data for a continuous time variable x(t) are denoted by x(kT ) with k taking the values of integers. How to decide the sampling period? It depends on the dynamics of the system, the required accuracy and hardware constraints.
EEEN30041, School of E&EE, University of Manchester, 2008 65

66

Sampler. An ideal sampler is a switch that closes for every T seconds for a instant. For an continuous time signal r(t), sampled at kT , the output from the sampler r(t) is an impulse signal, r(t) = r(kT )(t kT ) where is the impulse function. Zero-order-hold. After the sampling, it is assumed that the value is kept at same until next sampling, ie, the value of x(t) is assumed to be at the constant of x(kT ) for kT t < (k + 1)T . The impulse response of the zero-order-hold is given by 1, 0 t < T 0, otherwise.

g0(t) =
EEEN30041, School of E&EE, University of Manchester, 2008

(164)
66

67

and therefore its transfer function is given by 1 1 T s 1 eT s G0(s) = e = s s s Quantization error. An error due to a computers nite word size. (165)

EEEN30041, School of E&EE, University of Manchester, 2008

67

68

13. The z-Transform


The output from an ideal sampler is a sequence of impulses with values r(kT ), and we write

r(t) =
k=0

r(kT )(t kT )

(166)

Taking the Laplace transform of the above equation, we have


L{r(t)} =
k=0

r(kT )ekT s =
k=0

r(kT )(eT s)k

(167)

We dene the z-transform as

R(z) = Z{r(t)} =
k=0
EEEN30041, School of E&EE, University of Manchester, 2008

r(kT )z k

(168)

68

69

with z = eT s. Similar to the notation for the Laplace transformed functions, a capital letter R denotes the z-transformed functions of r(t). Example 14. Determine the z-transform for the unit step function u(t).

U (z) =
k=0

u(kT )z k =
k=0

z k =

1 z = 1 z 1 z 1

(169)

Example 15. Determine the z-transform of eat.


F (z) =
k=0

eakT z k =
k=0

(eaT z)k

z 1 = 1 (eaT z)1 z eaT

EEEN30041, School of E&EE, University of Manchester, 2008

69

70

The z-transform table x(t) (t) (t kT ) u(t), unit step t eat sin t cos t eat sin t eat cos t X(s) 1 ekT s 1/s 1/s2
1 s+a 2 + 2 s s 2 + 2 s (s+a)2 + 2 s+a (s+a)2 + 2

X(z) 1 z k
z z1 Tz (z1)2 z zeaT z sin T 2 2z cos T +1 z z(zcos T ) 2 2z cos T +1 z zeaT sin T z 2 2zeaT cos T +e2aT z 2 zeaT cos T z 2 2zeaT cos T +e2aT

EEEN30041, School of E&EE, University of Manchester, 2008

70

71

Inverse z transform Partial fraction method (similar to inverse Laplace transform) Long division Transfer function of an open loop system We need to multiply the transfer function of the zero-order-hold to the system transfer function Gp(s). G(z) = Z{G0(s)Gp(s)} (170)

Example 16. Determine the z-transfer function of Gp(s) =


EEEN30041, School of E&EE, University of Manchester, 2008

1 s(s+1) .
71

72

1 eT s 1 1 1 1 T s = (1 e )( 2 + ) G(s) = s s(s + 1) s s s+1 It follows that 1 1 1 G(z) = (1 z )Z( 2 + ) s s s+1 Tz z z = (1 z 1)( ) + 2 T (z 1) z1 ze


1

(171)

(zeT z + T z) + (1 eT T eT ) (z 1)(z eT )

EEEN30041, School of E&EE, University of Manchester, 2008

72

73

14. Discrete-time Systems


Dierence equation Consider y(k + n) + a1y(k + n 1) + . . . + any(k) = b1u(k + n) + . . . + bnu(k) (172) The solution of this dierence equation can be obtained by iteration using y(k + n) = a1y(k + n 1) . . . any(k) + b1u(k + n 1) + . . . + bnu(k) 173) ( if necessary initial values are unknown. Transfer function Note that z 1 and z can be used as a shift operator. It can be shown that Z{y(k 1)} = z 1Z{y(k)} = z 1y(z)
EEEN30041, School of E&EE, University of Manchester, 2008 73

74

Z{y(k + 1)} = zZ{y(k)} = zy(z) (174) In fact, from the denition, we have z 1 = eT s, a delay operator in Laplace domain. Taking z-transform of the dierence equation z nY (z) + a1z n1Y (z) + . . . + anY (z) = b1z n1U (z) + . . . + bnU (z) and the transfer function is given by Y (z) b1z n1 + . . . + bn G(z) = = n U (z) z + a1z n1 + . . . + an
EEEN30041, School of E&EE, University of Manchester, 2008

(175)

(176)
74

75

and nally we have b1z 1 + . . . + bnz n G(z) = 1 + a1z 1 + . . . + anz n System response using dierence equation For a given transfer function, we can obtain the dierence and then obtain the system responses using the dierence equation. Example 17. For the system considered in Example 16 with T = 1, determine the rst four terms of the output subject to the impulse input, assuming y(2) = y(1) = 0. For T = 1, we have the transfer function G(z) = Y (z) 0.3678z + 0.2644 = 2 U (z) z 1.3678z + 0.3678 (178)
75

(177)

EEEN30041, School of E&EE, University of Manchester, 2008

76

The dierence equation is obtained as y(k + 2) 1.3678y(k + 1) + 0.3678y(k) = 0.3678u(k + 1) + 0.2644u(k) (179) or y(k + 2) = 1.3678y(k + 1) 0.3678y(k) + 0.3678u(k + 1) + 0.2644u(k) (180) Note the {u(k)} = {1, 0, . . . , 0, . . .}. We have y(0) = 1.3678y(1) 0.3678y(2) + 0.3678u(1) + 0.2644u(2) = 0 (181)

y(1) = 1.3678y(0) 0.3678y(1) + 0.3678u(0) + 0.2644u(1) = 0.3678 (182) and y(2) = 0.7675 and y(3) = 0.9145.
EEEN30041, School of E&EE, University of Manchester, 2008 76

77

The method shown in the above example can also be used for evaluation of inverse z transform. Indeed, from partial fraction expansion, we have, taking U (z) = 1, Y (z) = G(z)U (z) = and y(k) = z 1(Z 1{ z z + 0, 6322 }) = (1)k1 0.6322(0.3678)k1 z1 z 0.3678 0.3678z + 0.2644 1 1 = + 0, 6322 z 2 1.3678z + 0.3678 z 1 z 0.3678

EEEN30041, School of E&EE, University of Manchester, 2008

77

78

15. Closed-loop Transfer Functions and Stability


Closed-loop transfer function Consider a closed-loop system Y (z) = G(z)U (z) U (z) = D(z)E(z) E(z) = R(z) Y (z) (183) (184) (185)

where D(z) denotes the transfer function of a digital controller, and E(z) and R(z) denote the feedback error and the reference signal. The closed-loop transfer function is obtained as G(z)D(z) Y (z) = R(z) 1 + G(z)D(z)
EEEN30041, School of E&EE, University of Manchester, 2008

(186)
78

79

The above result is the same for the closed-loop transfer function of the continuous-time system. In general, the block diagram manipulation follows in the same way as the block diagram manipulation of the continuous-time systems. Stability analysis Conside the mapping between s-plane and z-plane. Let s = + j and we have z = eT s = e+j (187)

It can be seen that for < 0 we have |z| < 1, that is, the left-half of the s plane corresponds to the area within the unit circle in z-plane. Therefore we have the following statement. A sampled (discrete-time) system is stable if all the poles of the closed-loop transfer function lie within the unit circle of the z-plane. Example 18. The open-loop transfer function considered in Example 17 is under a
EEEN30041, School of E&EE, University of Manchester, 2008 79

80

closed-loop control with the controller D(z) = K, a constant. Evaluate the stability for the closed-loop system when K = 1 and K = 10. The closed-loop transfer function is given by K z20.3678z+0.2644 KG(z) 1.3678z+0.3678 = 1 + KG(z) 1 + K z20.3678z+0.2644 1.3678z+0.3678 and therefore the characteristic equation is d(z) = z 2 + (0.3678K 1.3678)z + (0.2644K + 0.3678) For K = 1, we have d(z) = z 2 z + 0.6832 = 0 (190) (189) (188)

and the poles, z1,2 = 0.50 j0.6182, are within the unit circle and the system is
EEEN30041, School of E&EE, University of Manchester, 2008 80

81

stable. For K = 10, we have d(z) = z 2 + 2.310z + 3.012 = 0 (191)

and the poles, z1,2 = 1.155 j1.295, are outside the unit circle and the system is unstable. Example 19. Range of T for stability Consider a unit feedback sampled-data system with the plant transfer function 10 Gp = s+1 . Determine the range of the sampling interval to ensure the closed-loop stability. Let 1 eT s 10 1 1 T s G(s) = = (1 e )10( ) s s+1 s s+1
EEEN30041, School of E&EE, University of Manchester, 2008 81

82

Taking z-transform, we have 1 1 eT z G(z) = (1 z 1)10( = 10 z 1 z eT z eT The closed-loop transfer function is obtained as G(z) Gc(z) = = 1 + G(z) 1
1eT 10 zeT 1eT + 10 zeT

10(1 eT ) = z eT + 10(1 eT )

The characteristic equation is given by z eT + 10(1 eT ) = 0 or z = 10 11eT . For the stability, we need |z| < 1, ie, 1 < 10 11eT < 1
9 which gives 0 < T < ln 11 or 0 < T < 0.2007.
EEEN30041, School of E&EE, University of Manchester, 2008 82

83

Tutorial 4
Question 19. Determine the z-transfer functions of the following plants (Hint: A ZOH should be added in each case): 1 1) G1(s) = s(s+5) s+2 2) G2(s) = (s+1)(s+3) 3) G3(s) =
10e2T s s+5

Question 20. A plant is described by the transfer function Y (s) 5 = U (s) s(s + 5) (192)

and the systems input and output are sampled with a sampling interval T = 0.1 second. 1) Obtain the z transfer function between the input and the output. 2) Obtain the dierence equation relating y(k) and u(k).
EEEN30041, School of E&EE, University of Manchester, 2008 83

84

3) Determine the system output (rst ve steps) under a unit step using the dierence equation obtained in 2) .
(s) 10 Question 21. A rst order system Y (s) = s+5 is sampled at every T seconds. The U control law for the system is designed as u(kT ) = Ky(kT ) where K is the controller gain.

1) Determine the range of the sampling interval T such that the closed-loop system is stable with K = 10. 2) Determine the range of controller gain K such that the closed-loop system is stable with T = 0.1 second. Question 22. Consider a discrete-time system Y (z) 0.4z + 0.2 = 2 U (z) z 1.4z + 0.4 with feedback control u(k) = Ky(k).
EEEN30041, School of E&EE, University of Manchester, 2008 84

(193)

85

1) Obtain the closed-loop transfer function and the characteristic equation of the closed-loop system, and then determine the stability of the system with K = 1 and K = 10 respectively. 2) Suggest a method to determine the range of the controller gain K such that the closed system is stable.

EEEN30041, School of E&EE, University of Manchester, 2008

85

86

16. Discrete-time State Space Systems


State Dierence Equation Similar to the state dierential equations, we have state dierence equation x(k + 1) = Ax(k) + Bu(k) y(k) = Cx(k) + Du(k) where x(k) is the state vector at the step k. System Response The response can be evaluated repeatedly with the given initial values: x(1) = Ax(0) + Bu(0) x(2) = Ax(1) + Bu(1) = A2x(0) + ABu(0) + Bu(1)
EEEN30041, School of E&EE, University of Manchester, 2008 86

(194) (195)

87

. . x(k) = Ak x(0) + Ak1Bu(0) + . . . + Bu(k 1)

Controllability and Observability The controllability and observability can be checked in the same ways as for the continuous-time systems. The system is controllable if the controllability matrix Pc = [B AB . . . An1B] has full rank, and the system is observable if the observability matrix C CA Po = . . CAn1
EEEN30041, School of E&EE, University of Manchester, 2008

(196)

(197)

87

88

has full rank. Transfer functions from state dierence equations Taking z-transform of x(k + 1) = Ax(k) + Bu(k), we have (zI A)X(z) = BU (z) X(z) = (zI A)1BU (z) (198) and Y (z) = CX(z) = C(zI A)1BU (z) Therefore the transfer function is given by G(z) = Y (z) = C(zI A)1B U (z) (200)
88

(199)

EEEN30041, School of E&EE, University of Manchester, 2008

89

Note that the transfer function is in the same form as for the continuous-time case, with the only dierence that s is replaced by z. We would expect the same kind of state space realizations for discrete-time transfer functions, and this indeed is the case. State space realization The canonical forms corresponding to the transfer functions in s domain work in the same way for z domain. Example 20. Obtain the state dierence equation for the transfer function 0.3678z + 0.2644 G(z) = 2 z 1.3678z + 0.3678 The realization in the controller canonical form is given by x(k + 1) = 0 1 0.3678 1.3678 x(k) + 0 1 u(k) (202)
89

(201)

EEEN30041, School of E&EE, University of Manchester, 2008

90

= [0.2644

0.3678]x

(203)

Stability The characteristic equation for the transfer function in z domain is given by d(z) = |zI A| = 0 (204)

The system is stable if all the roots of the characteristic equation are within the unit circle. Full State Feedback Control Design Design the full state feedback control as u(k) = Kx(k)
EEEN30041, School of E&EE, University of Manchester, 2008

(205)
90

91

which gives the closed-loop system x(k + 1) = (A BK)x(k) (206)

The full-state feedback control can be used to place the poles of the closed-loop system at the desired positions, if the system is controllable. Example 21. Design the full state feedback control law for the system in Example 20 to place the poles at {0.5, 0.5}.

EEEN30041, School of E&EE, University of Manchester, 2008

91

92

17. Implementation of Digital Controllers


There are two methods for design a digital controller. Emulation method, ie, design the controller in continuous-time and then convert to discrete-time. Direct digital design, including discrete-time pole placement via full state feedback shown in the previous section. Digital implementation of PID controllers In s domain, we have the transfer function for a PID controller as U (s) k2 = Gc(s) = k1 + + k3 s X(s) s We need approximations for dierentiation and integration in discrete-time.
EEEN30041, School of E&EE, University of Manchester, 2008 92

(207)

93

Backward dierence rule for dierentiation u(KT ) = dx 1 |t=kT = (x(kT ) x((k 1)T ) dt T (208)

The z-transform for this equation is given by 1 z 1 z1 U (z) = X(z) = X(z) T Tz Forward-rectangular integration u(kT ) = u((k 1)T ) + T x(kT ) and the z-transform gives Tz U (z) = X(z) z 1
EEEN30041, School of E&EE, University of Manchester, 2008

(209)

(210)

(211)
93

94

The z domain transfer function for the PID controller is given by U (z) k2 T z z1 = k1 + + k3 X(z) z1 Tz The dierence equation for this transfer function is k3 u(kT ) = u((k 1)T ) + (k1 + k2T + )x(kT ) T 2k3 k3 (k1 + )x((k 1)T ) + x((k 2)T ) T T (212)

(213)

This is called the velocity form of PID implementation, as the control input at the current step is calculated based on the control input in the previous step, and the contribution in the current step only contributes to the change of the control input.
EEEN30041, School of E&EE, University of Manchester, 2008 94

95

Question: A PI controller is designed as equation for controller implementation. Hint:


U (z) X(z)

U (s) X(s)

= 10(1 + 1 ). Find the dierence s

109z 1 . 1z 1

EEEN30041, School of E&EE, University of Manchester, 2008

95

Das könnte Ihnen auch gefallen