Inferensys

Glossary

Control Barrier Function (CBF)

A Control Barrier Function (CBF) is a mathematical tool used to synthesize safety-critical controllers that formally guarantee a system will remain within a predefined safe set.
Developer demonstrating multi-agent tool use, agent tool selection interface on laptop, casual tech demo moment.
SAFETY-CRITICAL CONTROL

What is a Control Barrier Function (CBF)?

A mathematical formalism for synthesizing controllers that provide formal, provable safety guarantees for dynamical systems.

A Control Barrier Function (CBF) is a mathematical tool used in safety-critical control to synthesize controllers that formally guarantee a dynamical system will remain within a predefined safe set. It works by defining a scalar function, h(x), whose superlevel set represents the safe region. The core innovation is a constraint derived from the CBF that, when enforced on the system's control inputs at every timestep, ensures h(x) remains non-negative, thus keeping the state x safe. This transforms a complex safety requirement into a simple, instantaneous condition on allowable control actions.

The power of CBFs lies in their integration with optimization-based controllers, like Quadratic Programs (QPs). A typical CBF-based controller solves a QP that minimally modifies a nominal, performance-driven control input to satisfy the CBF safety constraint. This provides a formal guarantee of forward invariance of the safe set. CBFs are closely related to Lyapunov functions for stability but are specifically designed for safety. They are fundamental in robotics and autonomous systems for tasks like collision avoidance, where they ensure a vehicle or robot never enters an unsafe region defined by obstacles.

FORMAL GUARANTEES

Core Properties of Control Barrier Functions

A Control Barrier Function (CBF) is a mathematical tool used to synthesize safety-critical controllers. Its core properties are what enable the formal, provable guarantee that a system will remain within a predefined safe set.

01

The Forward Invariance Guarantee

The fundamental property of a valid CBF is that it ensures forward invariance of the safe set. If the system starts inside the safe set (defined by the CBF), it is mathematically guaranteed to never leave it under the derived control law. This is not just probabilistic safety; it is a formal, deterministic certificate.

  • Formal Definition: For a safe set (C), a CBF (h(x)) is designed such that (C = {x : h(x) \geq 0}). The control law is synthesized to ensure (\dot{h}(x, u) \geq -\alpha(h(x))), where (\alpha) is a class (\mathcal{K}) function. This inequality, known as the CBF condition, is the mathematical engine of the guarantee.
02

Relative Degree and High-Order CBFs

A CBF's relative degree is the number of times it must be differentiated with respect to time before the control input (u) explicitly appears. For many physical systems (e.g., a car where safety depends on position but control is acceleration), the safety constraint has a relative degree greater than one.

  • Standard CBFs apply when the control input appears in the first derivative ((\dot{h})).
  • High-Order CBFs (HOCBFs) extend the framework to handle constraints with higher relative degrees. They construct a series of derivative conditions to ensure the original constraint (h(x) \geq 0) is satisfied, effectively "pushing" the control influence back through the system's dynamics.
03

The CBF as a Safety Filter

A primary application is the CBF-based Quadratic Program (CBF-QP). This property allows CBFs to act as a real-time safety filter for any legacy or performance-driven controller (e.g., an LQR or learning-based policy).

  • Process: At each control cycle, the nominal controller proposes a desired input (u_{nom}).
  • Optimization: A small, fast QP is solved: minimize (||u - u_{nom}||^2) subject to the CBF condition (\dot{h}(x, u) \geq -\alpha(h(x))).
  • Result: The output (u^*) is the control closest to the nominal one that is provably safe. This decouples performance design from safety certification.
04

Composition and Multiple Constraints

