Fast error calibration of Flexible Measuring Arm based on an adaptive Genetic Algorithm

With the development of measurement technology, the Flexible Measuring Arm (FMA) is widely used in quality test of automobile processing and industrial production. FMA is a kind of nonlinear system with many parameters. Low cost and efficient calibration method have become the focuses of attention. This article presents a fast calibration method for FMA based on an adaptive Genetic Algorithm (GA) just with several standard balls and a ball plate. It can greatly reduce the calibration cost than common external calibration method which needs high precision instruments and sensors. Firstly, the kinematic model of FMA is established by RPY theory. Secondly, the common GA is optimized and improved, and an adaptive mechanism is added to the algorithms which can realize the automatic adjustment of crossover and mutation operators. A Normalized Genetic Algorithm (NGA) with adaptive mechanism is proposed to complete the optimization calculation. It can improve the numbers of optimal individuals and the convergence speed. So, the search efficiency will be enhanced greatly. Finally, the Least square method (LSM), the General Genetic Algorithm (GGA), and the proposed NGA are respectively used to finish the calibration work. The compensation accuracy and the search efficiency with the above three different algorithms have been systematically analyzed. Experiment indicates that the performance of NGA is much better than LSM and GGA. The data also has proved that the LSM is suitable to complete optimization calculation for linear system. Its convergence stability is much poorer than NGA and GGA because of the ill-condition Jacobin matrix. GGA is easy to fall into local optimization because of the fixed operators. The proposed NGA obviously owns fast convergence speed, high accuracy and better stability than GGA. The position error is reduced from 3.17 to 0.5 mm after compensation with the proposed NGA. Its convergence rate is almost two time of GGA which applies constant genetic factors. The effectiveness and feasibility of proposed method are verified by experiment.


Introduction
In recent years, industrial Flexible Measuring Arm (FMA) have been widely used in manufacturing industries. It has obvious advantages of large workspace, simple structure, and low cost. It is commonly applied to the processing quality test. However, its low accuracy restricts that this kind of measuring equipment is difficult to be used in the high precision field. [1][2][3][4][5] The accuracy of FMA can be improved by kinematic compensation. Calibration methods include self-calibration and external calibration. External calibration owns high compensation accuracy with high precision instruments and sensors. However, this calibration method owns high cost, complex operation, and low efficiency. [6][7][8][9] Self-calibration method applies optimization algorithm to finish the calibration work based on measuring data. It has low cost, high automation and easy operation. But its compensation accuracy is lower than external calibration.
Cui et al., 3 Li et al. 4 and Zhu et al. 5 have proved that the test error of FMA will be amplified with the number incensement of joints. So, it is significant to improve accuracy by calibration. Now the key problem is how to design an efficient algorithm which owns fast convergence and high accuracy to complete a lot of calculation. It is necessary to establish a reasonable error model to realize calibration. Traditional DH error model has less parameters. But it just only describes the transformation at X and Z direction between two adjacent coordinate systems. Therefore, it is difficult to realize error compensation at Y direction. So, its calibration accuracy is low. The numerical algorithm can improve the calculation speed of data and the efficiency of calibration. Least Square Method (LSM) is widely used in data calculation for robot system. [10][11][12][13][14][15] But these problems of large calculation, low stability, and highly sensitive to initial values will lead to low calibration efficiency and convergence stagnation especially for multi parameter system. Therefore, the numerical algorithm has become the research focus in recent years. General Genetic Algorithm (GGA) can avoid much matrix calculation compared with LSM. And it also has low dependence to initial value. But control factors are always set fixed values which results in low convergence rate and poor population' diversity. It is very important to build a precision error model and propose an effective calibration to realize error calibration. In this paper, we make optimization of GGA and introduce an adjustment mechanism to realize the automatic optimization of key genetic operators. An adaptive normalized genetic algorithm is summarized and proposed to solve these problems of low search efficiency and premature convergence of Genetic Algorithm. This article applies above three algorithms to make error compensation based on RPY model. Zhao et al. 9 has proved that the kinematic model based on RPY theory can reflect the translation and the rotation error at three axis's direction which is more accurate than DH model. Experiment indicates that the accuracy is improved to 0.38 mm just after 320 generations searching by proposed NGA with adaptive factors. GGA's compensation accuracy is 0.42 mm after 646 generations. Then, final accuracy of LSM is only 1.52 mm which doesn't meet the accuracy requirement because of ill condition of Jacobin matrix. The proposed method in this paper just applies one ball plate and several standard balls to realize the error calibration of FMA, which has obvious advantages of fast, high efficiency, and low cost, and experiments has proved the effectiveness and feasibility of the proposed numerical method.

