Skip to content
Tutorials Center
My learning

Topics

Lesson 30 of 37 ยท State Space

State Observers and Output Feedback

Estimate unmeasured states with a Luenberger observer, design its gain by duality, combine it with state feedback via the separation principle, and weigh speed against noise.

State feedback assumes you can read every state. In practice you usually have a sensor or two: a position encoder but no velocity sensor, one thermocouple for a multi-zone furnace. The solution is an observer (or state estimator): a copy of the model that runs alongside the real system, corrected by the measured output, producing an estimate xฬ‚ of the whole state. The controller then uses u = -Kยทxฬ‚.

The classic observer is the Luenberger observer:

TEXT
xฬ‚' = A xฬ‚ + B u + L (y - C xฬ‚)

The first two terms are the model's own prediction. The last is a correction proportional to the innovation y - Cxฬ‚, the difference between what was measured and what the estimate predicts. L is the observer gain.

flowchart LR
    U["u"] --> P["Plant"]
    P --> Y["y"]
    U --> M["Model copy: x_hat' = A x_hat + B u + L(y - C x_hat)"]
    Y --> M
    M -->|"x_hat"| K["-K"]
    K --> U

Output feedback: the plant output feeds the observer, and the controller acts on the estimate.

Why it works: the error dynamics

Define the estimation error e = x - xฬ‚. Subtract the observer equation from the plant equation:

TEXT
e' = (A - L C) e

The input u cancels, and the error is governed by A - LC, independent of what you apply. If you choose L so that A - LC is stable, the error decays to zero from any initial mismatch, even if the estimate starts at zero. Choosing L is dual to choosing K: the eigenvalues of A - LC are the same as those of Aแต€ - Cแต€Lแต€, which is a state-feedback problem for the pair (Aแต€, Cแต€). So you reuse the same tools, place_poles(A.T, C.T, poles).gain_matrix.T. It works when the system is observable.

The separation principle

Connecting everything gives a combined system on the stacked state (x, xฬ‚). Its poles turn out to be the union of the two designs:

TEXT
poles of the combined loop  =  eig(A - B K)  โˆช  eig(A - L C)

This is the separation principle: design K as if all states were available, design L for the observer independently, then connect. Neither design disturbs the other (for linear systems with an exact model).

Python Observer design by duality and the separation principle

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 full loop's four eigenvalues are -3 ยฑ 3j (controller) plus -10 and -11 (observer). The observer poles were placed several times faster than the controller poles, which is the usual rule: the estimate must converge before the controller needs it. A common choice is observer poles 3 to 10 times faster.

How fast should the observer be?

A fast observer trusts the measurement heavily; a slow one trusts the model. Which one is better depends on the noise.

  • Fast observer: converges quickly after a disturbance or a wrong initial state, but amplifies sensor noise into the estimates (especially the derivative-like states such as velocity).
  • Slow observer: smooth estimates, but slow to correct model errors.

The next experiment runs the observer open-loop on the mass-spring system with an initial error and a noisy position sensor, for three observer speeds.

Python Observer speed versus noise sensitivity

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.

Look at the columns. The slow observer (poles at -2 and -2.5) has not yet converged at t = 1 s (error 0.08). The medium and fast ones have. But the steady error of the velocity estimate x2 grows from 0.0007 to 0.036 as the observer gets faster: that is measurement noise leaking through. The sweet spot is a compromise, and finding it systematically is exactly what the Kalman filter does: it picks L from the noise covariances so the estimate has minimum variance. (Kalman gain and LQR gain come from the same kind of Riccati equation: see LQR.)

Reduced-order observers and integral action

  • Reduced-order observer: the measured states are known already, so you only need to estimate the rest, saving a few equations. It is a good fit when the output already equals a state (like our position).
  • Disturbance observer: augment the model with a constant disturbance state (d' = 0) and estimate it, then subtract it from the control. This acts like integral action and rejects constant loads.
  • Practical caveat: the observer assumes an exact model. A wrong A leaves a steady estimation error that feeds back into the control. Large L reduces the impact of model error but increases noise sensitivity, which is the same trade again.

Separation holds for linear systems but not for robustness: a controller-observer pair can have poor margins even if each half looks fine alone (Doyle's famous 1978 counterexample). Always check margins of the combined loop, for example by cutting it at the plant input and computing the loop transfer function K(sI - A + BK + LC)โปยน L ยท P(s).

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What are the dynamics of the observer's estimation error e = x - x_hat?

    Subtracting the observer from the plant cancels the input and leaves e' = (A - LC) e.
  2. 2. How do you compute L with place_poles?

    By duality, observer design for (A, C) is state-feedback design for (A^T, C^T); transpose the result.
  3. 3. The separation principle says that the poles of the combined controller-observer loop are:

    Controller and observer can be designed independently; the full loop has both sets of poles.
  4. 4. What is the main cost of a very fast observer?

    Large L trusts the measurement more, which passes noise straight into the estimate.

Summary

  • An observer xฬ‚' = Axฬ‚ + Bu + L(y - Cxฬ‚) reconstructs unmeasured states from the model and the output.
  • The error obeys e' = (A - LC)e; choose L by pole placement on the dual pair (Aแต€, Cแต€).
  • Separation principle: design K and L independently; the loop poles are the union.
  • Make the observer faster than the controller (3 to 10 times), but not so fast that noise dominates.
  • The Kalman filter chooses L optimally for given noise levels; check margins of the whole loop.

Next: LQR Optimal Control