## 4 Application
### Control Implementation and Test Results  
According to the functional block diagram for performance describing the continuous evolution of the AUV controller, the environmental disturbance caused by a wave was only considered as sea state code 1 [96], i.e., slight ripples on the free surface. \begin{table}
\begin{tabular}{c c} \hline
**Parameters** & **Values** \\ \hline Size (L \(\times\) H \(\times\) W) & (1.50 \(\times\) 0.20 \(\times\) 0.20) m \\ Weight & 11.50 kg \\ Autonomous duration & 25 min \\
2\(\times\) Li–Po battery & 22.2 V, 20,000 mAh \\ Ultimate capacity & 285 W \\ Maximum submersing/rising speed & 0.70 m/s \\ Maximum horizontal moving speed & 1.80 m/s \\ Maximum operation depth & 1.20 m \\ Maximum radius of operation & 400 m \\ Inertia moment on \(x\)-axis, \(I_{xx}\) & 0.057 kg\(\cdot\)m\({}^{2}\) \\ Inertia moments on \(y\)-axis and \(z\)-axis, \(I_{yy}=I_{zz}\) & 1.271 kg\(\cdot\)m\({}^{2}\) \\ \hline \end{tabular}
\end{table} 
Table 3: The torpedo-shaped AUV’s main operating parameters (data from [63]). Figure 7: State pattern structure of hybrid automata (HA) for the AUV controller. The state-space models shown in Equation (3) were implemented to calculate the current states of the AUV using the installed sensors, e.g., the inertial measurement unit (IMU) MPU6000 [97] and the global positioning system (GPS) Ublox Neo 6M [98]. The state estimations in both cases were based on the EKF (Algorithm 1) and the UKF (Algorithm 2). In Algorithms 1 and 2, \(\hat{\cdot}\) denotes an estimation, \(P\) is the state covariance, and \(Q\) and \(R\) represent the covariance matrices of the process and measurement noise, respectively. The state was estimated starting from the following initial conditions: \(\mathbf{x}_{0|0}=\mathbf{x}_{0}\) and \(\mathrm{P}_{0|0}=0_{12\times 12}\). ``` Function EKF algorithm Step EKF predict Data:\(\mathbf{x}_{\mathrm{k-1|k-1}},\mathrm{P}_{\mathrm{k-1|k-1}},\mathbf{f}_{ \mathrm{k-1}}(. )\) Result:\(\mathbf{x}_{\mathrm{k|k-1}},\mathrm{P}_{\mathrm{k-1}}\) ; \(\mathbf{x}_{\mathrm{k|k-1



We used the _OpenModelica_ tool [99], which is an open-source simulation environment, to perform the simulation of an AUV controller. _OpenModelica_ is an object-oriented modeling environment of _Modelica_[100] and C/C++ for hybrid systems. A case study in which the MDS was assumed to address an event in the transferring state to the AUV controller with a desired course angle of 020\({}^{\circ}\) and average speed of 1.5 m/s is shown in Figure 8. Here, the average transient durations, which correspond to the cases using EKF and UKF, were 6.8 and 6.2 s for the AUV's stabilized course. The ATMEGA32-U2 and STM32 Cortex-M4 microcontrollers [95] were installed on the mainboard. The AUV installation for trial trips is shown in Figure 9. The test scenarios were based on different desired courses, for various desired shape-based paths and average velocities. Some of the main planar course-tracking test results are shown in Table 4. Figure 10a,b and Figure 11a,b respectively show that the AUV reached and followed the desired rectangle- and triangle-shaped trajectories. Figure 8: Average transient response time in a desired course of 020\({}^{\circ}\) from the current position for the cases using EKF and UKF. Figure 9: AUV installation for trial trips. On the basis of comparison with the test results obtained in the literature [1; 63], this current AUV controller was superior in terms of the stabilized interval and trajectory error, which decreased by about 0.7 s and 0.90 m, respectively. The UKF enabled more accurate estimations. Although operations in UKF such as the unscented transform (UT), i.e., the _UT_ function in Algorithm 2, may appear more complex than those for the EKF, the assessments of actual computational complexity and optimizations for the application of various Kalman filter extensions were studied intensively by [PERSON], et al. [101] and [PERSON] and [PERSON] [102].