Log In Sign Up

Nonlinear Model Predictive Control of Robotic Systems with Control Lyapunov Functions

by   Ruben Grandia, et al.

The theoretical unification of Nonlinear Model Predictive Control (NMPC) with Control Lyapunov Functions (CLFs) provides a framework for achieving optimal control performance while ensuring stability guarantees. In this paper we present the first real-time realization of a unified NMPC and CLF controller on a robotic system with limited computational resources. These limitations motivate a set of approaches for efficiently incorporating CLF stability constraints into a general NMPC formulation. We evaluate the performance of the proposed methods compared to baseline CLF and NMPC controllers with a robotic Segway platform both in simulation and on hardware. The addition of a prediction horizon provides a performance advantage over CLF based controllers, which operate optimally point-wise in time. Moreover, the explicitly imposed stability constraints remove the need for difficult cost function and parameter tuning required by NMPC. Therefore the unified controller improves the performance of each isolated controller and simplifies the overall design process.


Stable, Concurrent Controller Composition for Multi-Objective Robotic Tasks

Robotic systems often need to consider multiple tasks concurrently. This...

Distributed Model Predictive Control for Linear Systems with Adaptive Terminal Sets

In this paper, we propose a distributed model predictive control (DMPC) ...

Episodic Learning with Control Lyapunov Functions for Uncertain Robotic Systems

Many modern nonlinear control methods aim to endow systems with guarante...

Multi-Agent Spatial Predictive Control with Application to Drone Flocking (Extended Version)

We introduce the novel concept of Spatial Predictive Control (SPC) to so...

Modeling and Simulation of a Point to Point Spherical Articulated Manipulator using Optimal Control

This paper aims to design an optimal stability controller for a point to...

Reactive Anticipatory Robot Skills with Memory

Optimal control in robotics has been increasingly popular in recent year...

Adaptation through prediction: multisensory active inference torque control

Adaptation to external and internal changes is major for robotic systems...

I Introduction

Fig. 1: Left: Segway model for simulation and control design. Right: Physical Segway system in outdoor experiment environment.

Deploying autonomous and versatile robots into the real world comes with the challenge of ever increasing complexity in sensing, decision making, and actuation. One difficulty in designing controllers for such complex systems lies in the need to simultaneously meet a large set of design requirements. Achieving stable and safe behavior is often in conflict with performance objectives, and finding the right balance between these requirements can be a challenging task.

A disjoint, hierarchical approach is typically taken in this context. High-level trajectories are planned to satisfy performance objectives via computationally intensive nonlinear optimization, and local feedback controllers are separately designed to ensure stability. The goal of this paper is to directly integrate these two components by constructing controllers that simultaneously optimize performance along a horizon and satisfy local stability constraints in a computationally efficient manner. In particular, we seek to unify guarantee-based methods of nonlinear control with the optimization-based view in model predictive control. To this end, we combine the guarantees endowed by Control Lyapunov Functions (CLFs) [4, 43] with the optimal performance of Nonlinear Model Predictive Control (NMPC) [6, 29, 40].

Lyapunov methods are a powerful tool for certifying stability properties of nonlinear systems [21]. The use of Control Lyapunov Functions to synthesize stabilizing controllers for robotic platforms has become increasingly popular [11, 26, 36], often via quadratic programs (QPs) [1, 2]. Despite the optimization-based formulation of these controllers, they often fail to achieve long-term optimal behavior. This deficiency arises due to the fact that the cost of these optimization problems fails to incorporate the future behavior of the system, but is instead point-wise optimal [10].

In contrast, Nonlinear Model Predictive Control (NMPC) emphasizes performance by solving a finite horizon optimal control problem online and applying the first element of the computed open-loop input trajectory to the system [40]. This optimization is repeatedly solved with each newly measured state to obtain the next control input trajectory. While this class of control laws can achieve strong performance in practice [12, 39, 14], and allows intuitive specification of the desired behaviour, additional assumptions must be met to certify closed-loop stability. In classical discrete-time NMPC, stability is guaranteed by an appropriately designed terminal penalty and terminal constraint [29, 7, 14].

