A Novel Indirect Calibration Approach for Robot Positioning Error Compensation Based on Neural Network and Hand-Eye Vision

Featured Application: This study aims to improve the absolute position error of robot manipulators for vehicle assembly line without using an expensive external apparatus. Abstract: It is well known that most of the industrial robots have excellent repeatability in positioning. However, the absolute position errors of industrial robots are relatively poor, and in some cases the error may reach even several millimeters, which make it di ﬃ cult to apply the robot system to vehicle assembly lines that need small position errors. In this paper, we have studied a method to reduce the absolute position error of robots using machine vision and neural network. The position / orientation of robot tool-end is compensated using a vision-based approach combined with a neural network, where a novel indirect calibration approach is presented in order to gather information for training the neural network. In the simulation, the proposed compensation algorithm was found to reduce the positional error to 98%. On average, the absolute position error was 0.029 mm. The application of the proposed algorithm in the actual robot experiment reduced the error to 50.3%, averaging 1.79 mm.


Introduction
The repeated and monotonous manual work is continuously reintegrated by flexible manufacturing systems.To build a flexible manufacturing system, adopting an intelligent robot system is essential to distinguish workpieces within a workspace, perceive a situation and manipulate themselves autonomously [1].Among the intelligent robot systems, vision-based robot systems have been developed continuously to improve the quality and efficiency of the manufacturing system such as arc welding, materials handling, painting and even assembly [2][3][4].Especially, picking up an object and assembling it to another subsystem accurately is the most important task in an automated manufacturing system [5][6][7].To do this task correctly, a robot should be calibrated precisely in advance, and then the robot should be connected with visual sensing systems to observe objects and compute the poses of objects.Although industrial robots generally have high-precision repeatability, the absolute position accuracy of them is not so high due to the kinematic error or assembly tolerance of the robot mechanism [8,9].In order to improve accuracy, various approaches have been proposed in the literature based on choosing a mathematical error model for robot calibration.From the actual robot experiment, the partial pose or whole pose data of the robot end-effector is gathered, and then it is used to estimate the real robot kinematic parameters.However, the processes of robot calibration considered in the methods are complex, and high precision measurement devices are required to track the nominal pose and the real pose of the robot end-effector.For small-range 3D measurements, touch probes or telescoping-ball bar devices are commonly used.On the other hand, for large-range measurement camera-based systems, coordinate measuring machines (CMM) and laser trackers are typically used [10][11][12][13][14].However, these types of devices are very expensive to be implemented in robot calibration, and even ineffective.
The conventional robot calibration is often implemented with these convenient devices, but there are still some remaining issues.In fact, the cost of measurement devices and the complexity of the mathematical error model are one of the concerns in the production line.Furthermore, these approaches directly track the pose of the robot end-effector with respect to the device's coordinate and estimate the robot base coordinate by applying the inverse kinematic process.However, this approach does not guarantee high calibration accuracy.In addition, for the vision-based robot system in the industrial field environment, it is essentially desirable that the system is capable of performing calibration without any expensive external apparatus or elaborate setups, which is the system self-calibration [5,6].
Lots of work about robot calibration techniques without using expensive external devices are reported in the literature.Meng et al. [15] proposed a method for robot calibration using vision technology.This approach only requires a ground-truth scale in the reference frame to estimate the pose of the manipulator.However, the proposed method adopts corner detection to extract the corners of the chessboard; its algorithm is easily affected by noise, leading to the failure of corner detection.Then, calibration errors are increased.Gong et al. [16] proposed a method for calibrating and compensating the robot system kinematic error using its internal laser sensor based on distance measurements.However, this approach is restricted by the sensor accuracy not using the absolute position measurement system to measure the robot end-effector.On the other hand, Yin et al. [17] presented an approach for evaluating the kinematic errors of the robot based on the fixed-point constraints to estimate the robot's end-effector.The method is limited to aligning the tool-center-point (TCP) of a robot to fixed points in the robot workspace.The predicted position of the robot's end-effector estimated by the fixed-point and the laser stripe could be misaligned.These techniques are often inconvenient, time consuming and it may not be feasible for some certain applications.To overcome the above limitations, we develop a novel and flexible indirect calibration method for the vision-based robot application that need small position errors.This is a straightforward and efficient method to reduce the absolute position error.Our method does not require the complex solution of the kinematics parameter equations and the complicated procedures of the traditional robot compensation methods.As a result, we successfully reduced the absolute position error the robot's end-effector in the workspace, the position/orientation of the robot's end-effector is compensated without modifying the parameters of the robot.Using the robot's end-effector as an input for a neural network, and the camera attached on the end-effector to observe the object and gather information for training the neural network, the absolute position error of the robot's end-effector is improved.The proposed method is well suited for easy deployment of the robot visual system in the different manufacturing environments because no external measuring equipment or no complicated setup is required in the error compensation and makes the calibration procedure more convenient to implement.
The purpose of our research in this paper is to improve the degree of work in an object picking application by compensating the absolute position error of a six-axis industrial robot by applying a vision-based measurement system.First, the position/orientation of the end-effector was estimated using a vision-based approach combined with the neural network.A novel indirect approach proposed in this paper was used to collect the data in the workspace and to train the neural network, and the calibration methodology among the robot base coordinate, camera system frame and the workspace is described in detail.Then, some simulations and experiments were performed to evaluate the performance of the proposed indirect calibration, and the results were compared in detail to demonstrate the excellence of the proposed method.Finally, some experiments to pick up objects using an industrial robot were conducted to guarantee the positioning performance of the proposed algorithm.

