Safe and Performant Controller Synthesis using Gradient-based Model Predictive Control and Control Barrier Functions

Aditya Singh, Aastha Mishra, Manan Tayal, Shishir Kolathaya, Pushpak Jagtap

TL;DR

This paper introduces a two-stage control framework that bridges the gap between high performance and strict safety guarantees for autonomous systems. By feeding a safety-aware, gradient-optimized Model Predictive Control (MPC) trajectory into a Control Barrier Function (CBF) safety filter, the approach achieves provable safety without the extreme conservatism or computational bottlenecks typical of traditional methods.

What Problem Does This Paper Address?

Autonomous systems like drones and self-driving cars must balance two often-conflicting goals: performance (getting to the destination quickly and efficiently) and safety (avoiding obstacles and staying within physical limits).

A common way to handle this is using a two-layered architecture: a nominal controller plans a path toward the goal, and a real-time "safety filter"—such as a Control Barrier Function Quadratic Program (CBF-QP)—modifies the control inputs at the last second if a collision is imminent. However, if the nominal planner is completely blind to safety, the filter has to make drastic, myopic corrections. This results in jerky, overly conservative, or even stuck behavior.

Alternatively, engineers can try to solve the entire State-Constrained Optimal Control Problem (SC-OCP) at once, but exact methods suffer from the "curse of dimensionality," becoming computationally intractable for systems with more than a few variables. Popular sample-based alternatives like Model Predictive Path Integral (MPPI) help, but their computational cost scales poorly in high-dimensional spaces.

Methods

The authors propose a novel two-stage framework that decouples performance optimization from hard safety enforcement, utilizing gradient-based optimization to maintain scalability:

  1. Stage 1: Gradient-Based Planning with Soft Constraints
    The hard state-constrained MPC problem is reformulated into an unconstrained one by moving the safety boundaries into the cost function as soft penalties. This elimination of hard nonlinear constraints prevents optimization failures. The problem is then solved online using a fast, gradient-based Quasi-Newton method (L-BFGS). Because it leverages exact gradients rather than random sampling, it scales almost linearly with system dimensions and outputs a reference trajectory ($u_{mpc}$) that is already highly safety-aware.

  2. Stage 2: CBF-QP Safety Filtering for Hard Guarantees
    Since soft penalties cannot strictly guarantee safety, the safety-aware control input from Stage 1 is passed as a reference to a CBF-QP filter. The filter mathematically guarantees forward invariance of the safe set (meaning the system physically cannot leave the safe zone) while minimally modifying the reference input. Because the reference input already accounts for obstacles, the filter rarely needs to make aggressive corrections, eliminating myopic behavior.

[Goal & State] ──> [Stage 1: Gradient MPC (Soft Penalties)] ──> u_mpc ──> [Stage 2: CBF-QP Filter (Hard Guarantees)] ──> Safe Control Action

Datasets

Not discussed in the paper. As is standard for theoretical control literature, the method was evaluated using simulated physics environments rather than static datasets. The authors tested their framework on two simulated robotics benchmarks:

  • 3D Dubins Car (Unicycle): Navigating from a random start to a goal while avoiding a circular obstacle.
  • 6D Planar Quadrotor: Navigating a closed room bounded strictly by walls, a floor, and a ceiling.

Key Insights and Ideas

  • Safety-Aware References Prevent Myopia: Standard safety filters perform poorly when the underlying controller is oblivious to danger. Providing the filter with a reference trajectory that already anticipates obstacles yields much smoother, more optimal paths.
  • Gradients Beat Sampling in High Dimensions: While sample-based methods like MPPI are popular due to their ease of implementation, their reliance on scalar cost signals causes them to struggle as action spaces grow. Gradient-based optimization (L-BFGS) provides rich curvature feedback, leading to superior convergence rates in higher-dimensional systems like quadrotors.
  • Decoupling Optimization and Guarantees: Trying to solve hard nonlinear constraints directly inside an MPC loop often leads to numerical infeasibility. Relaxing them to soft constraints for the planner, and then enforcing them strictly via a simple QP layer, provides the best of both worlds: numerical stability and formal safety guarantees.

Key Results

The proposed method (GMPC-CBF) was compared against standard Gradient MPC (GMPC), baseline MPPI, and an MPPI-CBF hybrid.

  • 100% Safety Rate: Both CBF-integrated methods achieved a perfect 100% safety rate across all trials, whereas pure GMPC and MPPI suffered from constraint violations (only achieving 85-88% safety).
  • Superior Performance (Lower Cost): In the unicycle task, the sample-based MPPI-CBF incurred a 47.6% higher cost than the proposed method due to over-conservatism. In the 6D quadrotor task, MPPI-CBF's cost skyrocketed to 110.6% higher because it failed to converge cleanly to the goal, oscillating wildly near the boundaries.
Trajectories for the Unicycle Robot Navigation task. The proposed method smoothly avoids the obstacle and reaches the goal, while baselines either crash or fail to converge.
  • Linear Computational Scaling: As the system complexity doubled from 3D (unicycle) to 6D (quadrotor), the computation time for the gradient-based method scaled linearly (from 0.14s to 0.3s). In contrast, sample-based methods experienced a 3-4x superlinear increase in computation time.
Trajectories for the Planar Quadrotor task inside a bounded room. GMPC-CBF successfully reaches the green goal while strictly respecting the boundary constraints.

Limitations and Future Work

  • Known Dynamics Assumption: The current framework assumes that the system's underlying control-affine dynamics are fully known and differentiable. The authors note that future work will focus on extending this method to systems with unknown or learned dynamics.
  • Manual CBF Design: Constructing valid Control Barrier Functions—especially Higher-Order CBFs for complex systems—remains a challenging manual task. The authors plan to investigate learning-based approaches to automatically construct and formally verify CBFs to enhance scalability to even more complex, real-world systems.

Summary updated

BibTeX
@misc{singh2025safe,
  author = {Aditya Singh and Aastha Mishra and Manan Tayal and Shishir Kolathaya and Pushpak Jagtap},
  title = {{Safe and Performant Controller Synthesis using Gradient-based Model Predictive Control and Control Barrier Functions}},
  year = {2025},
  eprint = {2507.13872},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.13872},
}
Figure