Cylindricity Error Evaluation Based on an Improved Harmony Search Algorithm

)e cylindricity error is one of the basic form errors in mechanical parts, which greatly influences the assembly accuracy and service life of relevant parts. For the minimum zone method (MZM) in international standards, there is no specific formula to calculate the cylindricity error. )erefore, the evaluation methods of the cylindricity error under the MZM have been widely concerned by international scholars. To improve the evaluation accuracy and accelerate the iteration speed of the cylindricity, an improved harmony search (IHS) algorithm is proposed and applied to compute the cylindricity. On the basis of the standard harmony search algorithm, the logistic chaotic initialization is introduced into the generation of initial solution to improve the quality of solutions. During the iterative process, the global and local search capabilities are balanced by adopting the par and bw operators adaptively. After each iteration, the Cauchy mutation strategy is adopted to the best solution to further improve the calculation precision of the IHS algorithm. Finally, four test functions and three groups of cylindricity error examples were applied to validity verification of the IHS algorithm, the simulation test results show that the IHS algorithm has advantages of the computing accuracy and iteration speed compared with other traditional algorithms, and it is very effective for the application in the evaluation of the cylindricity error.


Introduction
In order to evaluate the manufacturing quality of mechanical parts, the inspection process has always been an important step in the whole life cycle of mechanical products. As an important parameter to evaluate the manufacturing accuracy of the internal and external cylindrical surfaces of the rotary part, the cylindricity error has become the focus of the research in the field of mechanical measurement. Coordinate measuring machine (CMM) is a common tool to inspect the cylindricity error of the mechanical parts, which is widely used because of its high precision. e spatial coordinates information of the measured point of the part is obtained by the sensor of the CMM. en, the measurement data obtained from the sensor is analyzed through the error evaluation algorithm to calculate the cylindricity error of the measured parts. At present, in order to obtain the cylindricity error of measurement data more quickly and accurately, a lot of research results have been obtained. It is of great value in engineering application to evaluate the cylindricity error quickly and accurately, which has great influence on the function and life of the product.
For the cylindricity error evaluation, the least square method (LSM) is widely used in the field of engineering applications, but the accuracy of LSM is relatively low and cannot be applied in the high-precision evaluation field [1,2]. Compared with the LSM, the minimum zone method (MZM) is one of the techniques that has a higher evaluation accuracy. It can meet the minimum zone principle in the international standards and obtain the accurate results of the measurement data. However, there is no specific algorithm in international standards, so it has received widely attention and research on the MZM by international scholars.
Based on the initial research results, the nonlinear optimization algorithms [3,4] are the most important methods for cylindricity error evaluation under the MZM. Moreover, the nonlinear optimization algorithms are relatively complex and difficult in the construction of the mathematical model. However, with the continuous improvement of the artificial intelligence technology, the intelligent optimization algorithms have developed an effective method to solve such complex nonlinear problems. And some of them have been introduced into the cylindricity error evaluation because of their simplicity and effectiveness, such as GA [5] and PSO [6,7]. In addition, compared with nonlinear optimization algorithms, the construction of the mathematical model for intelligent optimization algorithm is also very simple. But the initialization parameters of these algorithms have great influence on the calculation results. erefore, the improvement of the accuracy and convergence speed of the cylindricity algorithm has become an important research topic at this stage.
Harmony search (HS) algorithm is an intelligent optimization algorithm, which simulates the creation process of the music [8]. It has the advantages of relatively simple computational principle and strong global search ability, so it is very suitable for engineering applications such as the sizing optimization of truss structures and reliability problems [9,10]. But for the basic HS algorithm, there are some problems such as the premature convergence in the iteration process and low accuracy in later iteration.
To improve the evaluation accuracy and accelerate the iteration speed of the cylindricity, on the basis of the standard HS algorithm, the logistic chaotic initialization is introduced into the generation of initial solution to improve the quality of solutions. During the iterative process, the global and local search capabilities are balanced by adopting the par and bw operators adaptively. After each iteration, the Cauchy mutation strategy is adopted to the best solution to further improve the calculation precision of the IHS algorithm. Finally, four test functions and three groups of cylindricity error examples were applied to validity verification of the IHS algorithm, the simulation test results show that the IHS algorithm has advantages of the computing accuracy and iteration speed compared with other traditional algorithms, and it is very effective for the application in the evaluation of the cylindricity error. e organizational structure of this paper is shown as follows: the research background and significance of the paper are introduced in Section 1. In Section 2, the present research results of this work are described. In Section 3, the mathematical model of the cylindricity error and the objective function of the problem are established. e basic HS algorithm and IHS algorithm are proposed in Sections 4 and 5, respectively. e simulation experiments of the algorithms and cylindricity error analysis are carried out in Section 6. In the last section of this paper, the conclusion of this work is summarized and the future work is prospected.

