A novel flexible two-step method for eye-to-hand calibration for robot assembly system

In the visual robot system, the calibration of the hand-eye system is very important, which has a great influence on the positioning accuracy of the robot. Traditional methods are either complicated or require advanced external equipment. This paper proposes a new flexible method for hand-eye calibration, which is simple and flexible. Firstly, the robot carries the target to perform two transformation motions to solve the rotation relationship, and then the robot tool coordinate system performs several rotation motions to solve the transformation relationship. The paper provides empirical insights about how the robot hand-eye system is calibrated by controlling the robot to perform the specified motion without expensive and complicated 3D measurement equipment. The experiment and analysis indicate that the developed hand-eye calibration has high precision in 6-DOF industrial robot assembly application.


Introduction
Machine vision has the ability to sense and measure the environment, and can guide robots to perform tasks such as grasping and assembly. Ahmad et al. 1 introduced a ToF sensor based information collection and intelligent decision methodology in order to localize the un-known, un-programmed obstacles and propose a safe peg-in-hole automated assembly process. Zeng et al. 2 presented an approach that leverages multi-view RGB-D data and self-supervised, data-driven learning to overcome the difficulties to realize reliably recognizes and locates objects amid cluttered environments, selfocclusions, sensor noise, and a large variety of objects. Wada et al. 3 proposed a practical method to compose a highly reliable picking system with verification-based approach to reduce the rate of wrong picking and raise the reliability of picking ordered objects. In order to convert the position information in the vision system to the robot coordinate system, hand-eye calibration is an important step among them, and its accuracy affects the accuracy of robot positioning.
The traditional hand-eye calibration method needs to solve the equation AX = XB. The problem of solving equation AX = XB is very important in multiple fields such as robotics, computer vision or machine vision. In the problem, A and B are parameterizations of rigid body motions, while X is an unknown transformation. Condurache et al. 4 proposed a new approach for solving the AX = XB sensor calibration problem by mapping the SE 3 classic formulation into an orthogonal dual tensors set SO 3 representation. For the Eyein-Hand form, the camera is mounted on the end of the robot, and the camera carries a fixed calibration plate image at dozens of positions at the end. For the Eye-to-Hand form, the robot is used to carry the calibration plate for dozens of positions, and the camera is fixed to capture the calibration plate image. Jiang et al. 5 proposed a calibration strategy for vision-guide robot assembly system, in which the eye-to-hand calibration method is developed with the uniaxial rotation of the robot joints and the pose tracking from the stereovision with large field of view. Jiang et al. 6 also proposed eyein-hand calibration method based on the homograph and the transformation of coordinates in the vision-guided robot grasping system. The effectiveness is proved by the great performance of the grasping results. The rotation axes between the two movements of the robot cannot be parallel to each other. The solution method can be divided into separable [7][8][9] or simultaneous. [10][11][12] There are also some other methods. Ma et al. 13 proposed a technique for calibrating the head-eye geometry and the camera intrinsic parameters, which requires no reference object and directly uses the images of the environment. Yang et al. 14 established a model that includes both the robot parameter error and the hand-eye relationship error. The robotic end-loaded structured light sensor is used to measure the fixed coordinates of the spherical center in the space. After transforming a few poses, the initial solution of the hand-eye relationship is obtained, and then the initial solution is substituted into the error model, and the robot error and the hand-eye error are simultaneously solved by the spherical center constraint. In order to solve the problem that the middle eye can not see the hand under the Eye-in-Hand situation, Zhang et al. 15 let the robot end suction cup carry the calibration plate, the camera obtains the image of the calibration plate in the plane mirror, and solves the camera to the end target by changing the posture of the plane mirror three times. The pose is then measured by the auxiliary camera to measure the distance from the end target to the suction cup, and finally the hand-eye relationship of the camera to the suction cup is obtained. The robot does not move during the whole process, and the parameter error caused by the robot movement is avoided.
In recent years, with the improvement of GPU computing capabilities, some hand-eye relationship calibration methods based on deep learning have also appeared. [16][17][18][19] The basic principle is that after collecting a large number of scratch samples, a large convolutional neural network is trained so that the robot can learn the spatial relationship between the gripper and the object. Finally, a single image is used to predict the success of the gripper's movement in the task space. The possibility of grasping does not require camera calibration and the current pose of the robot. However, it requires hundreds of thousands of sets of training data, and the trained neural network is configured for a specific robot, which will cause problems when converted to other targets.
However, it is usually required to achieve hand-eye calibration quickly and accurately in practical engineering applications. The above methods can not solve the problems that the poor absolute positioning accuracy of commercial robots, which results in the 1;3 mm absolute positioning error in the hand-eye calibration data. At the same time, whether solving the equation AX = XB or based on the deep learning, the above methods need to shoot the calibration plate and record the robot's position and pose for many times, which can not satisfies the application requirements of fast calibration. In order to solve these problems, this paper designs a new flexible two-step hand-eye calibration method for the Eye-to-Hand form. The rotation matrix of the calibration parameters is acquired with twice of robot transformation. The transformation matrix parameters are solved with the robot rotation operation without additional complicated and expensive measurement equipment for example CMM, laser tracker, and so on. Experiments show that the proposed method has stronger robustness and faster calibration process than the traditional method in practical application. The rest of the paper is as follows. We introduce the application scenarios of this paper and explain the principle of the hand-eye calibration method proposed in this paper in Section 2. We also introduce the system structure of this paper and carry out experiments to verify the calibration accuracy in Section 3. The results show that the method proposed in this paper has high accuracy.

