Learning soft constrained MPC value functions: Efficient MPC design and implementation providing stability and safety guarantees

Nicolas Chatzikiriakos, Kim Peter Wabersich, Felix Berkel, Patricia Pauli, Andrea Iannelli

Abstract

Model Predictive Control (MPC) is a cornerstone of modern control engineering, offering the ability to handle complex system dynamics and explicit constraints. However, its high computational demand often precludes its use on resource-constrained embedded hardware. This paper presents a framework for approximating the value function of a soft-constrained MPC using neural networks. By employing soft constraints and a novel function-splitting technique, the authors ensure the learned model is Lipschitz continuous, enabling formal mathematical guarantees for Input-to-State Stability (ISS) and safety through constraint tightening.

Introduction

In fields ranging from autonomous driving to robotics, Model Predictive Control (MPC) is favored for its ability to optimize performance while strictly adhering to safety and operational constraints. Despite its efficacy, MPC requires solving a constrained optimization problem at every sampling interval—a task that can be computationally prohibitive for embedded systems with limited processing power.

A common strategy to mitigate this computational burden is to "learn" the MPC control law using neural networks. However, standard MPC control laws are often discontinuous; small changes in the system state can lead to abrupt shifts in the optimal control action. These discontinuities are notoriously difficult for neural networks to approximate accurately, and even minor errors can lead to instability or safety violations. This research addresses these challenges by shifting the focus from learning the control law directly to learning the MPC value function under a soft-constraint regime.

Methodology

The proposed framework ensures that the learned controller is both computationally efficient and mathematically robust through four key innovations:

1. Soft Constraints and Continuity

Rather than employing "hard" constraints that the system must never cross, the authors utilize soft constraints. In this setup, nearing a boundary incurs a significant "slack penalty" within the cost function. This formulation ensures that the Value Function—the total predicted cost from a given state—is Lipschitz continuous. Continuity is the "secret sauce" that allows neural networks to approximate the function more reliably than the jagged landscapes of hard-constrained problems.

2. Value Function Approximation

Instead of training a network to map states directly to actions ($u \approx \pi(x)$), the authors train the network to approximate the Value Function ($V(x)$). At runtime, the controller performs a simplified, low-dimensional optimization to determine the best action based on the gradient of the learned value function. This approach preserves the optimization-based nature of MPC while drastically reducing the online workload.

3. Function Splitting

Learning a single function that is smooth in some regions but extremely steep near constraints is a significant challenge for standard architectures. To solve this, the authors split the value function into two distinct neural networks:

  • Performance Network: Captures the smooth, nominal behavior of the system.
  • Safety Network: Specifically handles the steep penalties associated with constraint violations. This separation allows for higher accuracy with significantly fewer training data points.

4. Formal Safety via Constraint Tightening

The framework provides formal proofs for Input-to-State Stability (ISS). By calculating the maximum approximation error of the neural network, the authors can determine a "tightening" factor ($\eta$). This safety margin ensures that even if the neural network's prediction is slightly off, the physical system remains within the original hard boundaries.

Experimental Results

The approach was validated using a simulated nonlinear mass-spring-damper system. The training dataset consisted of only 729 data points, generated by solving the true MPC problem offline across a state-space grid. An additional 1,000 random samples were used for validation.

Performance Metrics

  • Computational Efficiency: The approximate controller achieved an evaluation time of 1ms on a standard notebook without GPU acceleration, making it suitable for high-frequency real-time applications.
  • Approximation Accuracy: The validation error was measured at 0.0011, significantly lower than the theoretical safety threshold of 0.25 required for this specific system.
  • Robustness: In closed-loop simulations, the learned controller successfully maintained the nonlinear system within its physical constraints, even when trajectories approached the boundaries of the feasible set.

Discussion and Future Work

The results demonstrate that learning the value function of a soft-constrained MPC is a viable path toward deploying advanced control on embedded hardware. The function-splitting technique, in particular, proves essential for handling the non-linearities introduced by safety constraints.

However, some limitations remain. While the online optimization step is minimal, it may still be too slow for ultra-high-speed applications like power electronics. Furthermore, as the dimensionality of the system increases (e.g., in humanoid robotics), more advanced sampling strategies will be required to generate training data efficiently. Future research will also focus on reducing the sensitivity of the tightening factor to ensure the controller does not become overly conservative when approximation errors are present.

Conclusion

By combining the flexibility of neural networks with the rigor of control theory, this framework provides a bridge between high-performance MPC and resource-constrained implementation. The use of soft constraints and function splitting ensures that safety is not just an empirical observation, but a mathematical guarantee.

Summary updated

BibTeX
@inproceedings{chatzikiriakos2024learning,
  author = {Nicolas Chatzikiriakos and Kim Peter Wabersich and Felix Berkel and Patricia Pauli and Andrea Iannelli},
  title = {{Learning soft constrained MPC value functions: Efficient MPC design and implementation providing stability and safety guarantees}},
  booktitle = {L4DC},
  year = {2024},
}
Figure