Abstract
Designing safety controllers for complex robotic systems often involves a trade-off between mathematical tractability and operational efficiency. Traditional Handcrafted Control Barrier Functions (HCBFs) frequently result in conservative behavior, restricting robots to a small fraction of their truly safe operating space. This paper introduces a framework to learn an augmented CBF by combining a conservative base function with a neural network correction term. By utilizing Model Predictive Control (MPC) as a safety mechanism during training, the method enables safe exploration of state-space boundaries. Experimental results on linear and nonlinear systems demonstrate that the learned CBF recovers significantly more of the safe set while maintaining the real-time computational efficiency required for high-frequency control.
Introduction
In safety-critical robotics, such as autonomous driving or aerial navigation, ensuring that a system never enters an "unsafe" state is paramount. Control Barrier Functions (CBFs) have emerged as a powerful tool for this purpose, acting as mathematical boundaries that ensure forward invariance of a safe set. However, for nonlinear or high-dimensional systems, designing an optimal CBF is notoriously difficult. Engineers often rely on Handcrafted CBFs (HCBFs) which, while safe, are typically overly cautious. This conservatism leads to inefficient trajectories and "timid" robot behavior.
While Model Predictive Control (MPC) can handle complex constraints more precisely, its high computational cost often precludes its use in real-time, high-frequency applications. This research proposes a hybrid approach: learning a correction term for a simple HCBF to approximate the precision of MPC while retaining the speed of a Quadratic Program (QP) solver.
Methodology
1. Architecture: The Augmented CBF
Rather than learning a safety function from scratch, the authors define the total CBF, $h(x)$, as the sum of a known, conservative handcrafted function $\hat{h}(x)$ and a learned neural network component $\Delta h(x)$:
$$h(x) = \hat{h}(x) + \Delta h(x)$$
The neural network is implemented as a Deep Differential Network, which is specifically designed to learn the "gap" between the conservative estimate and the true physical limits of the system.
2. Safe Data Collection via MPC-Guided Rollouts
A primary challenge in learning safety is that traditional exploration often requires experiencing failure (crashing) to identify boundaries. To circumvent this, the authors employ MPC-guided rollouts. During the training phase, the system explores its environment; if the current controller approaches a potential safety violation, an MPC controller intervenes to steer the system back to a known safe state. This allows the model to gather data near the boundaries of the safe set without risking the hardware.
3. Training and Loss Functions
The neural network is optimized using a multi-objective loss function designed to enforce the mathematical properties of a valid CBF. The loss penalizes:
- Safe State Misclassification: Ensuring safe states do not have erroneously low CBF values.
- Unsafe State Misclassification: Ensuring unsafe states are correctly identified with high penalties.
- Derivative Condition Violations: Ensuring the "Lie derivative" condition is met, which guarantees that a valid control input exists to keep the robot safe in the subsequent time step.
4. Real-Time Execution
Once the network is trained, the augmented CBF is integrated into a standard Quadratic Program (QP). This setup allows the robot to make safety-certified decisions in microseconds, making it orders of magnitude faster than solving a full MPC problem at every control loop.
Experimental Evaluation
The proposed method was evaluated on two distinct simulated environments:
- Second-Order Integrator: A linear system used to visualize the expansion of the safe set. The goal was to reach a target while respecting a velocity limit. While the HCBF restricted the robot to a velocity of 2.0 m/s, the learned CBF successfully expanded the operational range to nearly the true physical limit of 3.0 m/s.
- Ball-on-Beam System: A classic nonlinear control problem involving balancing a ball on a tilting beam. This test demonstrated the method's ability to handle coupled constraints (beam angle and angular velocity), a task that is significantly more complex to tune manually.
Key Insights
- Incremental Learning: By starting with a conservative HCBF, the neural network does not need to learn the fundamental concept of safety from a blank slate. It only needs to learn the "residual" safety area, which simplifies the learning task.
- MPC as a Teacher: The framework leverages the high-fidelity safety of MPC during the offline training phase to create a fast, online controller. This effectively "distills" the safety knowledge of MPC into a QP-compatible format.
- Tunability: The authors demonstrated that the "aggressiveness" of the controller can be adjusted post-training by tuning a single parameter ($\gamma$), allowing operators to scale the safety buffer without retraining the underlying neural network.
Conclusion and Future Work
This research provides a robust path forward for making complex robots more efficient without sacrificing safety. By learning to expand the safe set of a conservative controller, the authors achieve MPC-like performance with QP-like speed.
Future work will address the current limitations of the model, specifically its dependency on an accurate dynamics model for rollouts. Additionally, scaling this approach to higher-dimensional systems, such as humanoid robots or multi-agent swarms, remains a critical next step for the deployment of learned safety functions in the real world.
Summary updated