Measuring system configuration
The industrial robot is widely used in aerospace manufacturing field. It can be arranged to work precisely and repeatability. The robot gripping assembly is common task in industrial application, the measurement form is shown in Figure 1. The position accuracy of the workpiece should be within 2 mm in the region 100031000 mm 2 in this practical application. The gripper is fixed on the robot flange which is called end effector. The coordinate of the flange can be read with the robot system, the relationship of position and pose between the end effector and the flange is unknown. When the end effector is installed on the robot for work, the coordinate of grip point should be calibrated precisely. The gripper of the robot carries the workpiece from position 1 to the fixed position 2 above the monocular vision system, and the monocular vision system measures the workpiece. In order to convert the coordinates in the camera measurement coordinate system to the robot base calibration system, a hand-eye calibration method suitable for this layout must be designed. It is also necessary to use a camera to measure the captured part for capturing the part precisely because of the previous calibration and the robot gripping error.
The novel two-step hand-eye calibration method The coordinate system of the Eye-to-Hand structure which is needed to calibrated is shown in the Figure 2. The tool coordinate system is O t À X t Y t Z t , the camera coordinate system is O c À X c Y c Z c , and the robot base Each time the robot grips the workpiece to take a picture at a fixed point above the monocular vision system, the relative positional relationship t c T of the tool coordinate system established on the robot end-effectors relative to the camera coordinate system is ensured each time the robot is repeatedly positioned. It is fixed, so the relative position of the tool coordinate system and the camera coordinate system which is used to measure the position is calibrated, and the conversion relationship b t T between the tool coordinate system and the robot base coordinate system can be read by the teach pendant, and the base is calculated. The relationship b c T between the coordinate system and the camera coordinate system is also calculated.
Several typical calibration methods are discussed in the introduction, some of which require the relative positional relationship between the camera and the robot. In the case of Eye-to-Hand, the positional relationship between the camera and the robot is very variable. Some methods are not suitable for use in all layout situations, and the calibration method of the robot carrying a calibration plate at the end of the robot can be applied to most occasions, so we will use the camera to calibrate the calibration plate on the end of the robot as a new two-step hand-eye calibration method.
Before the hand-eye calibration, the tool coordinate system had been calibrated by the four-point method described above, and the camera had also obtained the internal parameters and distortion coefficients after a single target. In order to obtain the relationship between the camera and the tool coordinate system, the camera must measure the point coordinates on the tool coordinate system. Since there is no cooperation target on the end-effectors, the code point calibration plate shown in Figure 3 is designed for the end-effectors. The coordinate system of the code point calibration plate is marked as O d À X d Y d Z d , the X and Y axis directions are marked in the figure, and the Z axis is determined by the right-hand rule. Specific process is as follows: Due to the use of coded landmarks, canny edge detection is performed on the image first, and noise and non-coded landmarks are filtered through a series of constraints. Then, the least squares ellipse fitting is used to locate the coded mark points, and the contours of the coded mark points are segmented and filled based   According to X axis and Y axis, the Z axis is determined by the right-hand rule.
The distance between code points is known as 40mm. There are two reasons for using code points: First, there are more than one calibration plate in the camera field of view, there may be other circular targets, and the calibration plate is not fixed in the image. The code point can be effectively distinguished from other circular targets by decoding and concentric circle constraints, thereby quickly extracting the center of the circle. Secondly, by decoding, the four code points can be directly separated to form a coordinate system without additional design sorting algorithm.
In the calibration process, the monocular vision system takes a picture of the code point calibration plate to obtain the image coordinates of the center of the code point. Since the relative positional relationship between the code points is known, and the image coordinates of the center of the code point are obtained, we can obtain the coordinates of the code point in the camera coordinate system by solving the P4P problem combined with the camera internal parameters.
The hand-eye calibration method is divided into two steps. First, the rotation relationship between the tool coordinate system and the camera coordinate system is calibrated, and then the transformation relationship is calibrated.
Calibration of the rotation relationship. The rotation matrix of the tool coordinate system to the camera coordinate system is c t R. Here we need to analyze the conversion relationship between the two coordinate systems. Let the two coordinate systems be O A À X A Y A Z A and O B À X B Y B Z B , and the transformation relationship between the fixed points in space between the two coordinate systems can be expressed as The first column of the transformation matrix can be regarded as the projection of the unit vector on the X axis of O B À X B Y B Z B onto the X, Y, and Z axes of the coordinate system O A À X A Y A Z A . The second and third columns are the same. The fourth column is the coordinates of the origin of O B À X B Y B Z B in O A À X A Y A Z A . So each column of c t R can be viewed as a projection of the unit vector on the principal axis of the tool coordinate system on each axis of the camera coordinate system.
Set the initial value of the rotation matrix as c t R 0 , the calibration steps are as follows: i) Calculation of cX t . Control the end of the robot to move a distance along the X-axis direction of the tool coordinate system. The moving distance does not need to be recorded. At the starting point and the end point, respectively, take images of the calibration plate to obtain the coordinates of the origin of the calibration plate coordinate systemO d in the camera coordinate system. The coordinates calculated by the positive direction of the X-axis of the coordinate system are c p 1 and c p 2 respectively. we obtain the first column cX t of c t R 0 by unitization after c p 2 À c p 1 ; ii) Calculation of cŶ t . Control the end of the robot to move a distance along the Y-axis direction of the tool coordinate system, and the subsequent steps are the same as (i), obtaining the second column cŶ t of c t R 0 ; iii) cX t and cŶ t cross-multiply to obtain the third column cẐ t of c t R 0 ; iv) Since c t R 0 is not a strict rotation matrix, SVD decomposition is performed on c t R 0 to find the rotation matrix c t R = UV T closest to c t R 0 .
After the calculation of c t R, the rotation matrix of the camera coordinate system to the tool coordinate system is t c R = c t R À1 .
Calibration of transformation relationship. The transformation matrix of the camera coordinate system to the tool coordinate system is t c t. The transformation relationship can be solved by the end-effectors clamping the calibration plate to transform multiple poses, and the coordinate system involved is more, and the conversion relationship is shown in Figure 4.
In the fixed photographing position, the tool coordinate system is O t À X t Y t Z t . At this time, the coordinate system of the calibration plate clamped on the endeffectors is O d À X d Y d Z d , the conversion relationship between the tool coordinate system and the camera coordinate system is c t T, and the tool coordinate system changes the pose, the new one. The tool coordinate system is O t1 À X t1 Y t1 Z t1 , the corresponding calibration plate coordinate system is O d1 À X d1 Y d1 Z d1 , and the conversion relationship between the tool coordinate system and the camera coordinate system is c t1 T. Note that the origin of the calibration plate coordinate system is the center of gravity of the four code points, and the direction is the same as the direction of the tool coordinate system. Therefore, the calibration plate coordinate system has only a transformation relationship with the tool coordinate system, and because of the clamping and calibration during the calibration process. The board does not move relatively, so the conversion relationship between the calibration board and the tool coordinate system is t d t is the coordinate of the origin of the calibration plate coordinate system in the tool coordinate system. Let the coordinates of the code point p in O f À X f Y f Z f be f p i (i = 0, 1, 2, 3), the coordinates in O c À X c Y c Z c be c p i , the coordinates in O t À X t Y t Z t be t p i , and the rotation and transformation relations of O f À X f Y f Z f to O c À X c Y c Z c be c f R and c f t, respectively, which are measured by the monocular vision system. The rotation and transformation relations of O c À X c Y c Z c to O t À X t Y t Z t are t c R and t c t respectively. We assume t c t = 0, so the conversion of f p i to t p i is According to the previous definition of However, the t O d calculated here is different from the real value by a t c t. If we can get that the true t O d is also t d t, the t c t can be calculated, so the problem is now converted to solve t d t. Let the point p of the calibration plate be d1 p in O d1 À X d1 Y d1 Z d1 . According to Figure 2, the coordinate c p of the point under O c À X c Y c Z c can be expressed as it can also be expressed as With the equations (4) and (5), So there is Combine equation (1), expand and simplify equation (6) If the tool coordinate system is fixed and the rotation transformation is only performs around the TCP point, there is no transformation, then c t t = c t1 t, the lower formula of formula (7) can be further simplified to In the above formula, d d1 t is an unknown quantity.
According to formula (2) and formula (3), finally In the above formula, c f1 R and c f1 t are the rotation and transformation relations of O f À X f Y f Z f to O c À X c Y c Z c after the tool coordinate system transforms the pose, and t c t has been eliminated at the time of subtraction. Therefore, assuming that t c t is any value which does not affect the calculation of d d1 t. Equation (8) can be regarded as the form of Ax = b. It should be noted that both c t1 R and c t Rare rotation matrices, and the matrix determinant obtained by the difference is zero. If the tool coordinate system only rotates a new position, only one equation of the formula (8) can be obtained and t d tcannot be solved. Therefore, the tool coordinate system needs to be rotated multiple positions to solve the least squares solution of t d t. After calculating t d t, according to the previous analysis, there is t c t = t d t À t O d , so we can calibrate the transformation matrix of the camera coordinate system to the tool coordinate system.

