Abstract
The determination of the optimal measurement area of the articulated arm measuring machine belongs to the multi-dimensional function optimization problem under complex constraints. To realize high-precision measurement of low-precision articulated arm measuring machine, we analyze the working principle and error source of the measuring machine, and establish the optimization target model of the optimal measurement area in this paper. We propose a method for determining the optimal measurement area of an articulated arm measuring machine based on improved FOA. The basic FOA algorithm is improved, the historical optimal individual and population centroid information are added in the population iteration update process, and the fruit fly individuals in each iteration are directly used as the taste concentration judgment value, which increases cooperation and information sharing among fruit fly individuals, and improves the global optimization ability and stability of the algorithm. In the designated area of the measuring machine, we have carried out comparative experiments on the optimization results of improved FOA and basic FOA, ACO, PSO, AL-SC-FOA, LGMS-FOA, IPGS-FFO. Experimental results show that the improved FOA, ACO, PSO, and IPGS-FFO algorithms do not fall into local optimum, and the optimal measurement area determined by them is consistent with the optimization results of other algorithms, and is superior to other algorithms in convergence speed and stability, so it is more suitable for determining the optimal measurement area of articulated arm measuring machine.
Keywords
Introduction
The error sources of articulated arm coordinate measuring machine (AACMM) mainly include circular encoder measurement errors with a sinusoidal variation law, structural parameter errors, thermal deformation errors, force deformation errors, motion errors, and data acquisition system errors; in addition, these error sources include probe errors and measurement errors caused by improper measurement methods and measurement environment 1 with complex variation laws given the series mechanical structure of the AACMM, thereby resulting in amplification effect of each joint error; thus, the measurement accuracy of the measuring machine is lower. 2 The object measured can be placed in the optimal measuring zone of the measuring machine to achieve high-precision measurement of the low-precision AACMM; the maximum measurement error in this zone is the minimum. 3 To determine the precise location of the optimal measuring zone for the measuring machine, the variation law of each error component, transfer relation, and comprehensive error distribution law of the measuring machine must be analyzed to find a precise determination location of the optimal measuring zone through an appropriate optimization algorithm.
Domestic and foreign scholars have conducted research on this issue. Qin 4 used optical autocollimator and metal polyhedral prism combination method to measure the circular indexing error of six grating circular encoders of the measuring machine, and matched the six encoders to determine the deviation range of different areas of the measuring machine. The ant colony algorithm was used to solve the optimal measurement area, but the ACO convergence speed was slow and the single optimization time was long. Jiang 5 simulated the distribution law of the maximum measurement error of the articulated arm measuring machine in the measurement space by using the distribution of points and the extended algorithm, and used the particle swarm optimization (PSO) to optimize the error in a certain area. However, the efficiency of the algorithm in solving the optimal measurement area is low and the program running time is long. Zheng 6 selected v-SVM and RBF kernel function to construct the spatial error distribution model of flexible coordinate measuring machine, and obtained the optimal measurement area model aiming at single point measurement and spatial distance measurement by using support vector machine theory. However, this method is not practical, and the model is based on a large number of measured data, and its measurement error does not include the angle measurement error of circular encoder. Hu et al. 7 determined the measurement space according to the structural parameter analysis of AACMM, divided the measurement space of the measuring machine into several small cubic areas at equal intervals, and used the improved ant colony algorithm to find the maximum measurement error of each small area, but the convergence speed of the algorithm was slow and it was easy to fall into local optimum. Given the complex error sources, transmission relationship, and error distribution law of the AACMM, solving the optimal measuring zone for the AACMM can be classified as a high-dimensional optimization problem. Simultaneously, the optimal measurement zone of the measuring machine under various measurement conditions is different and must be determined in real-time under the measurement condition. Therefore, the stability and real-time performance of the determination algorithm of the measuring machine is proposed. This determination algorithm is poor in search speed and real-time performance. There are many popular intelligent algorithms with good optimization results, such as DE (Differential Evolution algorithm), 8 which starts from a random initial population, so it has wide applicability and nonlinearity. However, when the number of individuals in the population is small, the fitness value of the newly generated population is poor and it is difficult to converge to the extreme point, and the accuracy of determining the best measurement area needs to be further improved.
Fruit fly optimization algorithm (FOA), proposed by Taiwan scholar Pan 9 in 2011, is a global optimization algorithm based on simulating the foraging behavior of Drosophila. Compared with other algorithms, it has the advantages of less control parameters, simple principle, fast search speed and good real-time performance.10,11 It has been successfully applied to solve many practical problems. For example, Wang et al. 12 applied the improved FOA algorithm to China’s industry. An improved fruit fly optimization algorithm (FOA) considers the time delay effect of input variables, which is helpful to select input variables. Wang et al. 13 predicted the remaining service life of lithium-ion batteries based on fractional brownian motion and fruit fly optimization algorithm, and optimized the Hurst index H in the brownian motion FBM model by FOA. Peng et al. 14 applied FOA algorithm to the determination of LSTM super parameters for long and short memory to solve the problems of handwriting recognition and time series prediction, and verified the effectiveness of FOA-LSTM model through experiments. However, the FOA also has some shortcomings, such as random blindness in search, slow convergence rate in subsequent period, low convergence accuracy, easy to fall into local optimization, and unsuitable for optimization problems with negative values in the domain of independent variables15,16; the expected effect is difficult to achieve, especially when solving complex problems, such as multi-peak, high-dimensional, and large-scale issues; therefore, solving the optimal measurement zone of the measuring machine is a complex high-dimensional optimization problem. To apply the FOA with fast search speed and good real-time performance to the real-time determination of the optimal measurement area of the measuring machine, an improved FOA is proposed to enhance its global optimization ability and algorithm stability, and the optimization results of different algorithms are compared and verified.
The remainder of this paper is organized as follows. Section “Related works” describes the related works, including introduce the optimization model of the optimal measuring area of the measuring machine and the improved FOA optimization algorithm. Section “Experiments and analysis” reports the implementation details, the experimental results. At the end of the paper, we conclude the proposed algorithm.
Related works
Model building
Working principle of the AACMM
The structure of the AACMM is illustrated in Figure 1. This structure consists of three flexible measuring arms, six movable joints, and one measuring head. The joints of the mechanical arms are equipped with circular encoder angle sensors. In accordance with the angle value of each joint and the length of the measuring arm, a computer calculates the 3D coordinates of the measured points using the measurement model expressed in equation (1), which is established through the D-H method. 17

