## 5 Experiments
### Matlab-Carsim HIL Simulation Platform Test  
Figure 12 shows the comparison experimental image of the Matlab-Carsim HIL simulation platform between the improved terminal sliding mode control and the general terminal sliding mode control. The initial speed was 60 km/h. As shown in Figure 12a, the improved algorithm tracks the desired trajectory image. The black represents the desired trajectory, and the red-dotted line represents the tracking trajectory. Figure 12b shows a partial enlarged image of the improved algorithm tracking the desired trajectory. As shown in Figure 12c, the general algorithm tracks the desired trajectory image. The black represents the desired trajectory, and the blue-dotted line is the tracking trajectory. Figure 12d shows a partial enlarged image of the desired trajectory tracked by the general algorithm. Figure 12e shows the lateral error image when the improved algorithm and the general algorithm track the desired trajectory. The red is the error of the improved algorithm, and the blue is the error of the general algorithm. Moreover, the positional errors at 50 m and 190 m become larger, because a large amount of steering is performed at the corresponding position. Figure 12f shows the image of the front wheel turning angle  
Figure 11: The chatter test: (**a**) maximum test 1; (**b**) test 2; (**c**) test 3; (**d**) minimum test 4.  
when the improved algorithm and the general algorithm track the desired trajectory. The red is the improved algorithm, and the blue is the general algorithm. Figure 12g shows the image of the side-slip angle of the centroid when the improved algorithm and the general algorithm track the desired trajectory. The red is the improved algorithm, and the blue is the general algorithm.  
Figure 12: Data image: (**a**) Improved trajectory tracking; (**b**) local enlarged view of improved trajectory tracking; (**c**) general trajectory tracking; (**d**) partial enlarged view of general trajectory tracking; (**e**) lateral deviation; (**f**) front wheel turning angle; (**g**) slip angle of centroid; (**h**) speed.  
Figure 12f,g change the data values greatly at 3 s and 15 s-25 s, because the intelligent vehicle makes a large turn at the corresponding position, especially the continuous turning at 15 s-25 s. Figure 12h is an image of the longitudinal velocity with an acceleration of 1 m/s\({}^{2}\). The Matlab-Carsim HIL simulation platform test is shown in Figure 13. Figure 13a,b are the images displayed by Carsim in the Matlab-Carsim HIL simulation platform. Figure 13c,d are the test images of the bench in the Matlab-Carsim HIL simulation platform.  
Tables 1-3 show the maximum deviation at the corresponding position. The improved algorithm has a higher tracking accuracy than the general algorithm in discontinuous sharp turns. During continuous steering, the tracking accuracy of the improved algorithm will gradually decrease. However, it can be seen from Figure 12 that the improved algorithm has less chattering and good stability, so it is easier to control.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Algorithm** & **50 m** & **189 m** & **192 m** \\ \hline Improved(m) & 0.194 & 1.350 & \(-\)0.797 \\ \hline General(m) & 0.846 & 1.793 & \(-\)0.849 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Maximum lateral error.  
Figure 13: Matlab-Carsim HIL simulation platform test: (**a**) improved trajectory tracking; (**b**) general algorithm; (**c**) Matlab-Carsim HIL simulation platform 1; (**d**) Matlab-Carsim HIL simulation platform 2.