D39 of 10
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

D3 · Lesson 9 · State space

Describing a system by its state vector and first-order equations ẋ = Ax + Bu, a mass on a spring as the example, the eigenvalues of A as the poles, the trace and determinant of a 2 × 2 system, and state feedback u = −Kx that places the closed-loop poles wherever you choose

Transfer functions describe one input and one output. A rocket has several engines and dozens of sensors, and a battery's state of charge isn't directly measurable at all. State space describes a system by a list of numbers, its state, that captures everything about its past that matters for its future (a mass's position and velocity, a circuit's capacitor voltages and inductor currents) and a set of first-order differential equations for how they change. Feeding back the whole state lets a controller put the closed-loop poles anywhere, and it's the language of modern control, from the Apollo guidance computer to a drone's flight controller.

  • A unit mass driven by a force (a double integrator, like the drone of lesson 3 or a cart on a track) with state feedback u=−k1x1−k2x2 on its position x1 and velocity x2.
  • The arrows show where the state moves from each point; the traced paths start from three different initial states.
  • k1 acts like a spring and k2 like a damper: the closed-loop poles are the roots of s2+k2s+k1, so any pair of poles is reachable by choosing the two gains.

Predict

A mass of 2 kg on a spring of 8 N/m with damping 2 N·s/m has state (x,v). What are the eigenvalues of its A matrix?

Name it

The state equations

𝐱˙=A𝐱+B𝐮,𝐲=C𝐱+D𝐮

An nth-order system has n states. For a mass m on a spring k with damping b and applied force u, with 𝐱=(x,v):

A=[01−k/m−b/m],B=[01/m]

Poles are eigenvalues

The system's poles are the eigenvalues of A, the roots of det⁡(sI−A)=0. For a 2 × 2 matrix that's s2−(tr⁡A)s+det⁡A, so the poles sum to the trace and multiply to the determinant. Stable 2 × 2 systems have a negative trace and a positive determinant.

State feedback

Feeding back every state, 𝐮=−K𝐱, gives 𝐱˙=(A−BK)𝐱: the gains change the matrix and so the poles. If the system is controllable (the input can influence every state, tested by the rank of [BAB⋯]), any set of pole locations can be reached. For the double integrator, matching s2+k2s+k1 to s2+2ζωns+ωn2 gives

k1=ωn2,k2=2ζωn

States that can't be measured are estimated by an observer, a model of the system run alongside it and corrected by the measured outputs (S9).

Worked example

Choose state-feedback gains for a unit mass so that its closed loop has ωn = 4 rad/s and ζ = 0.7.

Show the solution
  1. Position gain. k1=16N/m
  2. Velocity gain. k2=2×0.7×4=5.6N·s/m
  3. Closed-loop poles. s=−2.8±j2.86

Answer k1 = 16 N/m and k2 = 5.6 N·s/m.

Worked example

A 2 × 2 system has trace −6 and determinant 25. Where are its poles?

Show the solution
  1. Characteristic equation. s2+6s+25=0
  2. Poles. s=−3±j4
  3. What they mean. The system is stable, oscillating at 4 rad/s with a decay time constant of 1/3 s.

Answer the poles are at −3±j4.

Worked example

The unit mass's controller has ωn = 4 rad/s. An observer that measures position should be about four times faster. What observer gains give ωn = 16 rad/s and ζ = 0.7?

Show the solution
  1. Same form as the controller. The observer's error obeys the same form as the controlled mass.
  2. First gain. l1=2ζωn=22.4s−1
  3. Second gain. l2=ωn2=256s−2
  4. Settling. Its estimate settles in about 4/(0.7×16)=0.36s well before the controller's own response.

Answer l1 = 22.4 s⁻¹ and l2 = 256 s⁻².

Check

A 2 kg mass on a 4 N/m spring has state (position, velocity). What's the lower-left entry of its A matrix?

Check

A 2 × 2 system has trace −4 and determinant 13, so its poles are complex. What's their real part?

Check

For a 1 kg double integrator, what position gain k1 gives a closed-loop natural frequency of 5 rad/s?

Write units the way you normally would: 1.5 N/m, 1500 mN/m and 0.0015 kN/m are the same answer.

Check

For the same 1 kg double integrator, what velocity gain k2 gives ωn = 5 rad/s and ζ = 0.5?

Write units the way you normally would: 1.5 N·s/m, 1500 mN·s/m and 0.0015 kN·s/m are the same answer.

Check

A unit mass under state feedback u=−k1x−k2x˙ should have ωn = 4 rad/s and ζ = 0.5.

(a)

What is k1?

Write units the way you normally would: 1.5 N/m, 1500 mN/m and 0.0015 kN/m are the same answer.

(b)

What is k2?

Check

A 2 × 2 system matrix has trace −6 and determinant 29.

(a)

What is the real part of its poles?

(b)

What is their imaginary part?

Write units the way you normally would: 1.5 rad/s and 1500 mrad/s are the same answer.

Explain why

Why can full state feedback place a controllable system's poles anywhere?

Practice

Keep practicing

9 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.