HJB Based Optimal Safe Control using Control Barrier Functions

Hassan Almubarak, Evangelos A. Theodorou, Nader Sadegh

Abstract

Ensuring safety in nonlinear control systems often involves a trade-off between performance and constraint satisfaction. This paper presents a novel methodology that embeds Control Barrier Function (CBF) constraints directly into the Hamilton-Jacobi-Bellman (HJB) equation. By deriving a closed-form solution via Karush-Kuhn-Tucker (KKT) conditions and implementing a Safe Galerkin Successive Approximation (SGSA) algorithm, the authors achieve a proactive control law. This approach guarantees forward invariance of the safe set while minimizing infinite-horizon costs, significantly outperforming traditional reactive "min-norm" safety filters in both smoothness and cumulative cost.

Introduction: The Reactive Safety Problem

In safety-critical applications like autonomous driving and robotics, maintaining the system within a "safe set" is the primary objective. Control Barrier Functions (CBFs) have emerged as a powerful tool for ensuring this property, known as forward invariance. However, integrating CBFs with long-term performance optimization (e.g., minimizing an infinite-horizon cost) remains a challenge.

Most current implementations rely on a "min-norm" filter. In this setup, an optimal nominal controller is designed without regard for safety, and a CBF-based filter intervenes only when the system is on the verge of violating a boundary. This reactive approach often results in sharp, discontinuous control actions and sub-optimal "wall-hugging" behavior near unsafe regions. This paper proposes a unified framework to solve these issues by treating safety as an intrinsic part of the optimization problem.

Methodology: Integrating HJB and CBF

The authors bridge the gap between optimal control and safety through a constrained HJB formulation. By reformulating the optimal control problem to minimize the Generalized Hamilton-Jacobi-Bellman (GHJB) equation subject to High Order Control Barrier Function (HOCBF) constraints, they can handle systems with high relative degrees.

Using KKT optimality conditions, the researchers derived a closed-form expression for the optimal safe controller. A key theoretical insight is that enforcing a CBF constraint is mathematically equivalent to solving an unconstrained HJB problem with modified system dynamics and cost functions. This proactive integration allows the controller to "see" the safety boundaries in advance and adjust the trajectory smoothly.

To solve the resulting HJB equation—which is typically analytically intractable—the authors introduced the Safe Galerkin Successive Approximation (SGSA) algorithm. This offline method iteratively approximates the optimal cost-to-go function using a basis of functions, incorporating specific safety-related integrals to ensure the resulting control law is locally Lipschitz continuous and strictly safe.

Results and Discussion

The SGSA algorithm was tested against a standard 5th-order nonlinear quadratic regulator (NLQR) filtered by a traditional min-norm CBF.

Trajectories in state space comparing SGSA and min-norm controllers.

As illustrated in the state-space trajectories, the SGSA controller proactively steers the system around the unsafe region (the red obstacle). In contrast, the min-norm controller follows the nominal path until it hits the boundary, resulting in sub-optimal behavior. Quantitatively, SGSA significantly reduced cumulative costs. For an initial state of (1, -0.8), the SGSA cost was 18.61 compared to 28.85 for the min-norm filter. At state (1.6, -1.4), SGSA achieved a cost of 44.94 versus 55.65 for the filter.

Control actions u1 over time for initial condition (1, -0.8).

The control action plots highlight the qualitative superiority of the proposed method. While the min-norm approach exhibits sharp, reactive spikes as it encounters the safety boundary, the SGSA approach produces a much smoother control signal, which is more desirable for physical hardware longevity and stability.

Conclusion and Future Directions

The HJB-based approach provides a robust, proactive alternative to reactive safety filters. By embedding safety directly into the cost functional, the SGSA algorithm achieves lower costs and smoother trajectories while maintaining strict safety guarantees.

Future work will focus on addressing the "curse of dimensionality" inherent in HJB-based methods. The authors plan to explore tensor decomposition and advanced polynomial approximations to improve scalability. Additionally, they aim to extend the framework to robust control scenarios (min-max problems) to handle external disturbances and model uncertainties.

Summary updated

BibTeX
@inproceedings{almubarak2021hjb,
  author = {Hassan Almubarak and Evangelos A. Theodorou and Nader Sadegh},
  title = {{HJB Based Optimal Safe Control using Control Barrier Functions}},
  booktitle = {CDC},
  year = {2021},
  doi = {10.1109/cdc45484.2021.9683655},
}
Figure