Nonlinear model predictive control (NMPC) allows one to explicitly treat nonlinear dynamics and constraints. To apply NMPC in real time on embedded hardware, online algorithms as well as efficient code implementations are crucial. A tutorial-style approach is adopted in this article to present such algorithmic ideas and to show how they can efficiently be implemented based on the ACADO Toolkit from MATLAB (MathWorks, Natick, MA, USA). Using its code generation tool, one can export tailored Runge-Kutta methods-explicit and implicit ones-with efficient propagation of their sensitivities. The article summarizes recent research results on autogenerated integrators for NMPC and shows how they allow to formulate and solve practically relevant problems in only a few tens of microseconds. Several common NMPC formulations can be treated by these methods, including those with stiff ordinary differential equations, fully implicit differential algebraic equations, linear input and output models, and continuous output independent of the integration grid. One of the new algorithmic contributions is an efficient implementation of infinite horizon closed-loop costing. As a guiding example, a full swing-up of an inverted pendulum is considered. explicit system of ordinary differential equations (ODEs), but this will be further generalized to implicit systems of differential algebraic equations (DAEs). The optimization problem depends on the parameter N x 0 2 R n x through the initial value constraint of (1b) and can also be time dependent. Hence, the control trajectory obtained by solving problem (1) provides a feedback strategy u .t 0 ; N x 0 /, which depends on the current state and time. The OCP is in practice often solved by a direct approach where one first discretizes the problem to obtain a structured nonlinear program (NLP), which is generally nonconvex. A Newton-type algorithm is able to find a locally optimal solution by solving the Karush-Kuhn-Tucker conditions. Two popular Newton-type techniques are interior point (IP) methods and sequential quadratic programming (SQP) [1]. IP methods for nonconvex problems treat the inequality constraints therein by the use of a smoothening technique [2]. SQP instead consists in sequentially approximating the NLP by convex quadratic program (QP) subproblems.Recent algorithmic progress [3,4] allowed to reduce computational delays between receiving the new state estimate and applying the next control input to the process [3]. This made it possible to apply NMPC also to fast dynamic systems with sampling times in the millisecond or even microsecond range. The real-time iteration (RTI) scheme [5] is an SQP-type online algorithm. The resulting sequence of sparse QPs can either be solved directly using a structure exploiting convex solver such as FORCES [6] or qpDUNES [7] or by reducing the size of the QP subproblems with a condensing technique [8,9] and using a dense linear algebra solver such as qpOASES [10]. A discussion on these algorithmic aspects can be found in [11]. It is important...
Algorithms for fast real-time Nonlinear Model Predictive Control (NMPC) for mechatronic systems face several challenges. They need to respect tight real-time constraints and need to run on embedded control hardware with limited computing power and memory. A combination of efficient online algorithms and code generation of explicit integrators was shown to be able to overcome these hurdles. This paper generalizes the idea of code generation to Implicit Runge-Kutta (IRK) methods with efficient sensitivity generation. It is shown that they often outperform existing auto-generated Explicit Runge-Kutta (ERK) methods. Moreover, the new methods allow to treat Differential Algebraic Equation (DAE) systems by NMPC with microsecond sampling times.
Recent theoretical and algorithmic advances have led to efficient algorithms that allow for real-time optimisation of processes with fast nonlinear dynamics. This paper addresses the efficient implementation of algorithms for moving horizon estimation (MHE) for obtaining real-time estimates of process states or parameters that are not measured directly. To this end, we propose to combine the previously proposed concepts of real-time iteration schemes and automatic code generation to obtain highly efficient source code of MHE algorithms. This has led to major extensions of the ACADO Code Generation tool that automatically generates customised plain C code for both model predictive control (MPC) and MHE applications. As a proof of concept, we present numerical results of controlling a nonlinear ODE model by means of combined exported MHE and MPC algorithms in a closed-loop manner. These exported algorithms turn out to be significantly faster than their generically implemented counterparts.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
hi@scite.ai
10624 S. Eastern Ave., Ste. A-614
Henderson, NV 89052, USA
Copyright © 2024 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.