Control Barrier Functions
Key Terms
Barrier Functions
Purpose
Barrier functions are designed to penalise or discourage solutions that violate constraints. They are used in constrained optimsation problems, where certain conditions must be satisfied by the solution.
How it works
In essence, a barrier function incorporates constraints of optimisation problem into objective function. This is done by adding a penalty term to the objective function that becomes large as the solution approaches the boundary of the feasible region defined by the constraints.
Nagumo's Theorem
Defines necessary and sufficient conditions for set invariance (safety).
Theorem defines a safe set 'C' (like a safe driving path) using a mathematical function '
Advantages and Disadvantages
Barrier functions allow for the conversion of a constrained problem into an unconstrained one, simplifying the optimization process.
However, the choice of barrier function and its parameters can significantly impact the convergence and performance of the optimization algorithm.
Types
Given the case of objective
with constraints for
The barrier adds a term to the objective function. The purpose is for the barrier function to grow as the function approaches the constraint boundary.
- Linear Barrier Function:
- Quadratic Barrier Function:
- Logarithmic Barrier Function:
Examples
Logarithmic barrier functions:
Consider the optimisation problem:
Minimise
Here the constraint can be rewritten as
By applying a logarithmic barrier function, the modified objective function becomes:
As
Interior Point Methods
Purpose
Algorithms for solving linear and nonlinear optimsation probems. They are particularly useful for large-scale optimisation problems, like linear programming, quadratic programming and convex optimisation.
How it works
Starting from a point within the interior of the feasibly region (set) and iteratively moving towards the solution. This is in contrast to the methods like simplex algorithms that operate on boundary of the feasible region.
Key Features:
- Barrier Functions: Interior point methods often use barrier functions to ensure that the iterations remain within the feasible region. The logarithmic barrier function is a common choice.
- Polynomial Time Complexity: These methods have a polynomial time complexity, which can make them more efficient for certain large-scale problems compared to other methods like the simplex algorithm.
- Path-Following Algorithms: They typically follow a path that is defined by a sequence of optimization problems with decreasing values of a parameter in the barrier function.
Lyapunov Function
Definition and Purpose
Lyapunov function is a scalar function that helps to determine stability of an equlibrium point in a dynamical system. The function is analogous to a potential energy function in physics, where its value represents a measure of the system's potential for change.
They are valuable because they provide a way to prove stability without solving system's differential equation directly. Useful if equation is too complex to solve analytically.
Characteristics
Positive Definiteness
A Lyapunov function
Derivative Sign
The derivative of the Lyapunov function along the trajectories of the system,
Choosing a Lyapunov Function
Choosing a Lyapunov function for a dynamical system is more of an art than an exact science, as there's no universal method applicable to all systems. However, some general guidelines can help in the selection process:
- Positive Definiteness
- Negative Definite Derivative
- Intuition and System Knowledge - Understanding the physics or mechanics of the system can guide the choice. For mechanical systems, energy-like functions (kinetic plus potential energy) often serve as good candidates.
- Simplicity and Computability - Prefer simpler functions that make it easier to compute the derivative and analyze the system.
- Trial and Error - Sometimes, selecting a Lyapunov function involves trial and error, testing different functions to see which one satisfies the necessary conditions for the particular system being analyzed.
It is possible for one Lyapunov function to prove stability for a system while another does not. This can occur because the effectiveness of a Lyapunov function in proving stability depends on its specific form and how well it captures the dynamics of the system. A Lyapunov function that fails to prove stability doesn't necessarily mean the system is unstable; it might simply be that the particular function chosen isn't suitable for demonstrating stability for that system.
Therefore, finding a Lyapunov function that proves stability can sometimes be a matter of trial and error, and the inability of one function to prove stability doesn't preclude the existence of another function that can.
Types of Stability Analysis
Stability
If
Asymptotic Stability
If
Global Stability
If Lyapunov function and its derivative conditions are valid for all
Barrier Certificates
Definition and Purpose
Barrier certificate is a function
They are used to certify that trajectories of the system starting from a safe initial condition will not enter unsafe regions over time.
Characteristics
Non-negativity
Typically
Derivative Condition
Along the trajectories of the system, the derivative of
Example
Consider a simple robotic system where the goal is to ensure the robot does not collide with an obstacle. Let's define the state of the robot as
A barrier certificate
If we can show that for all initial states
Application
Barrier certificates are used extensively in the verification of safety properties in autonomous systems, including robots and self-driving cars. They are crucial in scenarios where it is not feasible to test all possible trajectories for safety, which is often the case in complex or high-dimensional systems. By providing a mathematical proof of safety, barrier certificates play a vital role in the design and implementation of reliable and secure autonomous systems.
Locally Lipschitz
Refers to a property of a function in context of differential equations and control theory. A function
In more technical terms, within this neighbourhood, the difference in the function's values at any two points is bounded by a constant (Lipschitz constant) times the distance between the two points.
This property is important to ensure that the well-behavedness of solutions to differential equations and is often a requirement for applying certain mathematical theorems and techniques.
Paper - Control Barrier Functions: Theory and Application
Access reference
Objective
Safety requires that "bad" things do not happen while liveness requires that "good" things eventually happen.
Asymptotic stability is an example of a liveness property since it is seen as "equilibrium is eventually reached". Invariance is analogous to safety.
Usually Lyapunov functions have played a predominant role in the investigation of liveness properties. This paper aims to refocus the discussion on safety by introducing control barrier functions that play a role equivalent to Lyapunov functions in study of liveness property.
Paper aims to establish basic theory of safety-critical control and highlight some important applications.
Fundamentals
Always consider a nonlinear affine control system:
Control Lyapunov Function (CLF)
Definition and Purpose
CLFs are used to ensure the stability of a system. They help in designing a control input that drives the system towards a desired stable state.
A function
Difference between CLF and regular Lyapunov Function
Regular LF
Primarily used to analyse stablity of an equilibrium point of a system. If such a function decreases over time, it implies that the system's state will converge to the equilibrium, indicating stability.
Consider simple system:
A potential LF could be
Take time derivative:
It abides to all the rules of a LF. Now at
CLF
Extends the concept to systems with control inputs. It is designed not just to assert stability but to actively guide the selection of control inputs that ensure the system's convergence to a stable state. Essentially, a CLF helps in designing a controller for stabilizing the system.
For a control system described:
A CLF might also be:
However, we can use the CLF to design a control law. For example, by choosing:
We find the derivative (note that it is being done w.r.t. time variable):
Which is negative definite. Thus the control law can stabilise the system at
Theorem 1
For the nonlinear control system, if there exists a control Lyapunov function positive definite function satisfying (3), then any Lipschitz continuous feedback controller
Control Barrier Function (CBF)
Definition and Purpose
CBFs provide a more flexible way to define safety in control systems. It defines a safe region (C), and the system is controlled to stay within C without requiring every possible state within C to always remain within C.
Unlike stability which involves driving a system to a point (or set), safety can be framed in the context of enforcing invariance of a set (i.e. not to leave a safe set).
Control Lyapunov Functions (CLFs) are powerful tools for ensuring stability in control systems. They help define regions (sublevel sets) where the system is guaranteed to remain.
However, CLFs can be overly restrictive for defining safety in systems. Applying CLF concepts directly would prevent a system from ever leaving a defined safe region, which might be too limiting in practice.