Related Works
In the research results of the cylindricity error evaluation under the MZM, Carr and Ferreira established the nonlinear mathematical model of the cylindricity and straightness errors and then used the linear programming method (LPM) to solve the problem, but this method requires a set of appropriate initial solutions [3]. Lai and Chen converted the spatial cylindricity into the plane problems by nonlinear transformation and used the parameters adjustment to obtain the cylindricity error [4]. Chou and Sun deduced a general mathematical model of the cylindricity error. e simulated annealing (SA) algorithm is applied to solve the model that shows the advantage in the global optimization performance [11]. Lai et al. used the genetic algorithm (GA) to solve the mathematical model of the cylindricity error under the MZM, and the experiment proves that the method has good flexibility and accuraxcy [5]. Weber et al. applied the linear approximation technique to the form error evaluation that includes the cylindricity error. e method provided an approximate solution for the form error [12]. Zhu and Ding combined the motion geometry and sequence approximation algorithm to analyze and evaluate the cylindricity error. e experiments proved the validity of the algorithm [13]. Lao et al. improved the hyperboloid technique by constructing an initial axis to establish the cylindrical error evaluation model, and the experiment showed that the method further improved the accuracy of cylindricity evaluation [14]. Cui et al. and Mao et al. applied a particle swarm optimization (PSO) algorithm to cylindricity error evaluation, and the calculation accuracy was further improved, respectively [6,7]. Venkaiah and Shunmugam designed a cylindricity error evaluation algorithm based on the computational geometry method [15]. Bei et al. and Guo et al. improved the genetic algorithm and applied it to the cylindricity error assessment, respectively [16,17]. Li et al. used the coordinate transformation to construct the cylindricity error mathematical model, and the model has a high evaluation accuracy [18]. Luo et al. further improved the global optimization ability of an artificial bee colony algorithm by introducing tabu strategy, thus increasing the evaluation speed of the cylindricity error [19]. Wen et al. modified the particle velocity using a contraction factor and improved the convergence ability of the PSO. e improved PSO (IPSO) was applied to the cylindricity and conicity errors which have a good flexibility [20]. Lei et al. designed a method of cylindricity error evaluation based on the geometry optimization searching algorithm. e method can obtain the cylindricity error by setting the hexagon in the measurement points [21]. Lee et al. developed a cylindricity error evaluation based on support vector machines (SVM), and the algorithm can be applied in the field of the machine vision system [22]. Wen et al. utilized a quasiparticle swarm algorithm and calculated the cylindricity error [23]. He et al. used kinematic geometry and a sequential quadratic programming algorithm to solve the cylindricity error of measured parts. e method has high stability and accuracy [24]. Hermann introduced the 2 Scientific Programming application of the computation geometry technique to the form errors that include cylindricity [25]. Zheng et al. adopted a linear programming method to construct the mathematical model of the cylindricity error. e model was solved by a new simplex method [26]. On the basis of the above literatures, we improved the HS algorithm through the generation of initial solution, the dynamic adjustment of operators, and the optimal solution perturbation, to further enhance the optimization ability and the iterative speed of the basic HS algorithm. It is designed to provide a reliable method for the evaluation of the cylindricity error.

Mathematical Model of Cylindricity Error Evaluation
According to the concepts in the relevant standard [1,2], the cylindricity error under the MZM can be de ned as follows: the area is the radius di erence of two coaxial ideal cylinders that contain the measured cylinder, and when the area reaches the minimum value, the radius di erence is the cylindricity error under the MZM. As shown in Figure 1, the graph shows the measurement process of the cylindricity error. For the cylindrical parts, due to the manufacturing errors of the machine tool, the actual parts will always have a certain error compared with the ideal parts, and the cylindrical surface will produce a certain deformation. erefore, the CMM is used to obtain the coordinates information of the measured parts. Figure 2 illustrates the principle of the cylindricity error calculation, where L is the axis of the two ideal cylinders and f is the radius di erence; when f takes the minimum value, the value of f is the cylindricity error of the cylinder measured under the MZM.
As a space element, the mathematical expression of the cylindricity error requires more parameters. In order to reduce the amount of computation, the relevant literatures simpli ed the model by assuming conditions, which does not really match the reality [5,17]. In order to ensure the generality of cylindricity error evaluation, the general equation of the cylinder error is established under the MZM to obtain the error. It is assumed that the points of the measured cylinder are is the coordinates of the measured point in the Cartesian coordinate system and n is the number of measured points. L is the coaxial cylindrical axis, and the pointoriented parametric equation is formula (1) [16], where x 0 , y 0 , and z 0 is the xed point of L and the a, b, and c are the directional parameters, respectively. For the measured point p i , its distance equation to the space axis L is shown as formula (2), where r is the distance from the point p i to the axis L and i, j, and k are the unit vectors of the x, y, and z direction: x erefore, for the intelligent optimization algorithm, the objective function of the problem needs to be established. Based on the minimum condition of the cylindricity error, it can be converted to a nonlinear minimum problem. e objective function is shown as formula (3) [16]. e target parameters are the value of x 0 , y 0 , z 0 , a, b, and c when f met the minimum value: Formula (3) describes the mathematical model of the cylindricity error. f is the value of the cylindricity error of the measured part. x 0 , y 0 , z 0 , a, b, and c are the parameters value of the two ideal cylindrical axes when f obtains the minimum value that can satisfy the MZM  erefore, for this nonlinear minimization problem, it can be solved by the HS algorithm.

