# Application of Improved Sliding Mode and Artificial Neural Networks in Robot Control
## 2 Application of Improved Sliding Surfaces and Artificial Neural Networks in Robotics
### Estimating Nonlinear Components Using Artificial Neural Networks  
This study employs an RBF neural network to estimate the nonlinear components in Equation (8). The RBF neural network has numerous applications, including function approximation, classification, and system control. Its strengths lie in its simple design structure, ease of training, fast convergence, and the ability to effectively fit any nonlinear function without falling into local optimum solutions [31]. The [5-7-1] structure of the RBF neural network is utilized to estimate the components \(a_{i|i=1,2,3}\) in the matrix \(A_{W}\) of Equation (8) as shown in Figure 3.  
The matrix, \(\mathbf{A}_{W}\), in the control law (8) contains characteristic parameters of the robot such as: the radius of each wheel (\(r\)); the robot's moment of inertia (\(I_{p}\)); and the mass of the robot (\(M\)). The RBF neural network uses the Gradient Descent algorithm for online weight  
Figure 3: RBF neural network structure. value updates. Each neural network contains seven Gaussian functions, and is described as in Equation (17):  
\[h_{ij}=\exp\left(-\frac{\left\|\mathbf{x}_{i}-\mathbf{c}_{ij}\right\|^{2}}{2\mathbf{b}_{ij}^{2 }}\right)\Bigg{|}_{i=1\overline{3},j=\overline{1,7}} \tag{17}\]  
where:  
\[\mathbf{x}_{i}= \begin{bmatrix}\mathbf{x}_{1}\\ \mathbf{x}_{2}\\ \mathbf{x}_{3}\end{bmatrix} = \begin{bmatrix}e(1)&\dot{e}(1)&\mathbf{\Gamma}_{d}(1)&\ddot {\mathbf{\Gamma}}_{d}(1)&\ddot{\mathbf{\Gamma}}_{d}(1)\\ e(2)&\dot{e}(2)&\mathbf{\Gamma}_{d}(2)&\ddot{\mathbf{\Gamma}}_{d}(2)&\ddot{\mathbf{\Gamma}} _{d}(2)\\ e(3)&\dot{e}(3)&\mathbf{\Gamma}_{d}(3)&\ddot{\mathbf{\Gamma}}_{d}(3)&\ddot{\mathbf{\Gamma}} _{d}(3)\end{bmatrix} \]  
\[h_{ij|i=1,2,3}= \begin{bmatrix}h_{i1}&h_{i2}&h_{i3}&h_{i4}&h_{i5}&h_{i6}&h_{i7} \end{bmatrix} \]  
\[w_{ij|i=1,2,3}= \begin{bmatrix}w_{i1}&w_{i2}&w_{i3}&w_{i4}&w_{i5}&w_{i6}&w_{i7} \end{bmatrix} \]  
The output of the neural network is given by Equation (18):  
\[\dot{a}_{i}=\mathbf{w}_{ij}^{T}\mathbf{h}_{ij} \tag{18}\]  
The objective function of the neural network is as Equation (19):  
\[E_{i}(t)=\frac{1}{2}(a_{i}(t)-\dot{a}_{i}(t))^{2};i=1,2,3 \tag{19}\]  
Based on the Gradient Descent method, the weight values of the network are updated as in Equations (20) and (21) [32]:  
\[\Delta w_{j}(t)=-\mu\frac{\partial E}{\partial w_{j}}=\mu(a_{i}(t)-\dot{a}_{i} (t))h_{j} \tag{20}\]  
\[w_{j}(t)=w_{j}(t-1)+\Delta w_{j}(t)+\delta\big{(}w_{j}(t-1)-w_{j}(t-2)\big{)} \tag{21}\]  
where \(\mu\in(0,1)\) is the learning rate and \(\delta\in(0,1)\) is the momentum factor. At this point, the approximated matrix of \(\mathbf{A}_{W}\) is as Equation (22):  
\[\mathbf{\hat{A}}_{W}= \begin{bmatrix}\mathbf{w}_{1j}^{T}\mathbf{h}_{1j}&-\mathbf{w}_{2j}^{T} \mathbf{h}_{2j}\dot{\mathbf{\phi}}&0\\ \mathbf{w}_{2j}^{T}\mathbf{h}_{2j}\dot{\mathbf{\phi}}&\mathbf{w}_{1j}^{T}\mathbf{h}_{1j}&0\\ 0&0&\mathbf{w}_{3j}^{T}\mathbf{h}_{3j}\end{bmatrix}  \tag{22}\]  
The sliding control law based on the improved sliding surface and the RBF neural network for the robot is as Equation (23):  
\[\mathbf{U}_{ISMC-Tanh-RBF}=-\frac{1}{2}\mathbf{B}_{W}^{-1}\Big{[}2\Big{(}\mathbf{\hat{A}} _{W}\mathbf{X}+\mathbf{D}_{f}-\ddot{\mathbf{\Gamma}}_{d}\Big{)}+(\mathbf{\lambda}+2\mathbf{a})\dot {\mathbf{e}}+\mathbf{\alpha}^{2}\mathbf{e}+\eta\text{tanh}\Big{(}\frac{\mathbf{s}}{\mathbf{\varepsilon }}\Big{)}+\mathbf{\kappa s}\Big{]} \tag{23}\]  
When the actual trajectory of the robot deviates from the reference trajectory due to conditions such as road friction, changing inertia, etc., the error, \(\mathbf{e}=\mathbf{\Gamma}-\mathbf{\Gamma}_{d}\), will change. The RBF neural network will then automatically update, leading to changes in \(A_{W}\) so that the errors can be minimized. By using the RBF neural network in law (23), the proposed controller can adapt to the conditions of the robot. To prove the stability of the ISMC-Tanh-RBF control law using the Lyapunov method, we need to show that the Lyapunov function \(V=\frac{1}{2}s^{2}\) decreases over time, ensuring \(\dot{V}\leq 0\).