## 3 Controller Design
### Evasive Path Generation  
The desired evasive path is shown in Figure 2. A Trapezoidal Acceleration Profile (TAP) is used to design the desired global lateral displacement of the evasive path [7]. The lateral acceleration can be obtained by specifying the maximum allowable \(a_{y,max}\), the maximum allowable jerk \(J_{y,max}\), and the evasive lateral displacement \(y_{eva}\). \(t_{1}\) and \(t_{2}\) of the TAP can be expressed as follows [7]. \[t_{1}=\frac{a_{y,max}}{J_{y,max}},\ t_{2}=\frac{-t_{1}^{2}+\sqrt{t_{1}^{4}+4t_{ 1}\frac{y_{eva}}{J_{y}}}}{2t_{1}} \tag{32}\]  
where \(a_{y,max}=\hat{\mu}g\); \(g\) is the gravity; \(\hat{\mu}\) is the estimated road friction coefficient that is assumed to be obtained from other approaches [44; 45; 46]. The desired global lateral position \(Y_{d}\) of the evasive path can then be obtained as follows by integrating the global lateral acceleration \(\ddot{Y}_{d}\) twice [7]. Figure 2: Evasive path planning. \[Y_{d}(t)= \begin{cases}\frac{1}{6}ly_{y,max}t^{3}&for\ 0\leq t\leq t_{1}\\ Y_{d,1}+v_{y,1}(t-t_{1})+\frac{1}{2}a_{y,max}(t-t_{1})^{2}&for\ t_{1}<t\leq t_{2} \\ Y_{d,2}+v_{y,2}(t-t_{2})+\frac{1}{2}a_{y,max}(t-t_{2})^{2}-\frac{1}{6}ly_{y,max} (t-t_{2})^{3}&for\ t_{2}<t\leq t_{3}\\ Y_{d,3}+v_{y,3}(t-t_{3})-\frac{1}{2}a_{y,max}(t-t_{3})^{2}&for\ t_{3}<t\leq t_{4} \\ Y_{d,A}+v_{y,A}(t-t_{4})-\frac{1}{6}ly_{y,max}(t-t_{4})^{3}&for\ t_{4}<t\leq t _{5}\\ y_{eva}&for\ t>t_{5}\end{cases}  \tag{33}\]  
where \(v_{y,i}=v_{y}(t_{i}),Y_{d,i}=Y_{d}(t_{i}),\ i\in[0,5]\). By assuming the vehicle longitudinal velocity \(v_{x}\) is constant along the evasive path, the desired global longitudinal velocity \(\dot{X}_{d}\) of the evasive path can then be obtained as follows. \[\dot{X}_{d}(t)=\sqrt{v_{x}^{2}-\dot{Y}_{d}(t)} \tag{34}\]  
where \(v_{x,0}\) is the initial longitudinal velocity of vehicle; \(\dot{Y}_{d}\) is the global lateral velocity that can be obtained by integrating \(\ddot{Y}_{d}\) in Equation (31). We can then obtain the desired global \(X_{d}\) by integrating \(\dot{X}_{d}\). The station number of the evasive path \(S_{d}\) that is the distance along the designed evasive path can be defined as follows. \[S_{d,j+1}=S_{d,j}+\sqrt{\left(X_{d,j}-X_{d,j-1}\right)^{2}+\left(Y_{d,j}-Y_{d, j-1}\right)^{2}} \tag{35}\]  
where \(j\) denotes the \(j\)th sample point of the evasive path. The initial values of \(X_{d}\), \(Y_{d}\), \(\dot{Y}_{d}\), and \(S_{d}\) are set to be zero. The desired evasive path can then be expressed as functions of the station number as follows. \[X_{d}=f_{SX}(S_{d}),Y_{d}=f_{SY}(S_{d}) \tag{36}\]  
The station number in the prediction horizon can be defined as follows with a constant \(v_{x}\). \[S_{p,k+i+1}=S_{p,k+i}+v_{x}iT_{s},i\in\left[0,\ 1,\cdots,\ N_{p}-1\right] \tag{37}\]  
where the initial station number \(S_{p,k}\) is the current station number \(S_{c}\). The desired evasive path in the preview horizon can then be expressed as follows. \[X_{p,k}=f_{SX}\Big{(}S_{p,k}\Big{)},Y_{p,k}=f_{SY}\Big{(}S_{p,k}\Big{)} \tag{38}\]  
The desired evasive path in the body coordinates of the vehicle can be calculated using coordinate transformation as shown below. \[ \begin{bmatrix}x_{r,k}\\ y_{r,k}\end{bmatrix} = \begin{bmatrix}cos(\Psi_{c})&sin(\Psi_{c})\\ -sin(\Psi_{c})&cos(\Psi_{c})\end{bmatrix}\begin{bmatrix}X_{p,k}-X_{c}\\ Y_{p,k}-Y_{c}\end{bmatrix}  \tag{39}\]  
where \(\Psi_{c}\) is the current global heading angle of vehicle; \(X_{c}\) and \(Y_{c}\) are the current global position of the vehicle, respectively; \(x_{r}\) and \(y_{r}\) are the local coordinates of the evasive path. \(X_{c}\), \(Y_{c}\), \(\Psi_{c}\) and \(S_{c}\) are assumed to be available from the localization system. The desired lateral displacement of the evasive path can be expressed as \(y_{r}=f_{r}(x_{r})\) in the body coordinates of the vehicle. The heading angle reference, which is the first derivative of the desired path, can then be approximated as follows. \[\psi_{r,k+i}=f_{r}^{\prime}(x_{r,k+i})=\frac{f_{r}(x_{r,k+i+1})-f_{r}(x_{r,k+i })}{x_{r,k+i+1}-x_{r,k+i}} \tag{40}\]