**5. Results and discussions**

In evaluating the performance of the proposed adaptive controller, trajectory tracking performance was observed. Two aspects were compared, namely, (a) the vehicle trajectories and (b) the lateral error while navigating the trajectories with each respected controller. The performance of the proposed knowledge-based adaptive controller was compared against its two predecessors, which are the original St controller from Eq. (1) and Mod St from Eq. (3) as explained in Section 3.1. All simulation results for the six trajectories are shown in **Figure 14** for the straight road, **Figure 15** for the Multiple Lane Change Road, **Figure 16** for the Double Lane Change Road, **Figure 17** for the Hook Road, **Figure 18** for the S Road, and **Figure 19** for the Curved Highway Road.

**Figure 14.** *Trajectory tracking performance for straight road: (a) vehicle trajectories, (b) lateral error, e.*

*Knowledge-Based Controller Optimised with Particle Swarm Optimisation for Adaptive Path… DOI: http://dx.doi.org/10.5772/intechopen.92667*

**Figure 15.**

*Trajectory tracking performance for curved highway road: (a) vehicle trajectories, (b) lateral error, e.*

**Figure 16.** *Trajectory tracking performance for multiple lane change road: (a) vehicle trajectories, (b) lateral error, e.*

It can be seen that the proposed controller managed to guide the heavy vehicle along the desired trajectories successfully. Overall, the adaptive controller performed significantly better than the St controller. The proposed controller managed to guide the vehicle with better precision closer to the path, which can be indicated further by the lateral error graphs in **(b)**. These improvements are mainly caused by the fact that the adaptive controller adopts Mod St steering command from Eq. (3) as the base controller to be automatically tuned. This controller considers the yaw rate error feedback, which can improve the overall trajectory tracking performance. Also, it has more controller parameters, which made the controller more sensitive to tuning, which, in turn, improve the tracking performance upon parameter selection. This also explains the exceptional performance by the Mod St controller shown in the graphs. For shorter and tight manoeuvring road

**Figure 17.** *Trajectory tracking performance for double lane change road: (a) vehicle trajectories, (b) lateral error, e.*

**Figure 18.**

*Trajectory tracking performance for hook road: (a) vehicle trajectories, (b) lateral error, e.*

**Figure 19.** *Trajectory tracking performance for S road: (a) vehicle trajectories, (b) lateral error, e.*

courses, namely, straight, multiple lane change, and lane change, shown in **Figures 14**–**16** respectively, the vehicle was manoeuvred successfully along the intended road courses with significantly better lateral error than the original Stanley controller. However, unwanted oscillations can be observed in **Figures 16** and **17** due to rapid cornering that exists in these courses. This can be minimised by preparing smoother curvature for the vehicle to follow [6].

However, one might notice the inferior performance shown by the proposed controller when compared against the Mod St controller. As stated before, this is the base controller where the adaptive algorithm was built on. In the simulation, the Mod St controller was tuned specifically for each trajectory using a metaheuristic optimisation algorithm, namely, PSO. The procedures are explained by Amer et al. [15]. Since the controller was specifically tuned for each trajectory and the 6 m/s speed, the controller parameter has been chosen to optimise the vehicle performance for each of the roads. This explains the fact that the base controller performed better than the adaptive controller, which was automatically tuned by the adaptive algorithm. However, despite the inferior performance compared to the Mod St controller, the adaptive controller still managed to guide the vehicle with a satisfactory performance. Looking at the RMS values for lateral error, the adaptive controller recorded a lateral error of 0.00154–0.0341 m across all the six trajectories, which are well below the average lateral error of 0.1 m recorded by the Stanley vehicle in the original publication [3]. Therefore, it can be concluded that the proposed adaptive controller performed well in navigating various trajectories. Overall comparison results for the RMS values on lateral error between the evaluated controllers are listed in **Table 4**.

The response of the controller under various vehicle speeds was studied next for hook, S, and curved highway road, as shown in **Figure 20**. These roads were chosen *Knowledge-Based Controller Optimised with Particle Swarm Optimisation for Adaptive Path… DOI: http://dx.doi.org/10.5772/intechopen.92667*


**Table 4.**

*Comparison of RMS values for lateral error between the controllers.*

**Figure 20.** *Effect of varying speeds for (a) hook road, (b) S road, and (c) curved highway road.*

due to its suitability for a high-speed testing. Straight, multiple lane change, and double lane change roads have shorter courses and extreme manoeuvrings, which are not suitable for a high-speed testing. In each analysis, six constant speed values were chosen to evaluate the controller, namely, 3, 8, 12, 17, 20, and 30 m/s. Based on knowledge database range and intervals listed in **Table 2**, 20 and 30 m/s were chosen to observe the controller's behaviour on the knowledge database boundary and outside the boundary. Other values were chosen randomly to observe the controller's performance with vehicle speeds well within the knowledge database boundary. From the figures, one can see that the proposed adaptive controller managed to steer the heavy vehicle well along the desired trajectory. However, as the vehicle speeds increase, larger error was observed since the vehicle is moving further than the intended trajectory. This is understandable since an increasing speed means that the vehicle can be diverted faster. Nevertheless, the controller still managed to bring the vehicle back to its intended direction with lateral error of well within 1 m as shown in **Table 5**.


**Table 5.**

*RMS values of lateral error for various vehicle speeds with the adaptive controller.*