Kinematic model
The researched FMA includes one linear guide rail and three rotation joints in Figure 1. The probe is fixed on the rotating platform, shown in Figure 2.
FMA's coordinate system is established shown in Figure 3. Base coordinate system fo 0 x 0 y 0 z 0 g is fixed on the foundation of FMA. A kinematic modeling method is applied based on three rotating set of Roll, Pitch, and Yaw. 10,[16][17][18][19] The transformation matrix between two coordinate systems can be defined as following:  In this formula, matrix R 333 and d 331 are given as follows R 333 = ca i cb i ca i sb i sg i À sacg ca i sb i cg i + sa i sg i sa i cb i sa i sb i sg i + cacg sa i sb i cg i À ca i sg i Àsb i cb i sg i cb i cg i Where ca i , sa i , cb i , sb i , sb i , cg i , and sg i are defined as In the formula, a, b, and g represent respectively rotation angle according to X, Y, and Z axis. Then d x , d y , and d z are defined as translating distance in the direction of X, Y, and Z axis.
So, the kinematic model of FMA can be expressed as follow where RPY P and Q are respectively defined as The system contains 24 parameters based on the above equation (5) and all parameters can be expressed as Then the equation (5) can be furtherly modified as We apply Dd to represent an error vector which represents 24 error parameters of system shown in the above equation (7), and it is defined as Dd = Da 0 ::: Da 3 Db 0 ::: Db 3 Dg 0 ::: Dg 3 Dd x0 ::: Dd x3 Dd y 0 ::: Dd y 3 Dd z0 ::: Therefore, the actual coordinates of the i point can be calculated by Sample points are measured by FMA on a standard ball which is fixed on the workspace. N is the number of sample points, and r 0 N is the radius which is calculated based on the sample points by FMA test. Then, r N is the radius of standard ball. f presents the difference between r 0 N and r N . So, the actual measurement error can be calculated by The main work of error calibration is quickly to obtain Dd which is used to compensate the FMA to meet accuracy requirement. We will verify measurement accuracy after compensation through testing a standard ball based on the above equation (11).

Error modeling
We make derivation for equation (8). Then the equation can be obtained and written as And position error of every point between theoretical value and actual value can be calculated by where RPY P l and RPY P s represent actual value and theoretical value. The above equation (12) is simplified as So, the error vector Dd will be obtained by algorithm based on experiment data. It's obvious that LSM need to calculate the inverse Jacobin matrix in every iteration. Once the Jacobin matrix appears ill-condition, the calculation will be stopped.

Optimization of Genetic Algorithm
Traditional calculation methods such as Conjugate Gradient Method, Least Squares Method, and Newton method can finish calculation with high efficiency for continuous function. 5,8,20,21 However, it is easy to fall into local optimization for nonlinear system's calibration with the above methods. For example, if the iterative initial value has much difference with the actual value for LSM, its accuracy is much lower because the initial values make a great influence on the accuracy. Therefore, this kind of methods own poor stability. 10 The paper proposes a Normalized Genetic Algorithm with adaptive operators to finish data calibration work. The setting of proposed algorithm parameters is given as follows:

Coding mode
In the paper, we define s m as an individuality which contains 24 chromosomes. These chromosomes are the parameters of error vector Dd. The s m applies real number coding to avoid high error by binary code. The individuality s m can be expressed as based on normalization theory s m = (s 1 , s 2 , ::::::::::, s 24 ), s j 2 ½0, 1, j = 1, 2, 3:::24 Where m represents individual number.

