This blog is work in progress…
Introduction
This document presents the mathematical foundation of a control scheme that combines a Control Lyapunov Function (CLF) for stabilizing a 3-DOF differential drive robot towards a target position, and a Control Barrier Function (CBF) for ensuring safe obstacle avoidance. The control inputs are derived by solving a Quadratic Programming (QP) problem at each time step.
3-DOF Differential Drive Robot Model
The state of a differential drive robot is defined by:
where x, y
denote the position in the plane and θ
is the heading angle of the robot. The control inputs are:
where v
is the linear velocity and ω
is the angular velocity.
The dynamics of the robot can be written as:
Control Lyapunov Function (CLF) and Stability
Lyapunov Function for Position and Heading Control
To design a controller that drives the robot towards the goal, we use a Lyapunov function. A Lyapunov function V(𝑉)
is a scalar function that is positive definite and decreases over time. The key property of a Lyapunov function is that if 𝑇V(𝑉) ≤ 0
, the system is stable, meaning that the robot will converge to the goal.
For this system, we can define the Lyapunov function based on the errors in position and heading:
where:
epos
is the position error,eθ
is the heading error.
These errors are defined as:
eθ = wrapToPi(θgoal – θ)
Control Law for Stability
To ensure stability, we choose control inputs 𝑂 = [ v, ω ]T
that make the Lyapunov function decrease over time. Specifically, we want 𝑇V(𝑉) ≤ 0
, where:
For the position error, we use a proportional control law:
where kv > 0
is a constant gain that dictates how aggressively the robot moves towards the goal.
For the heading error, we use a proportional control law for angular velocity:
where kθ > 0
is a constant gain that adjusts the heading of the robot to align with the target.
Control Barrier Function (CBF) Design
Design of the Barrier Function
The Control Barrier Function (CBF) ensures that the robot avoids obstacles by defining a constraint that keeps the robot away from unsafe regions. Consider an obstacle located at:
with a safety radius robs
. The barrier function is defined as:
This ensures that h(𝑉) > 0
, meaning the robot stays outside the unsafe region.
Barrier Function Derivative and Safety Constraint
To maintain safety, the time derivative of the barrier function must satisfy:
where α
is a positive constant. The time derivative of h(𝑉)
is:
The CBF constraint becomes:
Quadratic Programming Formulation
At each time step, the control inputs 𝑂 = [ v, ω ]T
are obtained by solving a Quadratic Program (QP) that balances the goal-reaching behavior (CLF) and the safety constraint (CBF). The QP is formulated as:
subject to the CBF constraint:
Including a Slack Variable
In cases where the CBF constraint might conflict with the CLF, we include a slack variable ε
to relax the CBF constraint:
This ensures that the optimization problem remains feasible, even when the robot is near the obstacle, allowing small safety violations in exchange for maintaining control stability.
Conclusion
The combined Control Lyapunov Function (CLF) and Control Barrier Function (CBF) framework ensures that the 3-DOF differential drive robot can both reach a target goal and avoid obstacles. The CLF ensures stability by guiding the robot towards the goal, while the CBF enforces safety by preventing the robot from entering unsafe regions. The use of a Quadratic Program (QP) allows the robot to balance these two objectives, and the inclusion of a slack variable ensures feasibility in cases of constraint conflicts.