## 5 Field Testing
### Integrated Path Tracking Controller Testing
#### 5.2.2 Tracking Result  
According to the pre-experiment results, the reference speed is set to 1 m/s and 2 m/s. The controller is tested under each reference speed and unloaded condition, respectively. The parameters of the integrated path tracking controller in the experiment are shown in Table 2. The parameters are chosen based on the summary of numerous experimental results. According to Equation (7), the larger \(N_{\text{p}}\) has a minor overall error between the tracking path and the reference path, but the error becomes more significant in the path in which the curvature changes significantly, and an excessive \(N_{\text{p}}\) leads to computational stress. Similarly, the error is smaller when \(N_{\text{c}}\) gradually increases to \(N_{\text{p}}\), but an oversized \(N_{\text{c}}\) causes more computational stress than excessive \(N_{\text{p}}\). Therefore, according to the experimental experience, \(N_{\text{p}}\) is chosen to be 20 and \(N_{\text{c}}\) to be 10. \(Q\), \(R\), and \(P\) are mainly responsible for adjusting the weight values among the cost functions to make them consistent in scale. However, an overly large weight will increase the computational load. Thus, they should be as small as possible without exceeding the minimum accuracy of the solver. The weights in the table are based on the experimental results to obtain the optimal relative values. CasADi is used as nonlinear optimization algorithm in this paper [15]. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Value** \\ \hline \(N_{\text{p}}\) & 20 \\ \(N_{\text{c}}\) & 10 \\ \(T\) & 0.1 s \\ \(P\) & \(\text{diag}(0.1,\,0.1,\,0.5,\,0)\in\mathbb{R}^{4\times 4}\) \\ \(Q\) & \(\text{diag}(0.01,\,0.01,\,0.05,\,0)\in\mathbb{R}^{4\times 4}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Parameters of NMPC path tracking controller. Figure 19: Speed test results: (**a**) path comparison results; (**b**) velocity comparison results. Figure 18: Three drivers in the maximum speed test: (**a**) 1 st driver; (**b**) 2 nd driver; (**c**) 3 rd driver. (a) Path Tracking Results at 1 m/s. The experimental results are shown in Figure 20. The blue curve represents the controller with traditional NMPC, and the red curve represents the controller with NMPC with terminal cost. The results show that the integrated controller with both traditional NMPC and proposed NMPC can make the vehicle track the path. In the case of the traditional NMPC, the peak lateral error is 0.0518 m, and the peak heading angle error is 0.0659 rad. At the proposed NMPC, the peak lateral error is 0.0358 m, and the peak heading angle error is 0.0547 rad. It is evident that the NMPC controller with terminal cost can increase tracking accuracy and stabilize earlier. At the same time, in both cases, the vehicle speed is well controlled at the reference speed, and both the speed and the articulated angular speed change smoothly. The calculation time of the controller is concentrated on 0.08 s to 0.09 s, and only a little exceeds 0.1 s (the time interval of the controller); however, the computation time of NMPC with the terminal cost is slightly higher than that of traditional NMPC. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Value** \\ \hline \(R\) & diag(0.01, 0.01) \(\in\mathbb{R}^{2\times 2}\) \\ \(\gamma_{\text{min}},\ \gamma_{\text{max}}\) & \(-\)0.73 rad, 0.73 rad \\ \(v_{\text{min}},\ v_{\text{max}}\) & 0 m/s, 4 m/s \\ \(\omega_{\text{min}},\ \omega_{\text{max}}\) & \(-\)0.17 rad/s, 0.17 rad/s \\ \(\Delta v_{\text{min}},\ \Delta v_{\text{max}}\) & \(-\)0.3m/s\({}^{2}\), 0.3 m/s\({}^{2}\) \\ \(\Delta\omega_{\text{min}},\ \Delta\omega_{\text{max}}\) & \(-\)0.17 rad/s\({}^{2}\), 0.17 rad/s\({}^{2}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: _Cont._  
Figure 20: Path tracking results at 1 m/s: (**a**) path comparison results; (**b**) lateral error and heading error comparison results; (**c**) computation time comparison results; (**d**) control inputs comparison results.