The integration of Lyapunov methods with NMPC is not a new idea. Lyapunov methods have been used to construct stabilizing terminal conditions [19], or to analyze stability in the absence thereof [18]. Another approach incorporates the stability condition required by a CLF along the prediction horizon found with NMPC [38, 48]. As noted in [38], this approach has several desirable properties such as the absence of a terminal cost, stability for any horizon length, and recovery of the CLF-QP [1] or infinite horizon optimal controllers when considering the limiting behavior of the finite horizon. The idea of imposing stability constraints along the horizon has appeared in other forms such as contractive state constraints [8], and has been applied within the context of chemical process control [27, 47], economic cost functions [16], and switched nonlinear systems [30].

While this existing work has analyzed the stability and optimality properties obtained through the unification of CLFs and NMPC, there has been little attention to the practical and computational aspects of the resulting nonlinear optimization problem. Limited computational resources and fast system dynamics present a challenge to the deployment of these unified methods to modern robotic systems. Indeed, to the best of our knowledge, such a control scheme has not yet been applied to robotic systems experimentally.

To achieve the goal of experimental realizability, we develop a new methodology for combining CLFs with NMPC. We describe practical methods to efficiently solve the resulting nonlinear optimization problems and ultimately realize the proposed controllers in simulation and, for the first time, experimentally on a robotic platform; in this case, a Segway hardware platform seen in Fig. 1. While each proposed method provides theoretical stability guarantees, significant differences in computational efficiency and performance are observed. Furthermore, we find that the pairing of these control methodologies leads to improved performance over CLF methods and significantly reduced tuning of prediction horizon length and terminal conditions for NMPC methods.

Our paper is organized as follows. Section II provides a review of CLFs and the stability guarantees they yield, and reviews the NMPC problem and how it is solved in practice. In Section III we propose a set of methods for incorporating CLF stability constraints into the NMPC problem, and provide additional details on implementation. Lastly, in Section IV we provide results from both simulation and hardware that demonstrate the ability of this unified control approach to achieve stability and improve performance.

Ii Background

In this section we provide background information on Control Lyapunov Functions (CLFs) and Nonlinear Model Predictive Control (NMPC). This information supports the specific framework unifying CLFs and NMPC in Section III.

Ii-a Control Lyapunov Functions

Consider a state space and a control input space , where it is assumed is path-connected and . Consider the control-affine dynamic system given by:


where , , and and are Lipschitz continuous on . Further assume that , or that the origin is an equilibrium point of the system. As in [21], we define a class function as a continuous function , with , and strictly monotonically increasing (denoted ). If and , then is said to be a class function (). This type of function can be interpreted as a type of nonlinear gain function, noting the linear gain function with satisfies this definition. Given this definition, we define Control Lyapunov Functions (CLFs) as in [4, 25].

Definition 1 (Control Lyapunov Functions).

A continuously differentiable function is a Control Lyapunov Function (CLF) for (1) on if there exists such that for all :


This definition can be restated with with resulting stability guarantees holding locally. The existence of a CLF for (1) implies the existence of a continuous (except possibly at ) state-feedback controller that renders the origin globally asymptotically stable [4, 44]. It is possible to make continuous at if satisfies the small-control property [43]. If the functions take the form , , the resulting stability is global exponential stability, with the magnitude of the state upper bounded by a function exponentially decaying in time:


with . Similarly, the CLF can be upper bounded:


This preceding bound will be useful for enforcing Lyapunov stability guarantees within the discrete time NMPC problem.

The CLF definition implies the existence of a point-wise set of stabilizing control inputs:


Thus a CLF characterizes a stabilizing feedback controller as a controller such that for all . Furthermore, upon selection of such a controller, the CLF is a certificate of stability for the closed loop system:


Establishing that a given function serves as a CLF for (1) is often done for robotic systems constructively by specifying a controller taking values in for all [46, 22]. Note that for any the set is described by an affine inequality in due to the affine nature of the dynamics:


Due to this, the CLF itself may then be used to synthesize a optimization-based controller with more desirable properties using quadratic programs [1, 2, 11]. Specifically, we obtain a feedback control law that satisfies the inequality (3):


where is positive definite and assumed to be a polytope. Feasibility of this optimization problem is guaranteed by the satisfaction of the constraint (3) and Lipschitz continuity of this controller has been studied in [32, 20].