Articulated arm measuring machine structure diagram.
where
Structural parameter nominal value of AACMM.
Error analysis of the AACMM
Error analysis of the AACMM
In this work, simplifying the algorithm model only considers the influence of the main error sources (circular encoder angular measurement error with progressive error amplification effect) on the measuring accuracy of the AACMM. The error fitting models of six circular coders measured by a certain type of the AACMM are expressed in equation (2), We use the method of combining autocollimator with metal polyhedral prism to measure the error of circular encoder, establish the eccentric error model of circular encoder, then fit the error curve by using the third-order Fourier series, and calculate the undetermined coefficient by using the least square method, and finally get the error characteristic curves of six circular encoders, as shown in Figure 2, all of which are sinusoidal-like curves with a period of
where

Characteristic curve of the circular encoder error.
Six circular encoder error model parameters.
The rotation angle of each encoder can be expressed as
For measuring the same point, measuing errors will be different with various measuring attitudes. Given that the AACMM can measure the point at any point in the space with numerous measuring attitudes (corresponding to different circular encoder angles and errors), the 3D space coordinate error of the measurement point exhibits a “fruit-like” distribution law and has a certain continuity. Thus, an optimal measurement zone with the maximum error being the minimum exists.
Algorithm model of the optimum measuring area for the AACMM
In accordance with the measurement model equation (1) and equation (4) of the AACMM, the optimal target algorithm model of the maximum measurement error of the points in each partition can be determined as:
where
A minus sign is added before
Clearly, equation (6) is a constrained optimization problem. The most common method for handling constraints is the penalty function. 18 In this work, the constraints are treated using an external penalty function, which is transformed into the external penalty function and then added to the objective function. The feasible field is
The penalty function is:
The target augmented function is
where
Apparently, equation (10) expresses the optimization problem of complex high-dimensional functions for solving the minimum value without specific requirements for solving this problem. In this function, six independent variables (six circular encoders) are presented in equation (10). Thus, the optimization algorithm adopted must be suitable for multi-dimensional function optimization and must have an improved multi-dimensional variable coding scheme. Given that the algorithm for determining the optimal measurement zone of the AACMM must be embedded in the DSP subsequently, this algorithm is used to determine the optimal measurement zone of the AACMM for different measurement objects, strategies, and environments in real-time. This real-time requirement of the optimization algorithm is proposed. The six variables in equation (10) have a large range of values, and the whole range of values has positive and negative values. The candidate solution of the optimization algorithm must cover the entire domain as much as possible and coordinate the global and local optimization.
The basic FOA has the advantages of minimal control parameters, simple principle, fast search speed, and favorable real-time performance. Thus, it can be used to solve the real-time problem of the optimal measurement zone of the AACMM. However, the basic FOA is unsuitable for solving the minimum value of equation (10). Therefore, the basic FOA must be improved to make this algorithm suitable for solving this question.
Optimization algorithm
Basic FOA
Fruit fly optimization algorithm (FOA) is a swarm intelligence optimization algorithm based on drosophila foraging behavior evolution. Drosophila has a keen olfactory system, which can search for food sources far away, and then find the location of food and other flies through the visual system, and fly to them. 19 The drosophila foraging behavior is applied to the field of intelligent optimization algorithm, and the fruit fly optimization algorithm is formed. The optimal solution of the specific problem is finally found through the communication between individual foraging information and group foraging information. In accordance with this characteristic of the fruit fly population, the basic steps of the FOA are presented as follows:
(1) Initialize the population location, and set the population size (Sizepop) and the maximum number of iterations (maxgen).
(2) Fruit fly individuals search for food through random directions and distances.
(3) Estimate the distance (Dist) between the fruit fly and the origin, and then calculate the taste concentration judgment value S, which is the reciprocal of Dist.
(4) Substitute the taste concentration det-ermination value
(5) Find the location of the fruit flies with the lowest taste concentration (bestindex) and minimum taste concentration (bestSmell) in the fruit fly population (in the case of minimum value).
(6) Preserve the optimal taste concentration value and
(7) Enter an iterative optimization, repeat Steps (2)–(5), and make a judgment: If true, then execute Step (6); otherwise, continue the iterative optimization. Figure 3 shows the algorithm flow chart of the basic FOA optimization algorithm.

