# RBF Neural Network Based Backstepping Control for an Electrohydraulic Elastic Manipulator
## 3 Control Design
### Backstepping Sliding Mode Control  
**Step 1:** The SMC is developed to make the tracking position error as small as possible. This step produces the virtual reference \(x_{3d}\). The sliding surface is chosen as:  
\[s_{1}=\lambda_{1}e_{1}+e_{2} \tag{17}\]  
where \(\lambda_{1}\) is a non-zero positive constant, \(e_{i}=x_{i}-x_{iid}\), \((i=1,2)\);  
The derivative of the sliding variable is calculated as follows:  
\[\dot{s}_{1}=\lambda_{1}\dot{e}_{1}+\dot{e}_{2}=\lambda_{1}\dot{e}_{1}+g_{1}x_{ 3}+f_{1}+\delta_{1}(t)-\dot{x}_{2d} \tag{18}\]  
Figure 4: Structure of the adaptive backstepping sliding mode control. The virtual reference \(x_{3d}\) is selected as:  
\[x_{3d}=g_{1}^{-1}\Big{(}-\lambda_{1}\dot{e}_{1}+\dot{x}_{2d}-f_{1}-k_{1}s_{1}- \eta_{1}sign(s_{1})\Big{)} \tag{19}\]  
where \(k_{1}\) is an arbitrary positive constant, and \(\eta_{1}\) presents a robust gain of the SMC, \(s_{1}\). The different torque error is defined as follows:  
\[e_{3}=x_{3}-x_{3d} \tag{20}\]  
Considering the Lyapunov function candidate  
\[V_{1}=\frac{1}{2}s_{1}^{2} \tag{21}\]  
The derivative of the Lyapunov function (21) with (18) is shown as follows:  
\[\dot{V}_{1}=s_{1}\dot{s}_{1}=s_{1}\Big{(}c_{1}\dot{e}_{1}+g_{1}x_{3}+f_{1}+ \delta_{1}(t)-\dot{x}_{2d}\Big{)} \tag{22}\]  
Applying the virtual reference \(x_{3d}\) and (20) to the derivative of the Lyapunov function is represented as follows:  
\[\dot{V}_{1}=s_{1}\Big{(}\lambda_{1}\dot{e}_{1}+g_{1}(x_{3d}+e_{3})+f_{1}+ \delta_{1}(t)-\dot{x}_{2d}\Big{)}=-k_{1}s_{1}^{2}+(\delta_{1}(t)-\eta_{1}sign (s_{1}))s_{1}+g_{1}s_{1}e_{3} \tag{23}\]  
**Step 2:** The controller is designed to guarantee that \(e_{3}\) approaches zero. The integral sliding surface is chosen as follows:  
\[s_{2}=e_{3}+\lambda_{2}z_{3} \tag{24}\]  
where \(\lambda_{2}\) is a positive constant, and \(z_{3}=\int_{0}^{t}e_{3}(\tau)d\tau\). Taking the derivative of the sliding variable (24), its result is shown as follows  
\[\dot{s}_{2}=g_{0}u+f_{0}+\delta_{2}(t)-\dot{x}_{3d}+\lambda_{2}e_{3} \tag{25}\]  
Since the virtual reference in (19) includes a discontinuous term, the derivative of the sliding variable in (25) cannot be expressed. In order to deal with this problem, a tan hyperbolic function replaced the discontinuous term. The virtual control (19) is represented as follows:  
\[\dot{s}_{1}=\lambda_{1}\dot{e}_{1}+\dot{e}_{2}=\lambda_{1}\dot{e}_{1}+g_{1}x_{ 3}+f_{1}+\delta_{1}(t)-\dot{x}_{2d} \tag{18}\]0  
The control is chosen as:  
\[\dot{s}_{1}=\lambda_{1}\dot{e}_{1}+\dot{e}_{2}=\lambda_{1}\dot{e}_{1}+g_{1}x_{ 3}+f_{1}+\delta_{1}(t)-\dot{x}_{2d} \tag{18}\]1  
where \(\phi_{i(i=1,2)}\) are arbitrary positive constants, \(k_{2}\) is arbitrary positive constants, and \(\eta_{2}\) is a robust gain of the SMC, \(s_{2}\). Considering the Lyapunov function candidate:  
\[\dot{s}_{1}=\lambda_{1}\dot{e}_{1}+\dot{e}_{2}=\lambda_{1}\dot{e}_{1}+g_{1}x_{ 3}+f_{1}+\delta_{1}(t)-\dot{x}_{2d} \tag{18}\]2  
where \(\zeta=[s_{1},e_{3},z_{3}]^{T}\), and \(\Omega=\frac{1}{2}\left[ \begin{array}{ccc}1&0&0\\ 0&1&\lambda_{2}\\ 0&\lambda_{2}&\lambda_{2}^{2}\end{array} \right]\). The time derivative of the Lyapunov function (28) is computed as follows:  
\[\dot{V}_{2}=\dot{V}_{1}+s_{2}\dot{s}_{2} \tag{29}\]  
When (25) and (27) are used in (29), the derivative can be rewritten as follows:  
\[