Brief paperAn auto-generated real-time iteration algorithm for nonlinear MPC in the microsecond range☆
Introduction
A recent trend in the field of convex optimization goes into the direction of automatic code export leading to automatically generated and customized interior point solvers. These optimized solvers have proven to be real-time feasible for online optimization with a sampling time in the microsecond range (Mattingley & Boyd, 2009). The advantages of auto-generated code are its efficiency and reliability. In addition, plain and self-contained C-code can easily be compiled for PC-like embedded hardware and possibly also for field-programmable gate arrays (FPGAs).
If a process model is derived from first-principle physical laws, we often end up with a nonlinear dynamic system, for which convex optimization techniques can typically not be applied. For this situation, nonlinear model predictive control (NMPC) algorithms are a well-known tool (Allgöwer and Zheng, 2000, Biegler and Rawlings, 1991, Diehl et al., 2001). The idea to use code generation for NMPC has been introduced by Ohtsuka in the form of the tool AutoGenU (Ohtsuka, 2004). Computation times of 1.5 ms per iteration have been reported for an experimental hovercraft setup (Seguchi & Ohtsuka, 2003). Another approach is the advanced step NMPC controller (Zavala & Biegler, 2009) which, however, solves a full nonlinear program at each sampling instant. Yet a different approach is the nonlinear real-time iteration (RTI) scheme (Diehl, 2001, Diehl et al., 2002). Like the previous approaches, it uses a similar continuation Newton-type framework for which nominal stability has been shown (Diehl, Findeisen, & Allgöwer, 2007) but solves one QP at each iteration. This allows for multiple active set changes and thus ensures that the nonlinear MPC algorithm cannot perform worse than a linear MPC controller. An overview of existing algorithms for fast nonlinear MPC can be found in Diehl, Ferreau, and Haverbeke (2009).
The RTI scheme has been originally developed for large scale chemical engineering applications. The aim of this paper is to demonstrate that NMPC algorithms based on the RTI scheme can be optimized and auto-generated efficiently aiming at sampling times in the milli- and micro-second range. In order to allow for these ultra-fast execution times, we reduce the algorithmic components of the nonlinear real-time iteration scheme (Diehl et al., 2002) to the absolute minimum. This allows us to auto-generate optimized C-code based on a symbolic representation of optimal control problems, as implemented within the open-source software ACADO Toolkit (Houska, Ferreau, & Diehl, in print).
In Section 2, we introduce the algorithmic core of the real-time iteration scheme, while Section 3 explains the newly developed ACADO Code Generation tool. In Section 4, we demonstrate the performance of the implemented tools. Finally, the paper is concluded in Section 5.
Section snippets
The real-time iteration algorithm for nonlinear optimal control
Throughout this paper, we are interested in nonlinear optimal control problems of the form Here, denotes the state, the control input, and the control bounds. The right-hand side function can be non-linear in both states and controls, while the objective is a least-squares tracking term with denoting the Euclidean norm. In the context of nonlinear MPC, is the current
The ACADO code generation tool
The ACADO Toolkit is an open-source software tool for automatic control and dynamic optimization (Houska et al., in print). The aim of this section is to explain the newly developed ACADO Code Generation tool which makes use of the symbolic features of ACADO to export optimized C-code. Here, we follow an idea from Mattingley and Boyd (2009), where automatic generation of C-code for convex optimization was suggested, and extend it to nonlinear dynamic systems.
The performance of the auto-generated NMPC algorithm
In order to demonstrate the performance of auto-generated NMPC algorithms we apply the ACADO auto-generation tools to two benchmark problems arising in mechatronics and chemical engineering. Both examples are tested using online optimization problem formulations with and without state constraints. Though we successfully employed both embedded QP solvers described in Section 3.3, only the run times of qpOASES are listed, which have been slightly lower throughout the examples.
Conclusions
In this paper, we have discussed automatic code generation techniques for nonlinear model predictive control algorithms. We have reviewed the nonlinear real-time iteration scheme, which has originally been developed in Diehl et al. (2002) for large scale chemical processes, and showed how ultra-fast computation times for embedded applications can be achieved. The presented ACADO Code Generation tool exports optimized, self-contained C-code for the model simulation and sensitivity generation as
Acknowledgments
This research was supported by Research Council KUL: CoE EF/05/006 Optimization in Engineering (OPTEC), OT/03/30, IOF-SCORES4CHEM, GOA/10/009 (MaNet), GOA/10/11, several Ph.D./postdoc and fellow grants; Flemish Government: FWO: Ph.D./postdoc grants, projects G.0452.04, G.0499.04, G.0211.05, G.0226.06, G.0321.06, G.0302.07, G.0320.08, G.0558.08, G.0557.08, G.0588.09, G.0377.09, research communities (ICCoS, ANMMM, MLDM); IWT: Ph.D. Grants, Belgian Federal Science Policy Office: IUAP P6/04; EU:
Boris Houska studied Mathematics and Physics at the University of Heidelberg in 2003–2008. He is now a Ph.D. candidate in the Optimization in Engineering Center (OPTEC) at the K.U. Leuven. His research interests include numerical optimization and control, robust optimization of dynamic systems, as well as fast MPC algorithms.
References (26)
- et al.
Real-time optimization and nonlinear model predictive control of processes governed by differential-algebraic equations
Journal of Process Control
(2002) - et al.
An efficient multiple shooting based reduced SQP strategy for large-scale dynamic process optimization
Computers and Chemical Engineering
(2003) A continuation/GMRES method for fast computation of nonlinear receding horizon control
Automatica
(2004)- et al.
The advanced Step NMPC controller: optimality, stability and robustness
Automatica
(2009) - qpOASES Homepage (2007–2011)....
- ACADO Toolkit Homepage (2009–2011)....
- et al.
Nonlinear predictive control and moving horizon estimation—an introductory overview
- et al.
- Biegler, L. T., & Rawlings, J. B (1991). Optimization approaches to nonlinear model predictive control. In W. H. Ray &...
Recent advances in parameter identification techniques for ODE
A direct multiple shooting method for real-time optimization of nonlinear DAE processes
Convex optimization
Cited by (0)
Boris Houska studied Mathematics and Physics at the University of Heidelberg in 2003–2008. He is now a Ph.D. candidate in the Optimization in Engineering Center (OPTEC) at the K.U. Leuven. His research interests include numerical optimization and control, robust optimization of dynamic systems, as well as fast MPC algorithms.
Hans Joachim Ferreau studied Mathematics and Computer Science at Heidelberg University, where he received a master degree in Mathematics in 2007. He is currently pursuing a Ph.D. degree in Engineering Science at the electrical engineering department of K.U. Leuven. His current research interests include the development of fast online QP solvers and efficient nonlinear model predictive control methods. He is also active in applying such methods to real-world control problems with practical relevance.
Moritz Diehl studied Mathematics and Physics at the universities of Heidelberg and Cambridge in 1993–1999 and obtained his Ph.D. in scientific computing in 2001 from Heidelberg University. Since 2006 he is an associate professor at the electrical engineering department of K.U. Leuven and the Principal Investigator of K.U. Leuven’s Optimization in Engineering Center (OPTEC). His research interests are in numerical optimization and control, in particular algorithms for embedded, nonlinear, convex, as well as robust optimization, and their applications in engineering, mostly in mechatronics and robotics, signal processing, process control, and renewable energy systems. Recent research focuses on the automatic control of tethered airplanes for high altitude wind power generation, for which he obtained a grant of the European Research Council (ERC) from 2011 to 2016.
- ☆
The material in this paper was not presented at any conference. This paper was recommended for publication in revised form by Associate Editor Martin Guay under the direction of Editor Frank Allgöwer.
- 1
Tel.: +32 0 16 320364; fax: +32 0 16 328539.