Differentiable Nonlinear Model Predictive Control
Jonathan Frey, Katrin Baumgärtner, Gianluca Frison, Dirk Reinhardt, Jasper Hoffmann, Leonard Fichtner, Sebastien Gros, Moritz Diehl
TL;DR
The paper tackles the need for reliable parametric solution sensitivities in learning-augmented nonlinear MPC by formulating a differentiable solver based on interior-point methods and the implicit function theorem. It develops a two-layer approach that uses smoothed KKT conditions to produce differentiable solution mappings and forwards/adjoints, implemented efficiently in acados for general OCPs. The results show substantial CPU-time speedups over leading ML-oriented solvers and demonstrate feasibility for high-dimensional, highly-parametric problems, enabling gradient-based learning within MPC. This work paves the way for integrating differentiable MPC as a learning-friendly module in real-time control systems.
Abstract
The efficient computation of parametric solution sensitivities is a key challenge in the integration of learning-enhanced methods with nonlinear model predictive control (MPC), as their availability is crucial for many learning algorithms. This paper discusses the computation of solution sensitivities of general nonlinear programs (NLPs) using the implicit function theorem (IFT) and smoothed optimality conditions treated in interior-point methods (IPM). We detail sensitivity computation within a sequential quadratic programming (SQP) method which employs an IPM for the quadratic subproblems. Previous works presented in the machine learning community are limited to convex or unconstrained formulations, or lack an implementation for efficient sensitivity evaluation. The publication is accompanied by an efficient open-source implementation within the acados framework, providing both forward and adjoint sensitivities for general optimal control problems, achieving speedups exceeding 3x over the state-of-the-art solvers mpc.pytorch and cvxpygen.