Real-world systems must often satisfy multiple concurrent safety constraints (e.g., avoid several obstacles, stay within joint limits, maintain a safe distance from humans). A key property is that CBFs can be composed.

  • For (m) constraints with functions (h_1(x), ..., h_m(x)), the controller must satisfy all CBF conditions simultaneously: (\dot{h}_i(x, u) \geq -\alpha_i(h_i(x))), for (i = 1,...,m).
  • These form multiple constraints in the safety-filter QP. The solution finds a control input that satisfies all constraints, if such an input exists within the actuator limits. This makes CBFs scalable to complex operational environments.
05

Relationship to Lyapunov Functions

CBFs are conceptually dual to Lyapunov functions, which certify stability. Understanding this relationship is crucial for unified controller design.

  • Lyapunov Function (V(x)): Certifies convergence to a goal. Requires (\dot{V}(x) \leq 0) (energy decreases).
  • Control Barrier Function (h(x)): Certifies remaining in a safe set. Requires (\dot{h}(x) \geq -\alpha(h(x))) (safety increases or decays slowly).
  • Combined Design: A Control Lyapunov-Barrier Function (CLBF) can encode both stability and safety objectives within a single framework, allowing the solution of a QP that guarantees the system is both safe and stable.
06

Robustness and Adaptive CBFs

A critical practical property is robustness to model uncertainty and disturbances. Standard CBFs assume a perfect dynamics model. Robust CBFs (RCBFs) and Adaptive CBFs (aCBFs) extend the guarantee to uncertain systems.

  • Robust CBFs: Use worst-case bounds on uncertainty to formulate a more conservative CBF condition that holds for all possible dynamics within a bounded set.
  • Adaptive CBFs: Integrate with parameter estimation laws. As the system learns unknown parameters (e.g., friction, payload mass), the CBF condition is adapted online, maintaining the safety guarantee throughout the learning process. This is essential for deployment in real-world, non-stationary environments.
SAFETY-CRITICAL CONTROL

How Does a Control Barrier Function Enforce Safety?

A Control Barrier Function (CBF) is a mathematical tool used to synthesize safety-critical controllers that formally guarantee a system will remain within a predefined safe set.

A Control Barrier Function (CBF) is a mathematical construct derived from a safe set defined by a scalar-valued function. The core mechanism enforces safety by imposing a constraint on the system's control input, ensuring the time derivative of the barrier function remains above a prescribed rate. This constraint is typically formulated as a quadratic program (QP) that minimally modifies a nominal, performance-driven controller to guarantee the forward invariance of the safe set, meaning the system can never leave it.

The enforcement is achieved through a sufficient condition for safety, often expressed as an inequality constraint on the Lie derivative of the barrier function along the system dynamics. By solving the resulting real-time optimization problem at each control cycle, the CBF-based controller filters out any unsafe control actions from the nominal policy. This provides a formal guarantee of safety for nonlinear systems, making it a cornerstone of verified autonomy in robotics and embodied intelligence.

SAFETY-CRITICAL CONTROL

Applications of Control Barrier Functions

Control Barrier Functions are a formal method for synthesizing controllers that guarantee a system will remain within a predefined safe set. Their primary applications are in domains where safety is non-negotiable and must be mathematically proven.

CONTROL BARRIER FUNCTION (CBF)

Frequently Asked Questions

Control Barrier Functions (CBFs) are a formal method for synthesizing safety-critical controllers in robotics and autonomous systems. These questions address their core principles, mathematical formulation, and practical applications in motion planning and control.

A Control Barrier Function (CBF) is a mathematical tool used to synthesize safety-critical controllers that formally guarantee a dynamical system will remain within a predefined safe set. It works by defining a scalar function, h(x), whose value represents the "distance" to the boundary of the safe set. The core idea is to enforce a constraint on the time derivative of h(x) along the system's trajectories, ensuring that if the system starts safe (h(x) ≥ 0), it will remain safe (h(x(t)) ≥ 0 for all t ≥ 0). This is achieved by filtering or modifying a nominal control input (e.g., from a motion planner) through a safety filter—a real-time quadratic program (QP) that minimally alters the input to satisfy the CBF condition, thereby rendering the safe set forward invariant.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.