Efficient Zero-Order Robust Optimization for Real-Time Model Predictive Control with acados

Jonathan Frey, Yunfan Gao, Florian Messerer, Amon Lahr, Melanie N. Zeilinger, Moritz Diehl

Abstract

Robust and stochastic optimal control problem (OCP) formulations allow a systematic treatment of uncertainty, but are typically associated with a high computational cost. The recently proposed zero-order robust optimization (zoRO) algorithm mitigates the computational cost of uncertainty-aware MPC by propagating the uncertainties outside of the MPC problem. This paper details the combination of zoRO with the real-time iteration (RTI) scheme and presents an efficient open-source implementation in acados, utilizing BLASFEO for the linear algebra operations. In addition to the scaling advantages posed by the zoRO algorithm, the efficient implementation drastically reduces the computational overhead, and, combined with an RTI scheme, enables the use of tube-based MPC for a wider range of applications. The flexibility, usability and effectiveness of the proposed implementation is demonstrated on two examples. On the practical example of a differential drive robot, the proposed implementation results in a tenfold reduction of computation time with respect to the previously available zoRO implementation.

Introduction

Model Predictive Control (MPC) is a cornerstone of modern robotics, enabling the control of complex systems under constraints. However, standard nominal MPC formulations often fail in the presence of model inaccuracies and external disturbances. Robust MPC (RMPC) addresses this by considering a "tube" of possible trajectories, ensuring safety even under uncertainty. Historically, RMPC has been computationally prohibitive for real-time applications, with complexity scaling as $O(n_x^6)$ relative to the state dimension $n_x$. This paper presents an efficient implementation of the Zero-Order Robust Optimization (zoRO) algorithm within the acados framework, reducing this complexity to $O(n_x^3)$ and enabling sub-millisecond control loops.

Methodology

The core of the proposed approach is the integration of the zoRO algorithm with the Real-Time Iteration (RTI) scheme.

Zero-Order Robust Optimization (zoRO)

The zoRO algorithm simplifies the robust OCP by propagating uncertainty ellipsoids outside the main optimization loop. By neglecting certain sensitivities of the uncertainty propagation, the algorithm avoids the massive state augmentation typical of traditional robust MPC. This results in a "tightened" nominal OCP where constraints are backed off by a safety margin derived from the uncertainty propagation.

High-Performance Implementation in acados

The implementation leverages acados, a software package designed for fast embedded optimization. Key features include:

  • BLASFEO Integration: High-performance linear algebra routines optimized for small-to-medium matrix sizes.
  • Generic Custom Update: A novel feature in acados that allows updating constraint bounds (the "tightening") directly within the C-stack, minimizing overhead between the preparation and feedback phases.
  • Template-Based Code Generation: Users define problems in Python, which are then exported as highly efficient, problem-specific C code.

Evaluation and Results

The implementation was evaluated on two benchmarks: a chain of masses (scaling test) and a differential drive robot (practical safety test).

Computational Scaling

The chain benchmark demonstrates the theoretical scaling advantages of zoRO. As shown in the figure below, the mean CPU time for the zoRO implementation scales cubically ($O(n_x^3)$), mirroring the performance of nominal MPC and significantly outperforming naive robust formulations that scale at $O(n_x^6)$.

Computational scaling of zoRO vs. naive robust MPC and nominal MPC.

Real-Time Performance and Speedup

In the differential drive robot scenario, the robot must navigate obstacles under process noise. The acados-based implementation (zoRO-24) was compared against a previous implementation (zoRO-21).

Comparison of computation times between the new acados implementation (zoRO-24) and the previous version (zoRO-21).

As illustrated above, the new implementation achieves a tenfold reduction in total computation time. The total time per OCP is reduced to approximately 0.7 ms, making it suitable for high-frequency control in mobile robotics. This speedup is primarily attributed to the efficient C implementation and the reduction of propagation overhead.

Conclusion

By combining the zoRO algorithm with the RTI scheme and the high-performance capabilities of acados, this work makes robust MPC feasible for a wide range of real-time robotic applications. The open-source implementation provides a 10x speedup over previous methods while maintaining the $O(n_x^3)$ scaling necessary for complex systems. Future work will explore online optimization of feedback gains and the inclusion of adjoint corrections to improve optimality without sacrificing real-time performance.

Summary updated

BibTeX
@inproceedings{frey2023efficient,
  author = {Jonathan Frey and Yunfan Gao and Florian Messerer and Amon Lahr and Melanie N. Zeilinger and Moritz Diehl},
  title = {{Efficient Zero-Order Robust Optimization for Real-Time Model Predictive Control with acados}},
  booktitle = {ECC},
  year = {2023},
}
Figure