# A software framework for embedded nonlinear model predictive control using a gradient-based augmented Lagrangian approach (GRAMPC)

- 292 Downloads

## Abstract

A nonlinear MPC framework is presented that is suitable for dynamical systems with sampling times in the (sub)millisecond range and that allows for an efficient implementation on embedded hardware. The algorithm is based on an augmented Lagrangian formulation with a tailored gradient method for the inner minimization problem. The algorithm is implemented in the software framework GRAMPC and is a fundamental revision of an earlier version. Detailed performance results are presented for a test set of benchmark problems and in comparison to other nonlinear MPC packages. In addition, runtime results and memory requirements for GRAMPC on ECU level demonstrate its applicability on embedded hardware.

## Keywords

Nonlinear model predictive control Moving horizon estimation Augmented Lagrangian method Gradient method Embedded optimization Real-time implementation## 1 Introduction

Model predictive control (MPC) is one of the most popular advanced control methods due to its ability to handle linear and nonlinear systems with constraints and multiple inputs. The well-known challenge of MPC is the numerical effort that is required to solve the underlying optimal control problem (OCP) online. In the recent past, however, the methodological as well as algorithmic development of MPC for linear and nonlinear systems has matured to a point that MPC nowadays can be applied to highly dynamical problems in real-time. Most approaches of real-time MPC either rely on suboptimal solution strategies (Scokaert et al. 1999; Diehl et al. 2004; Graichen and Kugi 2010) and/or use tailored optimization algorithms to optimize the computational efficiency.

Particularly for linear systems, the MPC problem can be reduced to a quadratic problem, for which the optimal control over the admissible polyhedral set can be precomputed. This results in an explicit MPC strategy with minimal computational effort for the online implementation (Bemporad et al. 2002a, b), though this approach is typically limited to a small number of state and control variables. An alternative to explicit MPC is the online active set method (Ferreau et al. 2008) that takes advantage of the receding horizon property of MPC in the sense that typically only a small number of constraints becomes active or inactive from one MPC step to the next.

In contrast to active set strategies, interior point methods relax the complementary conditions for the constraints and therefore solve a relaxed set of optimality conditions in the interior of the admissable constraint set. The MPC software packages FORCES (PRO) (Domahidi et al. 2012) and fast_mpc (Wang and Boyd 2010) employ interior point methods for linear MPC problems. An alternative to active set and interior point methods are accelerated gradient methods (Richter et al. 2012) that originally go back to Nesterov’s fast gradient method for convex problems (Nesterov 2003). A corresponding software package for linear MPC is FiOrdOs (Jones et al. 2012). An augmented Lagrangian framework for convex quadratic problems as they arise in linear MPC is implemented in the toolbox DuQuad (Necoara and Kvamme 2015) with an analysis of the computational complexity in Nedelcu et al. (2014).

For nonlinear systems, one of the first real-time MPC algorithms was the continuation/GMRES method (Ohtsuka 2004) that solves the optimality conditions of the underlying optimal control problem based on a continuation strategy. The well-known ACADO Toolkit (Houska et al. 2011) uses the above-mentioned active set strategy in combination with a real-time iteration scheme to efficiently solve nonlinear MPC problems. Another recently presented MPC toolkit is VIATOC (Kalmari et al. 2015) that employs a projected gradient method to solve the time-discretized, linearized MPC problem.

Besides the real-time aspect of MPC, a current focus of research is on embedded MPC, i.e. the neat integration of MPC on embedded hardware with limited ressources. This might be field programmable gate arrays (FPGA) (Ling et al. 2008; Käpernick et al. 2014; Hartley and Maciejowski 2015), programmable logic controllers (PLC) in standard automation systems (Kufoalor et al. 2014; Käpernick and Graichen 2014b) or electronic control units (ECU) in automotive applications (Mesmer et al. 2018). For embedded MPC, several challenges arise in addition to the real-time demand. For instance, numerical robustness even at low computational accuracy and tolerance against infeasibility are important aspects as well as the ability to provide fast, possibly suboptimal iterates with minimal computational demand. In this regard, it is also desirable to satisfy the system dynamics in the single MPC iterations in order to maintain dynamically consistent iterates. Low code complexity for portability and a small memory footprint are further important aspects to allow for an efficient implementation of MPC on embedded hardware. The latter aspects, in particular, require the usage of streamlined, self-contained code rather than highly complex MPC algorithms. To meet these challenges, gradient-based algorithms become popular choices due to their general simplicity and low computational complexity (Giselsson 2014; Kouzoupis et al. 2015; Necoara 2015). A comprehensive overview on literature on first-order methods for embedded optimization can be found in the survey papers (Ferreau et al. 2017; Findeisen et al. 2018) as well as in the aforementioned references (Nedelcu et al. 2014; Necoara and Kvamme 2015).

