## 3 Mathematical Models and Control Design
### Control Design  
Problem formulation: Constructing a control barrier function (CBF) that recovers the entire forward invariance part of the safe set is difficult. However, constructing a CBF that only recovers a subset of the safe set is shown in Figure 5.  
Define the zero-superlevel set of the handcrafted control barrier function (HCBF) as \(\check{x}=\left\{x\middle|\check{h}(x)\geq 0\right\}\subseteq x\); without loss of generality, it can assume the relationship \(h(x)=\check{h}(x)+\Delta h(x)\). Based on preference (\(u_{\mathit{perf}}\)) algorithms (CBF-QP), as shown in Figure 6, the algorithms are transferred to the wheeled mobile robot system (plant) if both model prediction control and learned CBF-QP are safe. The system then relays the feedback back to the reference and performs a rollout check using CBF-QP. The control algorithms evaluated whether the feedback signal was safe to roll out to the preferred setting based on the feedback signals [23]. The wheeled mobile robot's signals would be sent to a model-based rollout with a data buffer and input preference. Wheeled mobile robot signals are sent, checked for unsafe rollout using CBF-QP, and then sent to the data buffer. Data buffer would be used for model-based rollout with input preference [24]. Let us look at a state trajectory of the time-invariant, continuous-time controlled system with a disturbance. \[\left\{ \begin{aligned} \check{X}(s)=f(X(s),u(s),d(s),s\in[t,t^{ \prime}]\\ x(t)=x\end{aligned} \right. \tag{19}\]  
where \(t\) and \(x\) are the initial time and state. \(u\in U\subset R^{m}\) is control inputs, \(d\in D\subset R^{\omega}\) is disturbance, where \(U\) and \(D\) are compact and convex sets. \(f:R^{n}\times U\times D\to R^{n}\) is Lipschitz continuous in the state and bounded. The zero-superlevel set of a bounded Lipschitz continuous function \(l:R^{n}\to R\). \[L=\left\{x:l(x)\geq 0\right\} \tag{20}\]  
Figure 5: Venn diagram of the problem formulation [22]. Black circle line indicates initial state of the wheeled mobile robot, and red rectangle is new updated state of the wheeled mobile robot. The Equation (20) where safety target function. The safety control's goal is to ensure that the trajectory stays in \(L\) for \(s\in[t,0]\), in the event of the worst disturbance, resolved by the use of Hamilton-Jacobi (HJ) reachability analysis. The cost function could be  
\[J(x,t,u(.),d(.)):=\min_{s\in[t,0]}l(X(s)) \tag{21}\]  
At some point throughout the time span, the trajectory violated the safety requirement (obtaining a negative value of \(l\)), making it unsafe. In the worst scenario, the disturbance would act to reduce \(J\) as much as possible, while the goal of the safety control is to make \(J\) as large as feasible. This allows for us to define the value function \(V:R^{n}\ (-\infty,0]\to R\) as  
\[V(x,t):=\min_{\xi_{d}\in E_{[t,0]}}\max_{u\in U_{[t,0]}}J(x,t,u(.),\xi_{d}[u] (.)) \tag{22}\]  
The viscosity solution to the subsequent Hamilton-Jacobi-Isaacs variational inequality (HJJ-VI) is represented by the value function \(V\ (x,t)\). \[0=\min\Biggl{\{} \begin{aligned} & l(x)-V(x,t)\\ & D_{t}V(x,t)+maxmin\ D_{x}V(x,t).f(x,u,d)\end{aligned}  \Biggr{\}} \tag{23}\]  
This indicates that by applying the HJJ-VI at each location in the state space, \(V\ (x,t)\) may be directly calculated using dynamic programming backwards in time. The optimal policy \(\pi^{*}V\ (x,t):R^{n}\times(-\infty,\ 0]\to U\) is determined in a different way:  
\[\Biggl{\{} \begin{aligned} & V(x,t)<l(x)\\ &\pi^{*}V(x,t)=\operatorname*{argmaxmin}_{u\in U}\underset{d\in D} {\operatorname{maxmin}}D_{x}V(x,t).f(x,u,d)\end{aligned}  \tag{24}\]  
\[k_{v}(x,t)=\biggl{\{}\mathbf{u}\in\mathrm{U}:\mathrm{D}_{t}\mathrm{V}(x,t)+ \min_{d\in D}{\operatorname{maxmin}}D_{x}V(x,t).f(x,u,d)\geq 0 \tag{25}\]  
For any optimal:  
\[\dot{l}(x(t))=\dot{V}(x(t),t)\geq 0 \tag{26}\]  
Figure 6: Schematic diagrams of CBF-QP [25]. For a reference control signal, such a perfect control policy is frequently too tight to serve as a safety filter.