S9 · Lesson 38 · The linear-quadratic regulator
Choosing state-feedback gains by minimizing a quadratic cost on state error and control effort, the algebraic Riccati equation, the scalar and double-integrator solutions, Bryson's rule for the weights, and the margins an LQR loop is guaranteed
Pole placement lets you put the poles anywhere, which raises an awkward question: where? Fast poles need large gains and large actuator effort; slow ones leave errors uncorrected. Kálmán's answer in 1960 was to state the trade-off as a cost, the integral of squared state error plus squared control effort, and find the feedback that minimizes it. The result, the linear-quadratic regulator, picks every gain at once from two weights, and as a bonus comes with guaranteed stability margins that hand-placed poles don't have.
- A one-state plant under the LQR that minimizes , against the weight ratio ρ = q/r on a log axis.
- The closed-loop pole sits at and the gain is . Cheap control (large ρ) gives a fast pole and a big gain.
- Expensive control (ρ → 0) barely acts: a stable plant is left alone, but an unstable pole at +a is mirrored to −a, the least effort that stabilizes it.
Predict
A double integrator gets the LQR with Q = diag(q, 0) and R = 1. What damping ratio do its closed-loop poles have, whatever q is?
The Riccati equation gives K = , so the closed loop is : and ζ = = 0.707 exactly. The weight sets the speed; the optimization picks the damping on its own.
Name it
The problem
For , find u minimizing
The solution
If (A, B) is controllable, the optimum is state feedback with
the algebraic Riccati equation, with P the positive-definite solution. The minimum cost from is .
One state, , : , so
Double integrator, Q = diag(q, 0), R = 1: , , ζ = 0.707.
Choosing the weights
Bryson's rule: make each term about one at its largest acceptable value: and . Then adjust: raise a state's weight to tighten it, raise R to calm the actuator.
Guaranteed margins
With full state feedback and one input, the LQR loop gain always keeps : its Nyquist plot stays outside the unit circle around −1. That guarantees a gain margin from 1/2 to ∞ and a phase margin of at least 60°. An observer in the loop can destroy these guarantees, a famous result of John Doyle (1978), which is why lesson 39's estimator must be checked.
Worked example
An unstable plant gets the LQR with q = 3, r = 1. Find P, the gain and the closed-loop pole.
Show the solution
- Riccati solution. which satisfies .
- Gain and closed loop. The gain is K = 3, so a pole at .
- Cost. Starting from = 1, the cost is
Answer P = 3 and K = 3, with the closed-loop pole at −2.
Worked example
A position stage should stay within 0.1 m and its amplifier delivers at most 12 V. Set up Bryson's weights.
Show the solution
- Bryson's weights. One over the square of each allowed size: on position and voltage, a ratio q/r = 14,400.
- What that gives. For a double integrator with unit input gain, that's like q = 14,400 with r = 1, giving at ζ = 0.707.
- Adjust. If the step responses then saturate the amplifier, raise r.
Answer q = 100 on position and r = 0.00694 on voltage.
Worked example
An unstable plant gets the LQR with r = 1. Find the gain and pole for q = 0, 5 and 96.
Show the solution
- Pole.
- Gain. For the three weights:
| q | Pole | K |
|---|---|---|
| 0 | −2 | 4 |
| 5 | −3 | 5 |
| 96 | −10 | 12 |
- When the state costs nothing. Even then the LQR must stabilize, and the cheapest way mirrors the unstable pole into the left half-plane.
- Heavier weights. Heavier state weights then push the pole out roughly as .
Answer q = 0 gives a pole at −2 with K = 4, q = 5 gives −3 with K = 5, and q = 96 gives −10 with K = 12.
Check
gets the LQR for . Where's the closed-loop pole?
Write units the way you normally would: 1.5 rad/s and 1500 mrad/s are the same answer.
Check
For the same plant and cost, what's the LQR gain K?
Check
A double integrator gets the LQR with Q = diag(81, 0), R = 1. What's its velocity gain?
Check
By Bryson's rule, a state may reach 0.2 and the input 5. What's the weight ratio q/r?
Check
with cost weights q = 8, r = 2, starting from x = 2. What's the minimum cost?
Check
For , what weight ratio q/r makes the LQR put the pole at −20?
Check
The plant gets the LQR for , starting from x = 1.
(a)
What is P?
(b)
What is the gain K?
(c)
What is the minimum cost?
Check
The scalar LQR for with weights q and r.
Step 1
Where is the closed-loop pole?
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
What is P?
Step 3
What is K?
Explain why
Why does an LQR with expensive control move an unstable pole to its mirror image rather than just barely into the left half-plane?
When control is expensive, the optimal controller uses as little effort as it can while still keeping the cost finite. An unstable mode left alone would grow forever and make the state cost infinite, so it must be stabilized, but any effort beyond the minimum is wasted. Moving the pole from +a to −a turns out to be that minimum: the state decays at the same rate it would otherwise have grown, and the effort needed is just enough to reverse the growth. Moving it only barely past zero would leave the state decaying so slowly that its accumulated cost would be larger than the effort saved.
Practice
Keep practicing
10 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.