MPC Behind a Dead Time
Open the Hot-Air Balloon Altitude and Landing app
Advanced Control Exercise 17 of 30 in Linear MPC · All exercises · Time: 15 minutes
A hot-air balloon's burner heats the envelope, the temperature sets the climb rate, and the climb rate sets the altitude: three integrations behind a few seconds of dead time. One PID loop on altitude cannot hold that. A dynamic matrix controller, the original industrial MPC, plans with nothing more than the step response you can measure yourself. This exercise measures it, then flies the PID and the MPC on the same level-off.
Learning Outcomes
- Build a step-response prediction model from an open-loop step test.
- Explain why one PID loop hunts on a triple integrator behind a dead time.
- Compare one PID loop with a dynamic matrix controller built from the step test, on the same level-off.
Book Chapter
Model Predictive Control and Economic Optimization (Volume 9), Chapter 2, Hot-Air Balloon Simulator for Landing an Integrating Plant Behind a Dead Time. Read the chapter, open the PDF, or watch the lecture slides.
Theory in Brief
A step-response model predicts the output from past input moves `\Delta u` with the coefficients `a_i` read off a unit step test, here 26 values at 2 s spacing:
$$\hat y_{k+j} = \sum_{i=1}^{n} a_i\, \Delta u_{k+j-i} + b_k, \qquad b_k = y_k^{meas} - \hat y_k$$
The bias `b_k`, the measured output minus the model's, is added across the horizon each step; it is what makes the controller offset-free. Stacking the predictions gives the dynamic matrix `A` of step coefficients, and the unconstrained moves minimize
$$\begin{gathered} J = \left\| r - \hat y_{free} - A\,\Delta u \right\|^2_{Q} + \lambda \left\| \Delta u \right\|^2, \\ \Delta u = \left(A^T Q A + \lambda I\right)^{-1} A^T Q \left(r - \hat y_{free}\right) \end{gathered}$$
so the gain matrix is computed once and each step is one matrix-vector product. Only the first move is applied. The horizon must reach past the dead time `\theta` and well into the response; the move suppression `\lambda` trades speed against burner activity. Here the altitude has no steady state: an integrating output has a step response that keeps growing, which is why the model is truncated at its horizon.
Model: Data-driven. A step response measured on the app's own copy of the balloon at the design point, 26 coefficients.
Decision: The burner blast valve every 2 s, from the first of the planned moves.
Learning: System identification by one step test; the MPC knows nothing else about the balloon.
Exercise
Read 2 min · Predict 1 min · Run 7 min · Explain 3 min · Check your AI 2 min.
Predict. A 20 % step on the burner valve, held: sketch the altitude over the next two minutes. Then predict what one PID loop on altitude does with a 150 m level-off, and whether an MPC built from your step test does better.
Run the Hot-Air Balloon Altitude and Landing app. Use the fastest speed, 20×, and press Run again to pause at the times in each step.
- Open 2 · The step test the MPC is built from. In Manual, press Run and pause at 150 s. Read Climb rate, Off float and Altitude, and the dead time before the delivered heat moves on the trends.
- Open 3 · One PID loop on altitude, hunting and run to 900 s with Control architecture set to PID. Read Altitude at 900 s against the 450 m setpoint and watch the swing.
- Press Reset, set Control architecture to MPC, and run the same case to 900 s.
Explain.
- Why can no single gain stop the PID loop from hunting on this balloon?
- What does the bias term `b_k` do for the MPC when the balloon flies into sinking air that is nowhere in its model?
Generative AI Learning
Check the answer against your run: A good answer builds predictions from step coefficients, gives the least-squares gain with `\lambda`, and credits the bias correction for offset-free control. Check its gain formula against the theory above. The assistant is your tutor and reviewer; you answer for every claim you turn in.
What to Turn In
A table with the step-test readings, and the altitude at 900 s and swing under the PID and under the MPC, your written prediction, and three sentences that answer the two questions.

The step test at 150 s reads Climb rate +4.26 m/s and Off float +22.08 K, and the balloon has climbed to 606 m. The response is an integrator driving an integrator driving an integrator: heat into envelope temperature, temperature into climb rate, climb rate into altitude. There is no steady state to read a gain from.
Under the PID the balloon is at 371 m at 900 s, 79 m from its 450 m setpoint, and the altitude swing between 300 and 900 s is 125 m peak to peak. Three integrations behind a dead time leave one gain no useful bandwidth: more gain widens the swing, less is too slow. The MPC on the same case is at 454 m, 4 m from the setpoint, with a swing of 14 m. It plans the burner from the step response it measured, so it starts cutting the burner long before the balloon reaches 450 m.
The bias `b_k` is the MPC's integral action. A sink that the model does not contain shows up as measured altitude below the predicted one; adding that gap across the horizon makes the plan correct for it.
Measured with the app build of December 3, 2026 by a scripted replay of the steps above. Numbers that no tile shows come from the replay's record; your readings from the trends will be close. A later app release may move the last digit.
Control Tuning tunes MPC horizons and move suppression in GEKKO. Fit the 26 step coefficients from the app's exported step test, build `A`, and compute the first row of `(A^TQA + \lambda I)^{-1}A^TQ` for `\lambda` = 0.004, 0.02 and 1. Plot them: that row is the whole controller.
Related
- Check yourself: three-question quiz
- Course pages: Control Tuning, Model Predictive Control, SISO Model ID, TCLab F
- Exercises: previous: 16 · A First MPC, and a Model That Goes Stale; next: 18 · Offset-Free and Tube MPC on a Coupled Plant
References
- Hedengren, J. D. (ed.), Model Predictive Control and Economic Optimization, Volume 9 of Interactive Control Engineering, Chapter 2, "Hot-Air Balloon Simulator for Landing an Integrating Plant Behind a Dead Time", pp. 22–48, Advanced Process Solutions, 2026. PDF (CC BY 4.0).
- Cutler, C. R., Ramaker, B. L., Dynamic matrix control: a computer control algorithm, Joint Automatic Control Conference, 1980.
