# MPC and PSO Based Control Methodology for Path Tracking of 4 WS4 WD Vehicles
## 4 Simulation
### Parameters of Simulation  
The first two sections of Table 1 list the parameters of vehicles used in simulation. The common parameters in the objective functions are listed in the third section of Table 1, in which the vehicle mass and inertia values used in the objective function are different from actual vehicle values to simulate parametric uncertainties. This helps to verify the robustness of the vehicle control method in dealing with variations in the system. In order to run in real time, both optimization methods are limited to 15 ms of search time per iteration, less than the system sample time \(T_{s}=20\) ms. In optimization, the optimal solution is searched within the boundaries until time reaches \(T1\) or the error gradient of 0.001 is achieved by the objective function. The last two sections present the particular parameters for each method. Figure 8: Terrain disturbance. Figure 7: Reference path (RP) and terrain coefficients along the RP. (**a**) Reference path; (**b**) terrain coefficients. The drive torques and steering angles applied on four wheels are presented in Figure 10. At each cornering, the torques applied at the two outside wheels (i.e., \(T_{1}\) and \(T_{4}\)) firstly increase and then decrease, which are contrary to that of the two inside wheels (i.e., \(T_{2}\) and \(T_{3}\)). The difference in torques is used to compensate the insufficient angular accelerations of vehicle in corners. The steering angles of MPC-SQP and PSO controller follow the same varying trend in which steering curves of MPC-SQP show smoother variation. Thus, the MPC-SQP controller can provide more stable steerings compared with the PSO controller. In this work, another aim of control is to maintain high vehicle motion quality including its velocity and acceleration performances. Figure 11a presents the longitudinal velocity curves achieved by MPC-SQP and PSO controllers. Starting at 0.5 m/s, the two curves reach 3 m/s at 6.5 s and 4.8 s, respectively. Thus, the trajectory and error curves of the MPC controller responses are slower than the PSO controller in Figure 9. Both controllers are capable of maintaining the longitudinal velocity around 3 m/s in the rest process. In Figure 11b, the longitudinal acceleration curve of PSO increases faster than MPC-SQP and has a peak value of 1 m/s\({}^{2}\). The curve of MPC-SQP controller reaches 0.6 m/s\({}^{2}\) at a maximum and has smoother variation during the whole process. From the offset model, lateral velocity is undesirable as it causes tracking error. As shown in Figure 11c, both controllers maintain the lateral velocities fluctuating around zero. The MPC-SQP controller has a maximum lateral velocity of 0.08 m/s, whereas PSO has a maximum value of 0.17 m/s. The lateral velocities are well constrained, which provides higher accuracy of path tracking. The lateral acceleration curves follow the same varying trend in Figure 11d. It can be seen the PSO controller causes a lateral acceleration oscillation of 0.6 m/s\({}^{2}\) relative to the MPC-SQP. The smoother change of lateral acceleration achieved by MPC-SQP controller reduces the jerk effect, decreasing the deviation from the reference path. The angular velocities are demonstrated in Figure 11e, in which the MPC-SQP has higher accuracy and a smoother manner, compared with that of the PSO. In Figure 11f, the angular acceleration curves are presented. MPC-SQP and PSO curves vary with oscillations of 12 \({}^{\circ}\)/s\({}^{2}\) and 20 \({}^{\circ}\)/s\({}^{2}\), respectively. The undesirable oscillations are eliminated in the process of the integration, which can be demonstrated in Figure 11e. From all the acceleration plots given in Figure 11, the MPC-SQP controller performs better in constraining oscillations of accelerations, which provides better stability in vehicle motion control. Considering that the optimization based method may lead to an expensive computation, it is essential to analyze the computing efficiency for each controller. As shown in Figure 12, the computing efficiency of each controller is compared.