Basic Harmony Search Algorithm
e HS algorithm is a heuristic intelligent optimization algorithm proposed by Geem et al. [8] in 2001. It simulates the creation process of music to achieve the goal of optimization. e audience's evaluation of the music is the function fitness value. HS algorithm flow includes the parameters initialization, the generation of new solutions, and the updating of the harmony memory library (HMS). e HS algorithm process is shown as follows.

Parameter Initialization.
In the HS algorithm, N is the size of the HM, x i is the harmony vector of the HMS (the solution of problem), x ij is the component j of harmony vector i, D is the dimension of the problem, x l and x u are the lower and upper values in each dimension, the specific expression is x � x|x l ≤ x ij ≤ x u , i � 1, 2, . . . , N; j � 1, 2, . . . , D , P is the harmony memory considering the rate, par is the pitch adjusting rate, and bw is the bandwidth. According to the abovementioned variable meaning, the harmony vector i's is the function fitness value, and the optimal solution is the x best , and initialize the harmony memory library by where r is a random number whose value is 0 to 1.

Generation of New Harmony Vector.
In this stage, a new harmonic vector is generated by three methods, which are harmony memory, tone adjustment, and random generation. e new harmony vector can be expressed as x ′ � (x 1 ′ , x 2 ′ , . . . , x D ′ ), and each component of x ′ is produced by the above three methods. Firstly, the probability of HMCR is used to control the new vector component, and the pseudocode is shown as Algorithm 1; secondly, after considering the probability of memory consideration, it needs to consider probability of the tone adjustment, and the pseudocode is shown as Algorithm 2.

Termination Condition.
By setting the number of iterations or calculating precision, the algorithm is judged to be finished. e pseudocode of the HS algorithm is shown as Algorithm 3.

e Motivation of the IHS.
HS algorithm is an intelligent optimization algorithm derived from the creation of the music. For the basic HS, the best solution in the HM is an individual with the best function value. Although the HS algorithm has a good optimization ability, it is still easy to fall into the local optimum. According to the principle of the basic HS algorithm, there are three main problems. Firstly, the distribution of the initial solution will greatly affect the initial computational performance of the algorithm. Secondly, the par and bw of the HS algorithm greatly affect the algorithm optimization efficiency. irdly, the HS algorithm only updates the worst solution and does not search the optimal solution. erefore, based on the three problems existing above in the HS algorithm and combined with the problems to be solved, the initial solution generation, dynamic adjustment of the operator, and optimal solution disturbance are proposed to increase the diversity of the population and prevent the premature convergence of the algorithm.  (4) Calculate End while Output x best ALGORITHM 3: Pseudocode of the HS algorithm. 4 Scientific Programming

Chaos Initialization.
In the initialization process of the intelligent optimization algorithm, different generation methods will produce different initial solution sequences. e basic HS algorithm generates the initial population in a random way that has some problems such as the uneven distribution of the original individual and thus affects the optimization performance of the algorithm. To make the initial solution more uniformly distributed and improve the quality of the initial solution, the chaotic initialization is applied to the standard HS. Chaos sequence has the advantages of traversal, randomness, and regularity, and it can be obtained by a definite equation [27]. e sequence of initial solution generated by logistic chaotic [28] mapping is proposed as where μ is 4, and it indicates that the system is a completely chaotic; x min and x max are the upper and lower limits of the variable in solution space, respectively; x n is a initialization variable generated by chaotic in (0,1]; and x n ′ is the variable that is mapped to the range of value between x min and x max by x n .