This controller is point-wise optimal [10], and takes a greedy approach to specifying control inputs. This often leads to poor performance compared to even non-optimization based controllers as there is no consideration of the future behavior of the system when the input is chosen. In addition to challenges in achieving longer horizon optimality, these controllers face difficulty in implementation on robotic platforms. The stability guarantees endowed by these controllers assume a continuous-time implementation, which is not possible on many modern digital control systems. Instead, control inputs are chosen and held for a small interval of time in a zero-order-hold manner. Lyapunov stability of zero-order-hold systems has been studied utilizing an approximate discretization of the nonlinear dynamics [35, 34], or in the context of model predictive control [15, 33, 31, 13].

Ii-B Nonlinear Model Predictive Control

Nonlinear Model Predictive Control (NMPC) offers an alternative to CLF-based methods for controlling nonlinear systems, and is inherently designed to resolve the challenges of longer horizon optimality at the expensive of higher online computational cost.

We consider a direct NMPC approach to transform the continuous optimal control problem into a finite dimensional nonlinear program (NLP) [6]. The continuous control signal is parameterized over subintervals of the prediction horizon to obtain a finite dimensional decision problem. This creates a fixed grid of nodes defining control times separated by intervals of duration . In this work, we consider a piecewise constant, or zero-order-hold, parameterization of the input. Denoting and integrating the continuous dynamics in (1) over an interval leads to a discrete time representation of the dynamics:


The integral in (10) is numerically approximated with an integration method of choice to achieve a desired approximation accuracy of the evolution of the continuous time system under the zero-order-hold commands.

The general NMPC problem presented below can be formulated by defining and evaluating a cost function and constraints on the grid of nodes. Here, we write the problem in parametric form, depending on the current measured state and additional parameters contained in , and with a subset of the constraints implemented as soft-constraints with slack terms:


where , , and are the sequences of state, input, and slack variables respectively. The nonlinear cost and constraint functions , , , and , are allowed to vary depending on the node index and are dependent on problem specific parameters and the current measured state . The slack variables are penalized with , an exact penalty [42]

. Collecting all decision variables into a vector,

, problem (11) can be framed as a general nonlinear program (NLP):


Ii-C Sequential Quadratic Programming (SQP)

Interior-Point Methods (IP) and Sequential Quadratic Programming (SQP) are two popular families of algorithms for solving general NLPs [37]. Additionally, the sparsity of (12) induced by the underlying structure of (11) can be exploited to obtain solutions in real-time and at a high sampling rate, which is necessary in many dynamic robotic applications. An overview of recent advances in sparsity exploiting algorithms and software tools is provided in [23].

SQP approaches offer a distinct advantage in that successive problem instances may be warm-started with solutions from preceding instances. This serves to further decrease computation time as it is often only feasible to take a single SQP step per control iteration [24]. As NMPC computes optimal control inputs over a horizon, successive instances of (11) are similar and portions of the preceding optimal control sequence can be use to warm-start the following iteration, enabling convergence across multiple iterations of the problem, rather than iterating until convergence on one instance of the problem [9].

SQP based methods apply Newton-type iterations to KKT optimality conditions for (12), assuming some regularity conditions on the constraints [28]. The Lagrangian of the NLP in (12) is defined as:


with Lagrange multipliers , and corresponding to equality and inequality constraints, respectively. The Newton iterations can be equivalently computed by solving the following potentially non-convex QP [37]:


where the decision variables, , define the update step relative to the current iteration , and the Hessian . Computing the solution to (14) provides a decision variable update, , and updated Lagrange multipliers and . These iterations are ran until the variables , , and converge. This iterative approach is summarized in Algorithm 1.

while NotConverged()  do
      Solve (14)
end while
Algorithm 1 Sequential Quadratic Programming (SQP)

Convergence of the SQP algorithm leads to a state and input sequence, and , respectively. The first element of , denoted as , can be applied to the system, after which the SQP algorithm is run again to determine a new control input sequence. The application of SQP as a subroutine within a NMPC feedback controller is provided in Algorithm 2.

Iii Unifying CLFs with NMPC

In this section we explore different ways of integrating the stability based CLF-QP and performance driven NMPC controllers discussed in Section II. These different methods will be evaluated experimentally in Section IV.

