Source-linked AI summary
Approximate non-linear model predictive control with safety-augmented neural networks
Henrik Hose, Johannes Köhler, Melanie N. Zeilinger, Sebastian Trimpe
TL;DR
Online optimization makes nonlinear MPC computationally expensive, motivating fast neural-network approximations. The paper augments sequence predictions with online safety checks and a safe fallback; across three benchmark systems, it reports deterministic safety and one-to-four-order-of-magnitude computation-time reductions versus online optimization.
Problem
Nonlinear MPC provides stability and constraint-satisfaction guarantees, but computationally expensive online optimization limits practical use on resource-constrained systems.
Source: §I · p. 1Method
The method approximates MPC’s open-loop input sequence with a neural network, checks feasibility and cost online, and applies a safe candidate when the NN sequence is unsafe or does not improve cost.
Source: B. Contribution · p. 2, §III · p. 3Results
Across three nonlinear MPC benchmark systems, computation time fell by one to four orders of magnitude versus online optimization, with deterministic safety; always applying the NN caused non-negligible constraint violations.
Source: B. Contribution · p. 2Takeaways & Limitations
Online sequence checking requires a single forward simulation at small additional computational cost, while remaining significantly faster than MPC with online optimization.
Source: B. Contribution · p. 2The experiments identify poor out-of-distribution generalization and set-valued MPC solutions as limitations; the latter significantly deteriorates simple regression performance and necessitates generative models.
Source: §VI · p. 8
Abstract
from arXiv · showhide
Model predictive control (MPC) achieves stability and constraint satisfaction for general nonlinear systems, but requires computationally expensive online optimization. This paper studies approximations of such MPC controllers via neural networks (NNs) to achieve fast online evaluation. We propose safety augmentation that yields deterministic guarantees for convergence and constraint satisfaction despite approximation inaccuracies. We approximate the entire input sequence of the MPC with NNs, which allows us to verify online if it is a feasible solution to the MPC problem. We replace the NN solution by a safe candidate based on standard MPC techniques whenever it is infeasible or has worse cost. Our method requires a single evaluation of the NN and forward integration of the input sequence online, which is fast to compute on resource-constrained systems. The proposed control framework is illustrated using two numerical non-linear MPC benchmarks of different complexity, demonstrating computational speedups that are orders of magnitude higher than online optimization. In the examples, we achieve deterministic safety through the safety-augmented NNs, where a naive NN implementation fails.
I. INTRODUCTION
MPC offers constraint-satisfaction and stability guarantees but can require costly online optimization, while neural-network approximations are fast but do not generally retain hard safety guarantees. The paper proposes checking NN-predicted input sequences online and falling back to a safe candidate, with numerical examples showing deterministic safety and substantial computation-time reductions.
I. INTRODUCTION
- MPC provides constraint-satisfaction and stability guarantees, but online optimization can be too slow for resource-constrained systems, while NN approximations do not generally provide hard guarantees.The introduction also notes that a priori computation-time bounds are difficult for general nonlinear systems.Source: §I · p. 1
B. Contribution
- The method approximates the full MPC input sequence, checks it online, and uses a shifted prior safe sequence with appended terminal control as a fallback.The NN sequence is used only when safe and no worse in cost than the candidate.Source: B. Contribution · p. 2
A. Related work
- Unlike approaches that require uniform approximation-error bounds or probabilistic validation, the proposed safety augmentation provides deterministic guarantees without assumptions on approximation quality.Existing robustification may be conservative, and statistical validation leaves a nonzero probability of faulty inputs.Source: A. Related work · p. 1, B. Contribution · p. 2
B. Contribution
- The authors show that a naive neural-network approximation is safe when robust MPC is sufficiently well approximated, and use this result constructively to approximate robust MPC schemes.Source: B. Contribution · p. 2
- One to four orders of magnitude lower overall computation time than online optimization, with deterministic safety; naively applying NN solutions causes non-negligible constraint violations.The three benchmark examples demonstrate both the speedup and the importance of safety augmentation.Source: B. Contribution · p. 2
C. Notation
The paper considers constrained nonlinear discrete-time systems and formulates MPC as a finite-horizon optimization problem with a terminal set, cost, and feedback controller. Under standard terminal conditions, MPC ensures persistent feasibility and closed-loop stability, while requiring online optimization.
C. Notation
- The notation section defines integer sets, K∞ functions, Minkowski sums and Pontryagin differences, diagonal matrices, and identity matrices.I0:N denotes integers from 0 through N; N denotes non-negative integers.Source: C. Notation · p. 2
II. SYSTEM DESCRIPTION
- The system has state and input constraints and is to be driven to the equilibrium x = 0 while satisfying constraints for a large set of initial conditions.The dynamics are discrete-time and nonlinear, with continuous f and compact state and input constraint sets.Source: §II · p. 2
A. MPC problem
- MPC minimizes a finite-horizon cost over feasible input trajectories, with a terminal set containing the origin and a terminal feedback controller.The stage and terminal costs are non-negative and continuous.Source: A. MPC problem · pp. 2–3
- An invariant terminal set and a terminal cost that decreases under the terminal controller ensure persistent feasibility and closed-loop stability, but solving MPC requires online optimization.If a feasible solution exists initially, one exists at every subsequent time.Source: A. MPC problem · p. 3
B. Problem formulation: approximate MPC with guarantees
The problem is to approximate MPC with a neural network while preserving constraint satisfaction and convergence. Because NN input sequences need not be feasible, applying them directly does not guarantee safety.
B. Problem formulation: approximate MPC with guarantees
- The NN is trained offline to map a state to a full horizon-length input sequence approximating an optimal MPC sequence.The paper assumes no particular NN structure or learning procedure.Source: B. Problem formulation: approximate… · p. 3
- Because the approximation is not exact, applying its first input at every step can violate state constraints even from an initially feasible state.The paper points to numerical examples where naive application fails.Source: B. Problem formulation: approximate… · p. 3
- The goal is to guarantee constraint satisfaction and asymptotic convergence for a given NN approximation of MPC.The stated requirements are x(t) ∈ X for all t and x(t) → 0 as t → ∞.Source: B. Problem formulation: approximate… · p. 3
III. SAFE ONLINE EVALUATION
The safety augmentation checks each NN-predicted input sequence and selects it only when feasible and no more costly than a safe candidate. Under the stated assumptions, this selection preserves feasibility and convergence, with the added cost of one forward simulation rather than online optimization.
III. SAFE ONLINE EVALUATION
- Algorithm 1 checks NN-predicted sequences for feasibility and chooses the lower-cost option between a feasible NN sequence and the safe candidate.It then applies the first input and shifts the selected sequence, appending the terminal controller to form the next candidate.Source: §III · p. 3
- The method requires an initially safe candidate sequence; possible initialization includes a steady state or an offline-computed MPC solution.An NN sequence can also initialize the algorithm if it is feasible at the initial state.Source: §III · p. 3
- With Assumptions 1 and 2, Algorithm 1 keeps state-input pairs within constraints and converges to x = 0.Initialization requires a safe candidate input sequence at the initial state.Source: §III · p. 3
- The safe candidate remains feasible by the standard shifted-sequence construction, and its cost decreases by at least the stage cost; selecting a no-more-costly NN sequence preserves that decrease.This establishes persistent feasibility and convergence for the selected sequence.Source: §III · p. 4
- The added online computation is one forward simulation of the predicted sequence, considerably less than iterative online optimization.The paper describes this as a middle ground between online optimization and naive offline NN control.Source: §III · p. 4
IV. APPROXIMATING ROBUST MPCS
The paper derives sufficient conditions for safe neural-network approximations using robust MPC, then uses this result constructively to increase how often the approximated trajectory is feasible.
IV. APPROXIMATING ROBUST MPCS
- The method retains deterministic safety by applying a safe candidate when the NN sequence is infeasible.The sufficient conditions in this section build on that safety augmentation.Source: §IV · p. 4
- The authors introduce robust MPC before deriving guarantees for approximating its solution.Source: §IV · p. 4
- In the numerical examples, increasing MPC robustness is used constructively to make the NN approximation yield a feasible trajectory more often.Source: §IV · p. 4
A. Robust MPC
Robust MPC restricts input sequences to those that remain feasible under bounded input disturbances. The section outlines a Lipschitz-based constraint-tightening approach and notes that more general tube methods are also used.
A. Robust MPC
- The robust MPC scheme seeks stability and constraint satisfaction when the input is perturbed by a bounded disturbance.Source: A. Robust MPC · p. 4
- Its optimizer selects from robustly feasible input trajectories, a subset of the nominal feasible trajectories, and returns a sequence that is also suboptimal for the nominal MPC problem.Source: A. Robust MPC · p. 4
- A simple robustness construction tightens constraints using Lipschitz continuity of the dynamics and bounds on disturbance effects on state evolution.The examples also use more general feedback and tube parametrization.Source: A. Robust MPC · pp. 4–5
B. Guarantees for approximations of robust MPC
The section gives a sufficient approximation-error condition under which the NN sequence is feasible, while the safety augmentation preserves deterministic safety even when that condition does not hold.
B. Guarantees for approximations of robust MPC
- If the robust MPC solution satisfies the robust-feasibility condition and the NN approximation error is at most ϵ throughout the robust feasible set, the NN sequence is nominally feasible.Source: B. Guarantees for approximations of… · p. 5
- Deterministic safety still holds when the uniform approximation-error condition fails, because Algorithm 1 can use the safe candidate instead.Source: B. Guarantees for approximations of… · p. 5
- The sufficient condition can help identify useful approximations without requiring a uniform error bound everywhere, unlike the cited prior validation approach.The prior approach validates the approximation through closed-loop simulations and gives probabilistic safety guarantees.Source: B. Guarantees for approximations of… · p. 5
- Meeting the approximation condition does not ensure that Algorithm 1 always applies the NN sequence, since the safe candidate may have lower cost.Source: B. Guarantees for approximations of… · p. 5
C. Robustness to bounded model-mismatch
The paper extends robust-MPC approximation guarantees to bounded external disturbances and describes numerical examples and implementation choices. The supplied passages specify the robustness condition and experimental setup, but not benchmark outcomes.
C. Robustness to bounded model-mismatch
- When the NN approximation error is below the robust MPC disturbance allowance, the remaining allowance bounds external disturbances while preserving nominal feasibility.The remaining bound is ϵ_ext = ϵ − ϵ_app.Source: C. Robustness to bounded model-mismatch · p. 5
V. NUMERICAL EXAMPLES
- The examples compare safety-augmented NN MPC with online optimization and naive NN control on three nonlinear systems: a stirred-tank reactor, a quadcopter, and a robotic arm.Source: §V · p. 5
A. Implementation details
- Implementation uses terminal sets, costs, and controllers, tube-based robustification, and fully connected feedforward NNs; the dataset-generation solver and integrator choices vary by system.The stir-tank and quadcopter use acados with HPIPM and implicit integration; the robot arm uses CasADi with IPOPT and explicit first-order integration.Source: A. Implementation details · p. 5
B. Benchmark systems
The benchmark systems are a nonlinear stirred-tank reactor and a ten-state quadcopter, with system-specific dynamics, constraints, and MPC settings.
B. Benchmark systems
- The benchmark suite includes a nonlinear stirred-tank reactor and a ten-state quadcopter.The section introduces their dynamics and parameters.Source: 1) Stir tank reactor · p. 6, 2) Quadcopter · p. 6
1) Stir tank reactor:
- The stirred-tank reactor has two states and one input, targets xe = [0.2632, 0.6519]⊤ and ue = 0.7853, and uses a 10-step MPC horizon.Its state and input constraints are ∥x−xe∥∞≤0.2 and 0 ≤u ≤2; its NN has two 50-neuron hidden layers.Source: 1) Stir tank reactor · p. 6
2) Quadcopter:
- The quadcopter uses a ten-state model with three inputs and a 10-step MPC horizon, subject to a wall constraint at x1 ≤ 0.145.Its NN has six hidden layers with [200, 400, 600, 600, 400, 200] neurons.Source: 2) Quadcopter · p. 6
3) Robot arm:
Across the benchmarks, safety augmentation preserved closed-loop constraints where naive NN control violated them, while the method evaluated much faster than online optimization.
3) Robot arm:
- The Franka robot arm has six modeled joints, with joint-space position, velocity, and acceleration constraints plus an end-effector collision constraint.The third of the robot's seven joints is locked to avoid set-valued MPC solutions.Source: 3) Robot arm · p. 6
C. Simulation Results
- On test data, more than 99% of NN predictions were feasible for the stirred-tank and robot-arm systems, compared with 72% for the quadcopter.The quadcopter NN was trained using a dataset with approximately five gridpoints per state dimension.Source: C. Simulation Results · p. 6
1) Online computation times:
- The proposed method ran four orders of magnitude faster than solving the MPC problem and at least ten times faster than a single solver iteration.The combined evaluation took about 0.1–0.2 ms with implicit integration and 0.02 ms with simpler integration.Source: 1) Online computation times · p. 6, Table II · p. 7
2) Online constraint satisfaction (safety):
- Safety-augmented control remained safe from random feasible starts, whereas naive NN control produced closed-loop constraint violations.Table III compares the methods across the benchmark systems.Source: 2) Online constraint satisfaction… · p. 6, Table III · p. 7
- An initially feasible quadcopter NN sequence can become unsafe in closed loop: the safety augmentation switches to a safe candidate, while naive control later crashes into the wall.The NN remains feasible for the first 0.6 s in the described example; without the fallback, the crash occurs 0.3 s later.Source: 2) Online constraint satisfaction… · p. 7, Figure 2 · p. 7
- The rejection causes vary by benchmark: higher cost dominates in the stirred-tank reactor, while state-constraint violations dominate in the quadcopter.A trajectory can be rejected for multiple reasons, including constraint violations or failure to decrease cost.Source: Table IV · p. 7, 2) Online constraint satisfaction… · p. 7
- In the robot-arm simulation, safety-augmented control avoids collision while naive NN control collides just before 2 s, with NN control performance close to the data-generating MPC.The figure reports that the MPC uses 10 solver iterations taking 200 ms.Source: Figure 3 · p. 7
3) Robustness of the approximate MPC:
With 75% of the disturbance level, the safety augmentation uses 95% of NN inputs, while approximate MPC provides deterministic safety and convergence despite approximation errors. The method checks NN input sequences for feasibility and cost against a safe candidate, with four orders of magnitude faster computation than online NLP solving in the numerical examples.
3) Robustness of the approximate MPC:
- At 75% of the disturbance level, safety augmentation uses 95% of NN inputs; both approximate MPC and the 10-iteration data-generating MPC perform well, while fewer solver iterations fail.The 95% figure is a 5-percentage-point drop from the nominal case.Source: 3) Robustness of the approximate MPC · p. 7
VI. CONCLUSION
- The method provides deterministic safety and convergence despite approximation errors by checking NN input-sequence feasibility and cost against a safe candidate.The candidate is the shifted previous trajectory with an appended terminal controller.Source: §VI · pp. 7–8
- In three numerical examples, the method improves overall computation time by four orders of magnitude compared with solving NLPs online with acados.Source: §VI · p. 8
- Poor out-of-distribution generalization and set-valued MPC solutions can impair simple regression, necessitating generative models.The conclusion also notes that extending safety augmentation to reinforcement learning requires additional work because those methods compute single actions rather than action sequences.Source: §VI · p. 8