Model Predictive Control — Prediction, Constraints, and Control Under Limits

Classical controllers react to the current error. MPC predicts future behaviour and chooses control actions while respecting actuator and state constraints.

PD → PID → LQR → actuator limits → quaternion nonlinear control → MPC
Problem Setup

Control with Prediction and Limits

Consider a simplified spacecraft pointing problem. The system has a pointing error and angular velocity, and the controller must drive the state toward a desired target.

$$ x = \begin{bmatrix} e \\ \omega \end{bmatrix} $$ $$ e = \theta_{target} - \theta $$

Unlike basic feedback control, MPC does not only ask, “What should I do now?” It asks, “What will happen over the next several steps if I apply this control?”

MPC = prediction + optimization + constraints
Why Feedback Alone Is Not Enough

Feedback Reacts After Error Appears

Classical feedback controllers such as PD, PID, and LQR compute control from the current state. This is powerful, but it can react too late when constraints matter.

Classical feedback:
current error → current control

If the actuator has a torque limit or the spacecraft must avoid crossing a state boundary, a controller that does not explicitly plan ahead may command aggressive inputs or violate limits.

Prediction Horizon

Looking Ahead into the Future

The prediction horizon defines how far into the future the controller evaluates the system.

$$ N_p = \text{number of future prediction steps} $$

A short horizon reacts quickly but may not see future constraint problems. A longer horizon plans better, but requires more computation.

Control Horizon

How Many Future Inputs Are Planned

The control horizon describes how many future control actions are optimized. In many simplified MPC demonstrations, the controller plans a sequence but applies only the first action.

$$ u_0, u_1, u_2, ..., u_{N_c-1} $$

This page uses a simplified one-step candidate search at every time step to demonstrate the main MPC idea without turning the page into a heavy optimization lecture.

Cost Function

Balancing Tracking Error and Control Effort

MPC chooses the control action that minimizes a cost over the prediction horizon.

$$ J = \sum_{k=1}^{N_p} Qe_k^2 + R u_k^2 $$

The weight \(Q\) penalizes tracking error. The weight \(R\) penalizes control effort.

Constraints

Respecting Physical and Mission Limits

MPC is powerful because constraints can be included directly in the decision process.

$$ |u| \leq u_{max} $$ $$ |e| \leq e_{max} $$

In spacecraft systems, these limits may represent actuator authority, pointing safety limits, keep-out zones, thermal pointing restrictions, or mission operating boundaries.

Receding Horizon Logic

Plan Many Steps, Apply One Step

MPC repeatedly predicts the future, chooses the best control sequence, applies the first control action, then measures the state again and replans.

predict → optimize → apply first control → update → repeat

This is called receding horizon control because the future planning window moves forward at every step.

Interactive Demo

Simulate MPC with Constraints

Adjust the initial error, target state, prediction horizon, control limit, state constraint, and cost weights. The simulation shows predicted trajectory, applied control, constraint boundary, cost trend, and tracking error.

Engineering Interpretation

Why MPC Matters in Aerospace Systems

MPC is valuable when the system must obey limits while still reaching a target. This makes it useful for constrained attitude control, rendezvous planning, autonomous guidance, robotics, launch vehicle guidance, and systems with limited actuators.

Prediction

MPC evaluates future behaviour before choosing the current action.

Constraints

Actuator and state limits are included directly in the decision process.

Trade-Offs

Q and R weights shape the balance between accuracy and control effort.

Takeaway

What This Problem Shows

Classical controllers react to current error.
MPC predicts future behaviour before applying control.
MPC is not just a controller.
It is a planning method embedded inside feedback control.
Best learning sequence:
PD → PID → LQR → actuator limits → quaternion nonlinear control → MPC