## 3 Controller Design
### Vehicle Motion Control Layer  
Through the path tracking layer, the required yaw rate when the vehicle tracks the desired path at the desired vehicle speed can be obtained. The yaw motion and longitudinal motion of the vehicle are generated by the tire force. In this section, the vehicle motion control layer is designed to obtain the requirements of longitudinal resultant force, lateral resultant force, and yaw resultant moment. Since the parameter uncertainty and strong coupling characteristics of MIMO nonlinear system, the terminal sliding mode control strategy is adopted to control the vehicle motion in this paper. The selection of Terminal sliding-mode function ensures that the output tracking error converges to zero in finite time. In addition, the initial state of the system is on the sliding surface, which eliminates the reaching stage of the sliding mode control and ensures the global robustness and stability of the closed-loop system [31]. Equation (1) can be written as the form of state equation:  
\[\left[ \begin{array}{c}\dot{x}_{1}\\ \dot{x}_{2}\\ \dot{x}_{3}\end{array} \right]=\left[ \begin{array}{l}x_{2}x_{3}-\frac{1}{2}C_ {D}Ax_{1}{}^{2}-\mu mg\\ -x_{1}x_{3}\\ 0\end{array} \right]+\left[ \begin{array}{ccc}\frac{1}{m}&0&0\\ 0&\frac{1}{m}&0\\ 0&0&\frac{1}{z}\end{array} \right]\left[ \begin{array}{c}u_{1}\\ u_{2}\\ u_{3}\end{array} \right]+\left[ \begin{array}{c}\tau_{x}\\ \tau_{y}\\ \tau_{z}\end{array} \right] \tag{46}\]  
where \(x_{1}=v_{x}\), \(x_{2}=v_{y}\), \(x_{3}=\dot{\varphi}\), \(u_{1}=\sum F_{x}\), \(u_{2}=\sum F_{y}\), \(u_{3}=\sum M_{z}\), and \(\left[\tau_{x},\ \tau_{y},\ \tau_{z}\right]^{T}\) are uncertain variables. We define the state variables \(\xi=\left[x_{1},x_{2},x_{3}\right]\) and the input variables \(u=\left[u_{1},u_{2},u_{3}\right]\). The First-order MIMO nonlinear system is expressed as:  
Figure 5: Path tracking control layer structure. \[\left\{ \begin{array}{l}\dot{X}=f(X,t)+b(X,t)u+\Delta f(X,t)\\ y=\left[\begin{array}{cc}x_{1}&x_{2}&x_{3}\end{array}\right]^{T}\end{array} \right. \tag{47}\]  
where  
\[f(X,t)=\left[ \begin{array}{cc}x_{2}x_{3}-\frac{1}{2}C_{D}{A}{x_{1}}^{2}-\mu mg \\ -x_{1}x_{3}\\ 0\end{array} \right]\]  
\[b(X,t)=\left[ \begin{array}{ccc}\frac{1}{m}&0&0\\ 0&\frac{1}{m}&0\\ 0&0&\frac{1}{z}\end{array} \right]\]  
\[\Delta f(X,t)=\left[ \begin{array}{c}\tau_{x}\\ \tau_{y}\\ \tau_{z}\end{array} \right]\]  
The uncertainty part \(\Delta f(X,t)\) satisfies the following conditions:  
\[|\Delta f(X,t)|\leq F(X,t) \tag{48}\]  
where \(F(X,t)\) is a non-negative function. Defining the error vector:  
\[ \begin{array}{l}E=X-X_{d}\\ =\left[\begin{array}{cc}x_{1}&x_{2}&x_{3}\\ e_{1}&e_{2}&e_{3}\end{array}\right]^{T}-\left[\begin{array}{cc}x_{1d}&x_{2 d}&x_{3d}\end{array}\right]^{T}\\ =\left[\begin{array}{cc}e_{1}&e_{2}&e_{3}\end{array}\right]^{T}\end{array}  \tag{49}\]  
The sliding surface equation is designed as:  
\[\Gamma(X,t)=CE-W(t)=CE-C\Phi(t) \tag{50}\]  
where \(C=diag(c_{1}\ c_{2}\ c_{3})\). Defining \(\Phi(t)=[\phi_{1}(t)\ \phi_{2}(t)\ \phi_{3}(t)]^{T}\):  
\[\Gamma(X,t)=\left[ \begin{array}{c}\varphi_{1}\\ \varphi_{2}\\ \varphi_{3}\end{array} \right]=\left[ \begin{array}{c}c_{1}e_{1}-c_{1}\phi_{ 1}(t)\\ c_{2}e_{2}-c_{2}\phi_{2}(t)\\ c_{3}e_{3}-c_{3}\phi_{3}(t)\end{array} \right] \tag{51}\]  
Defining \(\Phi(t)\) satisfies the following assumptions:  
Assumption 1: \(\Phi_{i}(t):R_{+}\to R\), \(\Phi_{i}(t)\in C[0,\infty)\), \(\dot{\Phi}_{i}\in L^{\infty}\). For a constant \(T>0\), \(\Phi_{i}(t)\) is bounded on the time period \([0\,T]\), and \(\Phi_{i}(0)=e_{i}(0)\), \(\dot{\Phi}_{i}(0)=\dot{e}_{i}(0)\), \(C[0,\infty)\) represents all first order differentiable continuous functions defined at \([0,\infty)\), \(i=1,2,3\). The function \(\Phi_{i}(t)\) can be expressed as follows:  
\[\phi_{i}(t)=\left\{ \begin{array}{cc}\sum\limits_{k=0}^{1}\frac{1}{k!}e_{i}(0 )^{(k)}t^{k}+\sum\limits_{j=0}^{1}\ (\sum\limits_{l=0}^{\frac{\lambda_{jl}}{T^{j-l+2}}}e_{i}(0)^{(l)})t^{j+2},&0 \leq t\leq T\\ 0&t>T\end{array} \right. \tag{52}\]Furthermore  
\[\phi_{i}(t)=\left\{