## 3 Proposed Control Methodology  
### Adaptive Backstepping Sliding Mode Algorithm  
From the explanation in Introduction, in this section, the adaptive backstepping sliding mode control is designed to take into account for actuator dynamics to achieve global stability and robustness under the presence of parametric uncertainties or disturbances due to system model error. The overall control scheme is depicted in Figure 3.  
To conveniently derive the backstepping sliding mode algorithm, the dynamics of the manipulator including actuators is rewritten from Equations (1), (5)-(8) as  
\[\left\{ \begin{array}{l}\dot{\mathbf{y}}_{1}=\mathbf{y}_{2}\\ \dot{\mathbf{y}}_{2}=\mathbf{M}^{-1}\Big{(}\mathbf{-C(y_{1},y_{2})y_{2}-G(y_{1 })-\Delta-J^{T}F_{ext}+J_{a}^{T}y_{3}}\Big{)}\\ \dot{\mathbf{y}}_{3}=\mathbf{f(y_{1},y_{2})+gu+\
abla C_{\textit{lank}}}\end{array} \right. \tag{9}\]  
where \(\mathbf{y=}\left( \begin{array}{cccc}\mathbf{y}_{1}&\mathbf{y}_{2}&\mathbf{y }_{3}\end{array} \right)^{T}\)=\(\left( \begin{array}{cccc}\mathbf{q}&\dot{\mathbf{q}}&(\mathbf{A_{a1}P_{a1}-A_{a2}P_{a2}}) \end{array} \right)^{T}\) is a new state vector of the system. \(\mathbf{y}_{1}=\left( \begin{array}{cccc}y_{11}&y_{12}&y_{13}&\ldots&y_{1n} \end{array} \right)^{T}\) denotes vector of measurable position of joints (\(y_{1i}\) means angular position of joint \(i\)th). \(\mathbf{y}_{2}=\left( \begin{array}{cccc}y_{21}&y_{22}&y_{23}&\ldots&y_{2n} \end{array} \right)^{T}\) denotes vector of measurable angular velocity (\(y_{2i}\) mean angular velocity of joint \(i\)th). \(\mathbf{f(y_{1},y_{2})},\mathbf{g,\Psi,C_{\textit{lank}}}\) are defined as the following:  
\[\left\{ \begin{array}{l}\mathbf{f(y_{1i},y_{2i})}\triangleq\left(\begin{array} []{cccc}f_{1}(y_{11},y_{21})&f_{2}(y_{12},y_{22})&\ldots&f_{i}(y_{1i},y_{2i})& \ldots&f_{n}(y_{1n},y_{2n})\end{array}\right)^{T}\\ f_{i}(y_{1i},y_{2i})=\left(\begin{array}{cccc}-A_{\textit{a1i}}\frac{ \partial x_{\textit{a1i}}}{\partial y_{\textit{a1i}}}\dot{q}_{i}\dot{v}_{1i}-A _{\textit{a1i}}\frac{\partial x_{\textit{a1i}}}{\partial\dot{q}_{i}}\dot{q}_{i} \dot{v}_{2i}\end{array}\right)\\ \psi_{1i}=\frac{\beta A_{\textit{a1i}}}{\psi_{1i}+\Delta_{\textit{a1i}}x_{ \textit{a1i}}},\psi_{2i}=\frac{\beta A_{\textit{a2i}}}{\psi_{2i}+A_{\textit{a 2i}}(\Delta_{\textit{a1i}}-x_{\textit{a1i}})}\\ \mathbf{g}\triangleq\textit{diag}\Big{(}\begin{array}{cccc}g_{1}&g_{2}& \ldots&g_{i}&\ldots&g_{n}\end{array}\Big{)}\\ g_{i}=\psi_{1i}\Big{(}s(x_{\textit{a1i}})\sqrt{\frac{2}{\rho}(P_{\textit{a2i}}- P_{\textit{a1i}})}+s(-x_{\textit{a1i}})\sqrt{\frac{2}{\rho}(P_{\textit{a1i}}- P_{\textit{t}})}\Big{)}C_{\textit{d}}\omega K_{\textit{c}i}\\ \hskip 14.226378 pt+\psi_{2i}\Big{(}s(x_{\textit{a1i}})\sqrt{\frac{2}{\rho}(P_{ \textit{a2i}}-P_{\textit{t}})}+s(-x_{\textit{a1i}})\sqrt{\frac{2}{\rho}(P_{ \textit{s}}-P_{\textit{a2i}})}\Big{)}C_{\textit{d}}\omega K_{\textit{c}i}\\ \mathbf{\Psi}\triangleq\textit{diag}\Big{(}\begin{array}{cccc}\mathbf{\Psi}_{ 1}&\mathbf{\Psi}_{2}&\ldots&\mathbf{\Psi}_{i}&\ldots&\mathbf{\Psi}_{n}\end{array} \Big{)}\\ \mathbf{\Psi}_{i}=\left(-(P_{\textit{a1i}}-P_{\textit{a2i}})\psi_{1i}-(P_{ \textit{a1i}}-P_{\textit{a2i}})\psi_{2i}\right)\\ \mathbf{C}_{\textit{lank}}\triangleq\Big{(}\begin{array}{cccc}C_{\textit{lank },1}&C_{\textit{lank},2}&\ldots&C_{\textit{lank},i}&\ldots&C_{\textit{lank},n} \end{array}\right)^{T}\end{array} \right. \tag{10}\]  
Figure 3: Overall control scheme with energy tank for the n-DOF serial hydraulic manipulator. State error is defined as \(\mathbf{e}_{1}=\mathbf{y}_{1}-\mathbf{y}_{1d}\in R^{n}\) and \(\mathbf{e}_{2}=\dot{\mathbf{e}}_{1}=\mathbf{y}_{2}-\mathbf{y}_{2d}\in R^{n}\) where \(\mathbf{y}_{1d},\mathbf{y}_{2d}\in R^{n}\) are the vector of desired angles and angular velocities, respectively. Step 1: the sliding surface is chosen as  
\[\left\{ \begin{array}{l}\mathbf{s}_{1}\mathbf{=}\mathbf{e}_{2}\mathbf{+} \mathbf{\lambda}_{1}\mathbf{e}_{1}\\ \dot{\mathbf{s}}_{1}\mathbf{=}\ddot{\mathbf{e}}_{2}\mathbf{+}\mathbf{\lambda}_ {1}\mathbf{e}_{2}\end{array} \right.