New Parameters of par and bw.
In the basic harmony search algorithm, par and bw are the two key control parameters. e global and local search ability of the algorithm is mainly controlled by par, and the convergence speed of the algorithm is adjusted by bw. However, par and bw are constant values, and they are impossible to adjust the global and local search ability effectively in the iterative process of the algorithm, which leads to the algorithm falling into the local optimum.
In order to improve the optimization ability and iterative speed of the basic HS, the par and bw are adjusted by a dynamic factor. For par, a smaller value is taken at the beginning of the iteration to increase the global exploration ability, and the local search ability is enhanced by a larger value at the end of the algorithm. For bw, a large value is taken at the beginning of the iteration to increase the diversity of the population, and a smaller value is taken in the late iteration inspired by a simplified artificial fish warm algorithm (SAFSA) [29]. e new par and bw are shown as where bw 0 is the initial value of 0.5 and t is the current number of iterations.

Cauchy Mutation Strategy.
In the iterative process of the harmonic search algorithm, the optimal solution usually swings between the historical optimal solutions, so it needs to further increase the search space of the optimal solution and avoid the algorithm falling into the local optimum. In order to improve the accuracy of the algorithm, the Cauchy mutation strategy is introduced into the algorithm; in each iterative process, the global optimal solution is mutated, and the mutation prevents the optimal solution oscillation and accelerates the convergence speed of the algorithm, β is defined as the random number of Cauchy (0, 1) distribution, as shown in the following formulae: β � tan(π * (rand(0, 1) − 0.5)).

Algorithm
Steps of IHS. Based on the corresponding improvement methods, the proposed IHS algorithm process is shown below: (1) Parameters initialization: N is the size of the HM; D is the dimension of the problem; x l and x u are the End Update x best as formulae (7)  upper and lower limits of the variables; P is the harmony memory considering the rate; par is the pitch adjusting rate; and bw is the bandwidth. en, go to step (2). (2) Chaos initialization: As described in Section 5.2, random sequence individuals which number is N are generated, and the fitness function value of each individual is calculated; the generated N harmony vectors are deposited into the harmony memory as the initial solution vectors. en, go to step (3). (3) Generate a new harmony vector: As described in Section 4.2, a new harmony is generated by harmony memory, tone adjustment, and random generation, respectively, where par and bw are replaced by Section 5.2. en, go to step (4). (4) Update the HMS, as described in Section 4.3. en, go to step (5). (5) Cauchy mutation strategy: According to Section 5.3, the best solution x best is updated, shown as formulae (7) and (8). en, go to step (6). (6) Iteration stopping criterion: If the calculation satisfies the stopping criterion, the calculation is completed and the optimal solution is output; if not, return to step (3). e pseudocode of IHS is shown as Algorithm 5.

Experiment and Discussion
In order to verify the validity of the IHS algorithm for the calculation of the cylindricity error, this paper has selected four test functions and three groups of examples to test the performance of the IHS algorithm. e computer system in this experiment is Win 7 64 bit, the processor is i5-4200ucpu @ 1.60 GHz, the installation memory is 4.00 GB, each group experiment is calculated 30 times, experiment iterations of each group is 500, the population quantity is 50, the dimension of problem D is 6, bw 0 is 0.5, P is 0.9, and the upper and lower bounds of variables are [−30, 30].

Performance Test.
To test the performance of the IHS, four standard test functions are adopted. As shown in Table 1, sphere function is a simple one-peak function that mainly tests the iteration speed of the algorithm. Rosenbrock function is a relatively complex single-peak function to test the optimal performance. Rastrigin function and Griewank function are both multimodal test functions. But the Griewank function is relatively complex than the Rastrigin function, and they are commonly used to test the global search capability of the algorithm. e images of the above four test functions are shown as Figures 3-6.
To test the computing performance of the IHS, the HS, firefly algorithm (FA), dragonfly algorithm (DA), artificial bee colony (ABC), and modified harmony search (MHS) algorithm are applied to the test as contrast algorithms. e parameters of the IHS are shown in the following: the number of initial population is 50, the dimension of the problem is 6, the number of global iteration is 500, and the algorithm is tested 30 times.
e experimental results are shown in Table 2. For the test results of the test functions, compared with the HS, FA, DA, ABC, and MHS algorithms, the IHS algorithm has the lowest mean value that represents highest computing precision, and the lowest standard deviation that represents the high computational stability in sphere and Rosenbrock functions. For the test results of Rastrigin and Griewank, IHS can converge to the global optimal solution, while other algorithms fall into the local optimal. erefore, IHS algorithm has good optimization ability compared with other algorithms. Figures 7,9,11, and 13 describe the iterative convergence curves of FA, DA, ABC, HS, MHS, and IHS. Meanwhile, the optimal solution boxplot of the algorithms under each test function is also drawn. It can see that the IHS algorithm converges faster and converges to the optimal solution on Rastrigin and Griewank test functions. And as it also can be seen from Figures 8, 10, 12, and 14 that the IHS algorithm has a concentrated distribution of optimization results in 30 times, which shows has good stability. Based on the results of the test function of the six algorithms, it can been seen that the IHS algorithm is better than the other five algorithms from the comparison of the experimental curves in Figures 7-14. Table 3 shows the statistical analysis results of the Wilcoxon-rank test of the algorithms. e P value is the Wilcoxon test value of IHS algorithm with other five algorithms at confidence level of 0.05. According to the results in Table 3, the calculated P values are all less than 0.05, and there are significant differences between IHS and the other five algorithms under these four test functions. erefore, the conclusion is of statistical significance.