Following this motivation, this paper presents a software framework for nonlinear MPC that can be efficiently used for embedded control of nonlinear and highly dynamical systems with sampling times in the (sub)millisecond range. The presented framework is a fundamental revision of the MPC toolbox GRAMPC (Käpernick and Graichen 2014a) (Gradient-Based MPC – [græmp\('\)si:]) that was originally developed for nonlinear systems with control constraints. The revised algorithm of GRAMPC presented in this paper significantly extends the applicability of the initial GRAMPC version by accounting for general nonlinear equality and inequality constraints as well as terminal constraints. Beside “classical” MPC, GRAMPC can now be used for MPC on shrinking horizon, general optimal control problems, moving horizon estimation and parameter optimization problems including free end time problems. The new algorithm employs an augmented Lagrangian formulation in connection with a real-time gradient method and tailored line search and multiplier update strategies that are optimized for a time and memory efficient implementation on embedded hardware. The performance and effectiveness of augmented Lagrangian methods for embedded nonlinear MPC was recently demonstrated for various application examples on rapid prototyping and ECU hardware level (Harder et al. 2017; Mesmer et al. 2018; Englert and Graichen 2018). Beside the presentation of the augmented Lagrangian algorithm and the general usage of GRAMPC, the paper compares its performance to the nonlinear MPC toolkits ACADO and VIATOC for different benchmark problems. Moreover, runtime results are presented for GRAMPC on dSPACE and ECU level including its memory footprint to demonstrate its applicability on embedded hardware.

The paper is organized as follows. Section 2 presents the general problem formulation and exemplarily illustrates its application to model predictive control and moving horizon estimation. Section 3 describes the augmented Lagrangian framework in combination with a gradient method for the inner minimization problem. Section 4 gives an overview on the structure and usage of GRAMPC. Section 5 evaluates the performance of GRAMPC for different benchmark problems and in comparison to ACADO and VIATOC, before Sect. 6 closes the paper.

Some norms are used inside the paper, in particular in Sect. 3. The Euclidean norm of a vector \(\varvec{x}\in {\mathbb{R}}^n\) is denoted by \(\Vert \varvec{x}\Vert _2\), the weighted quadratic norm by \(\Vert \varvec{x}\Vert _{\varvec{Q}}=(\varvec{x}^{\mathsf{T}}\varvec{Q}\varvec{x})^{1/2}\) for some positive definite matrix \(\varvec{Q}\), and the scalar product of two vectors \(\varvec{x},\varvec{y}\in {\mathbb{R}}^n\) is defined as \(\langle \varvec{x},\varvec{y}\rangle =\varvec{x}^{\mathsf{T}}\varvec{y}\). For a time function \(\varvec{x}(t)\), \(t\in [0,T]\) with \(T<\infty\), the vector-valued \(L^2\)-norm is defined by \(\Vert \varvec{x}\Vert _{L_2}=\big (\sum _{i=1}^n \Vert x_i \Vert _{L_2}\big )^{1/2}\) with \(\Vert x_i \Vert _{L_2}=\big (\int _0^T x_i^2(t)\,{\mathrm{d}}t\big )^{1/2}\). The supremum-norm is defined componentwise in the sense of \(\Vert \varvec{x}\Vert _{L_\infty }=\big [\Vert x_1\Vert _{L_\infty } \ldots \Vert x_n\Vert _{L_\infty } \big ]^{\mathsf{T}}\) with \(\Vert x_i\Vert _{L_\infty }=\sup _{t\in [0,T]} |x_i(t)|\). The inner product is denoted by \(\langle \varvec{x},\varvec{y}\rangle =\int _0^T \varvec{x}^{\mathsf{T}}(t)\varvec{y}(t)\,{\mathrm{d}}t\) using the same (overloaded) \(\langle \,\rangle\)-notation as in the vector case. Moreover, function arguments (such as time *t*) might be omitted in the text for the sake of enhancing readability.

## 2 Problem formulation

This section describes the class of optimal control problems that can be solved by GRAMPC. The framework is especially suitable for model predictive control and moving horizon estimation, as the numerical solution method is tailored to embedded applications. Nevertheless, GRAMPC can be used to solve general optimal control problems or parameter optimization problems as well.

### 2.1 Optimal control problem

*T*(if applicable).

In comparison to the previous version of the GRAMPC toolbox (Käpernick and Graichen 2014a), the problem formulation (1) supports optimization with respect to parameters, a free end time, general state-dependent equality and inequality constraints, as well as terminal constraints. While the original GRAMPC version was based on a real-time gradient method, the new algorithm presented in this paper employs an augmented Lagrangian framework to account for the aforementioned general constraints. Furthermore, semi-implicit dynamics with a constant mass matrix \(\varvec{M}\) can be handled using the Rosenbrock solver RODAS (Hairer and Wanner 1996) as numerical integrator. This extends the range of possible applications besides MPC to general optimal control, parameter optimization, and moving horizon estimation. However, the primary target is embedded model predictive control of nonlinear systems, as the numerical solution algorithm is optimized for time and memory efficiency.

### 2.2 Application to model predictive control

*T*. The initial state value \(\varvec{x}_k\) is the measured or estimated system state at the current sampling instant \(t_k=t_0+k \varDelta t\), \(k \in {\mathbb{N}}\) with sampling time \(0<\varDelta t\le T\). The first part of the computed control trajectory \(\varvec{u}(\tau )\), \(\tau \in [0,\varDelta t)\) is used as control input for the actual plant over the time interval \(t\in [t_k,t_{k+1})\), before OCP (2) is solved again with the new initial state \(\varvec{x}_{k+1}\).

An alternative to the “classical” MPC formulation (2) is shrinking horizon MPC, see e.g. Diehl et al. (2005), Skaf et al. (2010) and Grüne and Palma (2014), where the horizon length *T* is shortened over the MPC steps. This can be achieved by formulating the underlying OCP (2) as a free end time problem with a terminal constraint \(\varvec{g}_T(\varvec{x}(T))=\varvec{x}(T)-\varvec{x}_{\text {des}}=\varvec{0}\) to ensure that a desired setpoint \(\varvec{x}_{\text {des}}\) is reached in finite time instead of the asymptotic behavior of fixed-horizon MPC.

### 2.3 Application to moving horizon estimation

*T*. Further constraints can be added to the formulation of (5) to incorporate a priori knowledge.

Note that the above time transformation can alternatively be reversed in order to directly estimate the current state \(\varvec{p}=\varvec{{\hat{x}}}(t_k)\). This, however, requires the reverse time integration of the dynamics, which is numerically unstable if the system is stable in forward time. Vice versa, a reverse time transformation is to be preferred for MHE of an unstable process.

## 3 Optimization algorithm

The optimization algorithm underlying GRAMPC uses an augmented Lagrangian formulation in combination with a real-time projected gradient method. Though SQP or interior point methods are typically superior in terms of convergence speed and accuracy, the augmented Lagrangian framework is able to rapidly provide a suboptimal solution at low computational costs, which is important in view of real-time applications and embedded optimization. In the following, the augmented Lagrangian formulation and the corresponding optimization algorithm are described for solving OCP (1). The algorithm follows a first-optimize-then-discretize approach in order to maintain the dynamical system structure in the optimality conditions, before numerical integration is applied.

### 3.1 Augmented Lagrangian formulation

The basic idea of augmented Lagrangian methods is to replace the original optimization problem by its dual problem, see for example Bertsekas (1996), Nocedal and Wright (2006) and Boyd and Vandenberghe (2004) as well as Fortin and Glowinski (1983), Ito and Kunisch (1990), Bergounioux (1997), de Aguiar et al. (2016) for corresponding approaches in optimal control and function space settings.

*t*. In the implementation of GRAMPC, the corresponding penalties \(\varvec{c}_{\varvec{g}}\) and \(\varvec{c}_{\varvec{h}}\) are handled time-dependently as well.

Strong duality typically relies on convexity, which is difficult to investigate for general constrained nonlinear optimization problems. However, the augmented Lagrangian formulation is favorable in this regard, as the duality gap that may occur for unpenalized, nonconvex Lagrangian formulations can potentially be closed by the augmented Lagrangian formulation (Rockafellar 1974).

The motivation behind the algorithm presented in the following lines is to solve the dual problem (13) instead of the original one (1) by approaching the saddle-point (14) from both sides. In essence, the max–min-problem (13) is solved in an alternating manner by performing the inner minimization with a projected gradient method and the outer maximization via a steepest ascent approach. Note that the dynamics (13b) are captured inside the minimization problem instead of treating the dynamics as equality constraints of the form \(\varvec{M} \varvec{\dot{x}} - \varvec{f}(\varvec{x}, \varvec{u}, \varvec{p}, t) = \varvec{0}\) in the augmented Lagrangian (Hager 1990). This ensures the dynamical consistency of the computed trajectories in each iteration of the algorithm, which is important for an embedded, possibly suboptimal implementation.

### 3.2 Structure of the augmented Lagrangian algorithm

The basic iteration structure of the augmented Lagrangian algorithm is summarized in Algorithm 1 and will be detailed in Sects. 3.3–3.5. The initialization of the algorithm concerns the multipliers \(\varvec{\bar{\mu }}^1\) and penalties \(\varvec{\bar{c}}^1\) as well as the definition of several tolerance values that are used for the convergence check (Sect. 3.4) and the update of the multipliers and penalties in (17) and (18), respectively.

In the current augmented Lagrangian iteration *i*, the inner minimization is carried out by solving the OCP (15) for the current set of multipliers \(\varvec{\bar{\mu }}^i\) and penalties \(\varvec{\bar{c}}^i\). Since the only remaining constraints within (15) are box constraints on the optimization variables (15c) and (15d), the problem can be efficiently solved by the projected gradient method described in Sect. 3.3. The solution of the minimization step consists of the control vector \(\varvec{u}^{i}\) and of the parameters \(\varvec{p}^{i}\) and free end time \(T^{i}\), if these are specified in the problem at hand. The subsequent convergence check in Algorithm 1 rates the constraint violation as well as convergence behavior of the previous minimization step and is detailed in Sect. 3.4.

If convergence is not reached yet, the multipliers and penalties are updated for the next iteration of the algorithm, as detailed in Sect. 3.5. Note that the penalty update in (18) relies on the last two iterates of the constraint functions (16). In the initial iteration \(i=1\) and if GRAMPC is used within an MPC setting, the constraint functions \(\varvec{g}^0\), \(\varvec{h}^{0}\), \(\varvec{g}_T^{0}\), \(\varvec{h}_T^{0}\) are warm-started by the corresponding last iterations of the previous MPC run. Otherwise, the penalty update is started in iteration \(i=2\).

Note that if the OCP or MPC problem to be solved is defined without the nonlinear constraints (1c) and (1d), the overall augmented Lagrangian algorithm reduces to the projected gradient method for solving the minimization problem (15), for which linear convergence results exist under the assumption of convexity (Dunn 1996).

*T*is treated as optimization variable as shown in Algorithm 1, the evaluation of (18) would formally require to redefine the constraint functions \(\varvec{g}^{i-1}(t)\) and \(\varvec{h}^{i-1}(t)\), \(t\in [0,T^{i-1}]\) from the previous iterations to the new horizon length \(T^{i}\) by either shrinkage or extension. This redefinition is not explicitly stated in Algorithm 1, since the actual implementation of GRAMPC stores the trajectories in discretized form, which implies that only the discretized time vector must be recomputed, once the end time \(T^i\) is updated.

Augmented Lagrangian algorithm

### 3.3 Gradient algorithm for inner minimization problem

The OCP (15) inside the augmented Lagrangian algorithm corresponds to the inner minimization problem of the max–min-formulation (13) for the current iterates of the multipliers \(\varvec{\bar{\mu }}^i\) and \(\varvec{\bar{c}}^i\). A projected gradient method is used to solve OCP (15) to a desired accuracy or for a fixed number of iterations.

*T*are additional optimization variables, the corresponding gradients have to be computed as well. Algorithm 2 lists the overall projected gradient algorithm for the full optimization case, i.e. for the optimization variables \((\varvec{u},\varvec{p},T)\), for the sake of completeness.

Augmented Lagrangian algorithm

The gradient algorithm is initialized with an initial control \(\varvec{u}^{i|1}(t)\) and initial parameters \(\varvec{p}^{i|1}\) and time length \(T^{i|1}\). In case of MPC, these initial values are taken from the last sampling step using a warmstart strategy with an optional time shift in order to compensate for the horizon shift by the sampling time \(\varDelta t\).

The convergence measure \(\eta ^{i|j+1}\) in (27) rates the relative gradient changes of \(\varvec{u}\), \(\varvec{p}\), and *T*. If the gradient scheme converges in the sense of \(\eta ^{i|j+1} \le \varepsilon _{\text {rel,c}}\) with threshold \(\varepsilon _{\text {rel,c}}>0\) or if the maximum number of iterations \(j_{\text {max}}\) is reached, the algorithm terminates and returns the last solution to Algorithm 1. Otherwise, *j* is incremented and the gradient iteration continues.

An important component of Algorithm 2 is the line search problem (24), which is performed in all search directions simultaneously. The scaling factors \(\gamma _{\varvec{p}}\) and \(\gamma _{T}\) can be used to scale the step sizes relative to each other, if they are not of the same order of magnitude or if the parameter or end time optimization is highly sensitive. GRAMPC implements two different line search strategies, an adaptive and an explicit one, in order to solve (24) in an accurate and robust manner without involving too much computational load.

### 3.4 Convergence criterion

*i*is incremented and the next minimization of problem (15) is carried out.

Note that the convergence criterion is typically deactivated in MPC applications and a fixed iteration count is used to ensure real-time feasibility. The last solution is then used as warm-start in the next MPC step. The incremental improvement of this suboptimal solution strategy in a real-time MPC setting is investigated e.g. in Diehl et al. (2004) and Graichen and Kugi (2010). In particular, it is shown in Graichen and Kugi (2010) that incremental improvement and asymtptotic stability is ensured for a sufficient number of iterations provided that the underlying optimization is linearly convergent.

If the convergence criterion is replaced by a fixed number of iterations, convergence of the augmented Lagrangian algorithm cannot be guaranteed in general, since the saddle-point condition (14) is based on the optimal solution of the inner problem. To remedy this issue, the multiplier update is adapted accordingly, which is explained in detail in the next section.

### 3.5 Update of multipliers and penalties

The updates (35) and (36) define the vector functions \(\varvec{\zeta }_{\varvec{g}}\), \(\varvec{\zeta }_{\varvec{g}_T}\) and \(\varvec{\xi }_{\varvec{g}}\), \(\varvec{\xi }_{\varvec{g}_T}\) in (17a) and (18a) with \(N_{\varvec{g}}\) and \(N_{\varvec{g}_T}\) components, corresponding to the number of equality and terminal equality constraints. Note that the multipliers for the equality and inequality constraints are time-dependent, i.e. \(\varvec{\mu }_{\varvec{g}}(t)\) and \(\varvec{\mu }_{\varvec{h}}(t)\), which implies that the functions \(\varvec{\zeta }_{\varvec{g}}\) and \(\varvec{\xi }_{\varvec{g}}\), resp. (35) and (36), are evaluated pointwise in time.

## 4 Structure and usage of GRAMPC

This section describes the framework of GRAMPC and illustrates its general usage. GRAMPC is designed to be portable and executable on different operating systems and hardware without the use of external libraries. The code is implemented in plain C with a user-friendly interface to C++, Matlab/Simulink, and dSpace. The following lines give an overview of GRAMPC and demonstrate how to implement and solve a problem.

### 4.1 General structure

### 4.2 Problem definition

The problem formulation (39) is provided in the user template probfct.c. The following listing gives an expression of the function structure and the problem implementation for the ball-on-plate example (39).

The naming of the functions follows the nomenclature of the general OCP formulation (1), except for the function ocp_dim, which defines the dimensions of the optimization problem. Problem specific parameters can be used inside the single functions via the pointer userparam. For convenience, the desired setpoint (xdes,udes) to be stabilized by the MPC is provided to the cost functions separately and therefore does not need to be passed via userparam.

In addition to the single OCP functions, GRAMPC requires the derivatives w.r.t. state \(\varvec{x}\), control \(\varvec{u}\), and if applicable w.r.t. the optimization parameters \(\varvec{p}\) and end time *T*, in order to evaluate the optimality conditions in Algorithm 2. Jacobians that occur in multiplied form, see e.g. \((\frac{\partial \varvec{f}}{\partial \varvec{x}}\big )^{\mathsf{T}}\varvec{\lambda }\) in the adjoint dynamics (22), have to be provided in this representation. This helps to avoid unnecessary zero multiplications in case of sparse Jacobians. The following listing shows an excerpt of the corresponding gradient functions.

### 4.3 Calling procedure and options

GRAMPC provides several key functions that are required for initializing and calling the MPC solver. As shown in Fig. 2, there exist mex wrapper functions that ensure that the interface for interacting with GRAMPC is largely the same under C/C++ and Matlab.

The following listing gives an idea on how to initialize GRAMPC and how to run a simple MPC loop for the ball-on-plate example under Matlab.

The listing also shows some of the algorithmic settings, e.g. the number of discretization points Nhor for the horizon [0, *T*], the maximum number of iterations \((i_{\text {max}},j_{\text {max}})\) for Algorithm 1 and 2, or the choice of integration scheme for solving the canonical equations (22), (26). Currently implemented integration methods are (modified) Euler, Heun, 4th order Runge–Kutta as well as the solver RODAS (Hairer and Wanner 1996) that implements a 4th order Rosenbrock method for solving semi-implicit differential-algebraic equations with possibly singular and sparse mass matrix \(\varvec{M}\), cf. the problem definition in (1). The Euler and Heun methods use a fixed step size depending on the number of discretization points (Nhor), whereas RODAS and Runge–Kutta use adaptive step size control. The choice of integrator therefore has significant impact on the computation time and allows one to optimize the algorithm in terms of accuracy and computational efficiency. Further options not shown in the listing are e.g. the settings (xScale,xOffset) and (uScale,uOffset) in order to scale the input and state variables of the optimization problem.

The initialization and calling procedure for GRAMPC is largely the same under C/C++ and Matlab. One exception is the handling of user parameters in userparam. Under C, userparam can be an arbitrary structure, whereas the Matlab interface restricts userparam to be of type array (of arbitrary length). Moreover, the Matlab call of grampc_run_Cmex returns an updated copy of the grampc structure as output argument in order to comply with the Matlab policy to not manipulate input arguments.

## 5 Performance evaluation

The intention of this section is to evaluate the performance of GRAMPC under realistic conditions and for meaningful problem settings. To this end, an MPC testbench suite is defined to evaluate the computational performance in comparison to other state-of-the-art MPC solvers and to demonstrate the portability of GRAMPC to real-time and embedded hardware. The remainder of this section demonstrates the handling of typical problems from the field of MPC, moving horizon estimation and optimal control.

### 5.1 General MPC evaluation

The MPC performance of GRAMPC is evaluated for a testbench that covers a wide range of meaningful MPC applications. For the sake of comparison, the two MPC toolboxes ACADO and VIATOC are included in the evaluation, although it is not the intention of this section to rigorously rate the performance against other solvers, as such a comparison is difficult to carry out objectively. The evaluation should rather give a general impression about the performance and properties of GRAMPC. In addition, implementation details are presented for running the MPC testbench examples with GRAMPC on dSpace and ECU level.

#### 5.1.1 Benchmarks

Overview of MPC benchmark problems

Problem | Dimensions | Constraints | Dynamics | References | ||||
---|---|---|---|---|---|---|---|---|

\(N_{\varvec{x}}\) | \(N_{\varvec{u}}\) | \(\varvec{u}\) | \(\varvec{x}\) | nonl. | semi-impl. | Linear | ||

Mass-spring-damper | 10 | 2 | Yes | No | No | No | Yes | Käpernick (2016) |

Motor (PMSM) | 4 | 2 | Yes | Yes | Yes | No | No | Englert and Graichen (2018) |

Nonl. chain (\(m=4\)) | 21 | 3 | Yes | No | No | No | No | Kirches et al. (2012) |

Nonl. chain (\(m=6\)) | 33 | 3 | Yes | No | No | No | No | Kirches et al. (2012) |

Nonl. chain (\(m=8\)) | 45 | 3 | Yes | No | No | No | No | Kirches et al. (2012) |

Nonl. chain (\(m=10\)) | 57 | 3 | Yes | No | No | No | No | Kirches et al. (2012) |

2D-Crane | 6 | 2 | Yes | Yes | Yes | No | No | Käpernick and Graichen (2013) |

3D-Crane | 10 | 3 | Yes | No | No | No | No | Graichen et al. (2010) |

Helicopter | 6 | 2 | Yes | Yes | No | No | Yes | Tøndel and Johansen (2002) |

Quadrotor | 9 | 4 | Yes | No | No | No | No | Käpernick and Graichen (2014a) |

VTOL | 6 | 2 | Yes | No | No | No | No | Sastry (2013) |

Ball-on-plate | 2 | 1 | Yes | Yes | No | No | Yes | Richter (2012) |

Vehicle | 5 | 2 | Yes | No | Yes | No | No | Werling et al. (2012) |

CSTR reactor | 4 | 2 | Yes | No | No | No | No | Rothfuss et al. (1996) |

PDE reactor | 11 | 1 | Yes | No | No | Yes | No | Utz et al. (2010) |

The testbench includes three linear problems (mass-spring-damper, helicopter, ball-on-plate) and one semi-implicit reactor example, where the mass matrix \(\varvec{M}\) in the semi-implicit form (1b) is computed from the original partial differential equation (PDE) using finite elements, also see Sect. 5.2.3. The nonlinear chain problem is a scalable MPC benchmark with *m* masses. Three further MPC examples are defined with nonlinear constraints. The permanent magnet synchronous machine (PMSM) possesses spherical voltage and current constraints in dq-coordinates, whereas the crane example with three degrees of freedom (DOF) and the vehicle problem include a nonlinear constraint to simulate a geometric restriction that must be bypassed (also see Sect. 5.2.1 for the crane example). Three of the problems (PMSM, 2D-crane, vehicle) are not evaluated with VIATOC, as nonlinear constraints cannot be handled by VIATOC at this stage.

For the GRAMPC implementation, most options are set to their default values. The only adapted parameters concern the horizon length *T*, the number of supporting points for the integration scheme and the integrator itself as well as the number of augmented Lagrangian and gradient iterations, \(i_{\text {max}}\) and \(j_{\text {max}}\), respectively. Default settings are used for the multiplier and penalty updates for the sake of consistency, see Algorithm 1 as well as Sect. 3.5. Note, however, that the performance and computation time of GRAMPC can be further optimized by tuning the parameters related to the penalty update to a specific problem. All benchmark problems listed in Table 1 are available as example implementations in GRAMPC.

ACADO and VIATOC are individually tuned for each MPC problem by varying the number of shooting intervals and iterations in order to either achieve minimum computation time (setting “speed”) or optimal performance in terms of minimal cost at reasonable computational load (setting “optimal”). The solution of the quadratic programs of ACADO was done with qpOASES (Ferreau et al. 2014).

The single MPC projects are integrated in a closed-loop simulation environment with a fourth-order Runge–Kutta integrator with adaptive step size to ensure an accurate system integration regardless of the integration schemes used internally by the MPC toolboxes. The MPC is initialized with the stationary solution at the start of the simulation scenario. The evaluation was carried out on a Windows 10 machine with Intel(R) Core(TM) i5-5300U CPU running at \(2.3 \hbox {GHz}\) using the Microsoft Visual C++ 2013 Professional (C) compiler. Each simulation was run multiple times to obtain a reliable average computation time.

#### 5.1.2 Evaluation results

Table 2 shows the evaluation results for the benchmark problems in terms of computation time and cost value integrated over the whole time interval of the simulation scenario. The cost values are normalized to the best one of each benchmark problem. The results for ACADO and VIATOC are listed for the settings “speed” and “optimal”, as mentioned above. The depicted computation times are the mean computation times, averaged over the complete time horizon of the simulation scenario. The best values for computation time and performance (minimal cost) for each benchmark problem are highlighted in bold font.

The linear MPC problems (mass-spring-damper, helicopter, ball-on-plate) with quadratic cost functions can be tackled well by VIATOC and ACADO due to their underlying linearization techniques. The PDE reactor problem contains a stiff system dynamics in semi-implicit form. ACADO can handle such problems well using its efficient integration schemes, whereas VIATOC relies on fixed step size integrators and therefore requires a relatively large amount of discretization points. While GRAMPC achieves the fastest computation time, the cost value of both ACADO settings as well as the VIATOC optimal setting is lower. A similar cost function, however, can be achieved by GRAMPC when deviating from the default parameters.

In case of the state constrained 2D-crane problem, the computation time is higher for ACADO than for GRAMPC. This appears to be due to the fact that almost over the complete simulation time a nonlinear constraint of a geometric object to be bypassed is active. A closer look at this problem is taken in Sect. 5.2.1.

A large difference in the cost values occurs for the VTOL example (Vertical Take-Off and Landing Aircraft). Due to the nonlinear dynamics and the corresponding coupling of the control variables, it seems that the gradient method underlying the minimization steps of GRAMPC is more accurate and robust when starting in an equilibrium position than the iterative linearization steps undertaken by ACADO and VIATOC.

*m*, which was to be expected in view of the SQP algorithm underlying ACADO. The computation time for VIATOC is worse for this example, since only fixed step size integrators are available in the current release, which requires to increase the number of discretization points manually. Figure 5 shows a logarithmic plot of the computation time for all three MPC solvers plotted over the number of masses of the nonlinear chain.

Evaluation results for the benchmark problems in Table 1 with overall integrated cost \(J_{\text {int}}\) and computation time \(t_{\text {CPU}}\) in milliseconds

Problem | GRAMPC | ACADO (optimal) | ACADO (speed) | VIATOC (optimal) | VIATOC (speed) | |||||
---|---|---|---|---|---|---|---|---|---|---|

\(J_{\text {int}}\) | \(t_{\text {CPU}}\) | \(J_{\text {int}}\) | \(t_{\text {CPU}}\) | \(J_{\text {int}}\) | \(t_{\text {CPU}}\) | \(J_{\text {int}}\) | \(t_{\text {CPU}}\) | \(J_{\text {int}}\) | \(t_{\text {CPU}}\) | |

Mass-spring-damper | \(\varvec{1.000}\) | 0.060 | 1.030 | 0.370 | 1.351 | 0.110 | \(\varvec{1.000}\) | 0.075 | 1.221 | \(\varvec{0.049}\) |

Motor (PMSM) | 1.006 | \(\varvec{0.032}\) | \(\varvec{1.000}\) | 0.129 | 1.096 | 0.057 | – | – | – | – |

Nonl. chain (\(m=4\)) | 1.003 | \(\varvec{0.301}\) | 1.003 | 4.666 | 1.027 | 1.770 | \(\varvec{1.000}\) | 12.32 | 1.041 | 7.660 |

Nonl. chain (\(m=6\)) | \(\varvec{1.000}\) | \(\varvec{0.707}\) | \(\varvec{1.000}\) | 12.438 | 1.028 | 5.407 | \(\varvec{1.000}\) | 18.10 | 1.042 | 11.48 |

Nonl. chain (\(m=8\)) | \(\varvec{1.000}\) | \(\varvec{1.158}\) | 1.005 | 26.834 | 1.050 | 10.127 | \(\varvec{1.000}\) | 38.51 | 1.055 | 15.30 |

Nonl. chain (\(m=10\)) | \(\varvec{1.000}\) | \(\varvec{1.463}\) | 1.004 | 43.467 | 1.042 | 21.745 | 1.004 | 52.84 | 1.149 | 24.85 |

2D-Crane | 1.032 | \(\varvec{0.019}\) | \(\varvec{1.000}\) | 0.446 | 1.096 | 0.058 | – | – | – | – |

3D-Crane | 1.002 | \(\varvec{0.036}\) | \(\varvec{1.000}\) | 0.728 | 1.013 | 0.321 | 1.163 | 0.839 | 1.160 | 0.194 |

Helicopter | 1.017 | 0.054 | 1.006 | 0.163 | 1.096 | \({\varvec{0.045}}\) | \(\varvec{1.000}\) | 0.185 | 1.060 | 0.071 |

Quadrotor | \(\varvec{1.000}\) | \(\varvec{0.022}\) | \(\varvec{1.000}\) | 1.465 | 1.005 | 0.243 | 1.009 | 0.535 | 1.010 | 0.113 |

VTOL | \(\varvec{1.000}\) | \(\varvec{0.033}\) | 1.210 | 0.229 | 1.227 | 0.090 | 1.243 | 0.092 | 1.259 | 0.083 |

Ball-on-plate | 1.113 | \(\varvec{0.014}\) | 1.112 | 0.068 | 1.126 | 0.022 | \(\varvec{1.000}\) | 0.116 | 1.158 | 0.018 |

Vehicle | 1.027 | \(\varvec{0.092}\) | \(\varvec{1.000}\) | 1.313 | 1.003 | 0.322 | – | – | – | – |

CSTR reactor | \(\varvec{1.000}\) | \(\varvec{0.058}\) | \(\varvec{1.000}\) | 0.195 | 1.002 | 0.076 | 1.001 | 0.365 | 1.017 | 0.140 |

PDE reactor | 1.059 | \(\varvec{0.362}\) | \(\varvec{1.000}\) | 6.259 | 1.005 | 0.498 | 1.046 | 7.214 | 1.072 | 2.868 |

The computation times shown in Table 2 are average values and therefore give no direct insight into the real-time feasibility of the MPC solvers and the variation of the computational load over the single sampling steps. To this end, Fig. 6 shows accumulation plots of the computation time per MPC step for three selected problems of the testbench. The computation times were evaluated after 30 successive runs to obtain reliable results. The plots show that the computation time of GRAMPC is almost constant for each MPC iteration, which is important for embedded control applications and to give tight upper bounds on the computation time for real-time guarantees. ACADO and VIATOC show a larger variation of the computation time over the iterations, which is mainly due to the active set strategy that both solvers follow and the varying number of QP iterations in each real-time iteration of ACADO, c.f. Houska et al. (2011).

#### 5.1.3 Embedded realization

In addition to the general MPC evaluation, this section evaluates the computation time and memory requirements of GRAMPC for the benchmark problems on real-time and embedded hardware. GRAMPC was implemented on a dSpace MicroLabbox (DS1202) with a \(2\,\hbox {GHz}\) Freescale QolQ processor as well as on the microntroller RH850/P1M from Renesas with a CPU frequency of \(160\,\hbox {MHz}\), \(2\,\hbox {MB}\) program flash and \(128\,\hbox {kB}\) RAM. This processor is typically used in electronic control units (ECU) in the automotive industry. The GRAMPC implementation on this microcontroller therefore can be seen as a prototypical ECU realization. As it is commonly done in embedded systems, GRAMPC was implemented using single floating point precision on both systems due to the floating point units of the processors.

Table 3 lists the computation time and RAM memory footprint of GRAMPC on both hardware platforms for the testbench problems in Tables 1 and 2. The settings of GRAMPC are the same as in the previous section, except for the floating point precision. Due to the compilation size limit of the ECU compiler (\(<10\) kB), the nonlinear chain examples as well as the PDE reactor could not be compiled on the ECU.

^{1}on the different hardware.

Computation time and memory usage for the embedded realization of GRAMPC on dSpace hardware (DS1202) and ECU level (Renesas RH850/P1M) with single floating point precision

Problem | \(t_{{{\textsc {d}{\rm{Space}}}}}\) (ms) | \(t_{{\rm{ECU}}}\) (ms) | Memory (kB) |
---|---|---|---|

Mass-spring-damper | 0.24 | 4.00 | 6.5 |

Motor (PMSM) | 0.13 | 2.10 | 2.4 |

Nonl. chain (\(m=4\)) | 4.79 | – | 12.9 |

Nonl. chain (\(m=6\)) | 9.62 | – | 18.5 |

Nonl. chain (\(m=8\)) | 17.50 | – | 24.1 |

Nonl. chain (\(m=10\)) | 24.20 | – | 29.8 |

2D-Crane | 0.18 | 1.65 | 4.5 |

3D-Crane | 0.31 | 3.05 | 7.3 |

Helicopter | 0.11 | 1.88 | 5.8 |

Quadrotor | 0.21 | 1.60 | 4.4 |

VTOL | 0.37 | 2.80 | 6.2 |

Ball-on-plate | 0.05 | 0.92 | 2.0 |

Vehicle | 0.25 | 2.69 | 3.6 |

CSTR reactor | 0.43 | 6.81 | 5.1 |

PDE reactor | 6.48 | – | 15.0 |

The required memory is below 9 kB for all examples, except for the nonlinear chain and the PDE reactor, which is less than 7% of the available RAM on the considered ECU. Although the nonlinear chain and the PDE reactor could not be compiled on the ECU as mentioned above, the memory usage as well as the computation time increase only linearly with the size of the system (using the same GRAMPC settings). Overall, the computational speed and the small memory footprint demonstrate the applicability of GRAMPC for embedded systems.

### 5.2 Application examples

This section discusses some application examples, including a more detailed view on two selected problems from the testbench collection (state constrained and semi-implicit problem), a shrinking horizon MPC application, an equality constrained OCP as well as a moving horizon estimation problem.

#### 5.2.1 Nonlinear constrained model predictive control

*g*. The system state \(\varvec{x}=[s_{\text {C}},\dot{s}_{\text {C}}, s_{\text {R}},\dot{s}_{\text {R}},\phi ,\dot{\phi }]^{\mathsf{T}}\in {\mathbb{R}}^6\) comprises the cart position \(s_{\text {C}}\), the rope length \(s_{\text {R}}\), the angular deflection \(\phi\) and the corresponding velocities. The two controls \(\varvec{u} \in {\mathbb{R}}^2\) are the cart acceleration \(u_1\) and the rope acceleration \(u_2\), respectively.

The prediction horizon and sampling time for the crane problem are set to \(T = 2 \,\text {s}\) and \(\varDelta t = 2\,\hbox {ms}\), respectively. The number of augmented Lagrangian steps and inner gradient iterations of GRAMPC are set to \((i_{\text {max}}, j_{\text {max}}) = (1,2)\). These settings correspond to the computational results in Tables 2 and 3.

#### 5.2.2 MPC on shrinking horizon

“Classical” MPC with a constant horizon length typically acts as an asymptotic controller in the sense that a desired setpoint is only reached asymptotically. MPC on a shrinking horizon instead reduces the horizon time *T* in each sampling step in order to reach the desired setpoint in finite time. In particular, if the desired setpoint is incorporated into a terminal constraint and the prediction horizon *T* is optimized in each MPC step, then *T* will be automatically reduced over the runtime due to the principle of optimality.

*u*subject to the box constraint (42d). The weight \(r>0\) in the cost functional (42a) allows a trade-off between energy optimality and time optimality of the MPC. The desired setpoint \(\varvec{x}_{\text {des}}\) is added as terminal constraint (42e), i.e. \(\varvec{g}_T(\varvec{ x}(T)) := \varvec{ x}(T) - \varvec{x}_{\text {des}} = \varvec{0}\) in view of (1c), and the prediction horizon

*T*is treated as optimization variable in addition to the control \(u(\tau )\), \(\tau \in [0,T]\).

*T*over the runtime

*t*. The initial end time of \(T=6\) is marked as a red circle. In the first MPC steps, the optimization quickly decreases the end time to approximately \(T=3.5\). In this short time interval, GRAMPC produces a suboptimal solution due to the strict limitation of the iterations \((i_{\text {max}},j_{\text {max}})\). Afterwards, however, the prediction horizon declines linearly, which concurs with the principle of optimality and shows the optimality of the computed trajectories after the initialization phase. In the simulated example, this knowledge is incorporated in the MPC implementation by substracting the sampling time \(\varDelta t\) from the last solution of

*T*for warm-starting the next MPC step. The simulation is stopped as soon as the horizon length reaches its minimum value \(T_{\mathrm{min}} = \varDelta t = 0.1\).

#### 5.2.3 Semi-implicit problems

The PDE system (43) is approximated by an ODE system of the form (16a) by applying a finite element discretization technique (Zienkiewicz and Morgan 1983), whereby the new state variables \(\varvec{x}\in {\mathbb{R}}^{N_{\varvec{x}}}\) approximate the temperature \(\theta\) on the discretized spatial domain *z* with \(N_{\varvec{x}}\) spatial grid points. The finite element discretization eventually leads to a finite-dimensional system dynamics of the form \(\varvec{M}\varvec{\dot{x}} = \varvec{f}(\varvec{x},u)\) with the mass matrix \(\varvec{M}\in {\mathbb{R}}^{N_{\varvec{x}}\times N_{\varvec{x}}}\) and the nonlinear system function \(\varvec{f}(\varvec{x}, u)\). In particular, \(N_{\varvec{x}}=11\) grid points are chosen for the GRAMPC simulation of the reactor (43). The upper right plot of Fig. 11 shows the sparsity structure of the mass matrix \(\varvec{M}\in {\mathbb{R}}^{11\times 11}\).

#### 5.2.4 OCP with equality constraints

Computation results for the planar two-arm robot with closed kinematics

Gradient tot. \(\varepsilon _{\text {rel,c}}\) | Constraint tot. \(\varvec{\varepsilon }_{\varvec{g}}\) | Gradient iterations | Augm. Lagr. iterations | \(t_{\text {CPU}}\) (ms) |
---|---|---|---|---|

1 × 10 | 1 × 10 | 64 | 189 | 135 |

1 × 10 | 1 × 10 | 65 | 298 | 214 |

1 × 10 | 1 × 10 | 306 | 190 | 628 |

1 × 10 | 1 × 10 | 222 | 431 | 1015 |

#### 5.2.5 Moving horizon estimation

*T*and \(T_{\mathrm{C}}\). The control variables \(\varvec{u}=[u_1,u_2]^{\mathsf{T}}\) are the normalized flow rate and cooling power. The measured quantities are the temperatures \(y_1 = T\) and \(y_2 = T_{\mathrm{C}}\). The parameter values and a more detailed description of the system are given in Rothfuss et al. (1996).

## 6 Conclusions

The augmented Lagrangian algorithm presented in this paper is implemented in the nonlinear model predictive control (MPC) toolbox GRAMPC and extends its original version that was published in 2014 in several significant aspects. The system class that can be handled by GRAMPC are general nonlinear systems described by explicit or semi-implicit differential equations or differential-algebraic equations (DAE) of index 1. Besides input constraints, the algorithm accounts for nonlinear state and/or input dependent equality and inequality constraints as well as for unknown parameters and a possibly free end time as further optimization variables, which is relevant, for instance, for moving horizon estimation or MPC on a shrinking horizon. The computational efficiency of GRAMPC is illustrated for a testbench of representative MPC problems and in comparison with two state-of-the-art nonlinear MPC toolboxes. In particular, the augmented Lagrangian algorithm implemented in GRAMPC is tailored to embedded MPC with very low memory requirements. This is demonstrated in terms of runtime results on dSPACE and ECU hardware that is typically used in automotive applications. GRAMPC is available at http://sourceforge.net/projects/grampc and is licensed under the GNU Lesser General Public License (version 3), which is suitable for both academic and industrial/commercial purposes.

## Footnotes

- 1.
For example software or hardware realization of sine or cosine functions.

## Notes

## References

- Allaire G (2007) Numerical analysis and optimization. Oxford University Press, OxfordzbMATHGoogle Scholar
- Barzilai J, Borwein JM (1988) Two-point step size gradient methods. SIAM J Numer Anal 8(1):141–148MathSciNetCrossRefGoogle Scholar
- Bemporad A, Borrelli F, Morari M (2002a) Model predictive control based on linear programming—the explicit solution. IEEE Trans Autom Control 47(12):1974–1985MathSciNetCrossRefGoogle Scholar
- Bemporad A, Morari M, Dua V, Pistikopoulos E (2002b) The explicit linear quadratic regulator for constrained systems. Automatica 38(1):3–20MathSciNetCrossRefGoogle Scholar
- Bergounioux M (1997) Use of augmented Lagrangian methods for the optimal control of obstacle problems. J Optim Theory Appl 95(1):101–126MathSciNetCrossRefGoogle Scholar
- Berkovitz LD (1974) Optimal control theory. Springer, New YorkCrossRefGoogle Scholar
- Bertsekas DP (1996) Constrained optimization and lagrange multiplier methods. Academic Press, BelmontzbMATHGoogle Scholar
- Boyd S, Vandenberghe L (2004) Convex optimization. Cambridge University Press, CambridgeCrossRefGoogle Scholar
- Cao Y, Li S, Petzold L, Serban R (2003) Adjoint sensitivity analysis for differential-algebraic equations: the adjoint DAE system and its numerical solution. SIAM J Sci Comput 24(3):1076–1089MathSciNetCrossRefGoogle Scholar
- Chen H, Allgöwer F (1998) A quasi-infinite horizon nonlinear model predictive control scheme with guaranteed stability. Automatica 34(10):1205–1217MathSciNetCrossRefGoogle Scholar
- Conn AR, Gould G, Toint PL (1992) LANCELOT: a fortran package for large-scale nonlinear optimization (release A). Springer, BerlinCrossRefGoogle Scholar
- de Aguiar M, Camponogara E, Foss B (2016) An augmented Lagrangian method for optimal control of continuous time DAE systems. In: Proceedings of the IEEE conference on control applications (CCA), Buenos Aires, pp 1185–1190Google Scholar
- Diehl M, Findeisen R, Allgöwer F, Bock H, Schlöder J (2004) Nominal stability of real-time iteration scheme for nonlinear model predictive control. IEE Proc 152(3):296–308Google Scholar
- Diehl M, Bock H, Schlöder J (2005) A real-time iteration scheme for nonlinear optimization in optimal feedback control. SIAM J Control Optim 43(5):1714–1736MathSciNetCrossRefGoogle Scholar
- Domahidi A, Zgraggen A, Zeilinger M, Morari M, Jones C (2012) Efficient interior point methods for multistage problems arising in receding horizon control. In: Proceedings of the IEEE conference on decision and control (CDC), Maui, pp 668–674Google Scholar
- Dunn JC (1996) On \({\text{ l }}^2\) sufficient conditions and the gradient projection method for optimal control problems. SIAM J Control Optim 34(4):1270–1290MathSciNetCrossRefGoogle Scholar
- Englert T, Graichen K (2018) Nonlinear model predictive torque control of PMSMs for high performance applications. Control Eng Pract 81:43–54CrossRefGoogle Scholar
- Ferreau H, Bock H, Diehl M (2008) An online active set strategy to overcome the limitations of explicit MPC. Int J Robust Nonlinear Control 18(8):816–830MathSciNetCrossRefGoogle Scholar
- Ferreau H, Kirches C, Potschka A, Bock H, Diehl M (2014) qpOASES: a parametric active-set algorithm for quadratic programming. Math Program Comput 6(4):327–363MathSciNetCrossRefGoogle Scholar
- Ferreau H, Almér S, Verschueren R, Diehl M, Frick D, Domahidi A, Jerez J, Stathopoulos G, Jones C (2017) Embedded optimization methods for industrial automatic control. In: Proceedings of 20th IFAC world congress, pp 13736–13751Google Scholar
- Findeisen R, Graichen K, Mönnigmann M (2018) Embedded optimization in control: an introduction, opportunities, and challenges. Automatisierungstechnik 66(11):877–902 (in German)CrossRefGoogle Scholar
- Fortin M, Glowinski R (1983) Augmented lagrangian methods: applications to the solution of boundary-value problems. North-Holland, AmsterdamzbMATHGoogle Scholar
- Giselsson P (2014) Improved fast dual gradient methods for embedded model predictive control. In: Proceedings of the 19th IFAC world congress, Cape Town, pp 2303–2309Google Scholar
- Graichen K (2012) A fixed-point iteration scheme for real-time model predictive control. Automatica 48(7):1300–1305MathSciNetCrossRefGoogle Scholar
- Graichen K, Kugi A (2010) Stability and incremental improvement of suboptimal MPC without terminal constraints. IEEE Trans Autom Control 55(11):2576–2580MathSciNetCrossRefGoogle Scholar
- Graichen K, Egretzberger M, Kugi A (2010) A suboptimal approach to real-time model predictive control of nonlinear systems. Automatisierungstechnik 58(8):447–456CrossRefGoogle Scholar
- Grüne L (2013) Economic receding horizon control without terminal constraints. Automatica 49(3):725–734MathSciNetCrossRefGoogle Scholar
- Grüne L, Palma V (2014) On the benefit of re-optimization in optimal control under perturbations. In: Proceedings of the 21st international symposium on mathematical theory of networks and systems (MTNS), Groningen, pp 439–446Google Scholar
- Hager W (1990) Multiplier methods for nonlinear optimal control. SIAM J Numer Anal 27(4):1061–1080MathSciNetCrossRefGoogle Scholar
- Hairer E, Wanner G (1996) Solving ordinary differential equations: stiff and differential-algebraic problems. Springer, HeidelbergCrossRefGoogle Scholar
- Harder K, Buchholz M, Niemeyer J, Remele J, Graichen K (2017) Nonlinear MPC with emission control for a real-world heavy-duty diesel engine. In: Proceedings of the IEEE international conference on advanced intelligent mechatronics (AIM), Munich, pp 1768–1773Google Scholar
- Hartley E, Maciejowski J (2015) Field programmable gate array based predictive control system for spacecraft rendezvous in elliptical orbits. Optim Control Appl Methods 36(5):585–607MathSciNetCrossRefGoogle Scholar
- Houska B, Ferreau H, Diehl M (2011) ACADO toolkit—an open source framework for automatic control and dynamic optimization. Optim Control Appl Methods 32(3):298–312MathSciNetCrossRefGoogle Scholar
- Ito K, Kunisch K (1990) The augmented Lagrangian method for equality and inequality constraints in hilbert spaces. Math Program 46:341–360MathSciNetCrossRefGoogle Scholar
- Jones C, Domahidi A, Morari M, Richter S, Ullmann F, Zeilinger M (2012) Fast predictive control: real-time computation and certification. In: Proceedings of the 4th IFAC nonlinear predictive control conference (NMPC), Leeuwenhorst, pp 94–98Google Scholar
- Kalmari J, Backman J, Visala A (2015) A toolkit for nonlinear model predictive control using gradient projection and code generation. Control Eng Pract 39:56–66CrossRefGoogle Scholar
- Käpernick B (2016) Gradient-based nonlinear model predictive control with constraint transformation for fast dynamical systems. Dissertation, Ulm University, Shaker, AachenGoogle Scholar
- Käpernick B, Graichen K (2013) Model predictive control of an overhead crane using constraint substitution. In: Proceedings of the american control conference (ACC), pp 3973–3978Google Scholar
- Käpernick B, Graichen K (2014a) The gradient based nonlinear model predictive control software GRAMPC. In: Proceedings of the European control conference (ECC), Strasbourg, pp 1170–1175Google Scholar
- Käpernick B, Graichen K (2014b) PLC implementation of a nonlinear model predictive controller. In: Proceedings of the 19th IFAC world congress, Cape Town, pp 1892–1897Google Scholar
- Käpernick B, Süß S, Schubert E, Graichen K (2014) A synthesis strategy for nonlinear model predictive controller on FPGA. In: Proceedings of the UKACC 10th international conference on control, Loughborough, pp 662–667Google Scholar
- Kirches C, Wirsching L, Bock H, Schlöder J (2012) Efficient direct multiple shooting for nonlinear model predictive control on long horizons. J Process Control 22(3):540–550CrossRefGoogle Scholar
- Kirk DE (1970) Optimal control theory: an introduction. Dover Publications, MineolaGoogle Scholar
- Kouzoupis D, Ferreau H, Peyrl H, Diehl M (2015) First-order methods in embedded nonlinear model predictive control. In: Proceedings of the European control conference (ECC), Linz, pp 2617–2622Google Scholar
- Kufoalor D, Richter S, Imsland L, Johansen T, Morari M, Eikrem G (2014) Embedded model predictive control on a PLC using a primal-dual first-order method for a subsea separation process. In: Proceedings of the 22nd mediterranean conference on control and automation (MED), Palermo, pp 368–373Google Scholar
- Limon D, Alamo T, Salas F, Camacho E (2006) On the stability of constrained MPC without terminal constraint. IEEE Trans Autom Control 51(5):832–836MathSciNetCrossRefGoogle Scholar
- Ling K, Wu B, Maciejowski J (2008) Embedded model predictive control (MPC) using a FPGA. In: Proceedings of the 17th IFAC world congress, Seoul, pp 15250–15255Google Scholar
- Mayne D, Rawlings J, Rao C, Scokaert P (2000) Constrained model predictive control: stability and optimality. Automatica 36(6):789–814MathSciNetCrossRefGoogle Scholar
- Mesmer F, Szabo T, Graichen K (2018) Embedded nonlinear model predictive control of dual-clutch transmissions with multiple groups on a shrinking horizon. IEEE Trans Control Syst Technol. https://doi.org/10.1109/TCST.2018.2856191 CrossRefGoogle Scholar
- Necoara I (2015) Computational complexity certification for dual gradient method: application to embedded MPC. Syst Control Lett 81:49–56MathSciNetCrossRefGoogle Scholar
- Necoara I, Kvamme S (2015) DuQuad: a toolbox for solving convex quadratic programs using dual (augmented) first order algorithms. In: Proceedings of the IEEE conference on decision and control (CDC), Osaka, pp 2043–2048Google Scholar
- Nedelcu V, Necoara I, Tran-Dinh Q (2014) Computational complexity of inexact gradient augmented Lagrangian methods: application to constrained MPC. SIAM J Control Optim 52(5):3109–3134MathSciNetCrossRefGoogle Scholar
- Nesterov Y (2003) Introductory lectures on convex optimization: a basic course. In: Paradalos P, Hearn D (eds) Applied optimization, applied optimization, vol 87. Kluwer Academic Publishers, BostonGoogle Scholar
- Nocedal J, Wright S (2006) Numerical optimization. Springer, New YorkzbMATHGoogle Scholar
- Ohtsuka T (2004) A continuation/GMRES method for fast computation of nonlinear receding horizon control. Automatica 40(4):563–574MathSciNetCrossRefGoogle Scholar
- Richter S (2012) Computational complexity certification of gradient methods for real-time model predictive control. Ph.D. thesis ETH Zürich, ETHGoogle Scholar
- Richter S, Jones C, Morari M (2012) Computational complexity certification for real-time MPC with input constraints based on the fast gradient method. IEEE Trans Autom Control 57(6):1391–1403MathSciNetCrossRefGoogle Scholar
- Rockafellar R (1974) Augmented Lagrange multiplier functions and duality in nonconvex programming. SIAM J Control 12(2):268–285MathSciNetCrossRefGoogle Scholar
- Rothfuss R, Rudolph J, Zeitz M (1996) Flatness based control of a nonlinear chemical reactor model. Automatica 32(10):1433–1439MathSciNetCrossRefGoogle Scholar
- Sastry S (2013) Nonlinear systems: analysis, stability and control. Springer, New YorkGoogle Scholar
- Scokaert P, Mayne D, Rawlings J (1999) Suboptimal model predictive control (feasibility implies optimality). IEEE Trans Autom Control 44(3):648–654CrossRefGoogle Scholar
- Skaf J, Boyd S, Zeevi A (2010) Shrinking-horizon dynamic programming. Int J Robust Nonlinear Control 20(17):1993–2002MathSciNetCrossRefGoogle Scholar
- Tøndel P, Johansen TA (2002) Complexity reduction in explicit linear model predictive control. In: Proceedings of the 15th IFAC world congress, Barcelona, pp 189–194Google Scholar
- Utz T, Graichen K, Kugi A (2010) Trajectory planning and receding horizon tracking control of a quasilinear diffusion–convection–reaction system. In: Proceedings of the 8th IFAC symposium on nonlinear control systems, Bologna, pp 587–592Google Scholar
- Wang Y, Boyd S (2010) Fast model predictive control using online optimization. IEEE Trans Control Syst Technol 18(2):267–278CrossRefGoogle Scholar
- Werling M, Reinisch P, Gresser K (2012) Kombinierte Brems-Ausweich-Assistenz mittels nichtlinearer modellprädiktiver Trajektorienplanung für den aktiven Fußgängerschutz. Tagungsband des 8. Workshop Fahrerassistenzsysteme, pp 68–77Google Scholar
- Zienkiewicz OC, Morgan K (1983) Finite elements and approximation. Wiley, New YorkzbMATHGoogle Scholar

## Copyright information

**Open Access**This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.