Code Generation for Conic Model-Predictive Control on Microcontrollers with TinyMPC

📅 2024-03-26
🏛️ arXiv.org
📈 Citations: 3
Influential: 0
📄 PDF
🤖 AI Summary
Deploying cone-constrained Model Predictive Control (MPC) on resource-constrained microcontrollers faces dual challenges: computational efficiency and embedded-system compatibility. This paper introduces TinyMPC-SOCP—the first ultra-lightweight MPC solver supporting second-order cone (SOC) constraints—designed for end-to-end automated embedded deployment. It integrates a customized interior-point method for SOCP, template-based C code generation, and aggressive memory and arithmetic optimizations. Compared to the state-of-the-art embedded solver ECOS, TinyMPC-SOCP achieves over 100× speedup and substantially reduced memory footprint. Real-world evaluation on the Crazyflie quadcopter demonstrates millisecond-level closed-loop control, establishing, for the first time, the real-time feasibility of SOC-constrained MPC on extremely resource-limited platforms. The core contribution lies in systematically embedding full SOCP capability into an ultra-lightweight framework and establishing a cross-platform automated deployment toolchain.

Technology Category

Application Category

📝 Abstract
Conic constraints appear in many important control applications like legged locomotion, robotic manipulation, and autonomous rocket landing. However, current solvers for conic optimization problems have relatively heavy computational demands in terms of both floating-point operations and memory footprint, making them impractical for use on small embedded devices. We extend TinyMPC, an open-source, high-speed solver targeting low-power embedded control applications, to handle second-order cone constraints. We also present code-generation software to enable deployment of TinyMPC on a variety of microcontrollers. We benchmark our generated code against state-of-the-art embedded QP and SOCP solvers, demonstrating a two-order-of-magnitude speed increase over ECOS while consuming less memory. Finally, we demonstrate TinyMPC's efficacy on the Crazyflie, a lightweight, resource-constrained quadrotor with fast dynamics. TinyMPC and its code-generation tools are publicly available at https://tinympc.org.
Problem

Research questions and friction points this paper is trying to address.

Deploying model-predictive control on resource-constrained microcontrollers
Handling conic constraints in embedded optimization problems
Generating efficient C++ code for microcontroller deployment from Python
Innovation

Methods, ideas, or system contributions that make the work stand out.

Extends cached ADMM solvers for embedded applications
Supports second-order cones and multi-language code generation
Achieves significant speedup and memory efficiency on microcontrollers
🔎 Similar Papers
No similar papers found.