Cylindricity Error Experiment 1.
To verify the effectiveness of the IHS algorithm in the cylindricity error evaluation, the data of the measured cylindrical parts were obtained by the CMM and are shown in Table 4. HS and IHS algorithms are used to calculate the cylindricity error.
Scientific Programming   Table 5. It can be seen that the calculation result of HS is 0.01941 mm. e calculation result of IHS is 0.01938 mm, and the cylinder axis coordinates are 13.004, 5.01066, 14.9803, −5.11827E − 05, −0.000733209, and −0.816712; its result is smaller than HS in the listed algorithms, so the accuracy of the cylindricity error is highest. As can be seen from Figure 15, the iteration curve of the HS and IHS algorithms are, respectively, described. As seen in Figure 8, when the number of iterations is set to 64 times, the IHS algorithm is convergence, and for HS, the number of iterations is 390 times. e IHS has a faster iterative speed than HS.

Cylindricity Error Experiment 2.
To test the performance of the IHS algorithm in the cylindricity evaluation, the data obtained from correlation literature are used to experiment [21]. e evaluation results of the HS and IHS algorithms are compared with the other literatures. Table 6 is reproduced from Lei et al. [21] (under the Creative Commons Attribution License/public domain). e calculation results of the IHS and other related literature algorithms are listed in Table 7. It can be seen that the calculation results of other algorithms are less than the MIC. e results of the GOS algorithm in the paper are 0.0319 mm. e calculation results of HS and IHS are 0.03204 mm and 0.03188 mm, respectively, and the cylinder axis coordinates of the IHS are 0.0120278, 0.01206, 60.522, −0.000008223, 0.000137151, and −0.853656; their result of IHS is the smallest in the listed algorithms, so the accuracy of the cylindricity error is the highest. e iteration curves of HS and IHS are shown in Figure 16. e convergence times of IHS are at 57 iterations, and HS times is at 365 iterations. e convergence speed of the IHS algorithm is faster than that of the HS algorithm.         Table 9. It can be seen that the calculation results of other algorithms are less than the LSM. e calculation results of HS and IHS are 0.18748 mm and 0.183957 mm, respectively, and the cylinder axis coordinates of the IHS are 0.005953, 0.024811, 7.583571, 0.006012, 0.028294, and −9.706070; their result of IHS is the smallest in the listed algorithms, so the accuracy of the cylindricity error is the highest. e iteration curves of HS and IHS are shown in Figure 17. e convergence times of IHS are at 48 iterations, and HS times is at 285 iteration times. e convergence speed of the IHS algorithm is faster than that of the HS algorithm.

Conclusion and Future Work
To improve the evaluation accuracy and accelerate the iteration speed of the cylindricity, the harmony search algorithm is applied to the evaluation of the cylindricity error. An improved harmony search algorithm is proposed to solve the problems of early premature convergence of the   basic harmony search algorithm and easy to get into local optimization. e logistic chaotic initialization is introduced into the generation of initial solution to improve the quality of solutions. During the iterative process, the global and local search capabilities are balanced by adopting the par and bw operators adaptively. After each iteration, the Cauchy mutation strategy is adopted to the best solution to further improve the calculation precision of the IHS algorithm. e results show that the improved harmony search algorithm is very suitable for the accurate evaluation of the cylindricity error.
With the continuous development of big data and arti cial intelligence technology, we will carry on a depth analysis to the cylindricity error data of the parts to nd the internal relation between the manufacturing information and cylindricity error, so as to further optimize the processing technology and improve the manufacturing accuracy of the parts.
Data Availability e data used to support the ndings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that there are no con icts of interest regarding the publication of this paper.   Scienti c Programming