## 3 Control Design  
### Sliding Mode Control with a Backstepping Technique  
In this research, a robust control via the backstepping approach [19] and sliding mode control [32] is designed to control the position of the manipulator. The proposed control is divided into two control loops to control the manipulator dynamic and regulate the hydraulic dynamic. One control is a conventional sliding model [33] which handles the manipulator dynamic to generate the desired torque for the hydraulic control. In the hydraulic dynamic, an ISMC is employed to control torques under the presence of the uncertainties and the nonlinear terms. **Step 1:** The sliding mode control for the manipulator dynamics. Definite state variable errors \(e=x_{1}-x_{1d}\in R^{3\times 1}\), \(\dot{e}=x_{2}-x_{2d}\in R^{3\times 1}\), and \(\ddot{e}=\dot{x}_{2}-\dot{x}_{2d}\in R^{3\times 1}\). The sliding variable vector \(s_{1}=\left[ \begin{array}{cc}s_{11}&s_{12}&s_{13}\end{array} \right]^{T}\in R ^{3\times 1}\) is chosen as follows:  
\[s_{1}=\dot{e}+\lambda_{1}e \tag{10}\]  
where \(\lambda_{1}=diag(\lambda_{11},\lambda_{12},\lambda_{13})\) is a positive-definite matrix. The reference state of the manipulator is defined as  
\[\left\{ \begin{array}{l}x_{2s}=x_{2}-s_{1}=x_{2d}-\lambda_{1}e\in R^{3\times 1 }\\ \dot{x}_{2s}=\dot{x}_{2}-\dot{s}_{1}=\dot{x}_{2d}-\lambda_{1}\dot{e}\in R^{3 \times 1}\end{array} \right. \tag{11}\]  
The derivative of the sliding variable with respect to time is expressed as follows:  
\[\dot{s}_{1}=\ddot{e}+\lambda_{1}\dot{e} \tag{12}\]  
Replacing (10)-(12) into the 2 nd equation of (9) yields:  
\[M_{0}(q)\dot{s}_{1}=J(x_{1})x_{3}-\Delta_{1}(t)-M_{0}(x_{1})\dot{x}_{2s}-C_{0} (x_{1},x_{2})x_{2s}-G_{0}(x_{1})-\frac{1}{2}\dot{M}_{0}(x_{1})s_{1} \tag{13}\]  
The desired torques are chosen as follows:  
\[x_{3d}=J(x_{1})^{-1}\big{(}C_{0}(x_{1},x_{2}\,x_{2s}+G_{0}(x_{1}+M_{0}(x_{1}\, \dot{x}_{2s}-K_{1}s_{1}-\eta\tanh\frac{s_{1}}{\psi_{1}}\Big{)}\Big{)} \tag{14}\]  
where \(K_{1}=diag(k_{11},\ldots,k_{13})\in R^{3\times 3}\) is the positive definite matrix, \(\eta_{1}=diag(\eta_{11},\ldots,\eta_{13})\in R^{3\times 3}\) is the positive definite matrix, it is chosen how to \(\eta_{1i}>|\Delta_{1i}|t||(i=1,\ldots,3)\), and \(\psi_{1}=\left[ \begin{array}{cc}\psi_{11}&\psi_{12}&\psi_{13}\end{array}  \right]^{T}\in R^{3\times 1}\) is a width vector, and \(\tanh\left(\frac{s_{1}}{\psi_{1}}\right)\) is defined in Appendix C.  
Definite the torque error vector  
\[e_{3}=x_{3}-x_{3d} \tag{15}\]  
with \(e_{3}=\left[ \begin{array}{cc}e_{31}&e_{32}&e_{33}\end{array} \right]^{T}\in R^{3 \times 1}\). To prove to the stability and robustness of the manipulator, the Lyapunov candidate function is chosen as follows:  
\[V_{1}(s_{1})=\frac{1}{2}{s_{1}}^{T}M_{0}s_{1} \tag{16}\]  
The derivative of the Lyapunov functions is presented as follows:  
\[\dot{V}_{1}(s_{1})={s_{1}}^{T}M_{0}\dot{s}_{1}+\frac{1}{2}{s_{1}}^{T}\dot{M}_{ 0}s_{1} \tag{17}\]  
Putting the Equations (14)-(16) into Equation (17) can yield to:  
\[\dot{V}_{1}(s_{1})={s_{1}}^{T}e_{3}-{s_{1}}^{T}K_{1}s_{1}+{s_{1}}^{T}\bigg{(} \Delta_{1}(t)-\eta_{1}\text{tanh}\bigg{(}\frac{s_{1}}{\psi_{1}}\bigg{)}\bigg{)} \tag{18}\]  
The sliding variable, \(s_{1}\), will converge to zero when the derivative of the Lyapunov function will be a negative semi-definite function. To ensure this condition, a robust control for the hydraulic dynamic is developed to guarantee that the torque error, \(s_{2}\), will be bounded by \(\varepsilon\). **Step 2:** Design the control, to assure the torque error is as small as possible. The integral sliding mode control is chosen as  
\[s_{2}=e_{3}+\lambda_{2}z_{3} \tag{19}\]  
where \(\lambda_{2}=diag(\lambda_{21},\lambda_{22},\lambda_{23})\in R^{3\times 3}\) is an arbitrary positive matrix, and \(z_{3}=\int_{0}^{t}e_{3}(t)dt\in R^{3\times 1}\). The differential of the ISMC is  
\[ \begin{array}{ll}\dot{s}_{2}&=\dot{x}_{3}-\dot{x}_{3d}+\lambda_{2}e_{3}\\ &=F_{1}(x)+F_{2}(x)U(u)+\Delta_{2}(t)-\dot{x}_{3d}+\lambda_{2}e_{3}\end{array}