Overview of the Problem
The goal of the error compensation approach is to reduce the position error of the robot tool in the real world during the online operation.The added information, usually the real coordinate value of objects, must be precisely determined with respect to the robot coordinate [18].One can estimate the pose of the object based on its 3D object model known a priori.The pose of the model in the frame (B) is written as where t and θ denote the position and the orientation of the object from the world coordinate to the robot base coordinate, respectively.Based on the B W x pose, the transformation matrix describing the model frame (W) relative to the base frame (B) can be determined as follows: However, the robot has its own error, so that the real pose of the object corresponding to the robot coordinate is different compared to the B W x pose.We denote the real pose as B W x .Figure 1 shows that the positions of these two objects differ from the coordinates of the robot.
Appl.Sci.2019, 9, x FOR PEER REVIEW 3 of 17 objects using an industrial robot were conducted to guarantee the positioning performance of the proposed algorithm.

Overview of the Problem
The goal of the error compensation approach is to reduce the position error of the robot tool in the real world during the online operation.The added information, usually the real coordinate value of objects, must be precisely determined with respect to the robot coordinate [18].One can estimate the pose of the object based on its 3D object model known a priori.The pose of the model in the frame (B) is written as where t and  denote the position and the orientation of the object from the world coordinate to the robot base coordinate, respectively.Based on the  pose, the transformation matrix describing the model frame (W) relative to the base frame (B) can be determined as follows: However, the robot has its own error, so that the real pose of the object corresponding to the robot coordinate is different compared to the  pose.We denote the real pose as  .Figure 1 shows that the positions of these two objects differ from the coordinates of the robot.In order to pick up objects using the robot, the robot moves to a fine search position.The 3D pose of the correct object is then calculated through the sensor and produces the object coordinates.After calculating the pickup posture considering the 3D posture of the object, the trajectory of the robot is modified to reach the expected position  .
In a real-life scenario, however, the robot will reach an actual location  ′ due to a robot's error.From a general point of view, there is a full pose corresponding to the pose  of an object that allows the controller to control the robot's reach.The important problem is that in order to get to the expected pose correctly, the controller will have to do an error compensation, and the actual pose In order to pick up objects using the robot, the robot moves to a fine search position.The 3D pose of the correct object is then calculated through the sensor and produces the object coordinates.After calculating the pickup posture considering the 3D posture of the object, the trajectory of the robot is modified to reach the expected position B W x. In a real-life scenario, however, the robot will reach an actual location B W x due to a robot's error.From a general point of view, there is a full pose corresponding to the pose B W x of an object that allows the controller to control the robot's reach.The important problem is that in order to get to the expected pose correctly, the controller will have to do an error compensation, and the actual pose of the robot Appl.Sci.2019, 9, 1940 4 of 17 will be moved to the expected pose.To solve this problem, we proposed a method using a neural network and a machine vision to predict a new pose B W x new after training the data inside the workspace.Figure 2 describes the architecture of the proposed error compensation algorithm for the object picking system.It consists of two stages: the initial stage and the robot operation stage.The first stage includes the pre-error compensation and error compensation operation.In the pre-error compensation, the operator has to register the reference pattern in the workspace; calibrate the camera in order to detect the 3D pose of the pattern as shown in Block 1. Next, the reference pattern will be detected in the error compensation operation; hand-eye calibration work is implemented to build up the coordinate relationship between camera and robot frames, and the position of the robot will be estimated in this operation based on the neural network as shown in Block 2. Finally, the whole process of object picking is described in the robot operation stage, which includes the go-to-fine-search-position to pick-object as shown in Block 3. The main technical functions of the proposed robot error compensation are training the workspace for the robot using the indirect calibration approach.
Appl.Sci.2019, 9, x FOR PEER REVIEW 4 of 17 of the robot will be moved to the expected pose.To solve this problem, we proposed a method using a neural network and a machine vision to predict a new pose  after training the data inside the workspace.
Figure 2 describes the architecture of the proposed error compensation algorithm for the object picking system.It consists of two stages: the initial stage and the robot operation stage.The first stage includes the pre-error compensation and error compensation operation.In the pre-error compensation, the operator has to register the reference pattern in the workspace; calibrate the camera in order to detect the 3D pose of the pattern as shown in Block 1. Next, the reference pattern will be detected in the error compensation operation; hand-eye calibration work is implemented to build up the coordinate relationship between camera and robot frames, and the position of the robot will be estimated in this operation based on the neural network as shown in Block 2. Finally, the whole process of object picking is described in the robot operation stage, which includes the go-to-fine-search-position to pick-object as shown in Block 3. The main technical functions of the proposed robot error compensation are training the workspace for the robot using the indirect calibration approach.

