Skip to content

Model Predictive Control

Control method — instantiates Moving-Target Tracking

At each step, optimizes a whole sequence of near-term actions against a forecast of the moving target — subject to hard constraints — then commits only the first action and re-optimizes when the next observation lands.

A reactive controller answers the error in front of it; Model Predictive Control (MPC) plans a route. At each cycle it takes a forecast of where the target is heading, solves an explicit optimization for the whole sequence of actions that would best follow that forecast over a finite horizon — while respecting hard constraints the actions must never violate — and then does something disciplined: it commits only the first action and throws the rest away, re-solving from scratch when the next observation arrives. Its two defining moves are the explicit constrained optimization (it can look several steps ahead and refuse any plan that would breach a limit) and the receding-horizon commitment (it plans far but commits little, so every plan is continuously corrected by fresh data). That combination is what lets it anticipate a moving target without gambling the whole future on a forecast that will drift.

Example

A grid-scale battery must hold a site's net demand near a contracted target while electricity prices and on-site solar swing through the day. A simple reactive rule — charge when cheap, discharge when the target is exceeded — either hits the battery's charge limits at the worst moment or misses the cheap window entirely. MPC instead takes the day-ahead price and demand forecast, and each five minutes solves for the charge/discharge schedule over the next few hours that best tracks the demand target, subject to the battery's state-of-charge bounds, its maximum power rate, and its cycle-life budget — constraints it is forbidden to cross.

It then dispatches only the next five minutes of that schedule and re-solves when new prices and meter readings land. So when the afternoon forecast turns out wrong, the plan simply reshapes at the next cycle — the battery is never caught having pre-committed to a discharge it can no longer afford, because it only ever committed one step. The horizon supplies the foresight; the re-solve supplies the correction.

How it works

What distinguishes MPC from both reactive tuning and open-loop planning is the optimize-commit-one-re-solve cycle around an explicit constraint set:

  • Forecast the target over a finite horizon and pose an optimization: find the action sequence minimizing predicted tracking error (plus effort) across that horizon.
  • Impose the feasibility envelope as hard constraints — bounds, rates, capacities the solution may not violate — so infeasible plans are rejected outright rather than penalized after the fact.
  • Commit only the first action, discarding the rest of the optimized sequence.
  • Re-solve on the next observation, sliding the horizon forward so every plan is recomputed against the freshest data — the receding-horizon move that keeps foresight from hardening into over-commitment.

Tuning parameters

  • Horizon length — how far ahead it optimizes. Longer anticipates slow constraints and turns but leans harder on an increasingly wrong forecast and costs more compute; shorter is nimble but myopic.
  • Control vs. prediction horizon — how many future actions are free to vary versus merely simulated; more free moves give a richer plan at higher solve cost.
  • Objective weights — the balance between tracking error, control effort, and constraint slack; retilt toward effort and it moves gently, toward error and it chases hard.
  • Constraint hardness — which limits are inviolable versus soft-penalized; hardening a limit guarantees safety but can render the problem infeasible when the target demands the impossible.
  • Re-solve cadence — how often the horizon slides forward; faster incorporates news sooner but spends compute and can amplify forecast noise into plan churn.

When it helps, and when it misleads

Its strength is handling anticipation and hard limits together — the two things a reactive loop cannot. It looks ahead to a moving target, plans through constraints it must not breach, and stays corrigible by only ever committing one step. Where a tuned feedback loop would either react too late or blow through a limit, MPC threads between them.

Its central vulnerability is that it is only as good as its forecast and its model: optimize confidently against a biased prediction and you get a confidently wrong plan — the plant-model mismatch that flatters the optimizer while the real system drifts off.[1] Push the horizon long to gain foresight and you compound that forecast error; harden every constraint and a genuinely over-demanding target can leave the optimizer with no feasible plan at all, forcing a fallback. Its quiet misuse is trusting the multi-step plan as a commitment rather than discarding all but the first step — which throws away the very corrigibility that makes it safe. The discipline that keeps it honest is to commit only the first move, keep the model and forecast fresh, and treat repeated infeasibility as a signal to escalate rather than to quietly relax the limits.

How it implements the components

Model Predictive Control fills the archetype's constrained-anticipatory-planning slot — the parts that turn a forecast into a limit-respecting action sequence:

  • rolling_horizon_plan — it produces exactly this: an optimized plan over a finite horizon, sliding forward and re-solved each cycle, with only the first step committed.
  • feasibility_envelope — the hard-constraint set is native to MPC; it optimizes inside the envelope of bounds, rates, and capacities, rejecting any plan that would leave it.

It consumes rather than produces the forecast model (predictive_feedforward_model is maintained by Model Retuning and, for pure delay compensation, Smith Predictor) and the current state estimate (State-Estimation Filter). The general re-planning discipline as an organizational cadence — rather than this optimal-control law — is Receding-Horizon Planning.

Notes

MPC and Receding-Horizon Planning share the same skeleton — plan over a window, commit the near term, re-plan — but sit at different layers: MPC is the automated optimal-control law with an explicit cost function and constraint solver running every cycle, whereas Receding-Horizon Planning is the broader (often human, often heuristic) discipline of re-planning on a rolling window. Read together they show the same idea at two scales; do not collapse one into the other.

References

[1] Plant–model mismatch — the gap between the model MPC optimizes against and the real system it controls. Because the optimizer trusts its model completely within each solve, a biased model yields a plan that is optimal on paper and wrong in practice; committing only the first step and re-solving is the standard hedge against it.