The NMPC framework presented in Algorithm 2 can be interpreted as a closed-loop feedback controller, . As described in Section II-A, for each state , a CLF defines a point-wise set of stabilizing control inputs given in (6). To inherit the stability guarantees provided by the CLF, we need to restrict the NMPC controller to these stabilizing inputs, such that for all .

As noted in [38], if only the first input in the input sequence is applied before the input sequence is recomputed, the restriction of the NMPC controller to stabilizing inputs can be achieved by directly imposing the CLF condition only on the first input, subject to the current measured state :

while ControllerIsRunning() do
      Solve SQP()
end while
Algorithm 2 SQP - NMPC

As in the case of the controller (9), for a given state, this constraint is affine in the decision variable . Due to this, the SQP subroutine (14) contains the CLF constraint without approximation, and will therefore, in the same way as the CLF-QP, compute a stabilizing control input after solving just one QP. In the context of dynamic robotic platforms, this provides an advantage over general NMPC in that it does not require the computational cost of multiple Newton iterations to converge to a potentially stabilizing control input.

Beyond the constraint on the first input, any further modifications to the NMPC problem are done explicitly to increase performance or accommodate the discrete time implementation of control inputs. In the following, we will discuss additional constraints that serve to increase performance beyond that of the controller given by (9) while achieving stability.

Iii-a Extended Horizon Constraints

While the preceding CLF constraint (15) enforces the selection of a stabilizing control input, the resulting theoretical stability properties rely on the controller being applied continuously in time, as noted in Section II-A. As this is not possible in practice, it desirable to incorporate additional stability constraints that enforce stable behavior when control is implemented in a zero-order-hold fashion. NMPC is an advantageous framework for these types of constraints as future states to reflect desired stability properties.

In particular, consider the bound in time on the Lyapunov function established with exponential stability in (5). While this bound is continuous in time, comparison principles [21] may be used to formulate an analogous discrete time bound at the th node:


The constraints given by and can be combined in varying ways along the length of the prediction horizon. The basic approach, denoted CLF-0 and presented in (17a) to (17f), implements the constraint only at the initial node. This is extended in the CLF-All approach, where the constraint is enforced at each node in the horizon in (17g). These constraints are no longer affine since at nodes both state and input are decision variables, and are non-linearly coupled in (15).

In the approach denoted LLS-N, we enforce the constraint at the first node and enforce the constraint at only the final node in the prediction horizon in (17h). A similar bound, which relies on evaluating at the final node after the system has been simulated under a control law given by Sontag’s universal formula [44], is enforced in [38]. Our bound differs in that it is controller independent and only relies on the bound from exponential stability. Lastly, in the approach denoted LLS-All, the level set constraint is applied at each node in (17h), forming an exponentially contracting funnel along the horizon. Additionally, for all formulations, the inputs are bounded , enforcing .





Iii-B Quadratic Approximation Strategy

When applying the SQP algorithm presented in Section II-B to the nonlinear formulations presented in (17), the quadratic subproblem (14) is repeatedly solved. As we seek to deploy NMPC on dynamic robotic platforms, it is critical that these optimization problems are well conditioned and do not provide difficulty to numerical solvers. In particular, when in (14a) is positive semi-definite (p.s.d), the resulting QP is convex and can be efficiently solved [23, 45].

To ensure this, an approximate (p.s.d) Hessian can be used instead of the full Hessian of the Lagrangian. For (17), the objective function has a least-squares form, i.e. , in which case the Gauss-Newton approximation,


proves effective in practice [5, 17]. This neglects the curvature of , as well as the contribution by the curvature of the constraints. We use this strategy for the CLF-0 and CLF-All formulations.

For the LLS-N and LLS-All formulations, we retain the contribution of the LLS constraints in the Hessian approximation. The second term in (16) is independent of the decision variables, and the properties of this constraint are thus directly determined by the structure of the CLF . In particular, if the CLF used is convex (as is the case for many constructive techniques for producing CLFs [46, 22]), then the approximation


remains positive definite, and, as we will show in Section IV-C, improves convergence compared to a Gauss-Newton approximation.

Iii-C Baseline Comparisons

To understand how unifying these two control methodologies impacts performance and stability, it is necessary to compare against baseline controllers given by both (9) and (11). In particular, elements should be shared between controllers to limit the impact of tuning on performance. To this end, we begin by synthesizing a CLF using feedback-linearization based constructive techniques discussed in [46], which enables the consideration of underactuated systems.

