Skip to content
Tutorials Center
My learning

Topics

Lesson 29 of 37 · State Space

State Feedback and Pole Placement

Design full-state feedback u = -Kx to place closed-loop poles where you want them, derive Ackermann's formula in code, scale the reference, and see the cost of speed.

If you can measure every state, you can use all of them. State feedback replaces the single error signal of a PID loop with a weighted sum of all states: u = -K·x. Substituting into x' = Ax + Bu gives the closed loop x' = (A - BK)x. The matrix K is a free design knob, and the eigenvalues of A - BK are the new poles. If the system is controllable, you can place those poles anywhere you like. That is the pole placement theorem, and it is far more freedom than a root locus gives, which is limited to a single gain.

flowchart LR
    R["r"] --> N["Nbar"]
    N --> S(("+"))
    S -->|"u"| P["x' = Ax + Bu"]
    P -->|"x"| K["K"]
    K -->|"-"| S
    P --> C["C"]
    C --> Y["y"]

State feedback with a reference scaling gain Nbar so that y tracks r in steady state.

Choosing the poles

Pole locations come from performance specs, via the second-order relations you already know:

  • Settling time ts ≈ 4/σ (for 2%), so poles need real part -σ at least 4/ts.
  • Overshoot sets damping ζ; ζ = 0.707 gives about 4.3%, so keep poles within 45° of the negative real axis.
  • Use a dominant pair for the response you want and put any extra poles well to the left (about 3 to 5 times faster) so they barely affect the result.

Faster poles are not free: they require larger K, so more control effort and more sensitivity to noise and model errors.

Ackermann's formula

For a single-input system, the gain that gives characteristic polynomial φ(s) = sⁿ + a₁sⁿ⁻¹ + ... + aₙ is:

TEXT
K = [0 0 ... 0 1] · Co⁻¹ · φ(A)

where Co is the controllability matrix and φ(A) is the desired polynomial evaluated at the matrix A. It is short enough to implement, and we can check it against SciPy's place_poles, which uses a more robust algorithm for larger systems and multiple inputs.

Python Ackermann's formula versus scipy

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Both give K = [27, 6]. Check by hand: A - BK has characteristic polynomial s² + (2 + 6)s + (5 + 27) = s² + 8s + 32, whose roots are -4 ± 4j.

Ackermann's formula is numerically fragile for high-order systems (inverting Co is ill-conditioned), which is why production code uses place_poles (the KNV algorithm) or LQR.

Tracking a reference: the scaling gain

State feedback u = -Kx regulates the state to zero. To make the output follow a nonzero reference r, use u = -Kx + N̄·r where N̄ is chosen so the closed-loop DC gain is 1:

TEXT
N̄ = -1 / ( C (A - BK)⁻¹ B )

This gives zero steady-state error only if the model is exact. With modeling error or constant disturbances you add integral action: augment the state with ∫(r - y)dt and design K for the extended system. That is the state-space version of the "I" in PID.

The price of speed

Let us try four pole locations on the mass-spring system, all with damping ratio 0.707 (except the first, which is the open loop), and measure the step response and the control effort.

Python Faster poles cost more control effort

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The first row (poles at the open-loop locations) needs K = 0. Moving the poles left shortens the settling time proportionally (from about 3.7 s to 0.35 s), but the peak control signal grows from 5 to nearly 290. Real actuators saturate long before that. This trade-off is why optimal methods such as LQR exist: they place the poles by balancing speed against effort instead of asking you to guess.

What state feedback cannot do

  • It needs all states measured. If you only have the position sensor, you need an observer.
  • It cannot move uncontrollable modes.
  • It does nothing about right-half-plane zeros: they limit how fast any controller can make the response without huge undershoot.
  • The model must be accurate: pole placement is not inherently robust (LQR has guaranteed margins; arbitrary placement does not).

For a sanity check, place the poles close to the open-loop poles first. The needed K will be small and the design is gentle. Only then move them further as the specs demand.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. With u = -Kx, what are the closed-loop poles?

    Substituting u = -Kx gives x' = (A - BK)x, so the poles are the eigenvalues of A - BK.
  2. 2. What condition guarantees that every pole can be placed arbitrarily?

    Controllability is necessary and sufficient for arbitrary pole placement by state feedback.
  3. 3. Why is a reference scaling gain Nbar needed?

    State feedback regulates x to zero; Nbar scales r so y settles at r when the model is exact.
  4. 4. What happens to the control effort as you move the closed-loop poles farther left?

    Faster poles need larger gains K and larger peak inputs.

Summary

  • State feedback u = -Kx gives closed-loop dynamics A - BK; controllability lets you place its eigenvalues freely.
  • Ackermann's formula K = [0 ... 1] Co⁻¹ φ(A) gives K for single-input systems; place_poles is the robust tool.
  • Add N̄ (or integral action) for tracking.
  • Faster poles cost much more control effort and amplify noise.
  • Measuring every state is rarely possible; the fix is an observer.

Next: State Observers and Output Feedback