CDS 11: Lecture 5-1 Reachability and State Space Feedback Richard M. Murray 23 October 26 Goals: Define reachability of a control system Give tests for reachability of linear systems and apply to examples Describe the design of state feedback controllers for linear systems Reading: Åström and Murray, Feedback Systems, Ch 6
Review from Last Week 23 Oct 6 R. M. Murray, Caltech CDS 2
Control Design Concepts System description: single input, single output system MIMO also OK) Stability: stabilize the system around an equilibrium point Given equilibrium point x e R n, find control law u=αx) such that Reachability: steer the system between two points Given x o, x f R n, find an input ut) such that ẋ = fx, ut)) takes xt ) = x xt ) = x f Tracking: track a given output trajectory Given y d t), find u=αx,t) such that x yt x f y d t t 23 Oct 6 R. M. Murray, Caltech CDS 3
Reachability of Input/Output Systems Defn An input/output system is reachable if for any x o, x f R n and any time T > there exists an input u [,T ] R such that the solution of the dynamics starting from x)=x and applying input ut) gives xt)=x f. Remarks In the definition, x and x f do not have to be equilibrium points we don t necessarily stay at x f after time T. Reachability is defined in terms of states doesn t depend on output For linear systems, can characterize reachability by looking at the general solution: If integral is surjective as a linear operator), then we can find an input to achieve any desired final state. 23 Oct 6 R. M. Murray, Caltech CDS 4
Tests for Reachability Thm A linear system is reachable if and only if the n n reachability matrix is full rank. Remarks Very simple test to apply. In MATLAB, use ctrba,b) and check rank w/ det) If this test is satisfied, we say the pair A,B) is reachable Some insight into the proof can be seen by expanding the matrix exponential 23 Oct 6 R. M. Murray, Caltech CDS 5
Example #1: Linearized pendulum on a cart θ m Question: can we locally control the position of the cart by proper choice of input? p Approach: look at the linearization around the upright position good approximation to the full dynamics if θ remains small) F M d dt p θ ṗ = θ 1 1 m 2 l 2 g cj t M t J t m 2 l 2 M t J t m 2 l 2 M t mgl M t J t m 2 l 2 clm M t J t m 2 l 2 γj t lm M t J t m 2 l 2 γm t M t J t m 2 l 2 p θ ṗ + θ J t M t J t m 2 l 2 lm M t J t m 2 l 2 u y = [ 1 ] x, 23 Oct 6 R. M. Murray, Caltech CDS 6
u W r = Example #1, con t: Linearized pendulum on a cart p M Reachability matrix J t µ lm µ J t θ m d dt gl 3 m 3 µ 2 gl 2 m 2 m+m) µ 2 µ gl 3 m 3 µ 2 1 p θ 1 ṗ = m 2 l 2 g cj t µ µ µ θ M t mgl µ µ = M t J t m 2 l 2 lm µ gl 2 m 2 m+m) µ 2 B AB A 2 B A 3 B clm µ. γj t lm γm t µ p θ ṗ + θ J t µ lm µ u Simplify by setting c, γ = Full rank as long as constants are such that columns 1 and 3 are not multiples of each other reachable as long as detw r ) = g2 l 4 m 4 µ 4 can steer linearization between points by proper choice of input 23 Oct 6 R. M. Murray, Caltech CDS 7
Control Design Concepts System description: single input, single output system MIMO also OK) Stability: stabilize the system around an equilibrium point Given equilibrium point x e 2 R n, find control law u=αx) such that Reachability: steer the system between two points Given x, x f 2 R n, find an input ut) such that x x f Tracking: track a given output trajectory Given y d t), find u=αx,t) such that yt y d t t 23 Oct 6 R. M. Murray, Caltech CDS 8
State space controller design for linear systems Goal: find a linear control law u = -K x such that the closed loop system is stable at x e =. Remarks ẋ = Ax BKx = A BK)x Stability based on eigenvalues use K to make eigenvalues of A+BK) stable Can also link eigenvalues to performance eg, initial condition response) Question: when can we place the eigenvalues anyplace that we want? Theorem The eigenvalues of A - BK) can be set to arbitrary values if and only if the pair A, B) is reachable. MATLAB: K = placea, B, eigs) 23 Oct 6 R. M. Murray, Caltech CDS 9
Natural dynamics dh dt = r hh 1 H ) K dl dt = r ll 1 L ) kh Example #2: Predator prey ahl 1 + aht h H L Controlled dynamics: modulate food supply dh dt = r h + u)h 1 H ) ahl K 1 + aht h dl dt = r ll 1 L ) kh Stable Q1: can we move from some initial population of foxes and rabbits to a specified one in time T by modulation of the food supply? Q2: can we stabilize the population around the desired equilibrium point Unstable Approach: try to answer this question locally, around the natural equilibrium point 23 Oct 6 R. M. Murray, Caltech CDS
Example #2: Problem setup Equilibrium point calculation dh dt = r h + u)h 1 H ) ahl K 1 + aht h dl dt = r ll 1 L ) kh x e = 6.5, 1.3), ue =, ye = 6.5 Linearization Compute linearization around equil. point, x e : % Compute the equil point % predprey.m contains dynamics f = inline'predprey,x)'); xeq = fsolvef, [1, 2]); % Compute linearization A = [ rh - 2*H*rH)/K - a*l)......, rl - 2*L*rL)/H*k) ]; B = [H*1 - H/K); ]; Redefine local variables: z=x-x e, v=u-u e d dt [ z1 z 2 ] = [ al ah T h +1) 2 2H r h L 2 r l H 2 k K + r h ah ah T h +1 r l 2L r l H k ] [z1 ] [ )] H 1 H + K v z 2 23 Oct 6 R. M. Murray, Caltech CDS 11
Example #2: Stabilization via eigenvalue assignment d dt [ z1 z 2 ] = [ al ah T h +1) 2 2H r h L 2 r l H 2 k K + r h ah ah T h +1 r l 2L r l H k ] [z1 ] [ )] H 1 H + K v z 2 Control design: v = Kz + k r r u = u e + Kx x e ) + k r r y e ) Place poles at stable values Choose λ=-1, -2 K = placea, B, [-1; -2]); Stable Modify NL dynamics to include control dh dt = r h + u)h 1 H ) ahl K 1 + aht h dl dt = r ll 1 L ) kh 23 Oct 6 R. M. Murray, Caltech CDS 12
Implementation Details Eigenvalues determine performance For each eigenvalue λ i =σ i + jω i, get contribution of the form Repeated eigenvalues can give additional terms of the form t k e σ + jω Imag Axis 2 1-1 Pole-zero map ω -2-15 -1-5 5 Real Axis Amplitude To: Y1).2.15.1.5 Step Response From: U1) T 2π /ω p 5 1 15 2 25 3 Time sec.) Use estimator to determine the current state if you can t measure it u y Estimator looks at inputs and outputs of plant and estimates the current state Can show that if a system is observable then you can construct and estimator Use the estimated state as the feedback Estimator Kalman filter is an example of an estimator 23 Oct 6 R. M. Murray, Caltech CDS 13
Summary: Reachability and State Space Feedback x x f u = Kx + k r r Key concepts Reachability: find u s.t. x x f Reachability rank test for linear systems State feedback to assign eigenvalues 23 Oct 6 R. M. Murray, Caltech CDS 14