LQG: control what you estimate
Combine LQR state feedback with a Kalman state estimate.
Identify the estimate used by the controller and separate ideal optimality from actuator limits.
LQR supplies a feedback gain, and a Kalman filter supplies a state estimate. LQG connects those two pieces.
Review the previous lesson: Kalman filter: infer hidden statesFirst, picture it
LQR knows what to do if it knows all four cart-pole states. The observer supplies estimates when only position and angle sensors are available. The controller then acts on those estimates.
Build the idea step by step
LQG combines the LQR control law with a Kalman state estimate. The controller multiplies the estimate by the feedback gain instead of assuming every true state is measured. Under the usual linear model, quadratic cost, and Gaussian-noise assumptions, with the required stability conditions, the two designs can be separated. This does not mean estimation mistakes are harmless. They change the control command, and input saturation changes the dynamics beyond the ideal theory.
Read the equations
The controller uses the estimated state at sample k. Under the linear, Gaussian-noise, quadratic-cost assumptions and the needed stability conditions, controller and estimator can be designed separately.
What the symbols mean
- sample index, not continuous time
- LQR state feedback gain
- state estimate from the filter
- requested input at this sample
Full-state LQR uses true x; LQG closes the loop with estimated x̂.
An estimate changes the command
Use a scalar normalized example with feedback gain 2. The true state is 0.5, but the filter estimates 0.4.
Estimated-state feedback asks for minus 0.8. If the controller knew the true state, it would ask for minus 1.
If input magnitude is limited to 0.6, both commands are clipped to minus 0.6. The ideal separation result does not remove this nonlinear limit.
More detail and model assumptions
Put the estimator into the feedback path
LQR computes a state-feedback gain K for a stated linearized model and quadratic cost. The Kalman filter supplies an estimate x̂ when the full state is not measured. LQG uses u=−Kx̂: the estimated state now changes the force. This is why observer tuning, unlike a display-only estimate, can change the cart's motion.
The linear separation principle allows controller and estimator gains to be designed separately under its assumptions. It does not make the nonlinear cart-pole globally stable, remove finite rail and force limits, or guarantee tolerance to a badly mismatched noise model.
Run a fair three-way comparison
Keep the initial pole angle, sensor noise seed, force limit and LQR weights fixed. Compare full-state LQR, Kalman-only observation and LQG. The first uses known states for feedback; the second estimates but does not feed that estimate to the force law; the third feeds back the estimate. This isolates what changed in the control path.
Report peak angle, cart travel, applied force and any rail or fall event, not just how smooth the estimate looks. A controller is judged on the actual plant motion under the stated conditions.
Connect the example to the lab
Pin an LQG run, switch to LQR without changing the kick, and compare position recovery, angle and force. Any difference comes from state estimation in this setup.
Feed the estimate into controlMake a prediction before moving a control.
- PREDICTWhen does an estimate become part of control?
- CHANGE ONE THINGPin the Kalman-only preset, then select LQG with unchanged Q/R assumptions and initial condition.
- OBSERVECompare estimated state and applied force as well as angle and cart position.
- EXPLAINIdentify which feedback equation now contains x̂ and where a force limit could break the linear prediction.
LQG is not a guaranteed cure for saturation or model error; a mathematically optimal linear gain can fail against a rail limit.
Check your understanding+
Which signal drives the LQG feedback law?
The estimated state from the observer, rather than the inaccessible true state.Why the next lesson follows
A controller can track a target well yet react poorly to a load or sensor noise. Sensitivity separates these signal paths.