Consider an output with relative degree 2 [41] and , a time-varying reference trajectory , and define the tracking error :


A feedback-linearizing controller exists, that yields linear closed-loop error dynamics given by:


where the eigenvalues of

have negative real part. For any positive definite , the Continuous Time Lyapunov Equation (CTLE):


has a positive definite solution . This enables the synthesis of a quadratic (and convex) Lyapunov function given by with time derivative , which is negative definite. Furthermore, the existence of the feedback linearizing controller implies that is a CLF, as:


This CLF can be used in the following CLF-QP controller that achieves exponential stability with . The constraint is slacked for numerical conditioning with .





To synthesize a baseline NMPC- controller, elements from the construction of the CLF can be utilized. In particular, can be used as a running cost on the state, and the terminal value of the CLF can penalized as in [19]:





That is, the CLF is used as a terminal cost and scaled up with the parameter . As noted in [40] if is selected large enough, stability can be achieved without the need to specify a terminal state constraint. The baseline NMPC problem has constraints on the initial condition and dynamic evolution given by (11b) and (11c), but does not include any CLF-based constraints. The inputs are also constrained such that .

Iv Simulation & Experimental Results

In this section we provide details on the implementation of the methods established in Section III on a Segway platform, and discuss simulation and experimental results.

Iv-a Segway System & Implementation

Dynamics simulations provide an environment for assessing attainable levels of performance of the various approaches. The simulated dynamics model reflects a modified Ninebot E+ Segway platform, seen in Fig. 1. We consider a planar representation of the Segway, with state where is the horizontal position and is the pitch angle. The input to the Segway, , is current to the Segway motors. The equations of motion are derived via the Newton-Euler equations for an asymmetric, two-wheeled inverted pendulum with torque input. The asymmetry of the system leads to an unforced equilibrium at with . In the NMPC controllers, a forward Euler time discretization is used with .

State estimation on the physical Segway is done with wheel encoders and IMU data from a VectorNav VN-100. All computations are performed on board on an ARM Cortex-A57 (quad-core) @ 2GHz CPU running the ERIKA3 RTOS. For each NMPC formulation, all functions, gradients, and Hessians in (

14) are found using the CasADi auto-differentiation framework [3]. This leads to a QP with a fixed sparsity pattern, which we solve with the sparsity-exploiting solver OSQP [45]. We solve a single QP per control iteration, unless otherwise stated.

Iv-B Simulation Results

To compare the behavior of the different control approaches, we considered a stabilization task. In particular, we simulated the system under each controller with a fixed initial condition and an objective of stabilizing to the unforced equilibrium point . The performance of each controller was quantified by the average input norm over a 2 second time horizon, which provides an assessment of the total input used. These averages appear in Table I.

N 1 10 20 30 40 50
CLF-QP 1.085 1.085 1.085 1.085 1.085 1.085
CLF-0 1.085 1.085 1.085 1.085 1.085 1.085
CLF-All 1.085 1.072 0.952 0.849 0.794 0.769
LLS-N 1.083 0.957 0.889 0.842 0.808 0.784
LLS-All 1.083 0.956 0.887 0.839 0.805 0.782
NMPC-0.1 - - 3.232 2.435 2.036 1.783
NMPC-1 - 3.026 2.019 1.732 1.574 1.471
NMPC-10 0.828 0.607 0.704 0.823 0.926 1.006
TABLE I: Average input norm along the simulation horizon against prediction horizon length (N) for different controller formulations defined in Section III. Absences indicate failure to stabilize the system.

We see that the CLF-QP and CLF-0 controllers select identical inputs over the entire trajectory and have the largest average input of any CLF-based controllers. This indicates that the addition of a prediction horizon to the baseline CLF-QP controller only improves its performance if the stability constraint is applied further along the horizon. We also see that with no horizon (), all of the CLF-based controllers recover similar performance to the baseline CLF-QP. If we consider the controllers that impose constraints further along the horizon we see that their average input consistently decreases with horizon length, with the CLF-All controller marginally outperforming the LLS controllers at the longest horizon lengths.