Experiment results
The experiment processes include two parts. In the first part, the method of numerical simulation is used to realize the eye-hand calibration with different degrees of Gaussian error to the origin data of simulation, and analyze the difference with traditional method. In the second part, the proposed method is implemented and the error is analyzed.
For comparison, we simulate the traditional handeye calibration method for solving the AX = XB equation, and then calculate the error as the basis for measuring the accuracy of these methods. In the simulation, a Gaussian error with a mean of zero and a sigma of 0.1 to 4.0 is set. After calculating the hand-eye matrix X by different methods, A i X À XB i k k (i = 1, 2, Á Á Á , n)is used as the error. The error data of experiments is shown in the Table 2. Methods 1;5 corresponds to references 7;11. The average accuracy of hand-eye calibration is about 1.8mm with the popular methods. The calibration accuracy decreases gradually with the increase of sigma. Our experimental hardware includes calibration boards, industrial robots, industrial cameras, and lenses. The 6-DOF industrial robot used in this experiment is KUKA KR60HA. KUKA KR60HA is a 6-axis industrial robot with a rated load of 60 kg, it has a 6 degrees of freedom, l, repeat positioning accuracy of 6 0.05 mm, track repeatability of 60.16 mm, a working space of 27.24 m 3 , and a maximum horizontal and vertical working distance of 2033 mm and 3003 mm. The specific dimension information of the robot is shown in Figure 5(a). The corresponding controller model is KR C4. The camera uses The Imaging Source's DMK 33G274, the lens is Computar M0814-MP2, and the focal length of lens is 8 mm. The experimental hardware information is shown in the Figure 5(b). For the new two-step calibration proposed in this paper, first, the rotation relationship between the camera and the tool coordinate system is calibrated as described in Section 2. The image of the code point calibration plate acquired during the calibration process is shown in the Figure 6.
It can be seen that the background environment of the calibration plate is more complicated, and the center of the circle can be well extracted due to the coding point. Finally, we calculate the rotation relationship t c R. Then control the tool coordinate system to rotate different angles, collect the calibration plate image under each attitude and record the reading of the tool coordinate system in the robot base coordinate system, and substitute the equation (8) The entire calibration process requires only a few translations and rotations of the robot, which is very fast. As a proof of accuracy, b c T is substituted into the AX=XB equation, taking the error err i = A i X À XB i k k (i = 1, 2, Á Á Á , n). A and B are calculated by the robot carrying the calibration plate to move multiple positions. The final translation error component (x, y, z) and angular error component (a, b, c) of X are shown in the Table 3 with 5 sets of experiments. The error components are substituted into the error equation and the err i = A i X À XB i k k (i = 1, 2, Á Á Á , n) is calculated as the calibration accuracy. There are 10 times measurement experiments, and the final error calculation is shown in the Figure 7(a). The average error is 1.815 mm which is better than other traditional methods.
From the Table 3, we can find that maximum error of translation part of hand-eye calibration result is 2.64 mm and minimum error of translation part of hand-eye calibration result is 0.0065 mm. At the same time, the maximum error of rotate part of hand-eye calibration result is 0.5903 degrees and the minimum error of rotate part of hand-eye calibration result is 0.0092 degrees. The experiments show that the above error is acceptable and the calibration accuracy satisfies the needs to grasp the workpiece in practical engineering application. The result of experiment is showed as Figure 7(b).
It can be seen that the calibration method proposed in this paper is flexible and has the accuracy which is   satisfied the grasping precision for robot assembly, the accuracy of this method is better than the direct product method. However, we can still find the error from the Figure 7(b). The reasons which results in the errors may be as follows: Firstly, the absolute positioning error of the industrial robot is too large and our method does not completely eliminate this part of the error. Secondly, the calibration of tool coordinate system lead into some errors. Finally, the precision of the code point calibration board used in the experiment is limited, which can also result in the error.

Conclusion
In this paper, a calibration method of the robot handeye system by controlling the robot to perform the specified motion is proposed, and the transformation matrix between the hand-eye systems is obtained. Compared with a series of methods of solving equation AX = XB, the developed method greatly reduces the times of camera shooting and robot motion in the calibration process, and simplifies the calibration process. At the same time, it overcomes the low calibration accuracy caused by the large absolute positioning error of the commercial robot, so that the calibration can be completed without the help of other measuring equipment in the calibration process. The experimental results show that the proposed method can satisfies the accuracy requirements of hand-eye calibration of 6-DOF robot, and the proposed method can quickly satisfy the speed requirements of practical application. In general, some other kinds of robots which can operate the end operator rotation and transformation motion can be calibrated with our developed method. In the future, we will study the scalability of our method on other kinds of robots besides 6-DOF robots. The limitation of the method is that the calibration process is a fusion with multi-step rotation and transformation motion, the high and stable calibration accuracy can be acquired with suitable optimization algorithm. In addition, the calibration process requires a large amount of work, and there is still a lot of research space for optimization of calibration results.

Declaration of Conflicting Interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.