Initial population
An initial population must be generated before global calculation based on the genetic algorithm theory. We random generate two times of chromosome numbers in random mode which is given in equation (17).

Selection operator
The selection factor is used to choose optimal individual to reserve to the next generation based on the rule of superior quality for every generation population. Ping and Jian-lu 12 has proved that it can obtain better search result compared with other general selection operators in random uniform. So, we choose random uniform distribution for selection factor.

Crossover operator and mutation operator
where F max is the maximum fitness value, and F j is the individual fitness of parent generation which participates in mutation. F À represents the average fitness in contemporary generation. F 0 is one of the two adjacent father generations' fitness to participate in crossing which is less then F max . The empirical coefficients are set Fitness function F(s g m ) is defined as the fitness function. The value of fitness in every generation can be calculated by In this formula, C max is the maximum fitness value in the g generation population. f(s g m ) represents fitness value in the g generation population. So, the average fitness function F À can be expressed as It represents the selection basis of the better individuals in every generation. A large number of excellent individuals can be selected to the next generation during iteration. It is helpful to improve the search efficiency of the algorithm.

Stop conditions
The equipment is applied in measurement of processing quality for general industrial parts, and its error requirement is 0.5 mm. Therefore, the permission error e is set 0.5 in the paper. Once the error is less than 0.5 mm after compensation, then the algorithm will stop calculating.

Principle of calibration
We apply a rectangular ball plate and some standard balls to complete the error calibration of FMA. The processing accuracy of plate is 0.01 mm. The radius r of the standard ball is 25 mm and its machining accuracy is 0.005 mm. The theoretical distance is Dd = 100mm between two adjacent fix slots. We fix four standard balls on the four positions from 1 to 4 fixed holes shown in the following Figure 4. Figure 5 is the sampling diagram on the standard ball. The FMA has obtained the coordinates P ri (x ri, y ri , z ri ) of each spherical center after position calibration. So the system can automatically plan the path to complete the detection after the sampling points are generated on the spherical surface.
So we can obtain four actual distances such as d 12 , d 34 , d 14 , and d 23 shown in Figure 4 with the compensation parameters of s m which is obtain by algorithm.
The theory values and above distances are defined as following: Then the compensation value of object function f obj is defined as In this paper, we finished the calibration through measure four standard balls. If the result can't meet the accuracy, it will be solved by test more points. We choose five planes on a standard ball to take sampling data. The following Figure 6 describes the data distribution.
In Figure 6, we take 75 points at five planes on a standard ball. These points coordinates are known and we control FMA to realize measuring. When the stop condition is reached, the research of algorithm is stopped. Every plane set 15 points to test. Table 1 is structure parameters of FMA.
In Table 1, d z0 , u 1 , u 2 , and u 3 represent the driving parameters of four joints respectively. When sampling positions are known, the FMA can automatically measure the points on the standard ball based on the above structure parameters. All the optimization algorithms such as LSM, GGA, and NGA need an initial value of iteration. But it is impossible to get the actual error of system before calibration. So, the initial values of LSM are generated randomly. GGA and NGA also apply the same initial value. The calibration procedures are summarized and given out shown in the following Figure 7.
Error calibration results are obtained shown in Table  2. The experiment data indicates that tensional and flexural deformation of joint 0 is less than joint 1. Linear guide rail (joint 0) which is fixed on the foundation can greatly enhance the ability of deformation resistance. It is helpful to reduce the error amplification effect which from the joint 0. Then the deformation of platform shown in Figure 2 is much smaller than other joints. Sealed turntable can further improve the accuracy.
The performances of the three algorithms are obtained shown in Figure 8. It obviously indicates that LSM is not suitable to identify angle error especially for rotational joint according to Table 2. Its calibration results are greatly different with GGA and NGA, and the calibration accuracy with LSM is much poorer.
LSM owns the best convergence speed from Figure 8. But the compensation accuracy is only 1.52 mm because the Jacobin matrix become ill-condition after 100 iterations and it stops convergence. Huang et al. 18 has proved that the initial iteration values of LSM design the convergence performance and calculation accuracy. However, it is impossible to get the best initial values before calibration. Therefore, the numerical algorithms have been widely applied and solve the problem of LSM. The proposed NGA meets the accuracy requirement just after 320 generations, and its convergence speed is two times of GGA. Although GGA also completes the optimization calculation, its compensation accuracy is 0.42 mm which is less than that of the proposed NGA. Its convergence speed is also obviously slower than proposed NGA.

