This collection of MATLAB scripts intends to study the performance of state-constrained controllers utilizing control barrier functions in the context of adaptive cruise control.
We consider a case in which two vehicles, modeled as point masses, are moving in a straight line. The following vehicle is equipped with an ACC and the lead vehicle drives with constant speed
-
Control Objective: Cruising at a given speed
$v_d$ for the following vehicle. -
Safety Objective: Ensure that the distance
$D$ is not violating the following safety constraint:
with
The dynamics of the system can be defined as follows:
with
We consider a control affine plant of the form:
where
For which we define the control objective of globally stabilizing the considered system to a point
The system is globally stabilizable if there exists the class
where
with
One can define the following positive definite control Lyapunov function (CLF)
We consider again a control affine plant of the form:
where
A closed set
with
The CBF can ensure for the presented control affine system that for any initial condition
where
with
By using a QP-based approach, it is possible to unify both CLF-based "performance objectives" and CBF-based "safety considerations". Using a quadratic programming formulation, the solution for
with
After each simulation run, a plot with results is given out. An example of such a plot is given here:
The scripts use external libraries, which need to be installed.
Further, the following MATLAB toolboxes are needed:
The software was tested with MATLAB 2020b under Windows 11 Home.
The contents of this repository are covered under the MIT License.
We kindly acknowledge the following papers, which have been the foundation of the here presented scripts:
- [1] J. Zeng, B. Zhang, and K. Sreenath, “Safety-Critical Model Predictive Control with Discrete-Time Control Barrier Function,” in 2021 American Control Conference (ACC), May 2021, pp. 3882–3889.
- [2] A. D. Ames, X. Xu, J. W. Grizzle and P. Tabuada, "Control Barrier Function Based Quadratic Programs for Safety Critical Systems," in IEEE Transactions on Automatic Control, vol. 62, no. 8, pp. 3861-3876.