Library / Control engineering / CTL-21
Control engineering
Scalar LQR feedback gain
Optimal state-feedback gain for the scalar plant ẋ = ax + bu that minimises the integral of Qx² + Ru².
- Ref
- CTL-21
- Rev
- v1
- Field
- Control engineering
- Result
- K
For the scalar plant ẋ = ax + bu with cost ∫(Qx² + Ru²) dt, the Riccati equation 2aP − (b²/R)P² + Q = 0 has the stabilising solution P = R(a + √(a² + b²Q/R))/b². The optimal control is u = −Kx with K = bP/R. The closed-loop pole is a − bK = −√(a² + b²Q/R), which is always in the left half-plane for Q > 0, even if the plant is unstable.
Optimal state-feedback gain for the scalar plant ẋ = ax + bu that minimises the integral of Qx² + Ru². It is the stabilising solution of the algebraic Riccati equation; the closed-loop pole moves to -√(a² + b²Q/R).
Calculator
- Riccati solution, P = R(a + √(a² + b²Q/R)) / b²2
- Closed-loop pole, a − bK−2 1/s
- Open-loop pole, a0 1/s
- Weight ratio Q / R4
What drives the result
Each variable is moved across its typical range while the others stay at the values above. The longest bar is the key driver.
- For ẋ = u with Q = 4 and R = 1 the gain is 2 and the closed-loop pole is −2, so u = −2x. Quadrupling Q to 16 raises the gain to 4 and moves the pole to −4: a faster response bought with more control effort.
- The design stabilises even an unstable plant. With a = 1 (unstable) the gain is 3.236 and the pole is at −2.236.
Chart data as tables
Ranked variables
| Variable | Typical range | Lowest result | Highest result | Swing () | Local step | Change in result |
|---|---|---|---|---|---|---|
| R Input weight | 0.1 to 10 | 0.6325 | 6.325 | 5.692 | +10% | −4.65 % |
| a Plant coefficient a | −2 to 2 1/s | 0.8284 | 4.828 | 4 | +0.08 1/s | +4.08 % |
| Q State weight | 0.5 to 20 | 0.7071 | 4.472 | 3.765 | +10% | +4.88 % |
| b Input gain b | 0.5 to 3 | 2 | 2 | 0 | +10% | 0 % |
Sweep of State weight
| State weight | Feedback gain |
|---|---|
| 0.5 | 0.7071 |
| 2.938 | 1.714 |
| 5.375 | 2.318 |
| 7.813 | 2.795 |
| 10.25 | 3.202 |
| 12.69 | 3.562 |
| 15.13 | 3.889 |
| 17.56 | 4.191 |
| 20 | 4.472 |
Sweep one variable
Variables and how each one contributes
Feedback gain
What the equation gives you. Everything else feeds it.
Plant coefficient a
The plant coefficient in 1/s. A positive value is an unstable plant, a negative value a stable one. A larger a means a plant that is less stable and needs more feedback gain to hold. Raising it by 0.5 1/s (to 0.5 1/s) moves the result by +28.1 %, from 2 to 2.562.
Input gain b
The input gain: how strongly the control acts on the state. Only the product bK moves the pole. When the plant has no dynamics of its own (a = 0) the gain is √(Q/R) whatever b is, so a stronger input changes nothing; when a is not zero a larger b lowers K a little. Raising it by 10 % (to 1.1) moves the result by +0 %, from 2 to 2.
State weight
The weight on state error in the cost. Larger Q penalises deviations more. A heavier state penalty raises the gain and speeds the response, at the cost of more control effort. Raising it by 10 % (to 4.4) moves the result by +4.88 %, from 2 to 2.098.
Input weight
The weight on control effort in the cost. Larger R penalises actuator use more. A heavier effort penalty lowers the gain and slows the response. Raising it by 10 % (to 1.1) moves the result by −4.65 %, from 2 to 1.907.
Worked example with the values above
- Inside the root: a² + b²Q/R = 0 + 1 × 4 / 1 = 4, so its square root is 2.
- Gain: K = (a + √...)/b = (0 + 2) / 1 = 2.
- Closed-loop pole: a − bK = 0 − 1 × 2 = −2.
Assumptions and limits
- A scalar linear plant with full state measurement, an infinite horizon and an unconstrained control input.
- Q ≥ 0 and R > 0, and the stabilising Riccati solution is used.
Common mistakes
- Treating Q and R as physical quantities. They are design weights, and the states and inputs should be scaled so that a weight of 1 corresponds to an acceptable error or effort.
- Forgetting that saturating an LQR command changes its closed-loop behaviour. The guarantees assume an unconstrained input.
Statistics and uncertainty
K depends on the weights only through the ratio Q/R (for fixed a and b), so scaling both by the same factor changes nothing. Q and R are design weights, not measured quantities, so they carry no sampling uncertainty. The plant parameters a and b do: a 10 % error in b changes the delivered closed-loop pole by about the same amount, since the pole shift is the product bK.
Where it is used
- Seeing how the cost weights trade state error against control effort, before moving to the matrix problem.
- Providing a first estimate of the gain and closed-loop speed for a single-state loop.
Maths you need
- Quadratic cost: integral of Qx² + Ru²
- Riccati equation: a quadratic equation for P in the scalar case