🎯 MPC Framework

1Prediction Model

Discrete-time system dynamics model used to predict future system states over the prediction horizon

x(k+1) = Ax(k) + Bu(k)

2Cost Function & Constraints

Define the optimization objective and constraints:

β€’ Minimize tracking error and control effort
β€’ Input constraints (u_min ≀ u ≀ u_max)
β€’ State constraints (optional)

3Receding Horizon Optimization

Over the N-step prediction horizon, simultaneously optimize all future control inputs U = [uβ‚€, u₁, ..., u_{N-1}]

Solve a global optimization problem, not a greedy step-by-step approach

4Feedback Correction

Apply only the optimal control input at the current time step uβ‚€, then re-optimize at the next time step to eliminate model mismatch

This is the essence of "Receding Horizon"β€”the optimization window rolls forward with updated measurements

βš™οΈ MPC Control Loop at Each Time Step

Measure State x(k)
β†’
Build Optimization Problem
β†’
Solve for Optimal Sequence
β†’
Apply uβ‚€
β†’
k:=k+1

πŸ“ Standard Quadratic MPC Optimization Problem

min Ξ£α΅’β‚Œβ‚€^(N-1) [||x(k+i) - x_ref||Β²_Q + ||u(k+i)||Β²_R]

subject to:
  x(k+i+1) = Ax(k+i) + Bu(k+i)
  u_min ≀ u(k+i) ≀ u_max
  x(k|k) = x(k) [current measured state]