Explaining MPC receding horizon and advantages over PID
Model predictive control (MPC) solves an optimization problem at each time step over a finite future horizon using the current state, generating an optimal input sequence but applying only the first input before repeating the process with updated measurements (the receding horizon principle). MPC outperforms PID for constrained systems because it explicitly incorporates constraints on inputs and states, anticipates future system behavior via a model, and coordinates multiple variables, whereas PID handles constraints poorly and lacks predictive, multivariable optimization.
In a basic PID loop you pick gains that give a satisfactory response to an error signal and then leave them to act on whatever situation arises. There is no explicit notion of the plant’s dynamics beyond what the gains “encode”, and if an actuator saturates or a state variable goes out of bounds the controller has no way of anticipating or avoiding it.
Model predictive control (MPC) starts from the opposite end. You assume you have a model of the process, you discretise it, and at each sampling instant (k) you pose a finite‑horizon optimal control problem
[
\min_{u(k),\dots,u(k+N-1)} \sum_{i=0}^{N-1} \ell(x(k+i),u(k+i))
]
subject to the model (x(k+i+1)=f(x(k+i),u(k+i))) and any input and state constraints. Solving that problem gives you an optimal sequence (u^\star(k),\dots,u^\star(k+N-1)) for the next (N) steps. You do not implement the whole sequence open‑loop, you apply only the first element (u^\star(k)), advance the plant one step, measure the new state (x(k+1)), shift the horizon forward and solve again. This rolling, or “receding”, horizon is what gives MPC its feedback character and robustness to disturbances and model mismatch.
The advantage over a PID in constrained, multivariable settings is that the constraints enter the optimisation explicitly. If an actuator has limits, a temperature must stay below a threshold, or two inputs interact, the optimiser will choose a future input profile that respects those limits while steering the state towards the target. A PID controller has no such predictive capability; when it hits a limit it will typically wind up the integrator and may become unstable. MPC also naturally handles multiple inputs/outputs and can “look ahead” to reject disturbances or track future set–point changes in a way a purely reactive PID loop cannot. The trade‑offs are greater computational load and the need for a model, but for constrained systems the ability to anticipate and enforce constraints is the main reason MPC is preferred.