Intro. Computer Control Systems: F9 State-feedback control and observers Dave Zachariah Dept. Information Technology, Div. Systems and Control 1 / 21 dave.zachariah@it.uu.se
F8: Quiz! 2 / 21 dave.zachariah@it.uu.se
F8: Quiz! 1) For an observable system a the effect of all x(t) can be observed in y(t) b we have det O = 0 c we have stability 2 / 21 dave.zachariah@it.uu.se
F8: Quiz! 1) For an observable system a the effect of all x(t) can be observed in y(t) b we have det O = 0 c we have stability 2) If a state-space form of G(s) is a minimal realization, a A:s eigenvalues < G(s):s poles b A:s eigenvalues = G(s):s poles c there exist more compact state-space forms 2 / 21 dave.zachariah@it.uu.se
F8: Quiz! 1) For an observable system a the effect of all x(t) can be observed in y(t) b we have det O = 0 c we have stability 2) If a state-space form of G(s) is a minimal realization, a A:s eigenvalues < G(s):s poles b A:s eigenvalues = G(s):s poles c there exist more compact state-space forms 3) For a controllable system with state-feedback control a the closed-loop system is stable b the poles of the closed-loop system can be designed arbitrarily c no information about the system is required 2 / 21 dave.zachariah@it.uu.se
State-feedback control 3 / 21 dave.zachariah@it.uu.se
State-feedback control State-space form of linear time-invariant system ẋ = Ax + Bu y = Cx G(s) = C(sI A) 1 B u x y (si A) 1 B C 4 / 21 dave.zachariah@it.uu.se
State-feedback control Controller using state feedback u = Lx + l 0 r gives closed-loop system ẋ = (A BL)x + Bl 0 r y = Cx where r is the reference signal. 4 / 21 dave.zachariah@it.uu.se
State-feedback control Controler using state feedback gives closed-loop system u = Lx + l 0 r ẋ = (A BL)x + Bl 0 r y = Cx where r is the reference signal. rl 0 u x y (si A) 1 B C + L G c (s) = C(sI A + BL) 1 Bl 0 4 / 21 dave.zachariah@it.uu.se
Pole placement Rules of thumb for designing L Eigenvalues/poles given by det(si A + BL) = 0, which we can design Im{s} Re{s} 5 / 21 dave.zachariah@it.uu.se
Pole placement Rules of thumb for designing L Eigenvalues/poles given by det(si A + BL) = 0, which we can design Im{s} Re{s} Distance to the origin: Quick system but also sensitive to disturbances 5 / 21 dave.zachariah@it.uu.se
Estimating the states via simulation 6 / 21 dave.zachariah@it.uu.se
Estimating the states Via simulation Controller u = Lx + l 0 r requires states x which are often unknown. 7 / 21 dave.zachariah@it.uu.se
Estimating the states Via simulation Controller u = Lx + l 0 r requires states x which are often unknown. In practice, feedback using u = Lˆx + l 0 r where ˆx is an estimate of x. 7 / 21 dave.zachariah@it.uu.se
Estimating the states Via simulation Controller u = Lx + l 0 r requires states x which are often unknown. In practice, feedback using u = Lˆx + l 0 r where ˆx is an estimate of x. Naive idea: Estimate x by simulating the states where ˆx 0 is an initial guess. ˆx = Aˆx + Bu, ˆx(0) = ˆx 0 7 / 21 dave.zachariah@it.uu.se
Build intuition from simple systems State estimation via simulation Ex.: Damper y State-space form: [ ] [ ] 0 1 0 ẋ(t) = x(t) + u(t), x(0) = x k/m 0 1/m 0 y(t) = [ 1 0 ] x(t) u 8 / 21 dave.zachariah@it.uu.se
Build intuition from simple systems State estimation via simulation Example using impulse u input u(t), output y(t) 1 0.8 0.6 0.4 0.2 0 0.2 u(t) y(t) 0.4 0 20 40 60 80 100 t [s] System with unknown initial state x 0 8 / 21 dave.zachariah@it.uu.se
Build intuition from simple systems State estimation via simulation Naive estimate using perfect initial guess: ˆx = Aˆx + Bu, ˆx 0 = x 0 0.15 0.1 x 2 (velocity) [m/s] 0.05 0 0.05 0.1 0.3 0.2 0.1 0 0.1 0.2 0.3 x 1 (position) [m] x versus ˆx at t = 0 + 8 / 21 dave.zachariah@it.uu.se
Build intuition from simple systems State estimation via simulation Naive estimate using perfect initial guess: ˆx = Aˆx + Bu, ˆx 0 = x 0 0.15 0.1 x 2 (velocity) [m/s] 0.05 0 0.05 0.1 0.3 0.2 0.1 0 0.1 0.2 0.3 x 1 (position) [m] x versus ˆx at t = 20 8 / 21 dave.zachariah@it.uu.se
Build intuition from simple systems State estimation via simulation Naive estimate using perfect initial guess: ˆx = Aˆx + Bu, ˆx 0 = x 0 0.15 0.1 x 2 (velocity) [m/s] 0.05 0 0.05 0.1 0.3 0.2 0.1 0 0.1 0.2 0.3 x 1 (position) [m] x versus ˆx at t = 100 8 / 21 dave.zachariah@it.uu.se
Build intuition from simple systems State estimation via simulation Naive estimate using wrong initial guess: ˆx = Aˆx + Bu, ˆx 0 x 0 0.15 0.1 x 2 (velocity) [m/s] 0.05 0 0.05 0.1 0.3 0.2 0.1 0 0.1 0.2 0.3 x 1 (position) [m] x versus ˆx at t = 0 + 9 / 21 dave.zachariah@it.uu.se
Build intuition from simple systems State estimation via simulation Naive estimate using wrong initial guess: ˆx = Aˆx + Bu, ˆx 0 x 0 0.15 0.1 x 2 (velocity) [m/s] 0.05 0 0.05 0.1 0.3 0.2 0.1 0 0.1 0.2 0.3 x 1 (position) [m] x versus ˆx at t = 20 9 / 21 dave.zachariah@it.uu.se
Build intuition from simple systems State estimation via simulation Naive estimate using wrong initial guess: ˆx = Aˆx + Bu, ˆx 0 x 0 0.15 0.1 x 2 (velocity) [m/s] 0.05 0 0.05 0.1 0.3 0.2 0.1 0 0.1 0.2 0.3 x 1 (position) [m] x versus ˆx at t = 100 9 / 21 dave.zachariah@it.uu.se
Build intuition from simple systems State estimation via simulation x och ˆx correspond to different outputs: y = Cx versus ŷ = C ˆx output y(t) 0.4 0.2 0 0.2 y(t) C ˆx(t) 0.4 0 20 40 60 80 100 t [s] 9 / 21 dave.zachariah@it.uu.se
Estimating the states via observer 10 / 21 dave.zachariah@it.uu.se
Estimating the states Correcting the state estimates Idea: Feedback the prediction error y C ˆx to correct ˆx Observer: an estimator with a correction term ˆx = Aˆx + Bu + K ( y C ˆx ), ˆx(0) = ˆx 0 }{{} correction 11 / 21 dave.zachariah@it.uu.se
Estimating the states Correcting the state estimates Idea: Feedback the prediction error y C ˆx to correct ˆx Observer: an estimator with a correction term Using matrix ˆx = Aˆx + Bu + K ( y C ˆx ), ˆx(0) = ˆx 0 }{{} correction we can design the estimator. k 1 k 2 K =. k n 11 / 21 dave.zachariah@it.uu.se
Estimating the states Correcting the state estimates Idea: Feedback the prediction error y C ˆx to correct ˆx Observer: an estimator with a correction term ˆx = Aˆx + Bu + K ( y C ˆx ), ˆx(0) = ˆx 0 }{{} correction u x y (si A) 1 B C ˆx Obs. 11 / 21 dave.zachariah@it.uu.se
Build intuition using simple systems State estimation using observer Estimation using observer: ˆx = Aˆx + Bu + K ( y C ˆx ), ˆx 0 x 0 0.15 0.1 x 2 (velocity) [m/s] 0.05 0 0.05 0.1 0.3 0.2 0.1 0 0.1 0.2 0.3 x 1 (position) [m] x versus ˆx at t = 0 + 12 / 21 dave.zachariah@it.uu.se
Build intuition using simple systems State estimation using observer Estimation using observer: ˆx = Aˆx + Bu + K ( y C ˆx ), ˆx 0 x 0 0.15 0.1 x 2 (velocity) [m/s] 0.05 0 0.05 0.1 0.3 0.2 0.1 0 0.1 0.2 0.3 x 1 (position) [m] x versus ˆx at t = 20 12 / 21 dave.zachariah@it.uu.se
Build intuition using simple systems State estimation using observer Estimation using observer: ˆx = Aˆx + Bu + K ( y C ˆx ), ˆx 0 x 0 0.15 0.1 x 2 (velocity) [m/s] 0.05 0 0.05 0.1 0.3 0.2 0.1 0 0.1 0.2 0.3 x 1 (position) [m] x versus ˆx at t = 100 12 / 21 dave.zachariah@it.uu.se
State estimation Estimation error and observability Estimation error: x x ˆx [Board: derive evolution of estimation errors] 13 / 21 dave.zachariah@it.uu.se
State estimation Estimation error and observability Estimation error: x x ˆx [Board: derive evolution of estimation errors] Result Errors of observer described as system x(t) = e (A KC)t x(0) and therefore x(t) decays at a rate given by maximum Re{ s i } where s i are observer poles/eigenvalues of (A KC). 13 / 21 dave.zachariah@it.uu.se
State estimation Estimation error and observability Estimation error: x x ˆx Result 9.2 State-space form is observable (cf. det O 0) matrix K can be chosen such that x vanish arbitrarily quick 14 / 21 dave.zachariah@it.uu.se
State estimation Estimation error and observability Estimation error: x x ˆx Result 9.2 State-space form is observable (cf. det O 0) matrix K can be chosen such that x vanish arbitrarily quick K is solved by polynomial det(si A + KC) = 0 with desired roots in left halfplane 14 / 21 dave.zachariah@it.uu.se
State estimation Estimation error and observability Estimation error: x x ˆx Result 9.2 State-space form is observable (cf. det O 0) matrix K can be chosen such that x vanish arbitrarily quick K is solved by polynomial det(si A + KC) = 0 with desired roots in left halfplane Quick observer ˆx is however sensitive to measurement noise! 14 / 21 dave.zachariah@it.uu.se
Combining feedback with estimated states 15 / 21 dave.zachariah@it.uu.se
Feedback using estimated states Controller the Laplace domain rl 0 + u x y (si A) 1 B C L ˆx Obs. 16 / 21 dave.zachariah@it.uu.se
Feedback using estimated states Controller the Laplace domain rl 0 + u x y (si A) 1 B C L ˆx Obs. System and controller with observer: { { ẋ = Ax + Bu u and y = Cx ˆx = Lˆx + l 0 r = Aˆx + Bu + K(y C ˆx) 16 / 21 dave.zachariah@it.uu.se
Feedback using estimated states Controller the Laplace domain rl 0 + u x y (si A) 1 B C L ˆx Obs. Controller with observer: { U(s) = L L : X(s) + l 0 R(s) s X(s) = A X(s) + BU(s) + K ( Y (s) C X(s) ) [Board: solve for controller] 16 / 21 dave.zachariah@it.uu.se
Feedback using estimated states General linear feedback control General linear feedback form, ch.9.5 G&L Controller with observer can be written as where U(s) = F r (s)r(s) F y (s)y (s), F r (s) = (1 L(sI A + KC + BL) 1 B)l 0 F y (s) = L(sI A + KC + BL) 1 K r F r + u G y F y 17 / 21 dave.zachariah@it.uu.se
Resulting closed-loop system 18 / 21 dave.zachariah@it.uu.se
Feedback using estimated states Effect of estimation error rl 0 + u x y (si A) 1 B C L ˆx Obs. Study system and controller with observer: { ẋ = Ax + Bu and u = Lˆx + l 0 r y = Cx by substituting ˆx = x x [Board: derive the closed-loop system with estimation error x] 19 / 21 dave.zachariah@it.uu.se
Feedback using estimated states Effect of estimation error rl 0 + u x y (si A) 1 B C L ˆx Obs. Yields closed-loop system: ẋ = (A BL)x + y = Cx with additional error states effect of estimation error {}}{ BL x +Bl 0 r x = (A KC) x 0 [Board: write the closed-loop system in state-space form] 19 / 21 dave.zachariah@it.uu.se
Feedback using estimated states The closed-loop system with observer The closed-loop system with estimation error can be written as [ẋ ] [ ] [ ] [ ] A BL BL x B = + l x 0 A KC x 0 0 r }{{}}{{} Ã B y = [ C 0 ] }{{} C with extended state vector. [ x x This yields transfer function from r to y: ] G c (s) = C(sI Ã) 1 B 20 / 21 dave.zachariah@it.uu.se
Feedback using estimated states The closed-loop system with observer Closed-loop system transfer function, ch.9.5 G&L Insert matrices Ã, B and C yields G c (s) = C(sI Ã) 1 B = C(sI A + BL) 1 Bl 0 with same poles as if states were known and K is gone! r F r + u G y F y 20 / 21 dave.zachariah@it.uu.se
Summary and recap Rules of thumb for pole placement Estimation using observer Feedback using estimated states Closed-loop system with observer 21 / 21 dave.zachariah@it.uu.se