Pattern Detection and Pose Estimation
In this study, the world coordinate system is located on the pattern board, which is the calibrated workspace for the robot.For simple detection and pose estimation of the pattern board, we designed a specific pattern image as seen in Figure 3a.The circles on the pattern board are numbered as seen in Figure 3d, four bigger circles.The pattern board consists of the key feature made of four big circles, which are used to create the workspace coordinate, and the rest of the circles with smaller size are used for the pose estimation.The operation of the pre-compensation system is divided into two stages: the pattern detection and pose estimation.For pattern image detection we moved the robot to the pattern board, then the hole geometry was extracted from the

Pattern Detection and Pose Estimation
In this study, the world coordinate system is located on the pattern board, which is the calibrated workspace for the robot.For simple detection and pose estimation of the pattern board, we designed a specific pattern image as seen in Figure 3a.The circles on the pattern board are numbered as seen in Figure 3d, four bigger circles.The pattern board consists of the key feature made of four big circles, which are used to create the workspace coordinate, and the rest of the circles with smaller size are used for the pose estimation.The operation of the pre-compensation system is divided into two stages: the pattern detection and pose estimation.For pattern image detection we moved the robot to the pattern board, then the hole geometry was extracted from the image.In the pose estimation stage, the Perspective-n-Point (PnP) method based on the RANSAC-algorithm was used to estimate the coordinate of the pattern corresponding to the camera system.
image.In the pose estimation stage, the Perspective-n-Point (PnP) method based on the RANSAC-algorithm was used to estimate the coordinate of the pattern corresponding to the camera system.In the pattern detection stage, we extracted the holes section from image data via the edge detection algorithm as shown in Figure 3b.We applied a Difference-of-Gaussian (DoG) filter to remove noise and improve the geometry shape of the holes.DoG is accomplished by convolving the image with a Gaussian filter at different scales.As a result, key-points were extracted from multiple scales, based on the maximum/minimum value of DoG: where (, , ) =  ( )/ .
In order to increase the reliability of pattern detection, the ellipse fitting techniques were additionally applied for circle detection as shown in Figure 3c.The ellipse-fitting algorithm is a common task in machine vision to estimate the centers and radius of the circle.Let denote a set of 2D data points  =  , ℎ  = ( ,  ), a family of curves C(a) parameterized by the vector a, and the distance metric ((), ) which measures the distance from a point x to the curve ().
The problem is to find the value  for which the error function  () = ∑ ((),   ) attains In the pattern detection stage, we extracted the holes section from image data via the edge detection algorithm as shown in Figure 3b.We applied a Difference-of-Gaussian (DoG) filter to remove noise and improve the geometry shape of the holes.DoG is accomplished by convolving the image with a Gaussian filter at different scales.As a result, key-points were extracted from multiple scales, based on the maximum/minimum value of DoG: where G(x, y, σ) = 1 2πσ 2 e −(x2 +y 2 )/2σ 2 .In order to increase the reliability of pattern detection, the ellipse fitting techniques were additionally applied for circle detection as shown in Figure 3c.The ellipse-fitting algorithm is a common task in machine vision to estimate the centers and radius of the circle.Let denote a set of 2D data points P = {x i } n i=1 , where x i = (x i , y i ), a family of curves C(a) parameterized by the vector a, and the distance metric δ(C(a), x) which measures the distance from a point x to the curve C(a).The problem is to find the value a min for which the error function 2 (a) = n i=1 δ(C(a), x i ) attains its global minimum.Hence, the curve best fits the data.In this study, the fitting algorithm based on the "approximate mean square distance" metric [19], minimizes the unusual objective function, where the matrices D x and D y are the partial derivatives of D with respect to x and y.
Based on the detection stage, key-points localization is suitably implemented using a pose estimation algorithm.To estimate the pose of the pattern, many approaches have been proposed in the literature.For this work, we applied the RANSAC algorithm to estimate the pose.RANSAC is an iterative method proposed to solve the PnP problem [20].Since then, it has been applied to many machine vision areas such as PnP, visual SLAM, homographic estimation, fundamental or essential matrix estimation, etc.Let assume we have a set of pairs of matched 2D-3D points (corresponding): x i , X W i , as shown in Figure 3d, four major feature points are used to define the workspace coordinate.The final solution is the transformation matrix T C W that transforms from the workspace coordinate to camera coordinate.
Since we applied robust image processing algorithms such as pattern detection and ellipse fitting to increase the performance of 3D position and orientation, the proposed system becomes more reliable on data preparation for the neural network used to compensate the error position.

