Comparison of two second-order sliding mode control algorithms for an articulated intervention AUV: Theory and experimental results Ocean Engineering

An articulated intervention autonomous underwater vehicle (AIAUV) is a slender, multi-articulated underwater robot. Accurate trajectory tracking is essential for AIAUV operations. Furthermore, due to hydrodynamic and hydrostatic parameter uncertainties, uncertain thruster characteristics, unknown disturbances, and unmodelled dynamic effects, robustness is crucial. In this paper, we present a super-twisting algorithm (STA) with adaptive gains and a generalized super-twisting algorithm (GSTA) for trajectory tracking of the position and orientation of AIAUVs. A higher-order sliding mode observer (HOSMO) for estimating the linear and angular velocities when velocity measurements are unavailable is also presented. The tracking errors for the resulting system are proven to converge asymptotically to zero. Finally, we demonstrate the applicability of the presented control laws with comprehensive simulation and experimental results and perform a comparison study, with two tests (C-shape and C-shape with a moving head), between the two algorithms and also a benchmark PID controller. The STA with adaptive gains exhibits the best overall tracking performance, with average position root mean square error (RMSE) 0.0121 m and average orientation RMSE 0.0335 rad. The GSTA also presented good results with average position RMSE 0.0267 m and average orientation RMSE 0.0292 rad. The PID controller gave average position RMSE 0.0371 m and average orientation RMSE 0.0491 rad.