The basic FOA algorithm flow chart.
Improve FOA
To make the FOA suitable for solving the optimal measurement zone of the AACMM, the present work combines ACFOA (The algorithm determines whether FOA is in local convergence state by the value of population fitness variance. If so, chaotic algorithm is used for global optimization, so as to jump out of local extremum and improve the convergence accuracy and convergence speed of FOA.) and LGMS-FOA 20 (In LGMS, a parameter called inertia weight is introduced to balance global search and local search. LGMS-FOA tends to have more global search ability at the beginning of operation and more local search ability at the end of operation) to make the following improvements to the basic FOA are as follows21,22:
A reasonable multi-dimensional variable coding scheme is designed.
The basic FOA only uses the optimal individual information of the current population in the iterative optimization, and the local optimal solution is easily reached. To solve this problem, the information of historical optimal individuals and population centroid is added to increase cooperation and information sharing among fruit fly individuals, thus improving the accuracy and robustness of the algorithm.
The taste concentration determination value
The improved FOA is used to solve the optimal measurement zone of the AACMM. The specific steps of the algorithm are presented as follows:
(1) Initialize the location of the fruit fly population (
(2) Provide the fruit fly individuals the random direction and distance to search for food using the sense of smell.
(3) Substitut
(4) Record the optimal taste concentration value of fruit fly individuals (bestSmell) in the current population, and retain the historical optimal fitness value and position information of everyone in
(5) Calculate the population center of mass using equations (24)–(27), and assign the value to
(6) Update the population position using equation (28).
where
(7) Limit the range of taste concentration determination value (
(8) Enter the iteration optimization until the termination condition is satisfied. Figure 4 shows the algorithm flow chart of the improved FOA optimization algorithm.

The improved FOA algorithm flow chart.
Experiments and analysis
Algorithm test for solving the optimal measurement zone
Space
To test the performance of the algorithm, the PSO algorithm, LGMS-FOA, ACO algorithm, and improved FOA are used to solve the maximum measurement error determined by the objective function of equation (10) in the small 3D space
In order to compare the influence of the maximum and minimum particle velocity parameters on PSO algorithm performance,

PSO algorithm optimization results at different particle velocities.
Particle size
Similarly, after several parameter adjustment and analysis, the optimal parameter settings of each algorithm are obtained as follows:
The LGMS-FOA parameters: population size
The ACO algorithm parameters: population size
The improved FOA parameters: population size
Parameter setting of four algorithms.
In accordance with the algorithm parameters set above, the PSO algorithm, LGMS-FOA, ACO algorithm, and improved FOA are run 100 times. The single optimization results of the four algorithms are depicted in Figure 6, and the test results are compared, as summarized in Table 4.

Comparison of optimization results of four algorithms.
Four algorithm test results.
To test the performance of the improved FOA further, the basic FOA, LGMS-FOA, IPGS-FFO algorithm, AL-SC-FOA, and improved FOA are used to solve the maximum measurement error determined by the objective function of equation (10) in the small 3D space
The parameters of the basic FOA are set as follows: population size
The parameters of the LGMS-FOA are set as follows: population size
The parameters of the IPGS-FFO algorithm are set as follows: population size
The parameters of the AL-SC-FOA are set as follows: population size
The parameters of the improved FOA are set as follows: population size
The test and optimization results of the five algorithms are displayed in Table 6 and Figure 7 respectively. The specific parameter settings are shown in Table 5.

Algorithm optimization results under different population sizes.
Parameter setting of five algorithms.
To verify the feasibility of the improved FOA further, the improved FOA algorithm and PSO algorithm which has successfully solved the optimal measurement area in AACMM in the early stage of the project team are adopted. These algorithms are applied to solve the minimum value using equation (10) (maximum measurement error of each small 3D space of 1000 small stereo spaces that are divided in section “Algorithm test for solving the optimal measurement zone”). Then, the optimization results of the two algorithms are compared.
The parameters of the improved FOA are set as follows: population size
The parameters of the PSO algorithm are set as follows: particle size
To compare the maximum measurement errors of each small stereo space, some data with large and small measurement errors are selected, and the obtained fitness value is retained using two significant figures (Table 7).
Analysis of experimental results
After testing and analyzing various algorithms for solving the optimal measurement area of AACMM measuring machine in section “Algorithm test for solving the optimal measurement zone,” we can get the following analysis results.
Taking the small measuring space area
the LGMS-FOA reaches the local optimal solution, and the optimal value is −0.063 mm. The PSO algorithm, ACO algorithm, and improved FOA do not reach the local optimal solution, and the optimal value (i.e. the maximum measurement error in the small stereo space) is −0.11 mm. Therefore, the maximum measurement error of the measuring machine in this area should be 0.11 mm.
The convergence speed is faster in the improved FOA than in the ACO and PSO algorithms. The improved FOA converges in the ninth generation, and the ACO and PSO algorithms converge in the 892nd and 653rd generations, correspondingly.
The improved FOA has a shorter single optimization time than the ACO and PSO algorithms. In comparison with the PSO algorithm, the improved FOA enhances the speed of the single optimization operation by 4.1%. In comparison with the ACO algorithm, the FOA improves the speed of a single optimization operation by 25.8%.
The mean value and standard deviation obtained by the three algorithms without falling into the local optimal solution running 100 times independently indicate that the accuracy and stability of the improved FOA are superior to the ACO and PSO algorithms.
As can be seen from Figure 7 and Table 6:
In the case of the different Sizepop values, the basic FOA, AL-SC-FOA, and LGMS-FOA all reach the local optimal solution. When
With the same value of Simipop, the single optimization operation time of the basic FOA and LGMS-FOA is short, and the IPGS-FFO has the longest single optimization time, followed by the improved FOA. When
The number of iterations of the improved FOA is nearly a single digit and does not fall into the local optimum. The convergence speed of the improved FOA is enhanced on the basis of the basic FOA.
The standard deviation of the improved FOA operation that is run 100 times is less than the IPGS-FFO, which shows that the stability is better in the improved FOA than in the IPGS-FFO.
The comparison of the basic FOA and the improved FOA implies that the performance of the basic FOA can be effectively enhanced through the method proposed in this work.
Algorithm test results.
In the measuring space
Maximum measurement error of each zone.
Conclusion
The error variation law of the articulated arm measuring machine is analyzed, and the error measurement model and the optimization target model of the optimal measurement area of the articulated arm measuring machine are established.
In this paper, an improved FOA optimization algorithm is proposed to solve the optimal measurement area of articulated arm measuring machine, and the optimization effect comparative experiments of the improved FOA algorithm, PSO algorithm, LGMS-FOA algorithm, and ACO algorithm are carried out in the specified small measurement space
According to the angle error data of six joint circular encoders, the PSO algorithm and the improved FOA algorithm are used to test the optimal measurement area of the articulated arm in the measurement space
Footnotes
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.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was funded by the National Natural Science Foundation of China (Grant No. 51675004 and No. 51775163).