The Hand-Eye Calibration
The initial vision-based robot involved determining the coordinate relationship between the robot coordinate and the sensor coordinate [21,22].Common setup of the sensor can be located at a fixed position or can be mounted on the tool of the robot according to a specific application.In this work, the sensor was attached to the tool of the robot for a better field of view in the workspace.The setup of the sensor was fixed on that position during the calibration.If there was any rearrangement about the setting, the calibration was implemented again.
Figure 4 represents the coordinate frames used to perform the hand-eye calibration in this paper, where (B), (E), (C) and (W) are the coordinates of the robot base, the robot, the camera, and the world, respectively.The relationship between each coordinate can be described by a homogenous transformation matrix.its global minimum.Hence, the curve best fits the data.In this study, the fitting algorithm based on the "approximate mean square distance" metric [19], minimizes the unusual objective function, where the matrices  and  are the partial derivatives of D with respect to x and y.
Based on the detection stage, key-points localization is suitably implemented using a pose estimation algorithm.To estimate the pose of the pattern, many approaches have been proposed in the literature.For this work, we applied the RANSAC algorithm to estimate the pose.RANSAC is an iterative method proposed to solve the PnP problem [20].Since then, it has been applied to many machine vision areas such as PnP, visual SLAM, homographic estimation, fundamental or essential matrix estimation, etc.Let assume we have a set of pairs of matched 2D-3D points (corresponding):( ,  ), as shown in Figure 3d, four major feature points are used to define the workspace coordinate.The final solution is the transformation matrix  that transforms from the workspace coordinate to camera coordinate.
Since we applied robust image processing algorithms such as pattern detection and ellipse fitting to increase the performance of 3D position and orientation, the proposed system becomes more reliable on data preparation for the neural network used to compensate the error position.

