Abstract
Model-Predictive Control (MPC) is a powerful tool for robotic control due to its ability to handle constraints explicitly. However, deploying MPC on resource-constrained microcontrollers (MCUs) is challenging due to limited RAM and processing power. This paper presents Conic-TinyMPC, an extension of the TinyMPC framework designed to solve Second-Order Cone Programs (SOCPs) on embedded hardware. By utilizing cached Riccati recursion and a specialized code-generation tool, Conic-TinyMPC achieves up to a 142x speedup over state-of-the-art solvers. We validate our approach through benchmarks and real-time flight experiments on a 27g nano-quadrotor, demonstrating efficient handling of complex conic constraints.
Introduction
Robotic systems often operate under strict physical constraints, such as thrust-vector limits or obstacle avoidance. While MPC is ideal for these scenarios, its computational demands often exceed the capabilities of the microcontrollers found in small-scale robots. Existing embedded solvers primarily target Quadratic Programming (QP), which cannot represent "conic" constraints essential for modeling friction cones or glideslope requirements. General-purpose SOCP solvers like ECOS or SCS are typically too slow for high-frequency control or rely on dynamic memory allocation, which is unsuitable for safety-critical embedded systems.
Methodology
Conic-TinyMPC builds upon the Alternating Direction Method of Multipliers (ADMM) to decompose complex optimization problems into simpler sub-problems. The framework introduces several key innovations to optimize performance for MCUs:
- Cached Riccati Recursion: For Linear Time-Invariant (LTI) systems, the solver pre-computes matrix factorizations offline. This reduces the online primal update to simple matrix-vector products, shifting the computational complexity from $O(n^3)$ to $O(n^2)$.
- Conic Projections: Support for Second-Order Cones (SOCs) is implemented via closed-form projection operators. This allows for efficient handling of glideslope and thrust constraints without the overhead of interior-point methods.
- Code Generation: A dedicated tool generates dependency-free, division-free C++ code. By caching the inverse of Riccati terms, the solver avoids slow floating-point divisions and uses only static memory allocation to ensure runtime reliability.
Experimental Results
The solver was evaluated across three primary benchmarks: Predictive Safety Filtering (QP), Rocket Soft-Landing (SOCP), and a hardware experiment using a Crazyflie nano-quadrotor.
In the hardware tests, the Crazyflie successfully performed a spiral landing while adhering to a 45° glideslope constraint—a task where traditional reactive controllers failed, leading to crashes. The solver's ability to warm-start from previous solutions was crucial for maintaining the high control rates (50Hz+) required for stable flight.
Performance Benchmarks
Quantitative analysis shows that Conic-TinyMPC significantly outperforms existing solvers in both speed and memory efficiency.
On the Rocket Soft-Landing benchmark, Conic-TinyMPC was 13.8x faster than SCS and 142.7x faster than ECOS. Furthermore, it maintained a predictable memory footprint, solving problems with 100 knot points where other solvers like OSQP failed due to memory limits at just 32 knot points. This predictability is vital for avoiding heap overflows during flight.
Conclusion
Conic-TinyMPC enables high-rate, constrained control on the smallest robotic platforms. While currently limited by the LTI assumption, the framework provides a robust, memory-safe solution for deploying advanced control strategies on resource-constrained hardware. Future work will focus on adaptive caching and reachability analysis to bridge the gap between linear models and nonlinear physics.
Summary updated