← Back to Case Studies
Robotics Mixed Evidence Logistics & Warehousing
NMPCLegged RobotsReal-Time ControlConstrained OptimizationQuadrupedsBipeds

Legged Locomotion Constraints MPC — Real-Time Walking Through Constrained Optimization

Public reference use case (by others): This page summarizes publicly available reference implementations and papers. Not client results of Dr. Rafal Noga.

Why This Matters (Executive Summary)

  • Legged robots must respect hard physical limits — friction cones, joint torque saturation, ground contact timing — at every control step. Violating any single constraint causes slipping, falling, or actuator damage. MPC encodes all of these as optimization constraints solved in real time.
  • Modern NMPC formulations achieve 100-850 Hz update rates on legged platforms, fast enough for dynamic walking, push recovery, and rough-terrain traversal with sub-20 mm foot placement accuracy.
  • The same design pattern transfers to any intermittent-contact mechatronic system: grippers, mobile platforms on uneven terrain, handling systems with friction-limited actuation, or variable-mode manufacturing equipment.
  • For DACH companies deploying mobile robots in warehouses, inspection, or field operations, constrained MPC provides the robustness layer that turns a laboratory demo into a reliable operational asset.

The Design Pattern Explained

Constraints-first MPC for legged locomotion treats contact physics — friction cones, torque limits, foot placement feasibility — as core optimization variables rather than afterthoughts. The optimizer decides not just where to move, but when to step, where to place each foot, and how much force to apply, all while respecting physical feasibility.

Why MPC/NMPC over alternatives? Classical gait controllers prescribe fixed step patterns and rely on heuristic recovery strategies. NMPC solves for the entire motion trajectory over a receding horizon, automatically discovering recovery strategies (step timing changes, force redistribution) that a fixed controller cannot. When a push arrives, the optimizer re-plans within one control cycle.

Architecture: The dominant pattern is a multi-layer stack: (1) perception and state estimation (20-200 Hz), (2) high-level MPC for footstep planning and center-of-mass trajectory (20-100 Hz), (3) low-level whole-body torque control (400-1000 Hz). Each layer has clear timing boundaries, and the MPC layer is the decision-making core.

Applications & Reference Implementations

Application 1: Variable-Horizon MPC on Bolt Biped — Step Timing as a Decision Variable

A two-level Variable Horizon MPC (VH-MPC) was validated on the open-source biped robot Bolt, where step timing and foot placement are part of the optimization rather than prescribed by a gait scheduler. The formulation includes swing-foot dynamics and explicit torque/friction constraints. Extensive simulation and real-robot experiments under disturbances demonstrated median foot-placement errors below 20 mm in both sagittal and lateral directions. This is significant because variable step timing is what enables natural push recovery — the robot can take a faster or slower step when disturbed, rather than following a rigid clock. 1

Application 2: Real-Time NMPC Reaction Strategy on Gazelle — Sub-Millisecond Solve Times

A seamless reaction strategy for bipedal locomotion was implemented on the biped robot Gazelle using real-time NMPC. The formulation uses an SQP solver capped at 3 iterations per cycle, achieving an average solve time of 0.125 ms at a 25 ms sampling period with a horizon of 10 steps. This sub-millisecond solve time means the controller can replan a full dynamically consistent motion before the next control tick, enabling reactive push recovery and terrain adaptation without any pre-computed motion library. The approach was validated in both simulation and physical experiments. 2

Application 3: Fast NMPC on AMBER-3M via QP Approximation — 850 Hz Update Rate

Researchers achieved extreme update rates for bipedal locomotion NMPC on the AMBER-3M platform by combining QP approximation with Hybrid Zero Dynamics (HZD) references. The QP approximation alone runs at 270 Hz with a 2-second prediction horizon. Adding HZD references to warm-start and reduce the problem dimension pushes the rate to 850 Hz with a 0.2-second horizon. These rates are fast enough for highly dynamic motions like running, where the contact phase can be as short as 100 ms. The trade-off between horizon length and update rate is a key engineering decision in any real-time MPC deployment. 3

Application 4: Perceptive Locomotion on ANYmal at 100 Hz — Rough Terrain with Terrain Encoding

ETH Zurich and ANYbotics developed a perception-planning-control pipeline for the quadruped ANYmal using NMPC at 100 Hz, with whole-body torque control and reactive behaviors at 400 Hz. Terrain information is encoded as convex foothold constraints plus a signed-distance field for collision avoidance. Perception runs at 20 Hz, feeding elevation maps into the MPC. The system was validated experimentally on rough terrain, demonstrating that perceptive NMPC can handle uneven ground, steps, and obstacles without pre-planned paths. For industrial inspection or warehouse robots, this pattern enables autonomous navigation over debris, ramps, and unstructured surfaces. 4

Application 5: VIO + Leg Odometry Fusion for NMPC on Solo12 — Outdoor State Estimation

