# SMCSPO-Based Robust Control of AUV in Underwater Environments including Disturbances
## 4 Simulation
### PID and SMCSPO Control Simulations with Disturbances  
To compare the results of the vehicle's PID and SMCSPO control in an underwater environment with disturbances, random disturbances were added to the disturbance part in Figure 2. In this simulation, two types of disturbances were considered: small and large. The small disturbance was a 10 Hz random signal with a variance of magnitude of 0.1 N\({}^{2}\)m\({}^{2}\), and the large disturbance was also a 10 Hz random signal with a variance of magnitude of 10 N\({}^{2}\)m\({}^{2}\). The reason for considering the random type of noise is that non-linear terms or sensor noise that are not modeled in the vehicle dynamics may be included in the underwater disturbance [2]. Therefore, we considered small, random, irregular disturbance within \(\pm\)0.5 Nm in Figure 7 to compare with the PID control results. In addition, we used large, random, irregular disturbance within \(\pm\)5 Nm to evaluate the control performance in a severe underwater environment. The small and large random disturbances are shown in Figure 7.  
Figure 8 shows the PID control simulation results and control inputs of the vehicle's rolling, pitching, and yawing velocity with small external disturbances, and Figure 9 shows the SMCSPO control results. The control input coefficient of rolling velocity \(K_{\delta_{s}}\) has about a three times larger value than other control input coefficients \(M_{\delta_{s}}\) and \(N_{\delta_{s}}\). In addition, the control fin angle of rolling velocity \(\delta_{s_{m}}\) has an angle limitation that is twice as large as \(\delta_{s_{p}}\) and \(\delta_{r}\). Due to these characteristics of the underwater vehicle system, rolling velocity control is more vulnerable to disturbances compared to pitching and yawing velocity control. In the rolling control results of PID, it can be seen that the PID controller results in velocity errors of about \(\pm\)5 degrees even with a small disturbance. The SMCSPO control results are more robust to disturbance compared to the PID control results; the rolling control result of SMCSPO is hardly affected by small disturbances, as shown in Figure 9. Through the comparison of the rolling velocity's error graphs of PID and SMCSPO in Figure 10, it is confirmed that the performance of SMCSPO is better than PID in a small disturbance environment.  
Figure 11 shows the PID control simulation results and control inputs of the vehicle's rolling, pitching, and yawing velocity with large external disturbances, and Figure 12 shows the SMCSPO control results. Although the SMCSPO control results of the rolling velocity are a little better than the PID control results, it was not possible to effectively suppress the effect of large disturbance because of the control fin limitation. However, in the case where the control input is smaller than the limit of the control fin in the 6-8 s section of the rolling velocity control graph in Figure 12, it can be seen that the SMCSPO control result is significantly better than the PID control result. In addition, despite the large magnitude of the strong disturbance, the vehicle's control fins can be controlled stably using the SMCSPO controller, because there is almost no chattering phenomenon in the control input graph in Figure 12. In general, SMC performs better than PID control in nonlinear systems, but it has chattering problems [7]. The main difference between Figures 11 and 12 is that SMCSPO results in almost no chattering, and thus it performs better than the PID control result.  
Figure 6: Rolling velocity’s error comparison of SMCSPO and PID controller without disturbances.