Introduction
An articulated intervention autonomous underwater vehicle (AIAUV) is an underwater swimming manipulator. It has the slender, multi-articulated body of an underwater snake robot (USR), which imparts the AIAUV with accessibility and flexibility, but it also has multiple thrusters along its body. The thrusters enable the AIAUV to move forward without using an undulating gait pattern and provides it with the ability to hover. This property is especially important for stationkeeping and trajectory tracking in narrow and confined spaces. These capabilities enable the AIAUV to operate as a floating base manipulator. Moreover, the AIAUV has adopted the flexibility and high-kinematic redundancy of the USR and the energy-efficient shape and tether-less operation of autonomous underwater vehicles (AUVs). Compared to standard survey AUVs, the AIAUV has the advantage that it has full actuation, and it can perform intervention tasks. Since it can use its slender body to access narrow spaces, use its thrusters to keep itself stationary and then use its joints to perform intervention tasks, the AIAUV can exploit the full potential of the inherent kinematic redundancy, which has been addressed in detail in (Sverdrup-Thygeson et al., 2016), (Sverdrup-Thygeson et al., 2018).
The controller design for underwater vehicles (UVs) such as AIAUVs, AUVs, USRs and remotely operated vehicles (ROVs) is a complex problem (Antonelli, 2014). Underwater vehicles are often subject to hydrodynamic and hydrostatic parameter uncertainties, uncertain thruster characteristics, unknown disturbances, and unmodelled dynamic effects. However, the control design for the AIAUV is more complex than for the other mentioned UVs, and control methods used for these type of vehicles can therefore not be directly applied. Specifically, the AIAUV has the same mechanical structure as a USR while also possessing hovering and intervention capabilities because of the thrusters. Path following and manoeuvring control of USRs are discussed in (Kelasidi et al., 2014(Kelasidi et al., , 2017aKohl et al., 2016aKohl et al., , 2016bKohl et al., , 2017aKohl et al., , 2017b; however, these method are not suitable for utilizing the AIAUV's hovering and intervention capabilities. The AUV is a single-body UV, and some methods for control design have been proposed in (Fossen, 2011), while the AIAUV is a floating-base manipulator arm. We therefore face the additional challenge of handling the interaction forces, also referred to as coupling forces, between the arm and the vehicle. Several different control approaches that address these challenges are summarized and presented in (Antonelli, 2014). However (Antonelli, 2014), considers mostly ROVs. ROVs also face these challenges, but for the AIAUV, the motion of the joints has a more significant effect on the overall motion of the AIAUV than for ROVs. This is because the AIAUV has no separate vehicle base and a low mass compared to an ROV, while ROVs have a separate base with a larger inertia than that of the manipulator arm. Furthermore, inertia, drag forces, and restoring forces and moments caused by the joint motion have a significant effect on the overall motion of the whole mechanism, for which any joint motion leads to a corresponding change in the direction of the thrusters that are distributed along the robot. All this increases the complexity of the motion for the AIAUV, thereby rendering the control problem even more complex than for ROVs. For the AIAUV in particular, some methods for propulsion have been proposed in , and energy-efficient methods for long-distance travel have been proposed in (Wrzos-Kaminska et al., 2019). In (Sverdrup-Thygeson et al., 2016, a control framework for AIAUVs that uses inverse kinematic (IK) control together with a dynamic controller is proposed. However, in both papers, IK is the main focus. The dynamic controller proposed in (Sverdrup-Thygeson et al., 2016) is only a simple P-controller, and the controller proposed in (Sverdrup-Thygeson et al., 2018) is a feedback-linearisation controller combined with a velocity-based proportional-integral-derivative (PID)-controller. Moreover, none of these methods focus on robust control, which is essential for the AIAUV due to large coupling forces, unknown disturbances and other unmodelled dynamic effects that affect the AIAUV. Sliding mode control (SMC) is a robust and versatile non-linear control approach that is particularly well suited for situations where unknown non-linearities affect the system, as in the case of AIAUVs. In this paper we therefore investigate using SMC to obtain a robust trajectory tracking controller.
In recent years, several results have been reported regarding the use of SMC for many complex dynamic systems. For UVs, in general, some relevant contributions are the following: in (Antonelli and Chiaverini, 1998), an SMC approach for the regulation problem of an underwater vehicle-manipulator system is developed. This control law is inspired by (Fjellstad and Fossen, 1994) and avoids the inversion of the system Jacobian and is therefore singularity-free. In (Fossen, 1991) and (Fossen and Sagatun, 1991), an SMC is used to address input uncertainty due to partly known non-linear thruster characteristics. In (Soylu et al., 2008), a chattering-free SMC is proposed for trajectory control. The chattering-free approach is developed by combining the SMC with adaptive proportional-integral-derivative controller gains and having an adaptive update of the upper bound on the disturbance and parameter uncertainties. In (Dannigan and Russell, 1998), an SMC is used to address the coupling effects between a manipulator and an UV. By combining a virtual velocity control and SMC, a hybrid control strategy is developed in (Zhu and Sun, 2013) for the trajectory tracking of an unmanned UV. In (Xu et al., 2015), the trajectory tracking problem of an under-actuated unmanned UV is studied by combining backstepping and SMC. An attitude controller for an AUV is designed in (Cui et al., 2016) by using a sliding-mode-based adaptive controller. In (Liu et al., 2017), the trajectory tracking problem for an UV subject to unknown system uncertainties and time-varying external disturbances is considered and is solved by using a non-linear disturbance observer-based backstepping finite-time SMC scheme. In (von Ellenrieder and Henninger, 2019) a third-order sliding mode disturbance observer, coupled with a modified super twisting controller, is proposed for the trajectory tracking of fully-actuated marine vehicles in the presence of unknown, time-varying disturbances. However, as mentioned in the previous section the control design for the AIAUV is more complex than for the other mentioned UVs, and control methods used for these type of vehicles can therefore not be directly applied.
In recent years, SMC has been further developed into higher-order SMC schemes, which removes the chattering problem. The super-twisting algorithm (STA) with adaptive gains, proposed by (Shtessel et al., 2010), is the most powerful second-order continuous SMC algorithm as it attenuates chattering and does not require the consideration of any conservative upper bound on the disturbance to maintain sliding because of the adaptive gains. Motivated by this (Borlaug et al., 2019a), applied the STA together with a higher-order sliding mode observer (HOSMO) (Kumari et al., 2016) to an AIAUV. The tracking problem of the centre of mass of the AIAUV in 2DOF was considered. The tracking errors were proven to converge asymptomatically to zero, and the simulation results demonstrated that the proposed control method provided excellent tracking capabilities. However, the tracking control problem was restricted to considering the position of the AIAUV in 2DOF, and the movements of the joints were considered to be a disturbance. We therefore extended these results in (Borlaug et al., 2018) by considering the AIAUV in 6DOF and examining the tracking problem for the position, orientation and joint angles. Equally good results were obtained in 6DOF as in 2DOF both in theory and in simulations. In (Borlaug et al., 2019a) and (Borlaug et al., 2018), an HOSMO had to be used because velocity measurements were unavailable. In (Borlaug et al., 2019b), we proposed using the generalized super-twisting algorithm (GSTA) proposed in (Castillo et al., 2018) for trajectory tracking of an AIAUV in 6DOF. In (Borlaug et al., 2020), we extended the results obtained in (Borlaug et al., 2019b) to include results with and without an HOSMO for trajectory tracking of an AIAUV in 6DOF. The GSTA is an extension of the STA that provides finite-time convergence in the presence of time-and state-dependent perturbations, which is essential for robust control of the AIAUV. These properties provide the GSTA with additional theoretical advantages over the STA with adaptive gains. These theoretical advantages enable verification that the tracking errors converge asymptotically to zero when the GSTA is used without an HOSMO, which is not possible for the STA with adaptive gains.
In this paper, we investigate the use of the STA with adaptive gains compared to the use of the GSTA. Specifically, we use both the STA with adaptive gains and the GSTA for the trajectory tracking of the position and orientation of the base of an AIAUV in 6DOF. We also solve the tracking problem using a PID controller to evaluate how the SMC algorithms perform compared to a linear controller. An HOSMO for estimating the linear and angular velocities when velocity measurements are unavailable is also presented. Furthermore, the tracking errors for the control law using the STA with adaptive gains in combination with the HOSMO are proven to converge asymptotically to zero. Finally, we demonstrate the applicability of the proposed control laws with comprehensive simulation and experimental results, and we compare the results. The main objective of this paper is a comparison between the STA with adaptive gains, the GSTA and a PID controller. In addition, the paper extends the results obtained in (Borlaug et al., 2019a) from 2DOF to 6DOF. In (Borlaug et al., 2019a), the tracking problem of the centre of mass of the AIAUV in 2DOF was considered and solved using the STA with adaptive gains in combination with an HOSMO, and the tracking errors were proven to converge asymptotically to zero. Preliminary results were presented in (Borlaug et al., 2018). In this paper, these results are extended by also solving the tracking control problem using the STA with adaptive gains without an HOSMO. We also include extensive simulation and experimental results not presented in (Borlaug et al., 2018) using the STA with adaptive gains. In (Borlaug et al., 2019b), the tracking control problem is considered and solved using the GSTA without an HOSMO. In (Borlaug et al., 2020), the tracking control problem is considered and solved using the GSTA with and without an HOSMO, and simulation and experimental results are given. The simulation and experimental results given in (Borlaug et al., 2020) are included in this paper to perform a comparison study between the STA with adaptive gains proposed here with the GSTA proposed in (Borlaug et al., 2020). The two algorithms are further compared with a benchmark PID controller.
The contributions of this paper can be summarized as follows. The trajectory tracking control problem of an AIAUV in 6DOF is solved using the STA with adaptive gains. The trajectory tracking control problem is also solved by using the algorithm in combination with an HOSMO. Additionally, the tracking errors for the control law using the STA with adaptive gains in combination with the HOSMO are proven to converge asymptotically to zero. We demonstrate the applicability of the presented control laws with comprehensive simulation and experimental results, and we compare these results with the GSTA proposed in (Borlaug et al., 2020) as well as with a PID controller.
The remainder of this paper is organized as follows. In Sec. 2, the model and the tracking control problem for the AIAUV are defined mathematically. The control law and observer design for tracking the desired trajectory are presented and analysed in Sec. 3 for all three algorithms. A description of the implemented simulation model and the simulation results are provided in Sec. 4. In Sec. 5, the experimental setup and the experimental results are given. The conclusions and suggestions for future work are presented in Sec. 6.

AIAUV model and problem statement
In this section, we provide the model and the mathematical definition of the tracking control problem for the AIAUV, Fig. 1. The AIAUV consists of n links connected by n − 1 motorized joints. Each joint is treated as a one-dimensional Euclidean joint. To follow the convention used in the robotics community, the first link is referred to as the base of the manipulator. The base link is link 1, and the front link, where the end-effector is positioned, is link n. A visual representation of the relevant frames is given in Fig. 2. In the right corner of Fig. 2 the link frames (blue coordinate-systems) have been visualized for a completely outstretched robot. Note that link frame 1 corresponds to the base frame. The joints are numbered from i = 1 to n − 1 such that link i and link i+ 1 are connected by joint i.
Furthermore, the AIAUV is equipped with m thrusters, including one or more thrusters acting along the body of the AIAUV to provide forward thrust and tunnel thrusters acting through the links to provide stationkeeping capability. The AIAUV is considered to be a floating base manipulator operating in an underwater environment subject to added mass forces, dissipative drag forces, and gravity and buoyancy forces, which allows us to model the AIAUV as an underwater vehiclemanipulator system (UVMS), with dynamic equations given in matrix form by (Antonelli, 2014), (From et al., 2014) where q ∈ R (n− 1) is the vector representing the joint angles, ζ ∈ R 6+(n− 1) is the vector of body-fixed velocities, M(q) is the inertia matrix including added mass terms, C(q, ζ) is the Coriolis-centripetal matrix, D(q, ζ) is the damping matrix, and g(q, R I B ) is the matrix of gravitational and buoyancy forces. The control input is given by the generalized forces τ(q): (2) where T(q) ∈ R 6×m is the thruster configuration matrix, τ thr ∈ R m is the vector of thruster forces, and τ q ∈ R (n− 1) represents the joint torques. To implement the control input τ(q), a thruster allocation scheme as proposed in (Sverdrup-Thygeson et al., 2018) needs to be implemented to distribute the desired control inputs onto the m thrusters. The vector of body-fixed velocities, ζ, is defined as where v and ω are the body-fixed linear and angular velocities of the base of the AIAUV, respectively, and q is the vector of joint angle velocities. The desired velocities are denoted as in the body-fixed frame. The velocity errors can then be defined as where ζ and ζ d are defined as in (3) and (4), respectively. To represent the orientation of the AIAUV, both Euler angles and quaternions can be used. In this paper, we will describe both methods, as we use quaternions to describe the dynamics when we create the control laws without the HOSMO and Euler angles when we create the control laws that use the estimated velocities from the HOSMO. The reason is that the HOSMO does not work with quaternions as a different number of states in position versus velocity then occurs.

Model representation using euler angles
In this section, we will describe the model using Euler angles. A wellknown problem when we use Euler angles is that the Jacobian can become singular at θ = ±π/2 (xyz-convention); however, if we stay away from that angle, the Jacobian is well defined and the inverse of the Jacobian matrix can still be used. When we use Euler angles to describe the AIAUV, we can use the HOSMO from (Kumari et al., 2016) to estimate the velocity such that we do not require velocity measurements. The complete state vector specifying the position, orientation, and shape of the AIAUV when Euler angles are used is defined as where η 1 = [ x y z ] T ∈ R 3 is the position of the base, and η 2 = [ φ θ ψ ] T ∈ R 3 are the Euler angles describing the orientation of the base in the inertial frame. The relationship between the body-fixed velocities and the complete state vector is given by the differential equation where with c x = cos(x) and s x = sin(x), is the rotation matrix expressing the transformation from the inertial frame to the body-fixed frame and is the Jacobian matrix. By defining the desired trajectory as ξ e,d = [ , the tracking error vector can be defined as The goal of the tracking problem is to make the error vector, ξ e , converge to zero. Therefore, the tracking control objective is to make (ξ e ,ζ) = (0, 0) an asymptotically stable equilibrium point of (1) and (7), which will ensure that the tracking errors will converge to zero.

Model representation using quaternions
In this section, we will describe the model using quaternions. When we use quaternions to represent the model, we avoid the singularities in the Jacobian matrix that arise from the Euler angles. We therefore obtain the advantage of a well-defined Jacobian, which means that we can use the inverse of the Jacobian matrix. The complete state vector specifying the position, orientation, and shape of the AIAUV when quaternions are used is defined as where η 1 = [ x y z ] T ∈ R 3 is the position of the base, and p = is the unit quaternion describing the orientation of the base in the inertial frame. The relationship between the body-fixed velocities and the complete state vector specifying the position, orientation, and shape of the AIAUV is given by the differential equation where R B I is the rotation matrix expressing the transformation from the inertial frame to the body-fixed frame, and J k,oq (p) = 1 where I 3 is the (3 ×3) identity matrix, and S( ⋅) is the cross-product operator defined as in [10, Definition2.2]. By defining the desired trajectories as where ] T , the orientation error, which is computed via the composition (quaternion product) (Antonelli, 2014), is then given by The complete tracking error can then be defined as Remark 1. Note that for the orientation, the goal is to ensure that p = ±p d , which corresponds to p = [ 0 1×3 ±1 ] T . Now, since the Euler parameters satisfy η 2 + ε T ε = 1, it is sufficient to make ε→0 because then Therefore, η is not included as an independent state in (15).
The goal of the tracking problem is to make the error vector (15) converge to zero. Therefore, the tracking control objective is to make (ξ q ,ζ) = (0, 0) an asymptotically stable equilibrium point of (1) and (12), which will ensure that the tracking error will converge to zero.

Tracking control laws
In this section, we will present the tracking control laws for the AIAUV using three different algorithms: the STA with adaptive gains, the GSTA and a PID controller. The control laws based on the GSTA obtained in (Borlaug et al., 2020) are briefly presented here for completeness. The control structure used when velocity measurements are available is presented in Fig. 3, and the control structure used when a HOSMO is used for state estimation is presented in Fig. 4.

Super-twisting algorithm with adaptive gains
In this section, we will present two tracking control laws for the AIAUV based on the STA with adaptive gains: one where only the STA with adaptive gains is used, and one where the STA with adaptive gains is combined with an HOSMO.

Control law based on the STA with adaptive gains
In this section, a control law based on the STA with adaptive gains is presented.
Sliding surface: For SMC to be used, a sliding surface needs to be designed. The surface should be designed such that when the sliding variable σ goes to zero, the state variables asymptotically converge to zero, and such that the control input τ(q) appears in the first derivative of σ. Define x 1,q =ξ q , where ξ q is given by (15) and where ζ and ζ d are defined in (3) and (4), respectively. The sliding surface can then be chosen as If σ q = 0, we will now have x 1,q +x 2,q = 0. Since x 2,q =ẋ 1,q , we can write this as which will ensure that x 1,q globally exponentially converges to zero. Now, since x 1,q =ξ q , the state variables ξ q will also globally exponentially converge to zero if σ q = 0. To drive the sliding surface to zero, we will use the STA with adaptive gains. Super-twisting algorithm with adaptive gains: Here, we present the equations describing the STA with adaptive gains in detail. The STA with adaptive gains proposed in (Shtessel et al., 2010) can be written by where the adaptive gains are defined as and where ε ∈ R 6+(n− 1) , λ ∈ R 6+(n− 1) , γ 1 ∈ R 6+(n− 1) and ω 1 ∈ R 6+(n− 1) are positive constants, and σ is the sliding surface. Note that the mathematical operations in (19), (20) and (21) are performed in an elementwise manner. For implementation purposes, a small boundary is placed on the sliding surface such that the adaptive gains can be expressed as where the design parameter α m is a small positive constant selected empirically. This boundary is introduced because numerically σ will never be exactly zero meaning that in practical implementations the second condition of (20) will never be met, which would make the adaptive gains increase to infinity. The STA with adaptive gains makes σ and σ go to zero in finite time (Shtessel et al., 2010).
Control input: Now, we want the control input τ(q) to be selected such that σ q = u STA , so that σ q and σ q will reach zero in finite time.
However, since we do not know anything about the model, we choose our control input to be with σ q defined as in (17). With this choice, u STA appears in σ q , as desired.

Control law based on the STA with adaptive gains combined with a higher-order sliding mode observer
In this section, a control law based on the STA with adaptive gains combined with an HOSMO will be derived. Using Lyapunov theory, we will show that (ξ e ,ζ) = (0, 0) is an asymptotically stable equilibrium point of (1) and (7) with the proposed control law.
State observer: Because velocity measurements are not available, a state observer has to be designed. We want to use the third-order sliding mode observer (SMO) presented in (Kumari et al., 2016) as it has been proven to be finite-time stable in (Moreno, 2012). To use this third-order SMO, we introduce a change of variables. Define x 1,e = ξ e , where ξ e is  given by (6), and x 2,e = J e (η 2 )ζ, where J e (η 2 )ζ is given by (7). The dynamics can then be written as Assumption 1. We assume that d dt (J e (η 2 ))J − 1 e (η 2 )x 2,e is a small bounded disturbance, which we will call d(t).
We also define f( to reduce the space used to write the model. The model can then be written as By designing the third-order SMO structure as in (Kumari et al., 2016), the third-order SMO can be written as and k 1 ∈ R 6+(n− 1) , k 2 ∈ R 6+(n− 1) and k 3 ∈ R 6+(n− 1) are gains to be chosen according to (Levant, 1998) and (Levant, 2003), where e 1 = x 1,e −x 1 ∈ R 6+(n− 1) . One choice of parameters that satisfies the requirements in (Levant, 1998) and (Levant, 2003) is, according to , k 1 = 6L 1/3 , k 2 = 11L 1/2 and k 3 = 6L, where L ∈ R 6+(n− 1) is a sufficiently large constant. Note that the mathematical operations in (26) and (27) are performed in an element-wise manner. By defining , the error dynamics of the HOSMO can be written as e 3 = − k 3 sgn(e 1 ) +Ḟ(⋅) If then the third-order SMO errors go to zero in finite time (Moreno, 2012). Since F( ⋅) is a combination of d(t), C(q, J − 1 e (η 2 )x 2,e )J − 1 e (η 2 )x 2,e , D(q, J − 1 e (η 2 )x 2,e )J − 1 e (η 2 )x 2,e and g(q, R I B ), and since the AIAUV is a mechanical system, these matrices will not change infinitely fast. Therefore, assuming that Ḟ (p, ζ, η 2 ) is bounded is a valid assumption. Sliding surface: As mentioned previously, we have to design a sliding surface to use SMC. The sliding surface is designed in the same manner as in Sec. 3.1.1. When the velocity measurement is available, we choose the sliding surface to be σ e =x 1,e +x 2,e ∈ R 6+(n− 1) where x 1,e =ξ e , with ξ e defined as in (10), and (7). If σ e = 0, we will now have x 1,e +x 2,e = 0. Since x 2,e =ẋ 1,e , we can write this as which will ensure that x 1,e globally exponentially converges to zero. Now, since x 1,e =ξ e , the state variables ξ e will also globally exponentially converge to zero if σ e = 0. When the velocity measurement is not available, the observed state values are used, and we can therefore write the sliding surface with the observed values as Since the third-order SMO errors in (28) go to zero in finite time, σ e = σ e after some finite time. Thus, if σ e goes to zero, the tracking objective will be satisfied. To drive the sliding surface to zero, we will use the STA with adaptive gains.
Control input: By designing the control input τ(q) such that σ e = u STA , we achieve that σ e and σ e reach zero in finite time since the STA is finite-time stable. Taking the time derivative of (31) and substituting ẋ 1 and ẋ 2 , defined in (26), we find that we obtain Stability: In this section, we perform a stability analysis of the closed-loop system and show that the tracking error converges asymptotically to zero. We consider the closed-loop system defined by (1), (7) and (33). By using the fact that x 1 = x 1,e − e 1 and that x 2 = x 2,e − e 2 , from Sec. 3.1.2, (31) can be written as Through rearranging, we obtain that the tracking error dynamics are expressed as ξ e = −ξ e +σ e + e 1 + e 2 (36) Furthermore, the velocity tracking error ζ is represented by the sliding variable σ e , cf., (24) and (31). The overall closed-loop dynamics with τ(q) given by (23) is thus given by σ e given in (34), ξ e given in (36) and the state observer error given in (28). The closed-loop dynamics are thus expressed as Theorem 1. Consider the closed-loop system (1), (7), and (33). Assume that the HOSMO in (26) and (27) is used to estimate x 1,e and x 2,e , where ⃒ ⃒ ⃒Ḟ( ⋅) ⃒ ⃒ ⃒ < Δ is assumed, and the sliding surface is selected as in (31). Then, the complete system is represented by the cascaded system in (37), and the origin of the cascaded system is uniformly globally asymptotically stable (UGAS), which ensures the asymptotic convergence of the tracking error.
Proof. The proof follows along the lines of the proof of [Borlaug et al., 2019a, Theorem 1], but for 6DOF instead of for 2DOF. Analysis of subsystem 1, with e 1 = 0 and e 2 = 0: With e 1 = 0 and e 2 = 0, subsystem 1 can be written as This can then be divided into two subsystems: where [Loría and Panteley, 2005, Lemma 2.1] can be used. Subsystem Σ 11 with σ e = 0 is analysed first, which is clearly a globally exponentially stable linear system, but since we will need a Lyapunov function to analyse this system when σ e ∕ = 0, we use the Lyapunov function candi- 2ξ 2 e for the analysis. The derivative of V 11 yields This indicates that the Lyapunov function satisfies: with k 1 = k 2 = 1 2 , k 3 = 1 and a = 2. Hence, by virtue of [Khalil, 2002, Theorem 4.10], the origin for subsystem Σ 11 with σ e = 0 is globally exponentially stable.
Subsystem Σ 12 has the structure of the STA with adaptive gains. In (Shtessel et al., 2010), a Lyapunov function is proposed for systems with this structure. Here, it is proven that the Lyapunov function proposed is indeed a Lyapunov function for subsystem Σ 12 and that for any initial conditions, σ e ,σ e →0 in finite time by using the STA with adaptive gains given by Eq. (20) and Eq. (21), where ε, λ, γ 1 and ω 1 are arbitrary positive constants. The sliding surface σ e = 0 is also proven to be reached in finite time. Now, since the subsystem is GFTS and autonomous, it is also UGAS by [Polyakov and Fridman, 2014, Proposition 2 and Proposition 3], which also implies that ||σ e (t)|| < β 1 ∀t ≥ 0.
To verify that the solutions of Σ 1 are uniformly globally bounded (UGB), subsystem Σ 11 must be analysed with σ e ∕ = 0. The derivative of the Lyapunov function V 11 is then as follows: where 0 < θ < 1. The solutions are then UGB because the conditions of [Khalil, 2002, Theorem 4.18] are satisfied. Consequently, the conditions of [Loría and Panteley, 2005, Lemma 2.1] are satisfied, which implies that the origin of subsystem Σ 1 is UGAS. Analysis of subsystem 2: In (Moreno, 2012) a Lyapunov function is proposed for a third-order observer. The Lyapunov function is proven to be radially unbounded and positive definite and that it is a Lyapunov function for subsystem Σ 2 , whose trajectories converge in finite time to the origin e = 0 for every value of is bounded by assumptions, the origin is GFTS for every value of Ḟ (t), which means that the origin is also UGAS by [Polyakov and Fridman, 2014, Proposition 2 and Proposition 3], which in turn implies ||e(t)|| ≤ β 2 ∀t ≥ 0.
Analysis of the complete system: To analyse the complete system [Loría and Panteley, 2005, Lemma 2.1] is used. To check if the solutions of the complete system are UGB, the boundedness of ξ e must be evaluated when e 1 ∕ = 0 and e 2 ∕ = 0, and for this, the Lyapunov function V 11 is used. Note that the boundedness of σ e follows from Σ 12 being UGAS because Σ 12 is not perturbed by Σ 2 .
where 0 < θ < 1. The solutions are then UGB because the conditions of [Khalil, 2002, Theorem 4.18] are satisfied. Consequently, the conditions of [Loría and Panteley, 2005, Lemma 2.1] are satisfied, which implies that the complete system is UGAS.

Generalized super-twisting algorithm
In this section, two tracking control laws for the AIAUV based on the GSTA will be presented: one where only the GSTA is used, and one where the GSTA is combined with an HOSMO. These control laws were derived and proven to achieve the tracking control objective in (Borlaug et al., 2020), but we briefly present them here for completeness.

Control law based on the GSTA
In this subsection, the tracking control law for the AIAUV using the GSTA will be presented. In (Borlaug et al., 2020), the control input that achieves the tracking control objective was found to be where p is defined as in (14), T q (p) is defined as in (16), σ is defined as in (17) and u GSTA (σ) is defined as in (Castillo et al., 2018): where where ⌠a⌡ b = |a| b sgn(a), where b is a constant, and k 1 ∈ R 6+(n− 1) , k 2 ∈ R 6+(n− 1) and β GSTA ∈ R 6+(n− 1) are controller gains. Note that the mathematical operations in (45) and (46) are performed in an element-wise manner. The two extra terms in φ 2 (σ) compared to the STA with adaptive gains in (19) provide one more parameter to adjust when designing the GSTA gains: k 1 , k 2 and β GSTA . The linear growth term β GSTA σ in φ 1 helps to counteract the effects of state-dependent perturbations, which can exponentially increase in time. In (Borlaug et al., 2020), it was proven that the control input (44) makes the closed-loop system UGAS and that the tracking errors for the complete system converge asymptotically to zero.

Control law based on the GSTA with a higher-order sliding mode observer
In this subsection, the tracking control law for the AIAUV using the GSTA combined with an HOSMO is presented. The HOSMO that is used is the third-order SMO presented in Sec. 3.1.2. In (Borlaug et al., 2020), the control input that achieves the tracking control objective was found to be where σ is as in (31) and where u GSTA (σ) is defined as in (Castillo et al., 2018), i.e., (45). In (Borlaug et al., 2020), it was proven that the control input (44) makes the closed-loop system UGAS and that the tracking errors for the complete system converge asymptotically to zero.

PID controller
To benchmark the two SMC algorithms, we also include a PID controller in the comparison. Therefore, in this section, we propose two tracking control laws for the AIAUV based on the PID controller: one where we assume that the velocity is known, and one where we use the estimated velocity from the HOSMO.

Control law based on the PID controller
In this subsection, the tracking control law for the AIAUV using the PID controller is presented. The control input when the PID controller is used is defined as where ξ e is defined as in (10) and ζ = ζ − ζ d , where ζ and ζ d are defined as in (3) and (4), respectively. The constants k p , k d and k i are controller gains.

Control law based on the PID controller combined with a higherorder sliding mode observer
In this subsection, the tracking control law for the AIAUV using the PID controller with the estimated velocity from the HOSMO is presented. The control input when the PID controller with the velocity from the third-order SMO from Sec. 3.1.2 is used can be found as where ξ e is defined as in (10) and ζ = J e (η 2 ) − 1x 2 − ζ d , where x 2 and ζ d are defined as in (26) and (4), respectively. The constants k p , k d and k i are controller gains.

Simulation results
In this section, we present the implemented simulation model, the test cases and the simulation results for trajectory tracking using the control laws presented in Sec. 3.

Implementation
The AIAUV model is implemented using the method described in (Schmidt-Didlaukies et al., 2018) in MATLAB Simulink together with the controllers. The implemented AIAUV is based on the Eelume robot, Fig. 1, which is the robot used in the experiments presented in Sec. 5. The AIAUV has n + 1 = 9 cylindrical links with a radius of 0.09 m, n = 8 revolute joints and m = 7 thrusters. The link frames are right-hand coordinate systems, in which the completely outstretched robot is placed such that the x-axes point forward and the z-axes point upwards. In Table 1, the properties of each link are presented. In the thrusters column, "2: Z, Y" means that the link has 2 thrusters, one imposing a force in the z-direction and one imposing a force in the y-direction. The maximum thrust of each thruster is approximately 50 N. Joints 1, 3, 5 and 7 rotate around the z-axis, and joints 2, 4, 6 and 8 rotate around the y-axis. The joint rotation occurs in the link frame of the corresponding link, i.e., joint 1 rotates around the z-axis of link 1.
To ensure a valid comparison between the simulations and the experiments, we use a P-controller for the joints. The reason for this choice is that the Eelume robot has an internal joint controller, which is a Pcontroller. To create a continuous trajectory, we do not use inverse kinematic control, as in (Borlaug et al., 2018) and (Borlaug et al., 2019b); rather, we use a filter to generate a continuous trajectory between setpoints. The reason is that the joint controller on the Eelume robot we used is not sufficiently precise to satisfy the assumption that q = q d , which is a prerequisite for the inverse kinematic control to perform properly. The thruster allocation matrix is implemented as proposed in (Sverdrup-Thygeson et al., 2018). For the simulations, the ode3 fixed-step solver with a step size of 0.002 was used.

Simulation cases
In this section, we describe the different test cases considered in the simulations. To validate and compare the control laws presented in Sec. 3, we created two different test cases to represent the operation mode, a mode that is thoroughly explained in (Sverdrup-Thygeson et al., 2018). In operation mode, we perform inspection and intervention tasks; therefore, accuracy is extremely important. The robot that we used during the experiments is unactuated in roll when the AIAUV is straight (all joint angels are equal to zero), and accurate control of rolling when the robot is straight is therefore not possible. We therefore found a shape, which we call C-shape, where the robot is actuated in every DOF such that we can perform accurate control in every DOF. We therefore have one test case called C-shape, which is explained in detail in Sec. 4.2.1. We also wanted to include a test case where the robustness of the algorithms would be evaluated. We therefore wanted to introduce some disturbance in our second test. However, we do not have access to a tank where we can introduce current. We therefore introduce disturbance by using the joints. Thus, the second test case is the C-shape with a moving head, which is explained in detail in Sec. 4.2.2. This test captures operation mode where the robot performs an inspection by looking around in a circular motion with its head, and the motion also introduces a disturbance.
The reference trajectories for the position and orientation used for the two test cases are shown in Fig. 5. The references for x, y and ψ are changed at 100 s, and at 300 s, the references for z and θ are changed.
The references for x, ψ and θ are also changed at 450 s and for x, y and z at 600 s. The reference value for z is, however, slightly different from case to case because during the experiments, we observed that some of the joints were emerging from the water and creating problems for the measurement system when we started the trajectory at − 1 for the Cshape with a moving head. The reference value for z is therefore as in Fig. 5 for the C-shape, i.e., the reference value starts at − 1 and changes to − 0.7, whereas for the C-shape with a moving head, the reference value starts at − 0.7 and changes to − 0.5. The z reference for the Cshape with a moving head when the control law with the HOSMO is used is also changed at 100 s, i.e., the reference value starts at − 1, changes to − 0.7 at 100 s, and then changes to − 0.5 at 300 s.

C-shape
In the C-shape configuration, the AIAUV is shaped like a C. In this shape, the AIAUV is actuated in every DOF since the thrusters are oriented such that the robot can provide thrust in all 6DOFs, and the C-shape is therefore ideal for the operation mode. In the C-shape, the joint angles references are set to q d = [45deg 0deg 45deg 0deg 45deg 0deg 45deg 0deg] T , and in Fig. 6, the configuration of the robot is shown.

C-shape with a moving head
The case of the C-shape with a moving head is almost identical to the C-shape case, but in this case, we move the head of the AIAUV around. Specifically, joint nr. 7 and joint nr. 8 are moved such that the camera positioned at joint nr. 8 (the head), is looking around. The joint angles together with their reference trajectories for the C-shape with a moving head are presented in Fig. 7.

Simulation results
In this section, the results from the performed simulation test cases are presented. To ensure that the comparison between the simulations and experiments is as fair as possible, the gains used during the simulations are the gains found during the experiments. The gains for the STA with adaptive gains and the HOSMO are presented in Table 2; for the GSTA and the HOSMO, the gains are presented in Table 3; and for the   Table 4. For the SMC algorithms, the gains for the HOSMO, L, are different from those used during the experiments for the C-shape and the C-shape with a moving head because we observed chattering in the simulations when we used L = 0.01, which was not experienced in the experiments.
The trajectory tracking results using the control laws from Sec. 3.1.1, Sec. 3.2.1 and Sec. 3.3.1, i.e., without the HOSMO, are presented in Fig. 8. The trajectory tracking results include both the position errors and the orientation errors for both test cases. The corresponding thruster forces are shown for the C-shape in Fig. 9 and for the C-shape with a moving head in Fig. 10. In Table 5, the root mean square error (RMSE) and maximum error for the position and orientation are given for each control law without the HOSMO and for both simulation test cases, i.e., the C-shape and the C-shape with a moving head. In Table 6, the root mean square (RMS) for the thruster forces and the derivative of the thruster forces are given for each control law without the HOSMO and for both simulation test cases. The RMS of the thruster forces provides an idea of how much force is used, and the RMS of the derivative of the thruster forces provides a measure of how much chattering is present in the thruster forces. The trajectory tracking results using the control laws from Sec. 3.1.2, Sec. 3.2.2 and Sec. 3.3.2, i.e., with the HOSMO, are presented in Fig. 11. The corresponding thruster forces are shown for the C-shape in Fig. 12 and for the C-shape with a moving head in Fig. 13. In Table 7, the RMSE and maximum error for the position and orientation are given for each control law with the HOSMO and for both simulation test cases. In Table 8, the RMS for the thruster forces and the derivative of the thruster forces are given for each control law with the HOSMO and for both simulation test cases. In Fig. 14 and Fig. 15 the estimation errors for the HOSMO are shown for the C-shape and the C-shape with a moving head, respectively. The first sub-plot shows e 1 = x 1,e −x 1 , and the second sub-plot shows e 2 = x 2,e −x 2 . Note that if higher gains had been used in the simulations, the results would have improved, at least for the GSTA.

Discussion
As shown in Fig. 8, the AIAUV follows the given position and orientation very well for both test cases as all errors are usually below 0.5 − 2 cm in position and 1 − 3deg in orientation, when the control laws from Sec. 3.1.1, Sec. 3.2.1 and Sec. 3.3.1, i.e., without the HOSMO, are used. This result indicates that all the control laws are applicable. As shown in Figs. 8a and 8b, in the C-shape case, the STA with adaptive gains provides the lowest error and therefore the best result overall, and the GSTA provides the second best results. The reason why the STA with adaptive gains provides better results than the GSTA is likely because it adaptively finds the best gains, whereas the GSTA must be tuned manually. However, if we more closely examine some of the results for φ and θ, we do find that for φ, the GSTA provides the lowest error, and for θ, GSTA and PID provide a slightly lower error than the STA with adaptive gains. From Figs. 8c and 8d, we observe the same tendencies for the C-shape with a moving head as for the C-shape case, i.e., in x, y, z and ψ, the STA with adaptive gains provides the smallest error, and the GSTA is the second best. However, for φ and θ, the errors are much more similar. Examining Table 5 confirms what we can observe from Fig. 8, i.   Fig. 7. Simulation: The joint angles and their reference trajectories for the C-shape with a moving head.    Borlaug et al. Ocean Engineering 222 (2021) 108480 e., that the STA with adaptive gains provides the smallest position errors, with an RMSE value of 0.0008 m for the C-shape and 0.0019 m for the C-shape with a moving head, and that the GSTA is the second best, with an RMSE value of 0.0054 m for the C-shape and 0.0068 m for the Cshape with a moving head, while the PID controller gives the largest position errors, with an RMSE value of 0.0087 m for the C-shape and 0.0115 m for the C-shape with a moving head. For the orientation errors however, the GSTA gives an RMSE value of 0.0114 rad for the C-shape and 0.0193 rad for the C-shape with a moving head, while the STA with adaptive gains gives an RMSE value of 0.0116 rad for the C-shape and 0.0228 rad for the C-shape with moving head, so the results are much more similar, and the GSTA actually provides slightly better results. The PID controller clearly offers the worst tracking performance for orientation, with an RMSE value of 0.0154 rad for the C-shape and 0.0249 rad for the C-shape with a moving head. We see the same results for the maximum error value. If we take the thruster use of the different algorithms into consideration, presented in Figs. 9 and 10, we find that for both test cases, the STA with adaptive gains uses more force than the GSTA and the PID controller, while the GSTA and the PID use very similar amounts of force. However, the RMS of τ thr in Table 6 shows that over time, the amount of force used is not actually very different. The STA with adaptive gains uses slightly more force in the C-shape case, with an RMS value of 2.16, while the GSTA and the PID controller uses a very similar amount of force with RMS values of 1.84 and 1.80, respectively. For the case of the C-shape with a moving head, however, all the algorithms use a very similar amount of force with RMS values between 1.87 − 1.91. From the RMS values of τ thr , we find that the most chattering occurs in the control input from the STA with adaptive gains, with RMS value of 5.32 for the C-shape and 2.19 for the C-shape with a moving head, and that less chattering occurs in that from the GSTA, with RMS value of 5.05 for the C-shape and 0.31 for the C-shape with a moving head, while the control input from the PID controller shows the least rapid changes in the thrust forces, with RMS value of 0.74 for the Cshape and 0.67 for the C-shape with a moving head. However, the value of the RMS of τ thr is so small that the chattering that is introduced by the STA with adaptive gains is negligible. From Figs. 14 and 15 we can see that the estimation errors for the HOSMO are quite small, the HOSMO is therefore applicable for state estimation. When the control laws with the HOSMO are used, i.e., the control laws from Sec. 3.1.2, Sec. 3.2.2 and Sec. 3.3.2, we observe the same tendencies in Fig. 11 as when the control laws without the HOSMO are used. As shown in Figs. 11a and 11b, the STA with adaptive gains provides the smallest errors for x, y, z and ψ, and the GSTA yields the second smallest errors. For φ, however, the GSTA provides the smallest error, while the STA with adaptive gains results in oscillations. For θ, the results are more similar between the STA with adaptive gains and the GSTA, while the PID controller gives rise to a larger error. As shown in Figs. 11c and 11d, the results for the C-shape with a moving head are the same as those for the C-shape case, except that the results for φ and θ are now more similar. Examining Table 7 confirms what we can observe from Fig. 11, i.e., that the STA with adaptive gains provides the best results for position, with an RMSE value of 0.0009 m for the C-shape and 0.0032 m for the C-shape with a moving head, and that the GSTA is the second best, with an RMSE value of 0.0059 m for the C-shape and 0.0075 m for the C-shape with a moving head, while the PID controller gives the largest position errors, with an RMSE value of 0.0083 m for the C-shape and 0.0112 m for the C-shape with a moving head. For the orientation errors however, the GSTA gives an RMSE value of 0.0072 rad for the C-shape and 0.0125 rad for the C-shape with a moving head, while the STA with adaptive gains gives an RMSE value of 0.0078 rad for the C-shape and 0.0198 rad for the C-shape with moving head, so the results are much more similar, and the GSTA actually provides slightly better results. The PID controller clearly offers the worst tracking performance for orientation, with an RMSE value of 0.0147 rad for the Cshape and 0.0245 rad for the C-shape with a moving head. We see the same results for the maximum error value. If we take the thruster use of the different algorithms into consideration, presented in Figs. 12 and 13, we find that the STA with adaptive gains also uses more force for both test cases, whereas the GSTA and the PID controller use quite similar amounts of force. Over time, however, as seen in Table 8 from the RMS value of τ thr , the amount of force used is not actually very different. The STA with adaptive gains uses slightly more force in the C-shape case, with an RMS value of 2.25, while the GSTA uses the second most amount of force with an RMS value of 2.11, while the PID controller uses the least amount of force with an RMS value of 1.82. For the C-shape with a moving head however, the GSTA actually uses the most amount of force with an RMS value of 2.22, and the STA with adaptive gains uses the second most amount of force with an RMS value of 2.05. The PID controller does however, also for the C-shape with a moving head case use the least amount of force with an RMS value of 1.89. From the RMS values of τ thr , we find that the most chattering occurs in the control input from the STA with adaptive gains, with RMS value of 15.78 for the Cshape and 9.48 for the C-shape with a moving head, and that less chattering occurs in that from the GSTA, with RMS value of 10.99 for the C-shape and 7.90 for the C-shape with a moving head, while the control input from the PID controller shows the least rapid changes in the thrust forces, with RMS value of 1.43 for the C-shape and 1.37 for the C-shape with a moving head. However, the value of the RMS of τ thr is so small that the chattering that is introduced by the STA with adaptive gains is negligible. Fig. 9. Simulation: Thruster forces used in the C-shape when the control laws without the HOSMO are used. Fig. 10. Simulation: Thruster forces used in the C-shape with a moving head when the control laws without the HOSMO are used. i.e., when the HOSMO is used, by comparing Table 5 with Table 7,  Table 6 and Table 8, we find that when the HOSMO is used, we obtain better tracking results for the orientation for all the algorithms, as well as better tracking for position when the PID controller is used. Additionally, note that the difference between the position errors, i.e., with and without the HOSMO, is smaller than the difference between the orientation errors, i.e., the control laws with the HOSMO provide the best performance overall. The reason for the better tracking performance is likely due to the increase in thruster use. The thruster use is, however, well within the boundaries of what the Eelume AIAUV can provide, which is 50 N.
To conclude, we find that we obtain the best tracking performance in position by using the STA with adaptive gains, and the GSTA provides the best tracking performance in orientation. If we simultaneously consider the errors for position and orientation, we find that the STA with adaptive gains provides the best tracking performance, but a large difference does not occur between the STA with adaptive gains and the GSTA. The reason for this difference is likely that we have to tune the GSTA manually, whereas the method with adaptive gains adaptively finds the best gains and thus has an advantage. If we use the HOSMO to estimate the linear and angular velocities in the control laws, we improve our results.

Experimental investigation
This section describes the Eelume robot used during the experiments, the experimental set-up and the obtained results.

The Eelume robot
The AIAUV robot "Eely", which was used during the experiments, was the first AIAUV created by the Eelume company, and the AIAUV is described in detail in (Liljebäck and Mills, 2017), which is the AIAUV on which the implemented simulation model is based. The Eelume AIAUV has internal joint controllers, which are P-controllers. Therefore, during the experiments, we could only provide a desired joint reference q d to the AIAUV. We thus also used a P-controller in the simulations, as explained in Sec. 4.1, for the fairest possible comparison between the simulations and experiments.

Experimental set-up
We performed the experiments at the MC-lab at NTNU, Trondheim, Norway (Marine cybernetics labora, 2018). The tank located in the MC-lab has the following dimensions: length of 40m, height of 1.5m and width of 6.45m. The underwater motion capture system from Qualisys (Qualisys-motion capture s, 2018) is installed in the basin to provide us with real-time measurements of the position and orientation of the base of the AIAUV. The Qualisys system has six identical cameras, allowing us to track reflective markers attached to the base of the AIAUV underwater, as shown in Fig. 16. The cameras allow us to track the reflective markers inside a working area with dimensions of 10m × 1.35m × 5.45m.
The system structure used during the experiments is illustrated in Fig. 17. The six cameras (indicated by blue boxes in Fig. 17), tracked reflective markers in the working area (indicated by the red box in Fig. 17). The Qualisys system or camera positioning system sent the measured position and orientation from an external computer, to which the Qualisys system was connected, through the User Datagram Protocol (UDP) to LabView 2016. LabView was then connected to the AIAUV  Fig. 11. Simulation: Trajectory tracking results using the control laws with the HOSMO.
through an optical fibre cable and through UDP to another computer running MATLAB Simulink with the dynamic controller; thruster allocation, which was implemented as in (Sverdrup-Thygeson et al., 2018); and the reference generator. The computer running MATLAB Simulink received the measured position and orientation, and if the control laws without the HOSMO were used, also an estimate of the linear and angular velocities, which were estimated by using a simple Kalman filter. When the control laws with the HOSMO were used, the linear and angular velocities were estimated by the HOSMO in the dynamic controller. The computer running MATLAB Simulink then sent the thrust commands and the desired joint angles back to LabView through UDP. These were then passed through to the AIAUV through the optical fibre cable. The trajectories for the position and orientation of the base of the AIAUV and the joints were generated by setting setpoints and then using a filter to create a continuous trajectory between them.

Test cases
The test cases considered during the experiments are the test cases that were explained in Sec. 4.2 and reproduced in the simulations, i.e., the C-shape and the C-shape with a moving head.

Experimental results
In this section, the results from the experiments are presented. All three algorithms, i.e., the STA with adaptive gains, the GSTA and the PID controller, were easy to apply successfully in the experiments, and none of them required much effort in tuning. In the experiments, we increased Fig. 14. Simulation: Estimation errors for the HOSMO during C-shape (the first sub-plot shows e 1 = x 1,e −x 1 , and the second sub-plot shows e 2 = x 2,e −x 2 ).

Fig. 15.
Simulation: Estimation errors for the HOSMO during C-shape with a moving head (the first sub-plot shows e 1 = x 1,e −x 1 , and the second sub-plot shows e 2 = x 2,e −x 2 ).
the gains until we observed that the AIAUV started to oscillate around the reference instead of following it. The gains that we chose therefore create a small deviation from the reference rather than oscillations around the reference. If we would have chosen more aggressive (higher) gains, the AIAUV would have oscillated. These oscillations might be caused by delays in the thrusters. For all the algorithms, we attempted to use the same gains for both test cases, i.e., we attempted to find the best possible gains for the C-shape, and then we used the same for the Cshape with a moving head for a fair comparison. For the STA with adaptive gains, the choice of gains is not very important because the gains will adapt to their best possible values by themselves. We did, however, observe that if we chose the initial adaptive gains to be too high, the Eelume AIAUV started to oscillate. We therefore had to use lower gains when the HOSMO was used in the case of the C-shape with a moving head likely because when the HOSMO was used, the thruster forces increased. The gains for the STA with adaptive gains and the HOSMO are presented in Table 2; for the GSTA and the HOSMO, the gains are presented in Table 3; and for the PID controller, the gains are listed in Table 4. Note that for the SMC algorithms, the HOSMO gain L was chosen as L = 0.01 in the experiments.  The trajectory tracking results using the control laws from Sec. 3.1.1, Sec. 3.2.1 and Sec. 3.3.1, i.e., without the HOSMO, are presented in Fig. 18. The trajectory tracking results include both the position errors and the orientation errors for both test cases. The corresponding thruster forces are shown for the C-shape in Fig. 19 and for the C-shape with a moving head in Fig. 20. Note that the thruster forces shown are the output from the control scheme, i.e. the desired thruster forces, since we are not able to measure the actual force of the thrusters or the thruster speed. In Table 9, the RMSE and maximum error for the position and orientation are given for each control law without the HOSMO and for both test cases. In Table 10, the RMS for the thruster forces and the derivative of the thruster forces are given for each control law without the HOSMO and for both test cases. The trajectory tracking results using the control laws from Sec. 3.1.2, Sec. 3.2.2 and Sec. 3.3.2, i.e., with the HOSMO, are presented in Fig. 21. The corresponding thruster forces are shown for the C-shape in Fig. 22 and for the C-shape with a moving head    Fig. 23. In Table 11, the RMSE and maximum error for the position and orientation are given for each control law with the HOSMO and for both test cases. In Table 12, the RMS for the thruster forces and the derivative of the thruster forces are given for each control law with the HOSMO and for both test cases. Note that the simulation study indicates that if higher gains could have been used without causing oscillations, then the tracking accuracy would have been improved.

Discussion
As shown in Fig. 18, the AIAUV follows the given position and orientation very well for both test cases, as all errors are usually below 1 − 4 cm in position and 2 − 5deg in orientation, when the control laws from Sec. 3.1.1, Sec. 3.2.1 and Sec. 3.3.1, i.e., without the HOSMO, are used. As shown in Fig. 18a, in the C-shape case, the STA with adaptive gains provides the best results for the position. The GSTA and PID controller have much more similar results for the position as the GSTA has almost as large position errors as the PID controller; however, we do observe that the position errors for the PID controller oscillate more than the position errors for the GSTA. As shown in Fig. 18b, for the orientation, the results are more similar for all algorithms. From Figs. 18c and 18d, the same tendencies are observed for the C-shape with a moving head as for the C-shape case, i.e., for the position, the STA with adaptive gains achieves the smallest error, whereas for the orientation, the tracking performance is more similar. Examining Table 9 confirms what we find from Fig. 18, i.e., that the STA with adaptive gains achieves the smallest position errors, with an RMSE value of 0.0054 m for the C-shape and 0.0121 m for the C-shape with a moving head, and that the GSTA is the second best, with an RMSE value of 0.0133 m for the C-shape and 0.0327 m for the C-shape with a moving head, while the PID controller gives the largest position errors, with an RMSE value of 0.0158 m for the C-shape and 0.0392 m for the C-shape with a moving head. For the orientation errors however, the GSTA gives an RMSE value of 0.0210 rad for the C-shape and 0.0216 rad for the C-shape with a moving head, while the STA with adaptive gains gives an RMSE value of 0.0163 rad for the C-shape and 0.0255 rad for the C-shape with moving head, so the STA with adaptive gains gives the best results for the C-shape, and the GSTA gives the best results for the C-shape with a moving head. The PID controller actually also gives better results than the GSTA for the Cshape case, with an RMSE value of 0.0194 rad, while for the C-shape with a moving head the PID controller gives the worst tracking performance in orientation with an RMSE value of 0.0362 rad. We see the same results for the maximum error value. The reason why the STA with adaptive gains outperforms the two other algorithms is likely because it has adaptive gains and is therefore robust against tuning. If we take the thruster use of the different algorithms into consideration, by looking at Figs. 19 and 20, we find that for both test cases, the STA with adaptive gains uses more force than the GSTA and the PID controller and that the GSTA uses more force than the PID controller. However, based on the RMS value of τ thr , Table 10 shows that over time, the amount of force used is not actually very different. In the C-shape case, the STA with adaptive gains uses slightly more force, with an RMS value of 1.94, than the GSTA, that has an RMS value 1.82, and the GSTA uses more force than the PID controller. that has an RMS value of 1.44. In the case of the C-shape with a moving head, however, the GSTA and the PID controller uses very similar amounts of force, with RMS values of 2.18 and 2.14, respectively, while the STA with adaptive gains uses more, with an RMS value of 2.76. From the RMS values of τ thr , we find that the most chattering occurs in the control input from the STA with adaptive gains, with RMS value of 2.95 for the C-shape and 7.24 for the C-shape with a moving head, and that less chattering occurs in that from the GSTA, with RMS value of 1.46 for the C-shape and 1.95 for the C-shape with a moving head, while the control input from the PID controller shows the least rapid changes in the thrust forces, with RMS value of 0.75 for the Cshape and 0.93 for the C-shape with a moving head. However, the value of the RMS of τ thr is so small that the chattering that is introduced by the STA with adaptive gains is almost negligible. The reason why the chattering may appear to be considerable in the plots is because of the time scale used. When the control laws with the HOSMO are used, i.e., from Sec. 3.1.2, Sec. 3.2.2 and Sec. 3.3.2, we observe the same tendencies in Fig. 21 as when the control laws without the HOSMO are used, but we find from Figs. 21a and 21b and from Figs. 21c and 21d that the STA with adaptive gains is no longer clearly better. We also observe that we have some more measurement noise and outliers in the measurements from the measurement system, see for instance the jumps in Figs. 21a and Fig. 21b between 200 s and 300 s. The performance of the algorithm indicates that the algorithms are robust against this noise and the outliers. As shown in Table 11, we have the same results as those when the   HOSMO is not used, i.e., the STA with adaptive gains provides the smallest position errors, with an RMSE value of 0.0064 m for the C-shape and 0.0177 m for the C-shape with a moving head, and that the GSTA is the second best, with an RMSE value of 0.0100 m for the C-shape and 0.0252 m for the C-shape with a moving head, while the PID controller gives the largest position errors, with an RMSE value of 0.0143 m for the C-shape and 0.0394 m for the C-shape with a moving head. For the orientation errors however, the GSTA gives an RMSE value of 0.0062 rad for the C-shape and 0.0147 rad for the C-shape with a moving head, while the STA with adaptive gains gives an RMSE value of 0.0087 rad for the C-shape and 0.0215 rad for the C-shape with moving head, so the results are much more similar, and the GSTA provides slightly better results. The PID controller clearly offers the worst tracking performance for orientation, with an RMSE value of 0.0181 rad for the C-shape and 0.0431 rad for the C-shape with a moving head. From the maximum errors in Table 11, we can see that the measurement noise impacts the maximum error results since if we would have filtered the position measurements such that the peaks/outliers in the measurements were removed, we would have obtained a lower maximum error for all algorithms, particularly the STA with adaptive gains and the GSTA, as some large peak/outliers exist in those measurements. If we take the thruster use of the different algorithms into consideration, presented in Figs. 22 and 23, we find that the STA with adaptive gains uses more force for both test cases and that the GSTA uses more force than the PID controller in the C-shape case, whereas in the case of the C-shape with a moving head, the PID controller and the GSTA use almost the same amount of force. However, as shown in Table 12, the RMS of τ thr indicates that the STA does use more force, with an RMS value of 3.02 for the C-shape and 3.34 for the C-shape with a moving head, than the GSTA, with an RMS value of 1.85 for the C-shape and 2.23 for the Cshape with a moving head, and the PID controller, with an RMS value of 1.71 for the C-shape and 2.09 for the C-shape with a moving head. The GSTA and the PID controller does, however, use a very similar amount of force. From the RMS values of τ thr , we find that the most chattering occurs in the control input from the STA with adaptive gains, with RMS value of 17.49 for the C-shape and 13.51 for the C-shape with a moving head, and that less chattering occurs in that from the GSTA, with RMS value of 4.77 for the C-shape and 5.05 for the C-shape with a moving head, while the control input from the PID controller shows the least rapid changes in the thrust forces, with RMS value of 4.27 for the Cshape and 4.64 for the C-shape with a moving head. However, the value of the RMS of τ thr is so small that the chattering that is introduced by the STA with adaptive gains is negligible. The reason why considerable chattering may be evident in the plots is again because of the time scale used. If we compare the results obtained with the control laws from Sec. 3.1.1, Sec. 3.2.1 and Sec. 3.3.1, i.e., without the HOSMO, and the results obtained with the control laws from Sec. 3.1.2, Sec. 3.2.2 and Sec. 3.3.2, i.e., when the HOSMO is used, by comparing Table 9 with Table 11,  Table 10 and Table 12, we find that when the HOSMO is used, we obtain better tracking results for the orientation for all the algorithms, as well as better tracking for position when the GSTA is used. Additionally, note that the difference between the position errors, i.e., with and without the HOSMO, is smaller than the difference between the orientation errors, i. e., the control laws with the HOSMO provide the overall best performance. The reason for the better tracking performance is likely due to the increase in thruster use. The thruster use is, however, well within the boundaries of what the Eelume AIAUV can provide, which is 50 N.
If we compare the simulation results (Figs. 8 and 11) and the experimental results (Figs. 18 and 21) for both test cases, we find that the results are quite similar and that all algorithms are applicable with and without the HOSMO to control the AIAUV. We also find that the same algorithms provide the best tracking results in the simulations and the experiments, i.e., the STA with adaptive gains and the GSTA in a good second place. We also observed an improvement in the tracking performance for all algorithms when the HOSMO was used in both simulations and experiments. Of course, the tracking errors, i.e., the position and orientation errors, are larger in the experiments than in the simulations, but that is to be expected because of measurement noise and outliers from the measurements system, thruster dynamics and other unmodelled dynamics. The fact that we did not have feedback from the thrusters likely also affected the errors because we did not necessarily obtain the desired forces from the thrusters.

Conclusions and future research
In this paper, we have presented and compared three different algorithms for solving the trajectory tracking problem for AIAUVs in 6DOF: the STA with adaptive gains, the GSTA and a PID controller. Comprehensive simulation and experimental results for two different test cases, have been presented and used to compare the performance of the three mentioned algorithms. In both the simulations and in the experiments, the STA with adaptive gains provided the best overall tracking performance, but the GSTA was not far from achieving the same tracking results. Thus, the fact that we had to tune the GSTA manually is likely the reason that we achieved lower tracking performance with this algorithm. The STA with adaptive gains is therefore better in practice than the GSTA, but the GSTA is proved to provide global finite-time stability for a larger class of systems.
Furthermore, we have also solved the 6DOF trajectory tracking problem using the three mentioned algorithms in combination with an HOSMO. Additionally, we have proven that the closed-loop system when the STA with adaptive gains is used in combination with a HOSMO is UGAS. The same two test cases were used to obtain comprehensive simulation and experimental results for the three algorithms in combination with the HOSMO. The results have been used to compare the control laws and to study the performance of the HOSMO. When the HOSMO was used to estimate the linear and angular velocities in the control laws, we improved our results, indicating that the HOSMO is indeed applicable for state estimation.
Future work includes proving when Assumption 24 holds. Moreover, identifying and including an HOSMO that works with quaternions is future work, as well as to determine whether adaptive gains can be used with the GSTA. We could then realize both the theoretical advantages afforded by the GSTA and the practical advantages afforded by having adaptive gains.

Declaration of competing interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.