Validation of calibration method
Compensation vector has been obtained shown in Table 2, and 75 points are measured again on a standard ball. Firstly, we record the theoretical points' coordinates in system. Then the actual measurement error of these points will be calculated by equation (11) before and after compensation. Its distribution on the standard ball is shown in the following Figure 9. Finally, we can obtain error curves about test points before and after compensation. In order to analyze the accuracy and calibration effectiveness, the position errors are given out at the three directions of x, y, and z shown in Figures 10 to 12.
It is obviously that all the measurement points' error is controlled at 20.50 to 0.50 mm after compensation. Figures 10 to 12 indicate that the curves after compensation are smoother than that before compensation. It also illustrates that the stability of motion is enhanced greatly. An obvious error spike occurs at plane 3 which indicates that FMA owns better accuracy at plane 4 and plane 5 in workspace. The max error at z direction reaches 2.13 mm, and the error at x and y direction is less than that at z direction which indicates that the linear guide with high stiffness can effectively restrain the torsion deformation. However, the deflection deformation of mechanism is relatively serious because of the affection of gravity. It results in the z-direction error being significantly greater than that in X and Y direction.
In addition, it is not difficult to find that the error's trend at the three directions becomes smaller with the number incensement of plane. When the researched FMA realizes the detection through the z direction linear guide motion, the deflection deformation at the top of guide is the largest because of structure weight. Therefore, it reduces the deformation error when the mechanism moves to the z-axis negative direction alone z-direction linear guide. When the measured object volume is small, FMA should complete the test work by rotating the rational platform shown in Figure 2, which is helpful to improve the accuracy. Figure 13 shows the final actual error curve before and after compensation.
The max position error in these 75 points is up to 3.17 mm before compensation. Its absolute error is less than 0.5 mm after compensation. The compensation accuracy has achieved the accuracy requirement. In addition, error peaks are significantly eliminated and the curve after compensation is much smoother. It also indicates that the motion is stable during the automatic test process. The proposed method effectively solves the problem of low detection accuracy for this kind of system. This calibration work greatly reduces the cost and owns high efficiency. But the proposed calibration  method needs to ensure that the probe has high detection accuracy, which is at least higher than the accuracy requirements.

Conclusions
In this article, a fast calibration method is proposed for FMA which is widely used in industry. The proposed method just needs several standard balls and a ball plate. The calibration work is completed automatically by software integrated with the algorithms proposed in the paper. It owns high efficiency and low cost. The GGA is optimized and an adaptive mechanism is introduced to algorithm which realize the adaptive adjustment of important genetic operators. It effectively solves the problem that the number of optimal individuals and the fitness of the population are poor after cross and mutation with fixed operators. Therefore, the convergence speed of the algorithm has been greatly improved. Experiments have proved that linear-guide is helpful to improve the torsion and bending deformation. The max error at the x, y, and z axis is 1.32, 1.35, and 1.91 mm because the influence of the weight of joint structure leads to the maximum deflection of FMA at the top of plane 1. The result is consistent with the actual application and structural mechanics analysis. The max position error reaches 3.17 mm before     compensation, and the absolute error of FMA is less than 0.5 mm after compensation with the proposed calibration method. The proposed NGA greatly improves the global research performance than GGA. Its convergence speed is almost two time of GGA. NGA quickly realizes the calculation and meets the accuracy requirement just after 320 generations. Its convergence rate is two times of GGA. The compensation accuracy with LSM is only 1.52 mm because the Jacobin matrix becomes ill-condition which leads to convergence stop. It indicates LSM is not fit to solve calibration with much data calculation for non-linear system. The proposed method is universal and can be extended to other FMAS with different structures. Its effectiveness and feasibility have been verified by experiments.

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.