Lec 6: State Feedback, Controllability, Integral Action November 22, 2017 Lund University, Department of Automatic Control
Controllability and Observability Example of Kalman decomposition 1 s 1 x 10 x 20 2 s+2 + y u x 30 3 s+3 x 40 4 s 4 How does the system behave? From outside the blue box we only see the input u and output y but a lot can happen inside!! 1
Controllability and Observability Example of Kalman decomposition 1 s 1 x 10 x 20 2 s+2 + y u x 30 3 s+3 x 40 4 s 4 Introduce states and write the system in state-space form. 1
Controllability and Observability How well can we control two subsystems at the same time? Q: Are there any differences for the two cases below and how does it depend on gain b? u y 1 1 s+1 b 2 s+2 y 2 u y 1 1 s+1 b 1 s+1 y 2 2
Different Ways to Describe a Dynamical System Differential equation ÿ + a 1ẏ + a 2y = b 1 u + b 2u x 1 = y x 2 = ẏ... State space ẋ = Ax + Bu y = Cx + Du Collection of Formulae G(s) = C(sI A) 1 B + D ( ) d L n f (t) (s) = s n F (s) dt n Transfer function Y (s) = G(s)U(s) = Q(s) P(s) U(s) 3
Recap of states and statespace realization Physical systems are modeled by differential equations. Example: Damped spring-mass system (ẏ velocity, y position) mÿ(t) = cẏ(t) ky(t) + F (t) The state vector x is a collection of physical quantities required to predict the evolution of the system x 1 x 2 x =. x i s could be positions, velocities, currents, voltages, queue lengths, number of virtual machines, temperatures, concentrations, etc. x n 4
Recap of states and statespace realization The evolution of the state vector (for an LTI system), subject to an external signal u, can be described by ẋ = Ax + Bu where A is a matrix and B a column vector. The measured signal of the system is given by y = Cx (+ Du) 5
Statespace Transfer function conversion A system with state-space representation ẋ = Ax + Bu y = Cx (+ Du) has transfer function G(s) = C(sI A) 1 B + D A transfer function model can have (infinitely) many different state-space realizations. Standard forms are: controllable canonical form, observable canonical form, diagonal form, see Collection of Formulae. 6
Lecture 6: State feedback control 1. Controllable form 2. State feedback control 3. Example 4. Controllability 5. Integral Action 7
Controllable canonical form The system with transfer function G(s) = D + b 1s n 1 + b 2 s n 2 + + b n s n + a 1 s n 1 + + a n has controllable canonical form a 1 a 2... a n 1 a n 1 0 0 0 1 dz dt = 0 0 1 0 0 z +. u. 0 0 0 1 0 ] y = [1 b 2... b n z + Du 8
Observable canonical form The system with transfer function has observable canonical form G(s) = D + b 1s n 1 + b 2 s n 2 + + b n s n + a 1 s n 1 + + a n a 1 1 0... 0 b 1 a 2 0 1 0 b 2 dz dt =. z +. u a n 1 0 0 1 a n 0 0 0 b n [ ] y = 1 0 0... 0 z + Du 8
PID and state feedback controller PID-controller: u = K ( e + 1 t ) de e(τ)dτ + T d, e = r y T i dt State feedback controller u = l ref r + l 1 (x 1,ref x 1 ) + l 2 (x 2,ref x 2 ) + l n (x n,ref x n ) 9
PID and state feedback controller PID-controller: u = K ( e + 1 t ) de e(τ)dτ + T d, e = r y T i dt State feedback controller u = l ref r + l 1 (x 1,ref x 1 ) + l 2 (x 2,ref x 2 ) + l n (x n,ref x n ) = = l ref r l 1 x 1 l 2 x 2 l n x n if x 1,ref = x 2,ref =... = x n,ref = 0 We will also add integral part to the state feedback later on. 9
Process {ẋ = Ax + Bu y = Cx Y (s) = C(sI A) 1 BU(s) The characteristic polynomial is det(si A) 10
Controller Linear state feedback controller u = l ref r l 1 x 1 l 2 x 2 l n x n = l ref r Lx ] L = [l 1 l 2... l n x = x 1. x n 11
Closed-Loop System ẋ = Ax + B(l ref r Lx) = (A BL)x + Bl ref r y = Cx Y (s) = C[sI (A BL)] 1 Bl ref R(s) We have new system matrix. The characteristic polynomial is Choose L to get desired poles. Choose l ref to get y = r in stationarity. det[si (A BL)]. 12
Example 1 DC-motor Transfer function from voltage to angle: G p (s) = b s(s + a) = 100 s(s + 10) Q: What are x 1 and x 2? 13
Example 1 DC-motor Transfer function from voltage to angle: G p (s) = b s(s + a) = 100 s(s + 10) Q: What are x 1 and x 2? State x 1 corresponds to angular speed State x 2 corresponds to motor angle 13
Example 1 DC-motor Transfer function from voltage to angle: G p (s) = P-control: u = K(r y) b s(s + a) = 100 s(s + 10) G o (s) = Kb s(s + a) G t (s) = G o(s) 1 + G o (s) = bk s 2 + as + bk s 2 + as + bk = s 2 + 2ζω 0 s + ω 2 os 2 ω 0 = bk ζ = 0.5a bk 13
Example 1 (cont d) State space model {ẋ1 = ax 1 + bu ẋ 2 = x 1 y = x 2 [ ] [ ] a 0 b ẋ = x + u 1 0 0 [ ] y = 0 1 x 14
Example 1 (cont d) Feedback from both x 1 and x 2 Control law: u = l ref r l 1 x 1 l 2 x 2 Closed-loop system: [ ] [ ] a bl1 bl 2 b ẋ = x + u 1 0 0 [ ] y = 0 1 x 15
DC-motor example The control law Figure 1: State feedback motor control. u = l r r l 1 x 1 l 2 x 2 = l r r Lx yields the closed-loop system [ ] [ ] 10 100l 1 100l 2 100 ẋ = x + l r r 1 0 0 y = [ ] 0 1 x 16
Example 1 (cont d) Characteristic polynomial: det(si A) = s + a + bl 1 bl 2 1 s = (s + a + bl 1 )s + bl 2 = s 2 + (a + bl 1 )s + bl 2 The poles can be placed anywhere want by choosing l 1, l 2. At stationarity: 0 = [ ẋ 1 ẋ 2 ] = [ (a + bl 1 )x 1 bl 2 x 2 + bl ref r x 1 ] { x1 = 0 l 2 x 2 = l ref r Choose l ref = l 2. This gives x 2 = r in stationarity. 17
Example 2 Can we choose characteristic polynomial (poles) freely how we want? {ẋ1 = x 1 + u We can not affect x 2! det(si A + BL) = ẋ 2 = 2x 2 [ ] [ ] 1 0 1 ẋ = x + u 0 2 0 s + 1 + l 1 l 2 0 s + 2 = (s + 1 + l 1 )(s + 2) 18
Controllability The system ẋ = Ax + Bu is called controllable if for any a and b there exist a control signal u which transfers from state x(0) = a to state x(t) = b. NOTE! Controllability does NOT concern y, C or D! 19
Cayley-Hamilton: t x(t) = e At x(0) + e A(t s) Bu(s)ds 0 0 = A n + a 1 A n 1 + + a n 1 A + a n where det(si A) = s n + a 1 s n 1 + + a n 1 s + a n. Thus, we have e At = I + At + 1 2 A2 t 2 + = α 0 (t)i + α 1 (t)a + + α n 1 (t)a n 1 20
It follows that t x(t) = e At a + where β k = t 0 α k(t s)u(s)ds. 0 n 1 = e At a + β k A k B k=0 e A(t s) Bu(s)ds Solutions for all a and b = x(t) exist if and only if are linearly independent. B, AB, A 2 B,..., A n 1 B 21
Criteria for controllability The system ẋ = Ax + Bu is controllable if and only if (iff) [ ] rank B AB... A n 1 B = n } {{ } W s The matrix W s is called the controllability matrix. 22
Example 2 [ ] [ ] a 0 b ẋ = Ax + Bu = x + u 1 0 0 [ ] b ab rank W s = rank = 2 Controllable! 0 b [ ] [ ] 1 0 1 ẋ = Ax + Bu = x + u 0 2 0 [ ] 1 1 rank W s = rank = 1 Not controllable! 0 0 23
Example 3a Pumping to lower tank {ẋ1 = ax 1 ẋ 2 = ax 1 ax 2 + bu [ ] [ ] a 0 0 ẋ = x + u a a b [ ] 0 0 W s = b ab Not controllable! 24
Example 3b Pumping to upper tank {ẋ1 = ax 1 + bu ẋ 2 = ax 1 ax 2 [ ] [ ] a 0 b ẋ = x + u a a 0 [ ] b ab W s = 0 ab Controllable! 25
Example 3c Pumping to parallel tanks {ẋ1 = ax 1 + bu ẋ 2 = ax 2 + bu [ ] [ ] a 0 b ẋ = x + u 0 a b [ b W s = b ] ab ab Not controllable! 26
Controllable form G(s) = b 1s n 1 + + b n 1 s + b n s n + a 1 s n 1 + + a n 1 s + a n a 1 a 2... a n 1 a n 1 1 0... 0 0 0 ẋ = 0 1... 0 0 x + 0 u..... 0 1 0 0 ] y = [b 1 b 2... b n 1 b n x 1... 0 1 W s =..... 0 0... 1 Controllable! 27
state feedback in canonical controllable form a 1 l 1 a 2 l 2... a n 1 l n 1 a n l n 1 0... 0 0 A BL = 0 1... 0 0.... 0 1 0 New charachteristic polynomial s n + (a 1 + l 1 )s n 1 + (a 2 + l 2 )s n 2 + + a n + l n 28
Integral action A limitation with ordinary state feedback controllers is that they lack integral action, which consequently may result in stationary control errors. 29
Introduce an extra state x i as the integral of the error. x i = (r y)dt ẋ i = r y = r Cx Figure 2: Introduce extra state x i for state feedback with integral action. 30
If we augment the state vector x with the integral state x i such that ẋ i x 1 x e =. the augmented system can be written [ ] [ ] [ ] [ ] ẋ A 0 B 0 ẋ e = = x e + u + r = A e x e + B e u + B r r C 0 0 1 y = [ ] C 0 x e = C e x e x n x i 31
If we augment the state vector x with the integral state x i such that ẋ i x 1 x e =. the augmented system can be written [ ] [ ] [ ] [ ] ẋ A 0 B 0 ẋ e = = x e + u + r = A e x e + B e u + B r r C 0 0 1 y = [ ] C 0 x e = C e x e We have hence augmented the state-space system with a state which represents the integral of the control error and thus arrived at a controller with integral action. In stationarity it holds that ẋ e = 0 and thereby that ẋ i = r y = 0. x n x i 31
stet feedback with Integral Action (cont d) The controller now becomes u = l r r Lx l i x i = l r r L e x e where ] L e = [L l i This yields the following closed-loop state-space equations ẋ e = (A e B e L e )x e + (B e l r + B r )r y = C e x e The parameters in the vector L e are chosen 1 so that we obtain a desired closed-loop pole placement, just as previously. Here the poles are given by the characteristic polynomial det(si (A e B e L e )) 1 NOT same L with and without intgral action!! 32
Remark: We no longer need the parameter l r in order to achieve y = r in stationarity. The parameter does not affect the poles of the closed-loop system, only its zeros. However, it can therefore be chosen so that the system obtains desired transient properties at setpoint changes. We shall come back to zero placement in a later lecture. 33
Summary 1. Controllable form 2. State feedback control 3. Example 4. Controllability 5. Integral Action 34