DESIGN DECISIONS 8 MIN READ

Choosing Q and R for LQR without guesswork

Q = I and R = 1 mean different things in different units. Bryson's rule turns each weight into an allowed size; a two-state axis shows what rescaling does.

Q = I and R = 1 is the usual first try, and it has no physical meaning: write position in millimetres instead of metres and the same identity matrix asks for a position gain a thousand times larger. Bryson's rule replaces the guess with a question you can answer from the specification: how large may each state and each input become?

01 / FIELD NOTE

Weights carry units

LQR minimises J = ∫(xᵀQx + uᵀRu) dt. Each term is a squared state or input times its weight, so a weight has the inverse units of that square. Bryson's rule picks the weights so that every term is dimensionless: Qᵢᵢ = 1/xᵢ,max² and Rⱼⱼ = 1/uⱼ,max², where xᵢ,max and uⱼ,max are the largest values you are willing to accept. A state at its allowance then costs as much as an input at its allowance.

02 / FIELD NOTE

A two-state axis

Take a linear axis with position x in metres, velocity v in m/s and drive voltage u in volts: ẋ = v and v̇ = −4v + 0.2u, so the velocity settles with a 0.25 s time constant at 0.05 m/s per volt. Allow 2 cm of position error, 0.2 m/s of speed and 10 V of drive. Bryson's rule gives Q = diag(2500, 25) and R = 0.01, and the Riccati equation gives K = [500 V/m, 68.9 V·s/m]. The closed-loop poles are −8.89 ± j4.58: a natural frequency of 10 rad/s with a damping ratio of 0.89.

Start the axis at rest 2 cm from its target. The first command is exactly −10 V, the voltage allowance; the speed peaks at 0.079 m/s, well inside its 0.2 m/s; and the position stays within 2% of zero after 0.46 s. The first number is not luck. For this structure the (1,1) entry of the Riccati equation gives the position gain as K₁ = √(Q₁₁/R) whatever the plant's time constant, so K₁·x_max = u_max.

03 / FIELD NOTE

What scaling does

Multiply Q and R by the same number and nothing changes: J is scaled, its minimiser is not, and K stays [500, 68.9]. Only the ratios matter, so it is common to keep Bryson's Q and write R = ρ/u_max², which leaves one knob. ρ below 1 says the input is cheaper than its allowance suggests; above 1, dearer.

Going from ρ = 1 to ρ = 0.1 multiplies the position gain and the first command by √10 ≈ 3.16, and going to ρ = 10 divides them by the same factor. The 2% settling time moves from 0.46 s to 0.41 s and to 0.73 s: more than three times the voltage buys less than 0.05 s. The last two rows of the table are the same axis with the same Q = I; only the length unit differs, and the position gains differ by a factor of a thousand. Bryson's weights written in millimetres, Q = diag(1/20², 1/200²), give back exactly K = [500, 68.9] in V/m.

WeightsK (V/m, V·s/m)Closed-loop polesFirst command from 2 cm
Bryson, ρ = 1500, 68.9−8.89 ± j4.5810.0 V
Q and R both × 10500, 68.9−8.89 ± j4.5810.0 V
ρ = 0.11581, 183−10.5, −30.131.6 V
ρ = 10158, 27.2−4.72 ± j3.053.16 V
Q = I, R = 1 in metres1, 0.273−0.050, −4.000.02 V
Q = I, R = 1 in millimetres1000, 985−1.00, −20020 V
04 / FIELD NOTE

Try it in the cart-pole lab

Open the LQR experiment. Its Position cost Qx = 10, Angle cost Qθ = 100 and Force cost R = 1, with both velocity weights fixed at 1, read under Bryson's rule as allowances of 0.32 m, 0.1 rad (5.7°), 1 m/s, 1 rad/s and 1 N. The engine's gain for position, velocity, angle and angular velocity is K = (−2.60, −3.19, −23.6, −3.61). After the 6° start and the 1.2 N·s kick, the force peaks at 5.47 N, the pole at 18.4° and the cart at 0.775 m: every peak exceeds its allowance. The rule scales the cost; it does not enforce the allowances, so compare the run with them.

Set R = 10: K becomes (−0.86, −1.46, −17.0, −2.59) and the peak force falls to 2.42 N. Then set Qx = 100, Qθ = 1000 and R = 10, ten times every weight the lab lets you change: K = (−2.64, −3.07, −23.1, −3.42), close to the default but not equal to it, because the velocity weights stayed at 1. In this lab the overall scale is therefore not free.

05 / FIELD NOTE

Where the rule stops

Bryson's rule is a starting point. The allowances are judgement, diagonal weights cannot say that some combination of states matters more than each state alone, and the guarantees of LQR hold for the linear model. The cart lab adds a 30 N force limit, a 20 ms discrete controller and nonlinear motion, so read its runs as tests of a design, not as proof. The axis is a linear model with no voltage limit, and its first command equals the allowance only for a pure position offset.

TAKEAWAY

Write each weight as one over an allowance squared, then tune one ratio. Scaling all weights together changes nothing; changing units without rescaling the weights changes everything.

CHECK YOUR UNDERSTANDING: You double every entry of Q and R. What happens to K? What if you double only R?

Doubling both leaves K unchanged. Doubling only R is ρ = 2: in the axis example the position gain falls by a factor of √2, from 500 to 354 V/m, and the first command from a 2 cm offset from 10 V to 7.07 V.