# Design of Constant Speed Controller for Hydraulic Retarder Based on Robust Control
## 3 Controller Design  
Due to the high degree of nonlinearity and uncertainty of the vehicle system, this study chooses to use the sliding mode control idea to design the controller and takes the difference between the target speed and the actual speed as the controller input and takes the hydraulic retarder target filling rate as the controller output. We define the nonlinear dynamics of the system \(f(v)\) and the controller input \(u\) as follows:  
\[f(v)=g(i-f)-\frac{C_{D}Av^{2}}{21.15m}-\frac{1000 ip_{m}V_{h}\eta_{t}}{\pi\tau m} \tag{16}\]\[u=-\frac{\lambda\rho\eta_{t}r^{2}D^{5}i_{0}{}^{3}i_{g}{}^{3}q}{(0.377)^{2}r^{3}m} \tag{17}\]  
Then Equation (14) can be rewritten as follows:  
\[\dot{v}=g(i-f)-\frac{C_{D}Av^{2}}{21.15m}-\frac{\lambda\rho\eta_{t}v^{2}D^{5}i_{ 0}{}^{3}i_{g}{}^{3}q}{(0.377)^{2}r^{3}m}-\frac{1000 ip_{m}V_{h}\eta_{t}}{\pi\tau m }=f(v)+u \tag{18}\]  
**Lemma 1. **_For a controlled system:_  
\[\dot{v}=f(v)+u \tag{19}\]  
_The controller input \(u=\dot{v}_{d}+k\epsilon(t)+u_{aux}\) can control the system to a given target vehicle speed \(v_{d}\), where \(u_{aux}\) is the controller auxiliary term equal to \(\rho(v)\frac{|\epsilon(t)|}{\epsilon(t)}\), \(k>0\), \(\rho(v)>|f(v)|\), \(e(t)=v_{d}-v\), where \(v_{d}\) is the target vehicle speed [28]. In this research, the target vehicle speed is unchanged, which gives \(\dot{v}_{d}=0\)._  
The stability of sliding mode control is usually analyzed based on the Lyapunov method, where the stability of the control system is demonstrated by constructing a Lyapunov function, constructing the Lyapunov function as follows:  
\[V_{(e(t))}=\frac{1}{2}e(t)^{2} \tag{20}\]  
Differentiating Equation (19) gives  
\[ \begin{array}{l}\dot{V}_{(e(t))}=e(t)\dot{e}(t)=e(t)(\dot{v}_{d}-\dot{v})=e( t)(\dot{v}_{d}-f(v)-u)\\ =-ke(t)^{2}-e(t)f(v)-e(t)\rho(v)\frac{|e(t)|}{\epsilon(t)}\\ =-ke(t)^{2}-e(t)f(v)-\rho(v)|e(t)|\\ \leq-ke(t)^{2}+|e(t)||f(v)|-\rho(v)|e(t)|\\ \leq-ke(t)^{2}=-2 kV_{(e(t))}\end{array}  \tag{21}\]  
Introduce a slack variable \(s(t)>0\) to transform inequality \(\dot{V}_{(e(t))}\leq-2 kV_{(e(t))}\) into an equation:  
\[\dot{V}_{(e(t))}+2 kV_{(e(t))}+s(t)=0 \tag{22}\]  
This is a first-order linear non-homogeneous equation, and its general solution is as follows:  
\[V_{(e(t))}=V_{(e(0))}e^{-2 kt}-e^{-2 kt}\int_{0}^{t}e^{2 kr}s(\tau)d\tau \tag{23}\]  
Since for \(s(t)>0\)\(e^{2 kt}>0\)\(e^{-2 kt}>0\), we obtain inequality \(V_{(e(t))}\leq V_{(e(0))}e^{-2 kt}\) as follows:  
\[e(t)^{2}\leq e(0)^{2}e^{-2 kt} \tag{24}\]  
Taking the square root of both sides of the inequality provides \(|e(t)|\leq|e(0)|e^{-kt}\), which is a kind of exponential asymptotic stability, resulting in the speed target error \(e\) being asymptotically stable. From the above proof, it can be concluded that the system is asymptotically stable, and the system's input is as follows:  
\[u=-\frac{\lambda\rho\eta_{t}v^{2}D^{5}i_{0}{}^{3}i_{g}{}^{3}q}{(0.377)^{2}r^{3 }m}=\dot{v}_{d}+k\epsilon(t)+\rho(v)\frac{|e(t)|}{e(t)}=k\epsilon(t)+\rho(v) \frac{|e(t)|}{e(t)} \tag{25}\]The equation for the hydraulic retarder filling rate is expressed as follows:  
\[q=\frac{ke(t)+\rho(v)\frac{|e(t)|}{e(t)}}{-\frac{\lambda\rho p_{t}v^{2}D^{5}b_{3} ^{3}{i_{3}}^{3}}{(0.377)^{2}v^{3}m}} \tag{26}\]  
Considering that the input in the above control system contains \(\frac{|e(t)|}{e(t)}\), which will switch back and forth from \(1\) to \(-1\), causing rapid switching of the control input, which may result in high-frequency chattering, in order to suppress the sliding mode chattering, this paper presents a design of the controller based on the sliding mode control, utilizing saturation function and high-frequency control concept. 1. The use of saturation function to suppress sliding mode chattering refers to the use of saturation function to replace the sign function in the control system and the use of saturation function continuity to achieve the purpose of weakening the sliding mode control system chattering [23]. The saturation function employed in this study is expressed as follows: \[sat(e(t))=