## 3 Proposed Error Compensation Method
### Feature Training Using Neural Network  
A non-parametric kinematics calibration is an approach using intelligent algorithms to reduce the position error without modifying robot parameters [9]. Its advantage is that the position is compensated directly, by which the calibration process can be simplified. Several approaches to error compensation without robot parameter modification are introduced in the literature [24; 25]. The real position of the robot can be tracked by using external devices such as a laser tracker, stereo vision, etc. Then, the non-linear approach is used to estimate the error between the actual position and the real position to minimize the error of the robot. In this paper, we proposed an error compensation method based on advanced machine-vision algorithms and neural network to guide the robot to pick the object. Figure 5 shows the difference between the direct and the indirect approach presented in this paper. When applying the indirect approach, the robot's end-effector is set to be interpolated, assuming that the coordinate conversion value from the measuring object to the camera coordinate system is obtained accurately. The transformation from the camera coordinate to the root always has a constant value. In addition, the real position of the end-effector and commanded position \(\frac{\mathbf{B}}{\mathbf{r}}\mathbf{p}_{a}\) from the robot controller is different, so the actual position of the robot controller in the world coordinate frame is defined as:  
\[ \begin{split}\tensor[^{B}_{E}]{\mathbf{P}_{a}}=\mathbf{H}_{W}^{B}\mathbf{H}_{C} ^{W}\mathbf{X}^{-1}\,\end{split}  \tag{13}\]where \(\mathbf{X}\), \(\mathbf{H}_{W}^{B}\in SE(3)\) are obtained from the above, and \(\mathbf{H}_{\text{C}}^{W}\in\ SE(3)\) is calculated from the camera. To collect information from the workspace, the robot moves to all defined 3D grids to obtain images from the camera to determine the position of the object, where the 3D grid is the workspace where the robot will be trained during the error-compensation stage; finally, the actual position of the robot is calculated by the controller and stored in memory. This data is used for training purposes. Figure 6 shows our proposed method. The next step is to perform training using measured data. In this paper, we applied a neural network to estimate the actual location of the robot. Neural networks are currently the state of the art method in machine learning [26]. In our experiment, we used a three-layer feedforward neural network to classify different types of defects. Let \(V=\left(V_{1}^{T},V_{2}^{T},\ldots,V_{m}^{T}\right)^{T}\) be the weight matrix connecting the input and the hidden layers, where \(V_{j}=\left(V_{j1},\ldots,V_{jn}\right)\) for \(j=1,2,\ldots,m\). Let \(W=\left(W_{1}^{T},W_{2}^{T},\ldots,W_{p}^{T}\right)^{T}\) be the weight matrix between  
Figure 5: An indirect method for robot calibration. Figure 6: Indirect method for robot error-compensation. the hidden and the output layers, where \(W_{k}=(W_{k1},\ W_{k2},\ldots,W_{km})\) for \(k=1,\ 2,\ \ldots,\ p\). Given input \(x=\ (x_{1},\ \ldots,x_{n})^{T}\in\ R^{n}\), and the final output vector \(o=\left( \begin{matrix}o_{1},\ \ldots,o_{p}\end{matrix} \right)^{T}\in\ R^{p}\) is given:  
\[o_{k}=f(W_{k}.y-\ b_{k})=f\left(\sum_{j=1}^{m}W_{kj}y_{j}-b_{k}\right)\quad k =1,\ \ldots,p. \tag{14}\]  
where \(\left\{b_{k}\right\}_{k=1}^{p}\) is the biases from hidden to output layers, and \(\boldsymbol{y}=\ (y_{1},\ \ldots,y_{n})^{T}\in\ R^{m}\) is the output of the hidden layer. The distance error is measured based on mean square error, defined as  
\[E(W,V)=\ \frac{1}{2}\sum_{h=1}^{H}\left\|z_{h}-o_{h}\right\|^{2}, \tag{15}\]  
where \(z_{n}=\ (z_{1},\ \ldots,z_{n})^{T}\in\ R^{n}\) is the desired output from the dataset.