## 4 Structure of the First Diagram for Robot Control, the Iterative Learning Method
### Algorithm Content According to the First Control Diagram
The uncertainty component of the system, in general, can be estimated and explicitly compensated as follows: First, we must approximate model (9) at time \(i\) in the \(k\) time, then when paid by \(\frac{\xi}{\xi_{k}}(n-1)\), becomes:  
\[\frac{\underline{X}_{k}(n)-\underline{X}_{k}(n-1)}{t_{s}}\approx g\underline{X }_{k}(n)+B\Big{[}\underline{\underline{\theta}}_{k}(n)-\underline{\xi}_{k}(n- 1)+\underline{\xi}_{k}(n)\Big{]}\]  
Hence, \(\underline{g}\underline{X}_{k}(n)\approx\underline{X}_{k}(n-1)+\hat{B}\Big{[} \underline{\underline{\theta}}_{k}(n)-\underline{\xi}_{k}(n-1)+\underline{ \xi}_{k}(n)\Big{]}\Leftrightarrow\hat{B}_{\underline{\xi}k}^{\delta}(n) \approx\underline{l}_{k}(n)\)  
In which: \(\hat{g}=(I_{2n}-t_{s}g),\hat{B}=t_{s}B,\underline{l}_{k}(n)=\underline{g} \underline{X}_{k}(n)-\underline{X}_{k}(n-1)-\hat{B}\Big{[}\underline{\underline {\theta}}_{k}(n)-\underline{\xi}_{k}(n-1)\Big{]}\)  
So, from \(\hat{B}^{T}\hat{B}=t_{s}^{2}I_{n}\), we have the estimated value \(\underline{\xi}_{k}(n)\approx\underline{\xi}_{k}(n)\) for the next offset at time \(n+1\) as:  
\[ \begin{array}{rl}\hat{\underline{\xi}}_{k}(n)&=\big{(}\hat{B}^{T}\hat{B} \big{)}^{-1}\hat{B}^{T}\underline{l}_{k}(n)=\frac{1}{t_{s}^{2}}\hat{B}^{T} \underline{l}_{k}(n)=\frac{1}{t_{s}^{2}}B^{T}\underline{l}_{k}(n)\\ &=\frac{1}{t_{s}}(0_{n},I_{n})\Big{\{}\underline{g}\underline{X}_{k}(n)- \underline{X}_{k}(n-1)-\hat{B}\Big{[}\underline{\underline{\theta}}_{k}(n)- \underline{\xi}_{k}(n-1)\Big{]}\Big{\}}\\ &=\frac{1}{t_{s}}B^{T}[\underline{g}\underline{X}_{k}(n)-\underline{X}_{k}(n- 1)]-\underline{\underline{\theta}}_{k}(n)+\underline{\xi}_{k}(n-1)\end{array}  \tag{13}\]  
The structure of the intelligent control system for industrial robots is shown in Figure 2.  
Below is the Algorithm 1 describing the steps to calculate an iterative learning controller, combined with identifying and compensating uncertain components (with no need to be repetitive) for industrial robots after accurate linearization; after several tries \(k\) is continuous along with the control process and only ends when the control stops. ```
Assign \(t=0,\frac{\xi}{\xi}=0\). Choose \(t_{s}>0\); Calculate \(\hat{g}\), \(S\). Choose \(K\);
1 Assign small value \(x_{0}=0,\underline{\xi}_{k}=0,\underline{\theta}_{k}=col(\underline{\underline {\theta}}_{k}(0),\dots,\underline{\theta}_{k}(S-1))=col(\underline{R}(0),\dots, \underline{R}(S-1))\). while continue the control do
2 for\(n=0,1,\dots,S-1\)do
3 Send \(\underline{\underline{\theta}}(n)-\underline{\xi}\) to into uncertain control (9) and determine \(\underline{X}=\underline{X}(t+nt_{s})\). 4 Calculate \(\underline{\xi}_{k}\gets B^{T}(\underline{g}\underline{X}-\underline{X}_{0} )/t_{s}-\underline{\theta}_{k}(n)+\underline{\xi}\) and \(\underline{X}_{0}\leftarrow\underline{X}\). 5 Establish \(\underline{Y}(n)=(I_{n},0_{n})\underline{X}\) and calculate \(\underline{\underline{\varepsilon}}(n)=\underline{R}(n)-\underline{Y}(n)\). 6 endfor
7 Set up the sum vector \(\underline{\varepsilon}\) t\(\underline{\underline{\varepsilon}}(n)\), \(n=0,1\dots,S-1\) theo (12) Update vector \(\underline{\underline{\theta}}(n)\) from its existing value according to (11) that is, calculate the values \(\underline{\underline{\theta}}(n)\),\(n=0,1,\dots,S-1\) for the next try. 8 Set \(t\gets t+T\)
9 endwhile
```  
**Algorithm 1**The first structure for robot control, the iterative learning method, is with function parameters smart online learning.