The performance of the baseline NMPC- controllers heavily depended on the weighting of the terminal cost. At shorter horizons the NMPC-0.1 and NMPC-1 controllers failed to stabilize the system, and saw improved performance as the horizon grew longer. In contrast, the NMPC-10 controller demonstrated the best performance of all controllers at shorter horizons, but saw worsening performance as the horizon grew longer. This illustrates the issues that arise when both stability and performance are achieved through the cost, rather than decoupled through constraints as in the CLF-based formulations.

Fig. 2: Initial CLF-NMPC solutions stabilizing to for and . Top: The optimal input sequence determined by each controller, with the CLF-0 controller dropping to zero beyond the first node. Middle: Evaluation of the bound on in (15). The controllers with the constraint meet this bound at all required points, while the two LLS controllers violated it at various points along the trajectory. Bottom: Evaluation of the the level set bound in (16). This bound is satisfied at all necessary points by the LSS controllers, but is violated by the CLF-All controller due to the zero-order-hold implementation.

To more clearly understand the possible behaviors of the various CLF-NMPC controllers, we visualize the solutions to each controller obtained at the initial condition, i.e.  in Fig. 2. As the CLF-0 controller is only required to satisfy the stability constraint at the initial node, its input quickly drops to zero and the constraint is violated in the next step in the horizon. In contrast, the CLF-All controller meets the constraint along the entirety of the horizon as required. Despite meeting this constraint on at each node, the CLF-All controller slightly fails to meet the implied level-set bounds along the horizon. This is due to the fact that the constraint is checked only at the beginning of each interval and is not required to hold over the interval which the control input is held over.

The LLS controllers both satisfy the level constraints at the required points, with the LLS-N controller violating the level set bounds earlier in the horizon. Despite meeting these level set bounds and the required points, both controllers violate the associated bound on , with the LLS-All controller satisfying the constraint loosely early in the trajectory before satisfying it tightly at the end of the trajectory.

The evolution of the system under these controllers with a horizon length is captured in Fig. 3. We see that all CLF-based controllers satisfy the stability constraint (15) during the entire simulation. The most significant difference in the behavior of these controllers arises in the magnitude of the input taken early in the trajectory. The best performing controllers applying higher inputs earlier in the trajectory to stabilize the system quickly and avoid accruing input over more of the trajectory.

Fig. 3: Simulation results stabilizing to for . The evaluation of the CLF constraint (15) along the simulation horizon is shown in the bottom-left plot. The system input, pitch angle, and pitch rate are shown in the top-left, top-right, and bottom-right respectively. The lower weighted NMPC- controllers take significantly more time to converge to the equilibrium point.

We additionally perform a simulation in the opposite direction, driving the Segway from its unforced equilibrium to a desired state, . The resulting trajectories are seen in Fig. 4. In this scenario we see that the CLF-QP controller demonstrates significantly different behavior from the CLF-NMPC controllers. In particular, the CLF-QP controller takes an initial input to drive the system towards the desired state, and then allows gravity to carry it to this point. This results in a large overshoot past the desired state, where as the CLF-NMPC controllers approach the equilibrium point more slowly.

The NMPC- controllers fail to converge to the desired state. This arises due to the fact that the cost on the input is not centered about the input that makes the desired state an equilibrium point, i.e. . Because both the input and the state error appear in the cost, larger error is accepted in the state to minimize the input. This highlights the flexibility in choosing the cost function in the CLF-NMPC formulations. General cost functions that do not necessarily obtain their minimum at the goal can be used, which opens up the possibility of using economic cost functions [16].

Fig. 4: Simulation results stabilizing to from . The evaluation of the CLF constraint (15) along the simulation horizon is shown in the bottom-left plot. The system input, pitch angle, and pitch rate are shown in the top-left, top-right, and bottom-right respectively. The CLF-QP controller overshoots the desired state, while the CLF-NMPC controllers slowly approach it. The NMPC- controllers do not converge due to the trade-off between input and state error in the cost function.

Iv-C Numerical Results

To understand the feasibility of deploying these control approaches on the computationally limited Segway platform, we investigated the convergence rate of each formulation on a single instance of the NMPC problem. We also considered variants of the LLS formulations using the Gauss-Newton approximation in (18) (denoted and ) and compare them to using the modified Hessian in (19).