Reliable NMPC locomotion depends on accurate state estimation, especially outdoors where GPS may be unavailable and wheel odometry does not apply. Researchers fused Visual-Inertial Odometry (VIO) with leg odometry using an Extended Kalman Filter running at 200 Hz, feeding an NMPC locomotion controller at 20 Hz and a low-level control loop at 1 kHz. Outdoor experiments on the Solo12 quadruped demonstrated that the fusion approach handles drift and intermittent observability issues that defeat single-sensor solutions. This sensor fusion pattern is essential for any field-deployed mobile robot using predictive control. 5

What This Means for Your Operations

  • If you are deploying quadruped or mobile robots for inspection, logistics, or field operations, constrained NMPC is the control layer that handles the gap between flat-floor demos and real-world uneven surfaces, unexpected obstacles, and payload variations.
  • Readiness indicators: You need joint-level torque control (or at minimum position control with known dynamics), an IMU, and ideally perception (cameras or LIDAR for terrain mapping). The compute platform must support 20-100 Hz optimization — modern embedded GPUs and ARM-based boards are sufficient.
  • The multi-layer architecture scales: The same MPC-at-the-top, torque-control-at-the-bottom pattern applies whether the system has 2 legs, 4 legs, or is a wheeled-legged hybrid.

How We Deliver This (Engagement Model)

  • Phase 0: NDA + data request — we review your robot platform, actuator specs, sensor suite, and operational environment
  • Phase 1: Fixed-scope discovery — dynamic model assessment, constraint identification, solver benchmarking (typically 4-6 weeks)
  • Phase 2: Implementation + validation + commissioning — NMPC formulation, code generation, hardware-in-the-loop testing, field trials
  • Phase 3: Monitoring + training + scaling — operator training, parameter tuning handover, extension to new terrain profiles or payloads

Typical KPIs to Track

  • Stability: Fall rate per operating hour, push recovery success rate, maximum recoverable disturbance magnitude
  • Accuracy: Foot placement error (mm), CoM tracking error, path following deviation
  • Efficiency: Energy consumption per meter traveled, solver compute time vs. available budget
  • Operational: Uptime percentage, autonomous distance between interventions, terrain difficulty handled

Risks & Prerequisites

  • Dynamic model quality: Legged locomotion NMPC is sensitive to inertia parameters and contact models. System identification or CAD-based models are a prerequisite.
  • Solver determinism: The MPC must produce a solution within the control cycle, every cycle. Solver warm-starting, iteration caps, and fallback strategies are essential for safety.
  • Perception latency: If terrain perception is delayed or inaccurate, the MPC will plan footholds based on stale data. Tight perception-to-control latency budgets (under 50 ms) are needed for rough terrain.
  • Hardware wear: Legged robots operating at their constraint boundaries experience higher actuator loads. Monitoring torque histories and thermal limits is important for longevity.

FAQ

Q: Does this pattern apply to wheeled or tracked robots too? A: The constraint-first MPC approach applies broadly. Wheeled-legged hybrids (e.g., ANYmal on wheels) use the same architecture. Pure wheeled robots benefit from the same pattern when traction limits, terrain slope, or payload shifts create constraint-active scenarios.

Q: What solver frameworks are used in practice? A: Common choices include acados (SQP-based, auto-generated C code), HPIPM (interior point for QPs), and OCS2 (multiple shooting for NMPC). All support real-time iteration schemes with bounded worst-case timing.

Q: How long does it take to port this to a new robot platform? A: With an existing dynamics model, porting the NMPC formulation to a new platform typically takes 6-10 weeks including constraint tuning and hardware-in-the-loop validation. The solver layer is largely platform-agnostic; the platform-specific work is in the dynamics model and sensor integration.

Q: Is reinforcement learning replacing MPC for locomotion? A: RL-based locomotion has shown impressive results, but MPC remains preferred when hard constraint guarantees (torque limits, force feasibility) are required, when the system must be auditable, or when the operating conditions change frequently. Many state-of-the-art systems combine RL for high-level policy with MPC for constraint enforcement.

Book a 30-Minute Discovery Call

Ready to explore whether this pattern fits your system?

Dr. Rafal Noga — Independent APC/MPC Consultant

Email me | noga.es

Fixed-scope discovery . NDA-first . DACH on-site available

Public References

Footnotes

  1. “Variable-Horizon MPC for Biped Walking on Bolt” (IEEE RA-L, 2021). https://par.nsf.gov/servlets/purl/10301331

  2. “Seamless Reaction Strategy for Bipedal Locomotion Exploiting Real-Time NMPC” (MPI, 2023). https://publications.mpi-inf.mpg.de/2023/SeamlessReactionStrategy.pdf

  3. Galliker et al., “Bipedal Locomotion using Nonlinear MPC” (LRA, 2022). https://paperss3.s3.us-east-2.amazonaws.com/accepted/2022/LRA/Galliker.pdf

  4. “Perceptive Locomotion through Nonlinear Model Predictive Control” (ETH Zurich / ANYbotics, 2022). https://arxiv.org/pdf/2208.08373

  5. Dhedin et al., “Visual-Inertial and Leg Odometry Fusion for Dynamic Locomotion” (arXiv, 2022). https://arxiv.org/pdf/2207.03928.pdf

Interested in applying these methods?

Let's discuss how APC/MPC can deliver similar results for your operations.

Get in Touch