## 3 Methods
### Clf-Cbf-Qp Design of the Suspension System  
The CLF-CBF-QP-based formulation of safety-critical controllers proposes a strategy to guarantee safety and stability as shown in Figure 2. Consider a control law (u) applied to the system (4) aiming at ensuring safety. Taking into account that the stability and safety conditions are affine in u, as given in Equations (6) and (8), respectively, the CLF-CBF-QP can minimally modify the control law to satisfy stability and safety constraints. QP is a convex optimization problem computationally fast enough for real-time applications [40]. The CLF-CBF-QP [38] controller is constructed as follows:  
\[u^{*}(x)=\arg\min_{u,p}\Bigl{(}u(x)-u_{ref}(x)\Bigr{)}^{T}M\Bigl{(}u(x)-u_{ ref}(x)\Bigr{)}+qs^{2} \tag{10}\]  
subject to:  
\[ \begin{array}{l}L_{f}V(x)+L_{g}V(x)u(x)+\eta V(x)\leq s\\ L_{f}H(x)+L_{g}H(x)u(x)+\mu H(x)\geq 0\\ u_{min}<u(x)<u_{max}\end{array}  \tag{11}\]where \(M\) is a positive definite matrix, and \(q\) is a positive scalar. Both \(M\) and \(q\) are weights that penalize the control effort and the slack variable for the QP problem, respectively. The reference control law (\(u_{ref}\)) is designed generally in the CLF-CBF-QP controller design framework using steady-state analysis, this does not work for these types of second-order problems. For the suspension systems, it is desirable to drive all states to equilibrium, including the sprung mass displacement, which is not directly proportional to the control input. One way to remedy this problem is to use backstopping techniques to formulate the proper Lyapunov function. Unfortunately, this may complicate the Lyapunov function and its derivatives. This work proposes another technique to solve this issue, the reference controller is designed using a Linear quadratic regulator (LQR) based on the linearized version of system Equation (3), simply by assuming \(N(x)=0\). The LQR problem is computed offline and searches for a state-feedback controller \(u_{ref}=-Kx\) that minimizes the following objective function:  
\[J=\int_{0}^{\infty}\Big{(}x^{T}Qx+u^{T}Ru\Big{)}dt \tag{12}\]  
where \(Q\) is positive semi-definite real symmetric matrix. \(R\) is a positive-definite real symmetric matrix. The matrices \(Q\) and \(R\) are weighting matrices that penalize the system states and the control input, respectively. Manipulating the relative weights assigned to \(Q\) and \(R\) allows for emphasis on either state tracking or control effort minimization. Note that this controller does not account for the nonlinearity in the suspension system. Therefore, the CLF is designed to improve the reference controller performance by taking into account nonlinearity, unmodeled dynamics, and disturbances via the online implementation. The Lyapunov Function \(V(x)\) used in this work is defined as:  
\[V(x)=\dot{z}_{1}^{2} \tag{13}\]  
in order to find the derivative of Lyapunov function (\(\dot{V}(x,u)\)) in Equation (7), the following is computed:  
\[\
abla V=[0\quad 2\dot{z}_{1}\quad 0\quad 0]\]  
\[L_{f}V(x)=\frac{2}{m_{1}}\dot{z}_{1}\Big{(}-k_{1}^{L}z_{1}-c\dot{z}_{1}+k_{1}^ {L}z_{2}+c\dot{z}_{2}-k_{1}^{NL}(z_{1}-z_{2})^{3}\Big{)}\]  
\[L_{g}V(x)=\frac{2}{m_{1}}\dot{z}_{1}\]  
Next, the safety objective of this controller is to maintain the suspension stroke within specified limits. This safety objective requires enforcing a safety-critical constraint of the form \(|z_{1}-z_{2}|<St_{max}\), where \((z_{1}-z_{2})\) is the suspension stroke and \(St_{max}\) is the maximum allowable stroke. Inspired by lane-keeping controllers for autonomous vehicles [35; 38; 41], this work formulates the safety constraint of the suspension stroke through the following barrier function:  
\[H(x)=St_{max}-\text{sign}(\dot{z}_{1}-\dot{z}_{2})(z_{1}-z_{2})-\frac{1}{2} \frac{(\dot{z}_{1}-z_{2})^{2}}{\alpha} \tag{14}\]  
where \(\alpha\) is a positive constant that can effectively relax the CBF constraint. It is worth noting that this type of barrier function was proven to be a valid CBF by [35; 41].