## 3 Discrete-Time 2 DOF Robot Manipulator Model
### Discrete-Time Sliding Mode Controller  
For the present proposal, we assume that the RHONN of Equation (4) can be represented in general nonlinear discrete-time form as follows:  
\[ \begin{split}\chi(k+1)&=f(\chi(k))+B(\chi(k))u(k)+ d(k)\,\\ y(k)&=\chi_{1}(k)\,\end{split}  \tag{9}\]  
where \(\chi(k)\in R^{n}\) is the state vector of the system (neural network state), \(u(k)\in R^{m}\) is the input vector, \(y(k)\in R^{p}\) is the output vector, the vector \(f(\cdot)\) and the function \(B(\cdot)\) are smooth vector fields, and \(d(k)\) is a vector that represents non-modeled dynamics and disturbances. This implies a non-singular transformation of the system in Equation (9), and can thus be represented in a controllable block form as in [26]. The \(r\) block is as follows:  
\[ \begin{split}\chi^{i}(k+1)&=f^{i}(\tilde{\chi}^{i }(k))+B^{i}(\tilde{\chi}^{i}(k))\chi^{i+1}(k)+d^{i}(k)\\ \chi^{r}(k+1)&=f^{r}(\chi(k))+B^{r}(\chi(k))u^{i}(k )+d^{r}(k)\,\\ y(k)&=\chi^{1}(k),\text{ with }i=1,...,r-1, \end{split}  \tag{10}\]  
where \(\chi(k)=[\chi^{1}(k)\;...\;\chi^{i}(k)\;...\;\chi^{r}(k)]^{\top}\), \(d(k)=[d^{1}(k)\;...\;d^{i}(k)\;...\;d^{r}(k)]^{\top}\) and \(\tilde{\chi}^{i}(k)=[(\chi^{1}(k)\;...\;\chi^{i}(k)]^{\top}\), and the sets of numbers \((n^{1},n^{2},...\;n^{r})\), which define the structure of the system in Equation (10), and satisfy \(n^{1}\leq n^{2}...\leq n^{r}\leq m\)[26]. Then, the transformation regarding the tracking error \(z(k)\) is defined as follows:  
\[ \begin{split} z^{1}(k)&=\chi^{1}(k)-\chi^{1d}(k)= \chi^{1}(k)-\chi^{1d}(k)+\Delta^{1}(k),\\ z^{i}(k)&=\chi^{i}(k)-\chi^{id}(k)=\chi^{i}(k)- \chi^{id}(k)+\Delta^{i}(k),\end{split}  \tag{11}\]  
where \(\Delta^{i}(k)\) represents the identification error for the \(i\)-th joint block, and \(\chi^{id}(k)\) is the desired value for \(\chi^{i}(k)\) obtained as follows:  
\[ \begin{split}&\chi^{2d}(k)=\tilde{B}^{1+}\Big{[}k^{1}z^{1}(k)- \tilde{f}^{1}\Big{(}\chi^{1}(k),k\Big{)}\Big{]},\\ &\chi^{i+1d}(k)=\tilde{B}^{i+}\Big{[}k^{i}z^{i}(k)-\tilde{f}^{i} \Big{(}\tilde{\chi}^{i}(k),k\Big{)}\Big{]}.\end{split}  \tag{12}\]It is important to mention that for \(n^{1},n^{2}...,n^{r}>1\), \(\tilde{B}^{i+}=\tilde{B}^{i\top}\left(\tilde{B}^{i}\tilde{B}^{i\top}\right)^{-1}\) is a pseudo-inverse matrix and thus we can guarantee that \(\tilde{B}^{i}\) is non-singular. For our particular case, \(\tilde{B}\) is a scalar (\(\tilde{\alpha}_{1}^{l}\)). Additionally, the fact that the \(K^{i}\) diagonal matrix is made by \(k^{l}\) elements, which constitutes a Schur matrix, means it yields the following expression:  
\[ \begin{split}&\tilde{f}^{1}\Big{(}\chi^{1}(k),k\Big{)}=\tilde{B}^{1 }S^{1}\Big{(}\chi^{1}(k),k\Big{)}-\chi^{1d}(k+1),\\ &\tilde{f}^{i}(\cdot)=\tilde{B}^{i}S^{i}\Big{(}\chi^{1}(k), \cdots,\chi^{i}(k)\Big{)}-\chi^{i-1d}(k+1),\\ & i=2,\cdots,r.\end{split}  \tag{13}\]  
Then, applying the procedure explained in [14], the transformations in Equations (11)-(13) reduce the system in Equation (4) to the following form:  
\[ \begin{split} z_{1}^{l}(k+1)=& k_{1}^{l}z_{1}^{l}(k) +\tilde{\alpha}_{1}^{l}z_{2}^{l}(k)+\tilde{\Delta}_{1}^{l}(k)\\ & z_{2}^{l}(k+1)=&\tilde{f}_{2}^{l}(\chi(k),k)+ \tilde{\omega}_{2}^{l}u^{l}(k)+\tilde{\Delta}_{2}^{l}(k)\,\end{split}  \tag{14}\]  
Then, if we apply the block control technique in the last block of system, Equation (14) yields  
\[z_{2}^{l}(k+1)=\mathbf{k}_{1}^{l}z_{1}^{l}(k)+\tilde{\Delta}_{1}^{l}(k)\, \tag{15}\]  
with the superscript \(l=1,2\) as the \(l\)-th joint, obtaining \(\tilde{f}_{2}^{l}(\chi(k),k)=\omega_{1}^{l}(k)S\Big{(}\chi_{1}^{l}(k)\Big{)}- \chi^{ld}(k+1)\). Each joint has two blocks (\(r=2\)), with \(n^{1}=1\) and \(n^{2}=1\), \(\tilde{\Delta}_{j}^{l}(k)=\Delta_{j}^{l}(k+1)\), and the subscript constitutes the \(j\)-th neural network state. The sliding function \(s_{D}^{l}(k)\) can be derived from the block control transformation in Equation (11), and the last block of Equation (14) can be represented as  
\[