# Novel Online Optimized Control for Underwater Pipe-Cleaning Robots
## 4 Simulations and Results  
In order to validate the effectiveness of the aforementioned methods, this paper designed two kinds of simulations, which explored the path tracking performance of the robot using the new method and the optimal location finding performance of the fusion BA. In the first simulation, the proposed fuzzy controller with online optimization of the scale factors using the fusion BA was applied to track a reference path with abrupt displacement, which imitates the condition where an embossment of the biofouling boundary appears or disappears in the view of the UPCR. As a contrast, the fuzzy controller without optimization was also simulated, and \(K_{pos}\), \(K_{ori}\), and \(K_{t}\) were set as 1000, 0.35, and 7, respectively. Figures 9 and 10 show the tracking performance of these two fuzzy controllers when the velocity of the front wheel of the UPCR is 3.6 m/min. Figure 8: Pseudo code of the fusion BA. As shown in Figure 9, both fuzzy controllers can successfully drive the UPCR to track the reference path. When initial conditions for both controllers were the same in stages 1 and2, the UPCR with the optimized fuzzy controller moved close to the reference path more quickly. As the reference path was short in stage 1, the UPCR with the conventional fuzzy controller did not have enough time to finish adjusting. In stage 1, although the initial deviation for the optimized fuzzy controller was bigger than that for the conventional fuzzy controller, both fuzzy controllers spent almost the same time to eliminate errors. Figure 10a,b shows the position error and the orientation error with respect to time and mileage along the \(x\)-axis, which represent the speed of the nozzle approaching the reference line and the UPCR straightening its body along the reference line, respectively. From the result, it takes more than 10 s for the UPCR to eliminate large position and orientation errors. This phenomenon is reasonable because the robot has to move slowly to ensure that the sea creatures are fully cleaned and the drive motor provides enough torque to overcome the resistance caused by magnetic adsorption. It should also be noted that the maximum orientation error was bigger when the UPCR used the optimized fuzzy controller, which is because the weight coefficient \(\omega_{1}\) was set to be bigger than \(\omega_{2}\) to decrease the position error as a priority, and a faster change of position in the left-right direction of the UPCR required a bigger orientation error. Despite all this, the correction of the orientation error was still  
Figure 10: Tracking error of the UPCR using the two fuzzy controllers in the first simulation: (**a**) Position error, (**b**) Orientation error. Figure 9: The UPCR path under the two fuzzy control methods and the reference path in the first simulation. faster using the optimized fuzzy controller, as shown in Figure 10b. In general, the proposed fuzzy controller is suitable for the tracking path task and optimizing its scale factors online can dramatically improve the performance. In order to explore the sensitivity of the proposed controller to the moving speed of the UPCR, we simulated its tracking performance at different speeds. Each simulation was performed under the same setting (e.g., reference trajectory and dynamic parameters). Figure 11 shows the root mean square error (RMSE) of the UPCR's performance error at seven different moving speeds. From the result, the RMSE of the position error increases with UPCR's speed, whereas the RMSE of the orientation error has no obvious relationship with the robot's speed. This result indicates that, within a certain velocity range, the tracking performance of the UPCR is inversely related to its moving speed. However, the RMSE of the tracking performance did not change significantly within such a large velocity range. Considering that the velocity of the robot in most applications is between 1.8 and 3.6 m/s, it can be concluded that the fusion bat algorithm-optimized fuzzy controller is suitable for the UPCR.