Guidance, Navigation and Control · Theory · M5
M5-T2 — Gain Scheduling
A fleet of linear designs, one per operating point, joined by a lookup table. It is the oldest way to fly a nonlinear vehicle, and its guarantees are weaker than they look.
Hopper loses 40% of its mass during the burn, and the authority of its gimbal falls with it. A pitch loop tuned at liftoff is a different loop at burnout. Gain scheduling designs the linear loop at several operating points and interpolates the gains on a measured variable. This lesson derives the schedule for Hopper, shows what a fixed design costs at the two ends of the flight, and states the conditions under which the scheduled loop inherits the properties of the designs it was built from.
Learning objectives
After this lesson, you should be able to:
- Schedule the gains of a pitch loop on mass so that the closed-loop poles stay fixed through the burn.
- Quantify the damping and delay margin lost by a fixed design at the other end of the flight.
- State the slow-variation condition under which frozen-parameter designs describe the time-varying loop.
- List what a scheduled loop does not inherit from its designs.
The intuition
UAV M5-T5: Attitude control runs one set of gains over the flight of a multirotor, whose dynamics change little. A rocket, an aircraft crossing its dynamic-pressure range or a vehicle burning half its mass does not have that luxury, and the schedule is the standard answer.
Why one design is not enough
Hopper's pitch loop has a plant whose gain is proportional to the thrust, and the thrust needed to fly it is proportional to the mass. At liftoff (120 kg) ; at burnout (72 kg) it is 11.77. A design with poles at for the first value has, at burnout, and : slower and less damped. The opposite choice, tuned at burnout, has and at liftoff, but its delay margin there falls from 0.18 s to 0.13 s. Neither fixed design is wrong, but neither is the design that was intended.
The schedule
Because the dependence of the plant on mass is known, the fix is to make the gains follow it: and are inversely proportional to , so that the loop gain, and with it the closed-loop poles, are the same at every mass. The scheduling variable is the mass estimate, the same one the navigation state carries. For Hopper the schedule is a single formula; for an aircraft it is a table in dynamic pressure and Mach number, one set of gains per entry, interpolated.
What the schedule does not promise
The scheduled loop is a time-varying system, not a fleet of linear ones. Its properties follow from the frozen designs only if the scheduling variable moves slowly compared with the loop dynamics. Hopper's mass changes by 0.8 kg/s, while the loop's time constant is 0.36 s, so the mass changes by 0.29 kg (0.24%) during one time constant and the condition is comfortably met. If the variable moved as fast as the loop, or if the schedule depended on a quantity that the loop itself changes rapidly (angle of attack in a hard manoeuvre), the guarantee would be lost.
Gain scheduling keeps the closed-loop poles where they were designed by following a known change in the plant. It is valid only while the scheduling variable moves slowly, and it gives no guarantees of its own beyond those of the point designs.
Definitions
- Scheduling variable
- A measured or estimated quantity, here the mass , that tracks the change of the plant and varies slowly: dynamic pressure, Mach number, altitude, mass.
- Operating points
- The values of at which linear designs are made. The gains between them are interpolated.
- Frozen-parameter design
- A linear design made with held constant at one value.
- Slow variation
- The condition that is small against the bandwidth of the loop, so that the time-varying loop behaves as the frozen ones in succession.
Derivation: the schedule, and the cost of a fixed design
The pitch plant with gimbal authority , a PD controller, and the closed-loop polynomial.
The pitch channel of the Hopper fact sheet with a PD law (the reference is dropped for the pole analysis).
The characteristic polynomial of the closed loop.
Match to the desired polynomial.
Solve. The gains are proportional to 1/b, which is the schedule: with from the mass estimate, the poles do not move.
The cost of a fixed design
Fix the gains at their liftoff values, designed for . Then the natural frequency follows .
The ratio of authorities is . The natural frequency falls 23%.
The damping term also scales with , but it is divided by the lower natural frequency, giving a damping of 0.55 rather than 0.7.
Because the plant is known to depend on mass, the gains can be made to follow it. The scheduled design is exactly the point designs, provided the mass varies slowly; a fixed design is the right design at one end of the flight only.
A worked example
Hopper's pitch loop, designed for (the plant here is the rigid pitch dynamics without servo or delay, so the margins differ from the 55.5° of module 3, which included the gimbal servo).
- Authority. With : b = 19.62 at 120 kg, 15.70 at 96 kg and 11.77 at 72 kg.
- The two fixed designs. Liftoff: . Burnout: .
- Crossing over. The liftoff gains at burnout give and . The burnout gains at liftoff give and .
- Margins. The scheduled loop has the same loop shape at every mass: crossover 6.13 rad/s, phase margin 64.4°, delay margin 0.183 s. The liftoff gains at burnout have crossover 4.04 rad/s and a delay margin of 0.233 s (more margin but less bandwidth); the burnout gains at liftoff cross at 9.70 rad/s with a delay margin of only 0.132 s.
- Time-varying simulation. With the mass falling at 0.8 kg/s and steps of 0.1 rad at 1 s and 55 s the scheduled loop overshoots by 7.8% both times. The liftoff design overshoots 8.0% at 1 s and 17.6% at 55 s; the burnout design 2.0% and 7.0%.
- Reading. The scheduled loop is the only one with the same response at both ends. The burnout design looks better on overshoot, because it is faster and more damped at liftoff, but it pays with the delay margin there: the choice between them is a choice of which margin to give up.
import math
import gnckit as g
lam2, g0 = 0.49, 9.81
J, l, dry, prop = 60.0, 1.0, 72.0, 48.0
Tmax = 2400.0
m0 = dry + prop
def bgain(mass):
"""Gimbal authority b = T l / J at a thrust that holds a fixed 1.2 g climb: T = 1.2 m g (the mass falls, so does the thrust)."""
return mass * g0 * l / J
def design(b, wn=4.0, zeta=0.7):
return (wn ** 2 + lam2) / b, 2 * zeta * wn / b
def loop_margins(b, kp, kd):
# L(s) = b (kp + kd s) / (s^2 - lam2)
num = [b * kd, b * kp]
den = [1.0, 0.0, -lam2]
L = g.TF(num, den)
return g.margins(L)
print('gimbal authority b = T l / J with T = m g:')
for mass in (120.0, 96.0, 72.0):
print(f' m = {mass:5.1f} kg: b = {bgain(mass):6.2f}')
bl, bb = bgain(120.0), bgain(72.0)
kp_l, kd_l = design(bl)
kp_b, kd_b = design(bb)
print(f'liftoff design Kp = {kp_l:.4f}, Kd = {kd_l:.4f}')
print(f'burnout design Kp = {kp_b:.4f}, Kd = {kd_b:.4f}')
def poles_zeta(b, kp, kd):
s = [complex(p) for p in g.mat_eigvals([[0, 1], [lam2 - b * kp, -b * kd]])]
p = s[0]
return abs(p), -p.real / abs(p)
wn, z = poles_zeta(bb, kp_l, kd_l)
print(f'liftoff gains at burnout: wn = {wn:.2f} rad/s, zeta = {z:.2f}')
wn, z = poles_zeta(bl, kp_b, kd_b)
print(f'burnout gains at liftoff: wn = {wn:.2f} rad/s, zeta = {z:.2f}')
def delay_margin(b, kp, kd):
m = loop_margins(b, kp, kd)
return m.pm, m.wgc, m.dm
for name, b, kp, kd in (('scheduled at liftoff', bl, kp_l, kd_l), ('scheduled at burnout', bb, kp_b, kd_b),
('liftoff gains at burnout', bb, kp_l, kd_l), ('burnout gains at liftoff', bl, kp_b, kd_b)):
pm, wc, dm = delay_margin(b, kp, kd)
print(f' {name:26s} crossover {wc:5.2f} rad/s, PM {pm:5.1f} deg, delay margin {dm:.3f} s')
# time-varying simulation: the mass falls at 0.8 kg/s, thrust 1.2 m g, pitch steps of 0.1 rad commanded at t = 1, 30, 55 s
mdot = 0.8
def run(mode):
def f(t, s):
mass = max(dry, m0 - mdot * t)
b = bgain(mass)
ref = 0.1 if t >= 1.0 else 0.0
if t >= 30.0:
ref = 0.0
if t >= 55.0:
ref = 0.1
if mode == 'scheduled':
kp, kd = design(b)
elif mode == 'fixed-liftoff':
kp, kd = kp_l, kd_l
else:
kp, kd = kp_b, kd_b
u = max(-0.15, min(0.15, -(kp * (s[0] - ref) + kd * s[1])))
return [s[1], lam2 * s[0] + b * u]
return g.integrate(f, [0.0, 0.0], 60.0, 0.002)[1]
def settling(xs, t0, t1, ref, dt=0.002):
seg = xs[int(t0 / dt):int(t1 / dt)]
over = max(0.0, (max(s[0] for s in seg) - ref) / ref * 100) if ref else 0.0
return over
for mode in ('fixed-liftoff', 'fixed-burnout', 'scheduled'):
xs = run(mode)
o1 = settling(xs, 1.0, 10.0, 0.1)
o3 = settling(xs, 55.0, 60.0, 0.1)
print(f' {mode:14s}: overshoot of the step at t = 1 s: {o1:5.1f}%, at t = 55 s: {o3:5.1f}%')
m = 120 - 0.8 * 1
print('mass rate 0.8 kg/s against a pitch time constant of 0.36 s (1/(zeta wn)): the mass changes by 0.29 kg per time constant, 0.24% of 120 kg')gimbal authority b = T l / J with T = m g: m = 120.0 kg: b = 19.62 m = 96.0 kg: b = 15.70 m = 72.0 kg: b = 11.77 liftoff design Kp = 0.8405, Kd = 0.2854 burnout design Kp = 1.4008, Kd = 0.4757 liftoff gains at burnout: wn = 3.07 rad/s, zeta = 0.55 burnout gains at liftoff: wn = 5.20 rad/s, zeta = 0.90 scheduled at liftoff crossover 6.13 rad/s, PM 64.4 deg, delay margin 0.183 s scheduled at burnout crossover 6.13 rad/s, PM 64.4 deg, delay margin 0.183 s liftoff gains at burnout crossover 4.04 rad/s, PM 53.9 deg, delay margin 0.233 s burnout gains at liftoff crossover 9.70 rad/s, PM 73.1 deg, delay margin 0.132 s fixed-liftoff : overshoot of the step at t = 1 s: 8.0%, at t = 55 s: 17.6% fixed-burnout : overshoot of the step at t = 1 s: 2.0%, at t = 55 s: 7.0% scheduled : overshoot of the step at t = 1 s: 7.8%, at t = 55 s: 7.8% mass rate 0.8 kg/s against a pitch time constant of 0.36 s (1/(zeta wn)): the mass changes by 0.29 kg per time constant, 0.24% of 120 kg
In robotics
Scheduling is the standard way flight control copes with a changing plant.
- Aircraft. The gains of an autopilot are tabulated against dynamic pressure and Mach number, because the control effectiveness of the surfaces scales with dynamic pressure. The same ratio argument as for Hopper's mass gives the table.
- Launchers and landers. Mass, thrust, centre-of-mass position and (for a launcher) aerodynamic pressure all change on a known schedule during the flight, and gains are interpolated against time or an estimate of them.
- Choosing the variable. The scheduling variable must track the change in the plant, be measured or estimated well, and move slowly. A variable that depends on the loop's own fast states, such as angle of attack in a manoeuvre, hides a nonlinear feedback inside the schedule that the point designs do not account for.
- Interpolation. Interpolating gains between points does not interpolate stability: two stable designs can have an unstable mixture. The margins must be checked at points between the table entries, not only at them.
- Hidden couplings. The estimator that provides the scheduling variable is part of the loop. A wrong mass estimate gives the wrong gains, which shows as a loss of damping like the fixed designs above.
The lab M5-L1: Schedule the Gains Through the Burn asks for the schedule of the whole Hopper flight with the margins held. The way to handle a plant too nonlinear for a schedule is the inversion of M5-T3: Dynamic Inversion and Its Incremental Form.
Common misconceptions
“Gain scheduling is a nonlinear controller with a proof.”
It is a set of linear designs joined by interpolation. Without the slow-variation condition, and a check between the points, the scheduled loop has no guarantee at all beyond the point designs.
“If both designs are stable the interpolated one is stable.”
A mixture of stable linear systems can be unstable. The margins must be examined at intermediate values of the scheduling variable.
“Schedule on any measured variable.”
The variable must track the plant change and vary slowly relative to the loop. A fast variable, or one that the loop itself moves, turns the schedule into a hidden feedback path that the design never analysed.
“The scheduled gains are the same as a robust fixed design.”
A fixed design must be robust to the whole range, which costs performance at every point. The schedule gives the intended response everywhere and relies on the knowledge of the plant change instead.
“A fixed liftoff design goes unstable at burnout.”
For Hopper's pitch loop the cost is lost damping (ζ 0.7 to 0.55) and bandwidth, not instability. The reverse crossing costs delay margin. The failure of a fixed design shows up first as degraded response and margin, not as divergence.
Key takeaways
- Gain scheduling designs linear loops at operating points and interpolates the gains on a measured variable.
- For Hopper's pitch loop the gains are and , which keeps the poles fixed as the mass falls.
- A fixed liftoff design has ζ = 0.55 and ωn = 3.07 at burnout; a fixed burnout design has delay margin 0.132 s at liftoff against 0.183 s scheduled.
- Frozen-parameter designs describe the scheduled loop only if the variable changes slowly compared with the loop.
- The scheduled loop inherits no margin guarantee between the points: check intermediate values and the estimator that supplies the variable.
- The method fails when the scheduling variable is as fast as the loop or depends on the loop's own fast states.
References and further reading
Each source is marked free or paid. Free to read does not mean free to reuse: the course resources page lists every source with its licence.
- K. J. Åström and R. M. Murray, Feedback Systems, 2nd edition, Princeton University Press, 2021 , the discussion of gain scheduling in the chapters on state feedback and robust performance. Free to read as the authors' PDF; the book is copyrighted.
- W. J. Rugh and J. S. Shamma, "Research on gain scheduling", Automatica 36(10), 2000, a survey of the theory and its conditions. Paid (Elsevier); preprints are often on the authors' pages.
- D. J. Leith and W. E. Leithead, "Survey of gain-scheduling analysis and design", International Journal of Control 73(11), 2000. Paid (Taylor and Francis).
- MIT 16.30 Feedback Control Systems (OpenCourseWare) , the notes on gain scheduling and its use in aircraft control. Free; licence CC BY-NC-SA 4.0.
Knowledge check
Three questions. Write an answer, then reveal the explanation. Your answers stay in your browser.
Question 1
Hopper's pitch gains are fixed at their liftoff values. Without computing, say what happens to the damping and bandwidth at burnout and why.
Explanation
The plant gain b is proportional to the mass, so at burnout it is 72/120 = 0.6 of its liftoff value. The loop gain falls by that factor, so the closed-loop natural frequency falls (from 4 to 3.07 rad/s) and the damping term, scaled by the same factor but divided by a smaller natural frequency, ends at 0.55 instead of 0.7. The loop is slower and less damped, but still stable: lowering the gain of a PD loop around an unstable pole of 0.7 rad/s leaves a large margin.
Question 2
Why must the scheduling variable change slowly, and does the mass of Hopper satisfy that?
Explanation
The point designs describe the loop with the parameter frozen. If the parameter changes at the speed of the loop, the loop sees the change as an extra disturbance and extra dynamics that the frozen designs do not contain, so their margins say nothing about it. Hopper's mass changes by 0.8 kg/s, 0.29 kg during one 0.36 s time constant, about 0.24% of its mass, so the loop has effectively time to settle at every mass and the condition holds comfortably.
Question 3
A table has designs at 120 kg and 72 kg and the gains are interpolated linearly in mass between them. Why check margins at 96 kg?
Explanation
Stability and margin are not linear in the gains, so the interpolated design is a new loop that was never designed. Both end designs can be good while the loop between them is poor, particularly when the closed-loop poles move far. For Hopper the interpolated gains do not follow the 1/b law exactly, so the damping at 96 kg is not 0.7. The check at intermediate points is the only way to know what the loop is there.
What’s next
Related content
Nothing below is required to finish this lesson.
- BeforeM5-T1: Lyapunov Stability
State Lyapunov's direct method and the invariance principle, and use an energy-like function to prove that a nonlinear loop is stable.
- LabM5-L1: Schedule the Gains Through the Burn
Hopper loses 40% of its mass during a flight, so a single fixed design loses damping at burnout (or delay margin at liftoff). Schedule the gains on estimated mass and hold the margins over the whole flight.
Other courses on this site treat neighbouring topics from their own angle:
- Lab: Build a CBF Safety Filter
- Navigation M7-T2: Safety Filters: Control Barrier Functions
- UAV M5-T5: Attitude control
- UAV M5-T16: Disturbance rejection and wind compensation
- UAV M1-T6: Roll, pitch, yaw and thrust generation
- Linear Algebra M6-T7: The Moore-Penrose Pseudoinverse
- Linear Algebra M8-T9: Null-Space Control
- Robot Learning M9-T4: Hybrid Learning and Control Systems
This course leaves the following to the pages that already teach them:
Get notified when the next lesson and new labs are released.
One email per new lesson or lab.