Learning for Safety-Critical Control with Control Barrier Functions

Andrew Taylor, Andrew Singletary, Yisong Yue, Aaron Ames

TL;DR

This paper introduces a machine learning framework that enhances Control Barrier Functions (CBFs) to maintain safety in the face of model uncertainty. By iteratively learning how unmodeled dynamics impact a system's safety boundaries—rather than trying to learn the entire system's physics—the authors demonstrate a robust way to keep robots like Segways safe, even when their initial mathematical models are inaccurate.

What Problem Does This Paper Address?

In safety-critical control (think autonomous cars or industrial robots), we often use Control Barrier Functions (CBFs) to mathematically guarantee that a system stays within a "safe set" (e.g., not hitting a wall or not tipping over). However, these guarantees are only as good as the underlying mathematical model of the robot.

In the real world, models are never perfect. Parametric errors (like getting the mass of a robot wrong) and unmodeled dynamics (like friction or air resistance) can cause a "safe" controller to fail, leading to dangerous behavior. While robust control methods exist to handle these errors, they are often overly conservative, making the robot move too slowly or cautiously to be useful. This paper seeks a middle ground: using data to learn exactly how uncertainty affects safety and updating the controller accordingly.

Methods

The authors propose an episodic learning framework called Dataset Aggregation for Control Barrier Functions (DaCBarF). Its key components include:

  1. Targeted Learning: Instead of trying to learn the full, complex dynamics of the system, the framework focuses specifically on learning the error in the time derivative of the CBF ($\dot{h}$). This is the specific term that determines whether a control action is safe.
  2. Episodic Data Collection: Inspired by the DAgger algorithm, the system runs in "episodes." It starts with a nominal controller, collects data on where the safety predictions were wrong, aggregates this new data with previous datasets, and retrains its uncertainty estimators.
  3. LCBF-QP (Learned CBF Quadratic Program): The safety constraint in the controller's optimization problem is updated with the learned uncertainty estimates. This allows the controller to "filter" desired actions through a more accurate safety lens.
  4. Trust Blending: To prevent the robot from behaving erratically in new, unlearned states, the learned controller is blended with the nominal one using a "trust coefficient" that increases as more data is collected.

Datasets

The researchers did not use standard static datasets. Instead, they generated data through active experimentation:

  • Simulation Environment: A 4-dimensional planar Segway model where mass and electrical parameters were intentionally perturbed by 15% to create model uncertainty.
  • Hardware Platform: A custom robotic Ninebot Segway platform. Data was collected over 3 episodes of the robot tracking a horizontal velocity profile while trying to satisfy a safety constraint on its pitch angle rate.

Key Insights and Ideas

  • Safety over Stability: Most prior work focused on learning for stability (Control Lyapunov Functions). This paper shifts the focus to safety (Control Barrier Functions), which is often more critical in human-robot interaction.
  • Efficiency through Dimensionality Reduction: By learning the impact of uncertainty on a scalar function ($h$) rather than the full state vector, the learning problem becomes significantly simpler and requires less data.
  • Breaking the i.i.d. Assumption: Standard supervised learning assumes data points are independent. In robotics, the next state depends on the current one. The episodic "aggregation" approach specifically tackles the "error cascades" that happen when a robot encounters states it didn't see during training.

Key Results

The framework was validated both in simulation and on physical hardware:

  • Simulation: As shown in Figure 1, the baseline model-based controller (green) failed to keep the Segway safe, with the state leaving the safe set (the black ellipse in the phase portrait) and the safety value $h$ dropping below zero. The learning-augmented controller (blue) successfully kept the system within the safe boundaries.
Figure 1. Simulation results using the model-based CBF controller (CBF-QP) (green) and learning-augmented controller (LCBF-QP) (blue). Episodic data appears as red traces. (a) Segway dynamics simulation CAD model. (b) The phase portrait showing the evolution of the state of the system leaves the safe set (black ellipse) with the model-based controller, while it remains within using the learning-augmented controller. (c) The value of h drops below zero (twice) using the model-based controller, while it remains above zero using the learning-augmented controller. Video can be found at https://vimeo.com/user106627792/review/380798349/649d4c391e
  • Hardware: On the real Segway (Figure 2), the baseline controller again violated the safety barrier ($h < 0$ at $t=3s$). After just three episodes of learning, the augmented controller was able to maintain safety throughout the entire run.
Experimental results on the Segway platform. The blue line shows the system remaining safe after learning.

Limitations and Future Work

  • Actuation Assumptions: The method assumes that the "relative degree" of the safety function is the same for both the model and the real system. Essentially, it assumes the robot has the same physical ability to move in the real world as it does in the simulation.
  • Heuristic Trust: The weights used to blend the nominal and learned controllers are currently chosen heuristically. The authors suggest that future work could involve more formal ways to quantify "trust" in the learned model.
  • Scaling: While successful on a Segway, testing this on higher-dimensional systems with more complex safety constraints remains an open challenge.

Summary updated

Abstract

Modern nonlinear control theory seeks to endow systems with properties of stability and safety, and have been deployed successfully in multiple domains. Despite this success, model uncertainty remains a significant challenge in synthesizing safe controllers, leading to degradation in the properties provided by the controllers. This paper develops a machine learning framework utilizing Control Barrier Functions (CBFs) to reduce model uncertainty as it impact the safe behavior of a system. This approach iteratively collects data and updates a controller, ultimately achieving safe behavior. We validate this method in simulation and experimentally on a Segway platform.
BibTeX
@inproceedings{taylor2020learning,
  author = {Andrew Taylor and Andrew Singletary and Yisong Yue and Aaron Ames},
  title = {{Learning for Safety-Critical Control with Control Barrier Functions}},
  booktitle = {L4DC},
  year = {2020},
}
Figure