NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

TinyMPC: Model-Predictive Control on Resource-Constrained Microcontrollers

Khai Nguyen, Sam Schoedel, Anoushka Alavilli, Brian Plancher, Zachary Manchester

TL;DR

TinyMPC is a high-speed, low-memory Model-Predictive Control (MPC) solver designed specifically for the resource-constrained microcontrollers found on tiny robots. By exploiting the mathematical structure of the MPC problem and pre-computing expensive matrix operations, it achieves nearly a 9x speedup over state-of-the-art solvers while fitting within the tiny memory footprints of platforms like the 27-gram Crazyflie quadrotor.

What Problem Does This Paper Address?

Model-Predictive Control (MPC) is the "gold standard" for robotic control because it can handle complex constraints (like staying within a room or avoiding obstacles) while optimizing performance. However, MPC is computationally expensive. While powerful CPUs and GPUs on large robots can handle these calculations, "microrobots" are stuck with microcontrollers (MCUs) that have orders of magnitude less memory and processing power.

Existing embedded solvers like OSQP or CVXGEN are often too memory-intensive or slow for these tiny platforms. This forces engineers to either use simpler, less capable controllers or offload the math to a nearby powerful computer, which limits the robot's autonomy and range. TinyMPC aims to bring full, high-speed MPC directly onto the "edge" hardware.

Methods

The authors built TinyMPC around the Alternating Direction Method of Multipliers (ADMM), a popular optimization algorithm. Their key innovation lies in how they "compress" and accelerate the algorithm:

  1. Exploiting LQR Structure: They recognized that the "primal update" step in ADMM for an MPC problem is mathematically identical to a Linear-Quadratic Regulator (LQR) problem.
  2. Pre-computation: Instead of solving a massive system of equations at every time step, they pre-compute and cache the solution to the infinite-horizon LQR problem (the Riccati solution). This turns expensive online matrix factorizations and inversions into simple, lightning-fast matrix-vector multiplications.
  3. Matrix-Inversion Free: By caching these factorizations, the solver completely avoids doing heavy division or matrix inversion during flight.
  4. Penalty Scaling: ADMM performance depends on a "penalty parameter" ($\rho$). Usually, solvers update this online, which requires re-calculating matrices. TinyMPC pre-computes a discrete set of matrices for different $\rho$ values, allowing it to switch between them online without any extra math.

Datasets

The paper does not use traditional machine learning datasets. Instead, it evaluates the solver using:

  • Randomly Generated Benchmarks: Thousands of linear MPC problems with varying state dimensions ($n$), input dimensions ($m$), and time horizons ($N$) to compare speed and memory against the OSQP solver.
  • Hardware Experiments: Real-world flight data from a Crazyflie 2.1 quadrotor performing aggressive maneuvers and obstacle avoidance.

Key Insights and Ideas

  • MPC is just "Constrained LQR": The "aha moment" is leveraging the fact that if you ignore constraints for a moment, the problem has a closed-form solution (Riccati). By using ADMM to handle the constraints separately, you can use that fast LQR solution as a building block.
  • Memory vs. Computation Trade-off: On MCUs, memory is often tighter than compute. TinyMPC is designed to store only a few essential vectors per time step, drastically reducing the RAM footprint compared to general-purpose solvers.
  • The "TinyML" Inspiration: Much like how TinyML optimized neural networks for MCUs by pruning and quantizing, TinyMPC "compresses" optimization by exploiting the specific physics-based structure of robotics problems.

Key Results

  • Speed: TinyMPC achieved a maximum 8.85x speedup over OSQP on a Teensy 4.1 microcontroller.
  • Memory Efficiency: OSQP failed to run on the benchmark hardware once the robot's state dimension reached 16 due to memory limits. TinyMPC successfully handled a state dimension of 32 while using only ~400 KB of RAM.
  • Real-world Performance: On a 27g Crazyflie quadrotor (which has only 192 KB of RAM), TinyMPC ran at 500 Hz.
  • Agility: It enabled the drone to recover from extreme 90° attitude errors and perform dynamic obstacle avoidance (dodging a moving stick) in real-time—tasks that traditional reactive controllers failed to complete without crashing.

Limitations and Future Work

  • Convex Constraints Only: Currently, TinyMPC is limited to convex constraints (like boxes or planes). It cannot yet handle "Second-Order Cone Constraints," which are useful for modeling complex friction or thrust vectors.
  • Floating Point Dependency: The current version assumes the MCU has a Floating Point Unit (FPU). The authors plan to develop a fixed-point version for even cheaper, lower-power chips that lack hardware support for decimals.
  • Ease of Use: While the solver is high-performance, the authors are working on code-generation wrappers (similar to CVXGEN) for Julia and Python to make it easier for non-experts to deploy.

The code is publicly available at https://tinympc.org.

Summary updated

BibTeX
@inproceedings{nguyen2024tinympc,
  author = {Khai Nguyen and Sam Schoedel and Anoushka Alavilli and Brian Plancher and Zachary Manchester},
  title = {{TinyMPC: Model-Predictive Control on Resource-Constrained Microcontrollers}},
  booktitle = {IEEE International Conference on Robotics and Automation},
  year = {2024},
  doi = {10.1109/icra57147.2024.10610987},
}
Figure