The Hand-Eye Calibration
The initial vision-based robot involved determining the coordinate relationship between the robot coordinate and the sensor coordinate [21,22].Common setup of the sensor can be located at a fixed position or can be mounted on the tool of the robot according to a specific application.In this work, the sensor was attached to the tool of the robot for a better field of view in the workspace.The setup of the sensor was fixed on that position during the calibration.If there was any rearrangement about the setting, the calibration was implemented again.
Figure 4 represents the coordinate frames used to perform the hand-eye calibration in this paper, where (B), (E), (C) and (W) are the coordinates of the robot base, the robot, the camera, and the world, respectively.The relationship between each coordinate can be described by a homogenous transformation matrix.In the literature, several approaches have been published to solve the hand-eye calibration; the problem yields a homogeneous matrix equation of the  =  form as the following: In the literature, several approaches have been published to solve the hand-eye calibration; the problem yields a homogeneous matrix equation of the AX = XB form as the following: where i 3 is 3 × 3 unit matrix r a , r b ∈ SO3 are rotation matrices corresponding to the robot and camera transformation, respectively.r x ∈ SO3 , t x ∈ R 3 are the rotation matrix and translation matrix, respectively, which denotes X.The linear optimization method is a common solution to solve this equation based on the assumption that A, B satisfy the rigid transformation or their rotation angles in Equation ( 5) are equal.However, in most cases, their A, B, and X might not satisfy rigid transformation.
A direct solution based on the iterative computation with Jacobian optimization is proposed by Jianfei et al. [23].Given multiple pairs, (A i , B i ) f or i = 1, . . ., n, where i represents the sequence number of the equation AX = XB.The problem of hand-eye can be stated using the properties of Kronecker product (⊗), the Equations ( 5) and ( 6) can be written as: where vec is an operation, which stretches a matrix as the row's direction, vec(R X ) ∈ R 9 is the vector obtained by stacking the columns of t X , and F(i), G(i) are the vectors of (9 × 1) and (3 × 1) separately.Find the rotation θ min ∈ R 3 and the translation t min ∈ R 3 for which the error function ] attains its global minimum, where L(θ, t) is the objective function of optimization for solving the hand-eye problem.Let J(i) be the Jacobian formula for the object function, T can be represented of multi-equations such as Equations ( 7) and (8).Then the interactive formula for optimization is given as: The transformation X(θ, t) is then the solution that best fits the multiple pairs (A i , B i ) f or i = 1, . . ., n.A linear solution can be found using singular value decomposition (SVD) or using a pseudo-inverse.
After solving the hand-eye problem, the object position in the world coordinate corresponding to the robot coordinate can be described as follows: where X is obtained from the work above, H B E is provided by the robot controller, H C W is calculated by the pattern detected from the camera, and P W i is the 3D position of the object in world coordinate.

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 B E P a from the robot controller is different, so the actual position of the robot controller in the world coordinate frame is defined as: where X, H B W ∈ SE(3) are obtained from the above, and H W C ∈ 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.where ,  ∈ (3) are obtained from the above, and  ∈ (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  = ( ,  , ⋯ ,  ) be the weight matrix connecting the input and the hidden layers, where  =  , ⋯ ,  for j=1, 2, …,m.Let  = ( ,  , ⋯ ,  ) be the weight matrix between the hidden and the output layers, where  = ( ,  , … ,  ) for k=1, 2,…, p.Given input  = ( , ⋯ ,  ) ∈  , and the final output vector  = ( , ⋯ ,  ) ∈  is given: where ,  ∈ (3) are obtained from the above, and  ∈ (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  = ( ,  , ⋯ ,  ) be the weight matrix connecting the input and the hidden layers, where  =  , ⋯ ,  for j=1, 2, …,m.Let  = ( ,  , ⋯ ,  ) be the weight matrix between the hidden and the output layers, where  = ( ,  , … ,  ) for k=1, 2,…, p.Given input  = ( , ⋯ ,  ) ∈  , and the final output vector  = ( , ⋯ ,  ) ∈  is given: 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 where {b k } p k=1 is the biases from hidden to output layers, and y = (y 1 , . . ., y n ) T ∈ R m is the output of the hidden layer.The distance error is measured based on mean square error, defined as where z n = (z 1 , . . ., z n ) T ∈ R n is the desired output from the dataset.The update rules based on gradient descent for the weight vector are V where l = 0, 1, 2, . . .; k = 1, 2, . . ., p; j = 1, 2, . . ., m; and i = 1, 2, . . ., n.

Simulation for Robot Model
To improve errors based on the direct approach, the simulation was performed based on PUMA robot parameters before and after compensation using a neural network.For the comparison, two robot models were created: the nominal model and the error model.All DH parameters of the error model added to the nominal model with uniformly distributed noise.Let ε length and ε angular be the length error magnitude (mm) and angular error offset (deg).The noises added to the nominal model parameters with length error ∆ε length (mm) and angular error ∆ε angular (deg) are given as: where • are the mean and standard deviation.The geometric errors in the robot-link could be written as ∆a i , ∆α i , ∆d i , ∆θ i while the original parameters of the robot-link i th were denoted as a i , α i , d i , θ i .The parameters of error model are as following: Where ∆• is the noise determined in Equations ( 18) and (19).The actual values for two kinematic models are shown in Tables 1 and 2, respectively.In this simulation, ε length = 10 mm, and ε angular = 2deg.Firstly, the simulation was based on the neural network combined with the laser tracker system.The simulation describes the use of an artificial neural to estimate the robot's end-effector where the actual positions of end-effector in the workspace are known.The robot is moved to all 3D grid points, all position errors in the 3D grid are measured and recorded by the laser tracker system, and these position errors are stored in the memory to train the neural network.The simulation results are shown in Figure 7.The errors have been improved after the compensation.However, a direct approach using a laser tracker is not well suited for vision-based robot applications because of the cost-effectiveness of the external measuring device and the elaborate setup for the calibration procedure.1111 Firstly, the simulation was based on the neural network combined with the laser tracker system.The simulation describes the use of an artificial neural to estimate the robot's end-effector where the actual positions of end-effector in the workspace are known.The robot is moved to all 3D grid points, all position errors in the 3D grid are measured and recorded by the laser tracker system, and these position errors are stored in the memory to train the neural network.The simulation results are shown in Figure 7.The errors have been improved after the compensation.However, a direct approach using a laser tracker is not well suited for vision-based robot applications because of the cost-effectiveness of the external measuring device and the elaborate setup for the calibration procedure.Secondly, to illustrate the validity of the proposed method, this section performs error compensation in the simulation environment of the PUMA 560 robot model.For comparison, two robot models were created the same as above.The data generated in this simulation for solving the hand-eye vision problem and training the neural network is also described in this section.

Simulation Procedure
The procedure for the simulation process is divided into two phases.In the first phase, data is collected from both models.An error compensation assessment is then performed.For the first step, for the hand-eye calibration (AX = XB), real data for the transformation matrix A i was generated by the nominal robot model and data for the transformation matrix B i was generated by the robot error model.Next, in the training for the neural network section, m (m = 686) set of samples were used, and 200 random samples on various positions and orientations in the work coordinate frame were examined for testing.In addition, the distance between the neighboring of each grid points was 28.5 (mm) in all three directions X, Y, and Z, which is an empirical interval for a mid-size calibration space.In total, the workspace includes 343 cells (7 × 7 × 7 mm 3 ).At each cell, two different orientations were taken.
In the error compensation stage, a generalized feed-forward neural network is used.This network consists of one hidden layer.As presented in Figure 8, there are 50 neurons in the hidden layer.The desired position and orientation x = (x 1 , . . ., x 6 ) T ∈ R 6 of the robot's end-effector is taken as input layer nodes, and the related position/orientation o = (o 1 , . . ., o 6 ) T ∈ R 6 for robot controller is taken as the output layer nodes.
Appl.Sci.2019, 9, x FOR PEER REVIEW 11 of 17 Secondly, to illustrate the validity of the proposed method, this section performs error compensation in the simulation environment of the PUMA 560 robot model.For comparison, two robot models were created the same as above.The data generated in this simulation for solving the hand-eye vision problem and training the neural network is also described in this section.

Simulation Procedure
The procedure for the simulation process is divided into two phases.In the first phase, data is collected from both models.An error compensation assessment is then performed.For the first step, for the hand-eye calibration (AX=XB), real data for the transformation matrix  was generated by the nominal robot model and data for the transformation matrix  was generated by the robot error model.Next, in the training for the neural network section, m (m = 686) set of samples were used, and 200 random samples on various positions and orientations in the work coordinate frame were examined for testing.In addition, the distance between the neighboring of each grid points was 28.5 (mm) in all three directions X, Y, and Z, which is an empirical interval for a mid-size calibration space.In total, the workspace includes 343 cells (7 × 7 × 7 mm ).At each cell, two different orientations were taken.
In the error compensation stage, a generalized feed-forward neural network is used.This network consists of one hidden layer.As presented in Figure 8, there are 50 neurons in the hidden layer.The desired position and orientation  = ( , ⋯ ,  ) ∈  of the robot's end-effector is taken as input layer nodes, and the related position/orientation  = ( , ⋯ ,  ) ∈  for robot controller is taken as the output layer nodes.

Simulation Results
After training the neural network, we used 200 test data to evaluate the performance of position/orientation error, and the results are shown in Figure 9.
In Figure 9, the blue area is the result of the robot system before training, while the red area is the result after applying neural network training.The position error   = ( ,  ,  ) ∈  and   = ( ,  ,  ) ∈  are defined as follows: =   −   .
As you can see in Figure 9, the errors have been greatly reduced when using the method proposed in this paper.In addition, you can see that applying the neural network to the indirect compensation approach significantly reduces the mean and standard deviation of error.

Simulation Results
After training the neural network, we used 200 test data to evaluate the performance of position/orientation error, and the results are shown in Figure 9.
In Figure 9, the blue area is the result of the robot system before training, while the red area is the result after applying neural network training.The position error t Error = t x , t y , t z T ∈ R 3 and As you can see in Figure 9, the errors have been greatly reduced when using the method proposed in this paper.In addition, you can see that applying the neural network to the indirect compensation approach significantly reduces the mean and standard deviation of error.Table 3 shows that the mean error decreased significantly when the error was compensated using the neural network compared to when the error was not compensated.The mean position errors after compensation are  = -0.0295(mm),  = -0.0079(mm), and  = -0.0496(mm), for which the errors are reduced by 98% on average.As shown in Table 4, the standard deviation for position/orientation error was greatly reduced:  = 0.3583 (mm),  = 0.5101 (mm), and  = 0.03634 (mm), approximately 94% of error reduction on average.

Experimental Results
We used a Hyundai Hi5 (HA006 model) 6-axis industrial robot to conduct the experiment.A high-resolution (12 Mp) baser camera with a focal length of 8 mm was attached to the end effector of the robot.In addition, a pneumatic gripper was attached to the robot's end-effector to enable the robot to grasp objects.The overall robot system is shown in Figure 10.Table 3 shows that the mean error decreased significantly when the error was compensated using the neural network compared to when the error was not compensated.The mean position errors after compensation are e t x = −0.0295(mm), e t y = −0.0079(mm), and e t z = −0.0496(mm), for which the errors are reduced by 98% on average.As shown in Table 4, the standard deviation for position/orientation error was greatly reduced: e t x = 0.3583 (mm), e t y = 0.5101 (mm), and e t z = 0.03634 (mm), approximately 94% of error reduction on average.

Experimental Results
We used a Hyundai Hi5 (HA006 model) 6-axis industrial robot to conduct the experiment.A high-resolution (12 Mp) baser camera with a focal length of 8 mm was attached to the end effector of

Experiments on Position/Orientation Error
To evaluate the performance of the proposed system, we compared the calculated amount of movement of the robot to the actual amount of movement.The amount of robot movement can be easily calculated using Equation (13).In this error evaluation process, 686 data samples were used for neural network training, and 200 data samples were used for testing the neural network.The test results are shown in Figure 11.Although the actual results are not as good as the results from the simulation environment, they have reduced the position/orientation error sufficiently.The after compensation value of mean error-position in each direction as shown in Table 5 are  = −1.3897(mm),  = −2.4289(mm), and  = 1.554 (mm), for which the error was reduced by 50.3% on average.
In Table 6, the standard deviation for position/orientation errors after compensation are greatly reduced:  = 0.6998 (mm),  = 0.8826 (mm), and  = 0.4484 (mm), approximately 69% of error reduction on average.The proposed method showed good performance as a result of the experiment.In Figure 11, the after-compensation error (red line) is smaller and smoother than the before compensation error (blue line) when applying the error compensation technique.This illustrates that the absolute position error of the robot's end-effector is improved.Considering the calculated data from the simulation and experiment as shown in Tables 3 and 4 and Tables 5 and 6, respectively, the compensation improvement of the experimental cases is smaller than the result of the simulation cases.The main reason is that it is really difficult in the real experiment to consider all factors that lead to the absolute position error of the robot's end-effector such as tolerances, eccentricities, wear-out, payload, temperature and insufficient knowledge of model parameters for the transformation between robot poses, etc. [5].However, our algorithm did reduce the absolute position error in real experiments by 50.3%, which can verify the proposed compensation algorithm to be utilized successfully in the real application.

Experiments on Position/Orientation Error
To evaluate the performance of the proposed system, we compared the calculated amount of movement of the robot to the actual amount of movement.The amount of robot movement can be easily calculated using Equation (13).In this error evaluation process, 686 data samples were used for neural network training, and 200 data samples were used for testing the neural network.The test results are shown in Figure 11.Although the actual results are not as good as the results from the simulation environment, they have reduced the position/orientation error sufficiently.The after compensation value of mean error-position in each direction as shown in Table 5 are e t x = −1.3897(mm), e t y = −2.4289(mm), and e t z = 1.554 (mm), for which the error was reduced by 50.3% on average.
In Table 6, the standard deviation for position/orientation errors after compensation are greatly reduced: e t x = 0.6998 (mm), e t y = 0.8826 (mm), and e t z = 0.4484 (mm), approximately 69% of error reduction on average.The proposed method showed good performance as a result of the experiment.In Figure 11, the after-compensation error (red line) is smaller and smoother than the before compensation error (blue line) when applying the error compensation technique.This illustrates that the absolute position error of the robot's end-effector is improved.Considering the calculated data from the simulation and experiment as shown in Tables 3-6, respectively, the compensation improvement of the experimental cases is smaller than the result of the simulation cases.The main reason is that it is really difficult in the real experiment to consider all factors that lead to the absolute position error of the robot's end-effector such as tolerances, eccentricities, wear-out, payload, temperature and insufficient knowledge of model parameters for the transformation between robot poses, etc. [5].However, our algorithm did reduce the absolute position error in real experiments by 50.3%, which can verify the proposed compensation algorithm to be utilized successfully in the real application.[27] proposed an improved method for the pose accuracy of the robot manipulator by using a multiple-sensor combination measuring system (MCMS).In their experiments, the pose accuracy of the manipulator is improved by 67.3%, to 3.379 mm on average with the Kamal filter (KF) and by 38.2%, to 1.286 mm on average with multi-sensor optimal information fusion algorithm (MOIFA).Yauheni et al. [2] proposed a method of robot end-effector pose accuracy improving using joint error mutual compensation, the improved value of positioning accuracy for the robot end-effector from 2% to two times, to ∆L = 2.39 mm on average.Hence, it can be concluded that our proposed method gives a better performance on the whole, both in terms of the error reduction ratio and the absolute position error, which is a quite acceptable error in robot application in the real field.Comparing the compensation performance the other works, Liu et al. [27] proposed an improved method for the pose accuracy of the robot manipulator by using a multiple-sensor combination measuring system (MCMS).In their experiments, the pose accuracy of the manipulator is improved by 67.3%, to 3.379 mm on average with the Kamal filter (KF) and by 38.2%, to 1.286 mm on average with multi-sensor optimal information fusion algorithm (MOIFA).Yauheni et al. [2] proposed a method of robot end-effector pose accuracy improving using joint error mutual compensation, the improved value of positioning accuracy for the robot end-effector from 2% to two times, to ∆L = 2.39 mm on average.Hence, it can be concluded that our proposed method gives a better performance on the whole, both in terms of the error reduction ratio and the absolute position error, which is a quite acceptable error in robot application in the real field.

The Qualitative Experiments Results
To verify the validity of the error compensation method proposed in this paper, an object-picking task was performed using the robot used in the experiment.The procedure for the object picking task is described in Figure 2. Using C#, control software was developed and Raspberry board was used for communication with the robot.Communication was carried out using the RS-232 standard.First, the robot was moved to the fine search position in the field-of-view area of the camera.Then, the camera was used to calculate the 3D pose of an object and then combined with the information of the hand-eye calibration.Then, the position and the normal vector of the object was calculated.Next, the position/orientation value of the end effector was estimated using a neural network.Finally, the robot's trajectory was modified, and the robot's gripper reached the target object.The photo of the robot's picking task is shown in Figures 12 and 13.

The Qualitative Experiments Results
To verify the validity of the error compensation method proposed in this paper, an object-picking task was performed using the robot used in the experiment.The procedure for the object picking task is described in Figure 2. Using C#, control software was developed and Raspberry board was used for communication with the robot.Communication was carried out using the RS-232 standard.First, the robot was moved to the fine search position in the field-of-view area of the camera.Then, the camera was used to calculate the 3D pose of an object and then combined with the information of the hand-eye calibration.Then, the position and the normal vector of the object was calculated.Next, the position/orientation value of the end effector was estimated using a neural network.Finally, the robot's trajectory was modified, and the robot's gripper reached the target object.The photo of the robot's picking task is shown in Figures 12 and 13   The results of the experiment confirmed that the proposed method reduced the absolute position error in the workspace with 200 random positions by 50.3% on average, which is sufficiently applicable to the object-picking task.We are confident that applying the method proposed in this paper to robots will also allow for tasks requiring higher accuracy.

Conclusion
In this paper, the proposed indirect calibration approach is proved to compensate for the absolute position/orientation error of a six-axis industrial robot throughout the simulations and experiments.In particular, experiments with an object picking task using a robot and camera were also conducted to substantively demonstrate the validity of the proposed algorithm.The

The Qualitative Experiments Results
To verify the validity of the error compensation method proposed in this paper, an object-picking task was performed using the robot used in the experiment.The procedure for the object picking task is described in Figure 2. Using C#, control software was developed and Raspberry board was used for communication with the robot.Communication was carried out using the RS-232 standard.First, the robot was moved to the fine search position in the field-of-view area of the camera.Then, the camera was used to calculate the 3D pose of an object and then combined with the information of the hand-eye calibration.Then, the position and the normal vector of the object was calculated.Next, the position/orientation value of the end effector was estimated using a neural network.Finally, the robot's trajectory was modified, and the robot's gripper reached the target object.The photo of the robot's picking task is shown in Figures 12 and 13   The results of the experiment confirmed that the proposed method reduced the absolute position error in the workspace with 200 random positions by 50.3% on average, which is sufficiently applicable to the object-picking task.We are confident that applying the method proposed in this paper to robots will also allow for tasks requiring higher accuracy.

Conclusion
In this paper, the proposed indirect calibration approach is proved to compensate for the absolute position/orientation error of a six-axis industrial robot throughout the simulations and experiments.In particular, experiments with an object picking task using a robot and camera were also conducted to substantively demonstrate the validity of the proposed algorithm.The The results of the experiment confirmed that the proposed method reduced the absolute position error in the workspace with 200 random positions by 50.3% on average, which is sufficiently applicable to the object-picking task.We are confident that applying the method proposed in this paper to robots will also allow for tasks requiring higher accuracy.

Conclusion
In this paper, the proposed indirect calibration approach is proved to compensate for the absolute position/orientation error of a six-axis industrial robot throughout the simulations and experiments.In particular, experiments with an object picking task using a robot and camera were also conducted to substantively demonstrate the validity of the proposed algorithm.The position/orientation of the robot's end-effector is compensated without modifying the robot's parameters.The proposed method is based on a machine vision algorithm combined with a neural network.Using the robot's end-effector as an input for a neural network, and the camera attached on the end-effector to observe the object, we successfully improved the absolute position error of the robot in the workspace.According to the simulation results, location errors decreased by 98%.The average value of the absolute position error was 0.029 mm.Actual results showed that the absolute position error was reduced to 50.3% and the average value of the absolute position error was 1.79 mm, which is a quite acceptable error in robot application in the real field [5][6][7].In conclusion, the proposed method is well suited for simply deploying the robot visual system in different manufacturing environments because no external measuring equipment or complicated setup is required in the error compensation and makes the calibration procedure more convenient to implement.We believe that the method proposed in this paper can also be applied to robot tasks requiring a high degree of accuracy and replace the existing error-compensating methods.

Figure 1 .
Figure 1.Difference between expected and actual robot position.

Figure 1 .
Figure 1.Difference between expected and actual robot position.

Figure 2 .
Figure 2. The overall architecture of proposed error compensation algorithm.

Figure 2 .
Figure 2. The overall architecture of proposed error compensation algorithm.

Figure 5 .
Figure 5.An indirect method for robot calibration.

Figure 5 .
Figure 5.An indirect method for robot calibration.

Figure 5 .
Figure 5.An indirect method for robot calibration.

Figure 8 .
Figure 8. Architecture developed for the neural network.

Figure 8 .
Figure 8. Architecture developed for the neural network.

Figure 9 .
Figure 9. Position/orientation error in 3D space for simulation.

Figure 9 .
Figure 9. Position/orientation error in 3D space for simulation.

Figure 11 .
Figure 11.Comparison between before and after compensation in the experiment environment.

Figure 11 .
Figure 11.Comparison between before and after compensation in the experiment environment. .

Figure 12 .
Figure 12.Trajectory that the robot was taught.

Figure 12 .
Figure 12.Trajectory that the robot was taught. .

Figure 12 .
Figure 12.Trajectory that the robot was taught.

Table 1 .
DH parameters of the nominal model.

Table 2 .
DH parameters of the error model.

Table 3 .
Mean error of the measurement system position-accuracy.

Table 3 .
Mean error of the measurement system position-accuracy.

Table 5 .
Mean error of the measurement system position accuracy.

Table 5 .
Mean error of the measurement system position accuracy.