Skip to the lesson
FixTheRobot Explore Robotics / Guidance, Navigation and Control / M5 Nonlinear, Scheduled and Adaptive Control / M5-T2

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.

  • Lesson 2 of 7
  • Intermediate
  • Module 5: Nonlinear, Scheduled and Adaptive Control
  • Theory
  • About 13 minutes to read

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 b/(s2−λ2)b/(s^2 - \lambda^2) whose gain b=Tl/Jb = T l / J is proportional to the thrust, and the thrust needed to fly it is proportional to the mass. At liftoff (120 kg) b=19.62b = 19.62; at burnout (72 kg) it is 11.77. A design with poles at ωn=4, ζ=0.7\omega_n = 4,\ \zeta = 0.7 for the first value has, at burnout, ωn=3.07\omega_n = 3.07 and ζ=0.55\zeta = 0.55: slower and less damped. The opposite choice, tuned at burnout, has ωn=5.20\omega_n = 5.20 and ζ=0.90\zeta = 0.90 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: Kp(m)K_p(m) and Kd(m)K_d(m) are inversely proportional to b(m)b(m), 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.

Damping of the pitch loop across the burn for three designsDamping ratio against mass from 72 to 120 kilograms. A design fixed at liftoff has damping 0.70 at 120 kilograms falling to 0.55 at 72 kilograms. A design fixed at burnout has damping 0.70 at 72 kilograms rising to 0.90 at 120. The scheduled design stays at 0.70 over the whole range.728088961041121200.40.50.60.70.80.91Hopper mass (kg), burnout on the leftdamping ratio of the pitch loop fixed at liftoff fixed at burnout scheduled
Damping ratio of the pitch loop across the burn. A fixed design at liftoff loses damping as the mass falls; a fixed design at burnout is over-damped early; the scheduled gains hold 0.7 throughout.

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 σ\sigma
A measured or estimated quantity, here the mass mm, that tracks the change of the plant and varies slowly: dynamic pressure, Mach number, altitude, mass.
Operating points
The values of σ\sigma at which linear designs are made. The gains between them are interpolated.
Frozen-parameter design
A linear design made with σ\sigma held constant at one value.
Slow variation
The condition that ∣σ˙∣|\dot{\sigma}| is small against the bandwidth of the loop, so that the time-varying loop behaves as the frozen ones in succession.
The schedule for Hopper's pitch loop
b(m)=m g lJ,Kp(m)=ωn2+λ2b(m),Kd(m)=2ζωnb(m)b(m) = \dfrac{m\,g\,l}{J}, \qquad K_p(m) = \dfrac{\omega_n^2 + \lambda^2}{b(m)}, \qquad K_d(m) = \dfrac{2\zeta\omega_n}{b(m)}
The thrust is taken as the weight, T=mgT = m g, so the gimbal authority follows the mass. The gains are inversely proportional to bb, which holds the closed-loop characteristic polynomial s2+2ζωns+ωn2s^2 + 2\zeta\omega_n s + \omega_n^2 at every mass.
The slow-variation condition (qualitative)
σ˙  ≪  (bandwidth of the loop)×(size of the change in the design across the range)−1\dot{\sigma}\; \ll\; \text{(bandwidth of the loop)} \times \text{(size of the change in the design across the range)}^{-1}
The precise statements in the literature bound the rate in terms of the margin of the frozen designs. For Hopper the time constant is 0.36 s and the mass changes by 0.29 kg in that time, 0.24% of the total.

Derivation: the schedule, and the cost of a fixed design

The pitch plant with gimbal authority bb, a PD controller, and the closed-loop polynomial.

  1. θ¨=λ2θ+b δ,δ=−Kpθ−Kdq\ddot{\theta} = \lambda^2\theta + b\,\delta, \qquad \delta = -K_p\theta - K_d q

    The pitch channel of the Hopper fact sheet with a PD law (the reference is dropped for the pole analysis).

  2. s2+bKd s+(bKp−λ2)=0s^2 + b K_d\,s + (b K_p - \lambda^2) = 0

    The characteristic polynomial of the closed loop.

  3. bKd=2ζωn,bKp−λ2=ωn2b K_d = 2\zeta\omega_n, \qquad b K_p - \lambda^2 = \omega_n^2

    Match to the desired polynomial.

  4. Kp=ωn2+λ2b,Kd=2ζωnbK_p = \dfrac{\omega_n^2 + \lambda^2}{b}, \quad K_d = \dfrac{2\zeta\omega_n}{b}

    Solve. The gains are proportional to 1/b, which is the schedule: with b(m)b(m) from the mass estimate, the poles do not move.

The cost of a fixed design

  1. ωn2(m)=b(m)Kpfixed−λ2=b(m)b0(ωn02+λ2)−λ2\omega_n^2(m) = b(m)K_p^{\mathrm{fixed}} - \lambda^2 = \dfrac{b(m)}{b_0}(\omega_{n0}^2 + \lambda^2) - \lambda^2

    Fix the gains at their liftoff values, designed for b0b_0. Then the natural frequency follows b(m)b(m).

  2. at m=72:  ωn2=0.6⋅16.49−0.49=9.40, ωn=3.07\text{at } m = 72:\ \ \omega_n^2 = 0.6\cdot 16.49 - 0.49 = 9.40, \ \omega_n = 3.07

    The ratio of authorities is 72/120=0.672/120 = 0.6. The natural frequency falls 23%.

  3. ζ(m)=b(m)Kdfixed2ωn(m)=0.6⋅5.62⋅3.07=0.55\zeta(m) = \dfrac{b(m)K_d^{\mathrm{fixed}}}{2\omega_n(m)} = \dfrac{0.6\cdot 5.6}{2\cdot 3.07} = 0.55

    The damping term also scales with bb, 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 ωn=4, ζ=0.7\omega_n = 4,\ \zeta = 0.7 (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).

  1. Authority. With T=mgT = m g: b = 19.62 at 120 kg, 15.70 at 96 kg and 11.77 at 72 kg.
  2. The two fixed designs. Liftoff: Kp=0.8405, Kd=0.2854K_p = 0.8405,\ K_d = 0.2854. Burnout: Kp=1.4008, Kd=0.4757K_p = 1.4008,\ K_d = 0.4757.
  3. Crossing over. The liftoff gains at burnout give ωn=3.07\omega_n = 3.07 and ζ=0.55\zeta = 0.55. The burnout gains at liftoff give ωn=5.20\omega_n = 5.20 and ζ=0.90\zeta = 0.90.
  4. 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.
  5. 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%.
  6. 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
The gains are computed from the authority b(m); margins come from g.margins of the open loop; the time-varying simulation lets the mass fall with time inside the right-hand side.

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

  1. Gain scheduling designs linear loops at operating points and interpolates the gains on a measured variable.
  2. For Hopper's pitch loop the gains are (ωn2+λ2)/b(m)(\omega_n^2 + \lambda^2)/b(m) and 2ζωn/b(m)2\zeta\omega_n/b(m), which keeps the poles fixed as the mass falls.
  3. 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.
  4. Frozen-parameter designs describe the scheduled loop only if the variable changes slowly compared with the loop.
  5. The scheduled loop inherits no margin guarantee between the points: check intermediate values and the estimator that supplies the variable.
  6. 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

Practice this lesson

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.

Next lesson

M5-T3 — Dynamic Inversion and Its Incremental Form

Cancel a known nonlinearity by feedback linearization, state what the method assumes about the model, and explain how incremental inversion replaces the model with a measurement.

Nothing below is required to finish this lesson.

  • Before
    M5-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.

  • Lab
    M5-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:

This course leaves the following to the pages that already teach them: