Inferensys

Glossary

Model Predictive Control (MPC)

Model Predictive Control (MPC) is an advanced control method that uses an internal dynamic model to predict future system behavior over a finite horizon and solves an optimization problem at each time step to determine optimal control inputs.
ML engineer managing model versions on laptop, version history visible, technical Git-like workflow.
CONTROL THEORY

What is Model Predictive Control (MPC)?

Model Predictive Control (MPC) is an advanced, optimization-based control methodology for managing complex dynamic systems, widely used in robotics, process industries, and autonomous vehicles.

Model Predictive Control (MPC) is an advanced control method that uses an internal dynamic model to predict a system's future behavior over a finite time horizon and solves an online optimization problem at each control step to determine the optimal sequence of control inputs. The controller implements only the first control action from this optimized sequence before repeating the predict-optimize cycle with updated sensor feedback, enabling real-time, feedback-driven control that explicitly handles system constraints on states, inputs, and outputs. This receding horizon approach makes MPC exceptionally powerful for managing complex, multi-variable systems where traditional PID controllers are insufficient.

In legged and mobile robot locomotion, MPC is fundamental for dynamic stability and terrain adaptation. The controller uses a reduced-order model, like the Linear Inverted Pendulum Model (LIPM), to predict the robot's Center of Mass (CoM) trajectory and optimize future Ground Reaction Forces (GRFs) and foot placements. By solving a Quadratic Program (QP) at high frequency (e.g., 100-500 Hz), MPC can generate control commands that respect physical constraints—such as friction cones and torque limits—while rejecting disturbances and tracking desired velocities. This allows bipedal and quadrupedal robots to walk, run, and recover from pushes autonomously.

CONTROL METHOD

Key Features of MPC

Model Predictive Control (MPC) distinguishes itself from classical control methods through its explicit use of a predictive model and online optimization. These core features enable it to handle complex, constrained multi-variable systems common in robotics.

01

Receding Horizon Optimization

This is the defining mechanism of MPC. At each control time step, the algorithm solves a finite-horizon optimal control problem. It uses an internal dynamic model to predict future system states over a prediction horizon (N steps). It computes a sequence of optimal control inputs, but only the first control action from this sequence is applied to the system. At the next time step, the horizon "recedes" forward, and the optimization is repeated with new state measurements, providing continuous feedback and disturbance rejection.

  • Core Mechanism: Plan, execute first step, re-plan.
  • Benefit: Inherently accounts for new information and model errors.
02

Explicit Constraint Handling

MPC formulations directly incorporate hard and soft constraints into the online optimization problem. This is a major advantage over methods that handle constraints via ad-hoc methods or saturation. Common constraints in legged robotics include:

  • Actuator Limits: Joint torque, velocity, and position bounds.
  • Kinematic Limits: Self-collision avoidance, joint range of motion.
  • Dynamic Stability: Keeping the Center of Pressure (CoP) within the support polygon.
  • Friction Cone Constraints: Ensuring ground reaction forces remain within limits to prevent slipping.

By optimizing within these boundaries, MPC generates control actions that are feasible and safe for the physical hardware.

03

Multi-Variable & Coupled System Control

MPC naturally handles Multiple-Input, Multiple-Output (MIMO) systems where control variables are highly coupled. In a legged robot, moving one leg affects the forces on all others and the robot's overall balance. A single MPC formulation can simultaneously optimize:

  • Center of Mass (CoM) trajectory.
  • Swing foot trajectories.
  • Ground reaction forces at each foot.
  • Body orientation (pitch, roll).

The optimizer finds the coordinated set of control inputs (e.g., joint torques) that best achieves all these objectives while respecting constraints, avoiding the need for decoupled, single-loop controllers that can conflict.

04

Model-Based Feedforward & Disturbance Rejection

MPC generates a feedforward control signal based on the predicted future evolution of the system from its internal model. This proactive action is crucial for managing the inherent delays and dynamics of a physical robot. When a disturbance (e.g., a push or uneven terrain) causes the measured state to deviate from the prediction, the receding horizon mechanism automatically corrects for it in the next optimization cycle.

  • Feedforward: Anticipates required forces for planned motions.
  • Feedback: Corrects for model inaccuracies and external pushes. This combination provides robust performance even with imperfect models.
05

Cost Function Design for Task Specification

The desired robot behavior is encoded in the MPC's cost function (or objective function). The optimizer minimizes this cost over the prediction horizon. Engineers specify high-level tasks by designing appropriate costs. Examples for locomotion include:

  • Tracking Cost: Penalize deviation from a desired CoM or foot trajectory.
  • Effort Cost: Minimize joint torques or power consumption to improve efficiency.
  • Smoothness Cost: Penalize jerk in motions for stable, fluid movement.
  • Terminal Cost: Encourage the robot to reach a specific state (e.g., balanced stance) by the end of the horizon. This flexibility allows a single MPC framework to be re-tasked for walking, running, or manipulation by changing the cost function.
06

Integration with Hierarchical Planning

In practical robotic systems, MPC often operates as a mid-level controller within a hierarchy. A higher-level motion planner or gait generator (e.g., using Linear Inverted Pendulum Model (LIPM)) might provide reference footstep locations and CoM trajectories over a longer time span. The MPC layer then translates these higher-level plans into dynamically feasible, constraint-satisfying whole-body motions and torques over its shorter horizon. This decoupling allows for complex long-horizon task planning while MPC handles the intricate, short-timescale dynamics and stabilization.

COMPARATIVE ANALYSIS

MPC vs. Other Control Strategies

A technical comparison of Model Predictive Control (MPC) against other foundational control strategies used in legged and mobile robot locomotion, highlighting key operational and design differences.

Feature / MetricModel Predictive Control (MPC)Proportional-Integral-Derivative (PID) ControlLinear-Quadratic Regulator (LQR)

Core Control Philosophy

Finite-horizon, constrained optimization solved online

Error-based feedback with fixed gains

Infinite-horizon, unconstrained optimization solved offline

Explicit Constraint Handling

Explicit Future Prediction

Optimality Criterion

Optimizes a custom cost over a finite horizon (N steps)

Minimizes instantaneous error (no explicit cost function)

Minimizes an infinite-horizon quadratic cost

Feedforward Capability

Inherent via model-based prediction

Typically none (purely reactive)

Inherent via optimal state feedback gain

Computational Demand

High (solves QP at each time step)

Very Low (simple arithmetic)

Low (applies pre-computed gain matrix)

Typical Update Rate

10-100 Hz (varies with problem complexity)

1-10 kHz

1-10 kHz

Handling of Nonlinear Dynamics

Yes (via Nonlinear MPC or linearization)

Poor (designed for linearized ops)

No (strictly linear dynamics)

Multi-Input, Multi-Output (MIMO) Suitability

Excellent (native formulation)

Poor (requires decoupled loops)

Excellent (native formulation)

Primary Use Case in Locomotion

Dynamic gait stabilization, push recovery, terrain adaptation

Low-level joint position/velocity tracking

Stabilization of simplified linear models (e.g., LIPM)

MODEL PREDICTIVE CONTROL (MPC)

Frequently Asked Questions

Model Predictive Control (MPC) is a cornerstone advanced control method for legged and mobile robots. This FAQ addresses its core principles, implementation, and role in achieving dynamic, stable locomotion.

Model Predictive Control (MPC) is an advanced, optimization-based control strategy where, at each control time step, an internal dynamic model of the system is used to predict its future behavior over a finite time horizon, and an online optimization problem is solved to compute a sequence of optimal control inputs. Only the first control input from this optimized sequence is applied to the robot. At the next time step, the process repeats with updated state measurements, forming a receding horizon control loop. This allows MPC to proactively account for future constraints (like actuator limits or obstacle avoidance) and disturbances, making it exceptionally powerful for managing the complex, underactuated dynamics of legged locomotion.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.