03 Control Systems · #15 of 46

Observers

Seeing the states you were never allowed to measure

Your controller wants the full state: position and velocity, angle and rate. Your sensors hand you half of it. A drone has a barometer but no clean rate-of-climb. A motor has an encoder but no clean angular velocity.

So you do something that sounds like cheating: you build a fake plant in software, run it next to the real one, and let the one measurement you do have keep nudging the fake one toward the truth.

That little software twin is an observer.

The trick is to run a model of the plant in parallel with reality and correct it, every step, using the one output you can actually see. An observer estimates the states you cannot measure directly by feeding the measurement error back into its own copy of the dynamics. Get the feedback right and the estimate chases the truth even though it started off wrong.

Watch the estimate hunt down the truth

Below is a mass-spring plant that starts at position 1 and oscillates. You only ever measure its position, never its velocity. Three traces overlay that position on one time axis:

Estimate what you can't directly measure

Luenberger RMS err
open-loop RMS err
settling (Luenberger)
init mismatch x̂(0) ≠ x(0)
what to try
  • With , the Luenberger trace is just an open-loop sim; it never converges. Bump L₁ up; convergence appears.
  • Crank both L's high. Convergence is faster, but the noise pours through. Faster observer = louder estimate. Trade-off.
  • Slide the noise σ up. Notice that the Luenberger trace stays close to truth, just visibly noisier. A Kalman filter is a Luenberger observer whose L is recomputed each step to minimize the noise-vs-speed trade-off automatically.

The two L sliders are the observer gains: they set how much the estimate trusts the fresh measurement versus its own internal model. Crank L high and convergence is fast, but sensor noise pours straight through into the estimate. Crank L low and the estimate is smooth but sluggish, taking forever to forget a bad start. There is no setting that wins both ways; you are buying speed with noise.

Notice the open-loop trace never recovers. That is the whole point: a model alone is not enough. You can have the exact equations of the plant and still be wrong forever if you never look at the world. The measurement feedback is what closes the gap.

The hidden danger of cranking the gain: peaking

Noise is not the only price of a high gain. There is a sneakier failure called the peaking phenomenon. When you make LL large to force fast convergence, the estimation error does eventually shrink, but on the way there it can first spike to an enormous value before it settles. For a fraction of a second your "estimate" of, say, a robot arm's velocity might read wildly wrong, large enough to be impractical or downright unsafe if a controller is acting on it. Hassan Khalil's Nonlinear Systems lays this trap out in detail. It is the reason engineers reach for cleverer designs, like the sliding mode observer, which can drive one state's error to zero in finite time without the violent overshoot, and which inherits noise-rejection properties similar to a Kalman filter.

David Luenberger introduced this deterministic observer in 1964, and its defining feature is freedom: you get to place the poles that govern how fast the estimation error decays. Push them deep into the left-half-plane and the error dies quickly; keep them gentle and it eases in. The catch is that "deterministic" assumes a clean world. The moment you turn the noise slider up, the question stops being where do I want the poles and becomes what placement is actually optimal given how noisy my sensor is, and that question has a famous answer.

There is a precondition hiding under all of this. You can only reconstruct a hidden state if the system is observable, meaning the output actually carries enough information to pin it down. The textbook picture is a tunnel: you can watch the rate cars enter one end and leave the other, but the exact arrangement of cars inside is something you can only infer. If the math says the pair [A,C][A, C] is observable, the inference is guaranteed to work and you can place the error poles wherever you like. If it is not, no gain on earth will save you, because the missing information was never in the measurement to begin with.

A steam-turbine rotor being assembled in a factory.
Hidden state: once a turbine is sealed and spinning, its internal blade temperatures can't be measured directly, so an observer estimates them from the outside. · Siemens / Christian Kuhna, CC BY-SA 3.0

The optimal observer for a noisy system IS Rudolf E. Kálmán's Kalman filter, the doorway from control into the state-estimation half of robotics. Add noise to the plant and the optimal observer is no longer a matter of taste. The Kalman filter recomputes the gain L every step to minimize the estimation error given the measured noise statistics. That is precisely where the next chapter of robotics, state estimation, picks up. The observer you just played with is the deterministic skeleton; the Kalman filter is what you get when you let the noise itself tell you how much to trust each measurement.

The math: a parallel model and the error dynamics

Take any linear plant with state xx, input uu, and a single measured output yy:

x˙=Ax+Bu,y=Cx+v\dot{x} = A x + B u, \qquad y = C x + v

where vv is measurement noise and CC picks out only the states you can actually read (here, position but not velocity). The Luenberger observer runs a copy of those dynamics and bolts on a correction term proportional to how wrong its predicted output is:

x^˙=Ax^+Bu+L(yCx^)\dot{\hat{x}} = A \hat{x} + B u + L\,(y - C \hat{x})

The term yCx^y - C\hat{x} is the innovation, the surprise between what you measured and what your model expected. Define the estimation error e=xx^e = x - \hat{x}. Subtract the observer from the plant and the input cancels, leaving a clean autonomous equation for how the error decays:

e˙=(ALC)e+noise\dot{e} = (A - L C)\,e + \text{noise}

Now the design is laid bare. Choose LL so that ALCA - L C has stable eigenvalues, and the error collapses to zero on its own. Place those eigenvalues deep in the left-half-plane for fast convergence, but the deeper you push, the larger LL grows, and the more raw measurement noise the correction term injects. That tension is the speed-versus-noise trade-off you felt in the sliders. The Kalman filter resolves it by picking the LL that minimizes the steady-state covariance of ee for the given noise levels: the provably optimal gain.

Key takeaways

An observer is the humblest idea in control and the most profound: you can never see the whole world, so you carry a model of it in your head and let your eyes nudge that model back toward the truth, one glance at a time.

Make the world noisy and "nudge it just right" stops being a hunch and becomes a theorem. Its name is the Kalman filter, and it is the doorway out of control theory and into the estimation half of robotics.

full glossary →