# SMCSPO-Based Robust Control of AUV in Underwater Environments including Disturbances
## 3 Controller and Observer Design  
### Spo  
In this section, the structure of an SPO is briefly discussed [7]. The state space representation of the underwater vehicle dynamics is defined as shown in (20) and (21). \[\dot{\mathbf{X}}_{\mathbf{1}}=\mathbf{X_{\mathbf{2}}}, \tag{20}\]  
\[\dot{\mathbf{X}}_{\mathbf{2}}=\mathbf{A}\mathbf{X_{\mathbf{2}}}+\mathbf{\Lambda}\mathbf{A}(\mathbf{X})+\mathbf{B} \delta+\mathbf{D}(t), \tag{21}\]  
where \(\mathbf{X_{\mathbf{2}}}=\left[u,v,w,p,q,r,\phi,\theta,\Psi\right]=\left[x_{21},x_{22}, x_{23},x_{24},x_{25},x_{26},x_{27},x_{28},x_{29}\right]\) represents the translational velocities, rotational velocities, and the orientations of the vehicle; \(\mathbf{X}=\mathbf{X_{\mathbf{1}}}\) is an observable state variable and is the integral value of \(\mathbf{X_{\mathbf{2}}}\); \(\mathbf{A}\mathbf{X_{\mathbf{2}}}\) and \(\mathbf{\Lambda}\mathbf{A}(\mathbf{X})\) are linear and nonlinear terms of dynamics, respectively; and \(\mathbf{B}\delta\) is the control input matrix of the underwater vehicle. By using the AUV dynamics in (1) to (6) and the defined perturbations terms in (11) to (19), Equation (21) can be expressed in the following matrix form. \[ \begin{bmatrix}\dot{\mathbf{u}}\\ \dot{\mathbf{v}}\\ \dot{\mathbf{v}}\\ \dot{\mathbf{p}}\\ \dot{\mathbf{p}}\\ \dot{\mathbf{\phi}}\\ \dot{\mathbf{\phi}}\\ \dot{\mathbf{\phi}}\\ \dot{\mathbf{\psi}}\\ \end{bmatrix} =\begin{bmatrix}X_{u}^{\prime}/(m-X_{u}^{\prime})&0&0&0&0&0&0&0 &0\\ 0&Y_{v}^{\prime}/(m-Y_{v}^{\prime})&0&0&0&0&0\\ 0&0&Z_{w}^{\prime}/(m-Z_{w}^{\prime})&0&Z_{w}^{\prime}/(m-Z_{w}^{\prime})&0&0&0 &0\\ 0&0&0&X_{w}^{\prime}/(l_{xx}-X_{w}^{\prime})&0&0&0&0&0\\ 0&0&M_{w}^{\prime}/(l_{yy}-M_{\hat{q}}^{\prime})&0&M_{w}^{\prime}/(l_{yy}-M_{ \hat{q}}^{\prime})&0&0&0\\ 0&N_{v}^{\prime}/(l_{xx}-N_{r}^{\prime})&0&0&0&0&N_{r}^{\prime}/(l_{xxPerturbation can be defined as the summation of all nonlinear terms and disturbances in (21), as follows:  
\[\mathbf{\Psi}\mathbf{=}\mathbf{\Delta}\mathbf{A}(\mathbf{X})\mathbf{+}\mathbf{D}(t), \tag{23}\]  
It is assumed that the perturbations are upper-bounded by a known continuous function of state [19]. For convenience, the perturbation terms and the linear terms of the system can be separated from the dynamics. An arbitrary positive number (\(\mathbf{\alpha}_{3}\)) and a new control input (\(\overline{\mathbf{U}}\)) are defined to decouple the control variable. \[\mathbf{A}\mathbf{\bar{X}}_{2}\mathbf{+}\mathbf{B}\delta\mathbf{=}\mathbf{\alpha}_{3}\overline{\mathbf{U}}, \tag{24}\]  
where \(\mathbf{\hat{X}}_{2}\) is the estimated state variable. Throughout the text, \"\(\sim\)\" refers to estimation errors, and \"\(\sim\)\" symbolizes the estimated quantity. By the perturbation and new control input, the state space representation is replaced as follows:  
\[\dot{\mathbf{X}}_{1}=\mathbf{X}_{2}, \tag{25}\]  
\[\dot{\mathbf{X}}_{2}\mathbf{=}\mathbf{\alpha}_{3}\overline{\mathbf{U}}\mathbf{+}\mathbf{\Psi}, \tag{26}\]  
\[\mathbf{Y}\mathbf{=}\mathbf{X}_{1}. \tag{27}\]  
Using (23) and (24), (21) can be simplified as (26). A new state variable (\(\mathbf{X_{3}}\)) for deriving the perturbation from the sliding observer is defined as  
\[\mathbf{X_{3}}\mathbf{=}\mathbf{\alpha}_{3}\mathbf{X}_{2}-\mathbf{\Psi}\mathbf{/}\mathbf{\alpha}_{3}. \tag{28}\]  
The perturbation is calculated using (28).