We execute Algorithm 1 for each formulation until the constraints are sufficiently satisfied, , and no further progress is made in cost, . The optimization is fully cold-started such that all decision variables and Lagrange multipliers are initialized to zero. The problem is set up with and a horizon length of . The step size, constraint satisfaction, and first order optimality are plotted in Fig. 5.

The CLF-0 and NMPC- formulations converge rapidly as they have a quadratic cost function and affine constraints. The only nonlinearity in these problems therefore arises from the system dynamics, making the QP subproblem a good model for the full problem. The CLF-All, LLS-N, and LLS-All have nonlinear constraints along the horizon, and therefore take significantly longer to converge. Nonetheless, the convergence rate accelerates over the last few iterations, indicating that these formulations can still perform well when starting close to the solution. Finally, the LLS-N, and LLS-All formulations initially decrease the constraint violation, but fail to make further progress after a certain point.

Fig. 5: Convergence of Algorithm 1 applied to a cold-started NMPC problem with . Top: Step size, , Middle: Constraint violation, , Bottom: First order optimality condition, . The CLF-0 and NMPC- methods converge quickly, while the CLF-NMPC methods take longer. The LLS formulations without the modified Hessian in (19) stop progressing beyond a certain point.

Iv-D Experimental Results

In addition to simulation, we also demonstrate the ability of this unified control approach on the physical Segway in Fig. 1. In particular, we define a desired angular trajectory in time:


where is a commanded velocity and is a velocity feedback gain, leading to error dynamics given by . These dynamics are used to synthesize a quadratic CLF as per Section III. This CLF was used to formulate a CLF-QP controller given by (24), a NMPC-1 and NMPC-10 controller with cost given by (25a), and CLF-All, LLS-N, and LLS-All controllers. Each controller was used to track the desired trajectory and then stabilize the system. The results of these experiments can be seen in Fig. 6. We see that all controllers except the NMPC-1 controller are able to stabilize the system. The CLF-QP displays aggressive behavior compared to the NMPC controllers as it does not incorporate a prediction horizon.

Fig. 6: Experimental results from trajectory tracking. Top: Desired velocity profile, Middle: Input profile, Bottom: Pitch angle profile. The CLF-QP controller displays more aggressive behavior due to no prediction horizon, while the NMPC-1 controller fails to stabilize the system.

The average input and control frequency along the experimental horizon is seen in Table II. We see that at a horizon of the NMPC-10 controller has the best performance, with the NMPC-1 controller omitted due to failure to stabilize. Of the CLF-NMPC controllers the CLF-All controller has the best performance. We note that although the baseline NMPC-10 controller outperforms the proposed methods, this required tuning of the cost function and matches the behavior seen in simulation at this horizon length. We see that the CLF-NMPC methods have a higher computational cost than the NMPC-10 controller. This follows as the NLP has additional constraints related to stability that must be met. In that sense, LLS-N is an appealing approach among the CLF-NMPC methods, as it imposes only two stability constraints.

2.081 1.594 1.666 1.898 1.152
1.25 5.56 4.17 6.13 3.11
TABLE II: Average input norm () and computation time () in along the experiment horizon with prediction horizon for the different controller formulations defined in Section III.

V Conclusion

In conclusion, we have presented a novel set of approaches for unifying CLFs and NMPC on robotic platforms with limited computational resources. The use of a SQP algorithm with modified Hessian was proposed to efficiently solve the resulting nonlinear optimization problem. The different unified formulations were analyzed in simulation, for the first time demonstrated on hardware, and were shown to improve performance beyond baseline CLF and NMPC methods. In particular for forced equilibria, the CLF-NMPC method converges without modifications while the cost-driven baseline NMPC does not. Furthermore, the unified methods all achieved stability where as the stability baseline NMPC methods was sensitive to cost function parameters. As system complexity increases, such manual tuning becomes increasingly difficult. In this space, we see an opportunity for the presented CLF-NMPC methods, where stability is explicitly embedded and requires no further tuning.


R.Grandia and M. Hutter are supported via the European Union’s Horizon 2020 research and innovation programme under grant agreement No 780883. A. Taylor, A. Singletary, and A. Ames are supported via DARPA awards HR00111890035 and NNN12AA01C, and NSF awards 1923239 and 1924526.