Improved algorithm for minimum zone of roundness error evaluation using alternating exchange approach

Based on computational geometry techniques, an improved algorithm for the minimum zone of roundness error evaluation using an alternating exchange method is presented. A minimum zone fitting function was created to enhance the roundness error evaluation. The function uses three candidate points to determine the initial solution: the expected centre, the mean circle radius, and the corresponding zone half-width. The best solution function is designed to use the initial solution as the input to determine the optimum solution for the minimum zone circle (MZC). The proposed algorithm was validated using data available in the literature. The roundness error evaluation comparison results demonstrate that the proposed method accurately detects both the centre error magnitude and MZC and overcomes the insufficiency of using selected colinear points for four selected points.


Introduction
The roundness error is a fundamental criterion in quality inspection for validating produced parts. This error has been specified by the American National Standards Institute (ANSI) under dimensioning and tolerance standards [1,2], as well as by the International Organization for Standardization (ISO) under their geometrical product specifications [3,4]. Owing to the complexity and uncertainty of machining processes, soft computing techniques are preferred for evaluating the roundness error [5]. These techniques are primarily classified into * Author to whom any correspondence should be addressed.
Original content from this work may be used under the terms of the Creative Commons Attribution 4.0 licence. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI. two groups: algebraic-based techniques and computational geometry-based techniques [6]. The most commonly used methods for the evaluation of roundness error are the leastsquare circle method, minimum zone circle (MZC) method, minimum circumscribed circle (MCC) method, and maximum inscribed circle (MIC) method [7]. Among these, only the MZC has been confirmed by ANSI and ISO. Although the MZC is extensively used for the evaluation of roundness errors, there is no specific procedure for establishing a reference feature [8]. Therefore, researchers have focused on improving the accuracy of roundness error evaluation.
In recent years, numerous studies have addressed the MZC evaluation of roundness errors. Different methods have been used to solve linear and nonlinear MZC problems. Based on nonlinear optimisation, a genetic algorithm was proposed by Wen et al [9]. However, although this technique is robust, it has only been applied to small samples. For cases with a significant number of sample points, a fast genetic algorithm was implemented. The applied genetic parameters include population size, crossover, mutation, stop condition, and search space. The use of ideal genetic parameters improves the feasibility of a solution while reducing the computing time [10]. By contrast, Du et al [11] introduced a particle swarm algorithm that can avoid becoming trapped in the local minimum of the optimisation by changing the weight. However, the computation time is a key factor in metaheuristic methods. Rossi et al [12] presented an optimal sampling strategy that provided sufficient accuracy with an appropriate processing time. Moreover, computational geometry methods have also been widely used to evaluate the roundness error. Lei et al [13] introduced a roundness error evaluation method based on a polar coordinate transform algorithm (PCTA). Similarly, Ben et al [14] presented a rapid precision evaluation of the roundness error in polar coordinates. However, the accuracy of this method depends on the number of mesh points, which is expensive in some cases. In another study, a fourpoint intersection principle and bisection method were introduced to evaluate the MZCs [15]. This method focuses on improving the selection of the initial points. The chord intersection relationship is also used to accurately determine the centre coordinates of the concentric circles [16]. The roundness error has also been evaluated using other approaches, such as integrating the bidirectional search of unequal probability and offset mechanisms [17], hybrid global search [8], selection of four points [18], worst-case analysis [19], the concept of convex hulls, and the newly proposed equi-angular diagrams [20]. Based on a selected point dataset, Muralikrishnan et al [21] discussed the implementation of the alternating exchange algorithm. This method determines the MZC using a set of four selected points. According to [22], this method can fail to achieve the best approximation if the four points are collinear or are at the vertices of a (convex) quadrilateral with a pair of opposite sides parallel.
This paper proposes an algorithm that utilises a set of three selected points to enhance the positioning of the MZC centre coordinate to create the best approximation and thus avoid failures caused by collinear selected points. However, the direct mathematical calculation for the MZC defined by three points does not guarantee the best solution. Hence, to obtain the best solution, an improved alternating exchange algorithm with a realistic pre-construct geometry was developed.

Principle of MZC
According to the definition of MZC, the problem requires the identification of two concentric circles that confine all the dataset points with a minimal difference in their radii [3], which is given by where r 1 and r 2 represent the outer and inner minimum zone radii, respectively; (a, b), the MZ coordinate centre; and (x 1 , y 1 ), (x 2 , y 2 ), the furthest boundary points. The roundness error of the MZC is given as follows:

Improved exchange algorithm
The algorithm intends to specify the centre coordinate of the MZCs O (a, b) , with respect to the measurement origin M, the mean radius r o , and the current zone half-width h. The proposed algorithm relies on the geometry interception properties, as shown in figure 1. It takes three selected points from the measured dataset as inputs p 1 , p 2 , p 3 , which are denoted as the critical points and are selected randomly for the first iteration. Two concentric circles will be constructed from a temporary specified centre O (a, b); current zone half-width h will be used to verify whether any points are outside the current zone; and the two concentric circles that confine all the datasets will represent the minimum zone error. The basic consideration comes from the exchange algorithm, and it proves that for selected set points p 1 , p 3 , p 3 no two consequent points should be on the same circle, which allows us to say that (p 1 , p 3 ) specifies one circle (outer boundary), and p 2 specifies the other circle (inner boundary). In addition, by the theorem of the circle, the best centre must be located somewhere on the p 1 p 3 bisector. Accordancing to [13], the specified minimum zone coordinate centre point of the MIC, MCC, and MZC are located in a small zone area around the measurement origin M.

Small zone specification.
To identify the proposed small zone, we assume p 1 , p 3 to be in the same circle (outer boundary) and take p 1 p 3 as a chord in this circle, with the constructed bisector in g. We construct two small circles referenced in M using the intersection points O 1 , O 2 . The first circle is constructed with a radius M O 1 and the second circle with a radius M O 2 . Then, we consider the quadrilateral shape 4 as the proposed small zone.

Minimum zone fitting function.
According to the alternating exchange algorithm, the function is intended to search for the furthest inner and outer points p 1 , p 2 , p 3 ; this fuction helps obtain the MZC error by updating these points in each iteration. Since the exchange algorithm is based on the mean radius r o and minimum zone half-width between the two concentric circles h; then, from the assumed small zone, as shown in figure 1, the interception point of the p 1 p 3 bisector and the angle P2, M, P3 bisector can be obtained as a good approximation of the concentric centre point O (a, b). Thus, to achieve the centre of two concentric MZCs, the Thus, from the selected critical points p 1 , p 2 , p 3 , with it is corresponding temporarily obtained centre O (a, b), we rewrite equation (1) as follows: The specified mean radius r o is given as follows: Further, the minimum zone half-width between the two concentric circles, h, is given as follows: Practically, the obtained centre O(a, b) of the minimum zone for particularly critical points is located in a triangular sector area p 1 Mp 2 when p 1 > p 3 and sgn (x 2 ) = sgn (a 2 ).
Alternatively, it will be located in a triangular sector area p 3 Mp 2 when p 3 > p 1 and sgn (x 2 ) = sgn (a 2 ).
Otherwise, we invert the signs of O 3 (a 3 , b 3 ) for calculating the centre O(a, b). This is because the incommensurate signs of x 2 and a 2 indicate that the intersection point O 2 between p 1 p 3 bisector and M p 2 is on the extension of M p 2 .
A particular condition should also be noted. Consider  to handle this situation, we add the following condition in the minimum zone fitting function:

Alternating exchange rule.
The alternating exchange rule [21] is used to replace the undesirable point in each iteration till we reach the desired points.
The fitting function output was used to determine the minimum zone boundaries. The exchange algorithm checks any point out of the obtained boundaries, which are denoted as the outlier points, by calculating the deviations (dev) between the mean radius and the distance from (a, b) to ( where n is the number of measured data. If h > |dev i |, it indicates that there is no outlier point, and the result is accepted as the initial solution. If h < |dev i |, then the specific point (i) is the outlier point, and we apply the alternating rule to replace the outlier point with one of the critical points. As shown in figure 2, the current minimum zone boundaries were defined by critical points (p 1 , p 2, p 3 ) and were ordered anticlockwise starting from the positive x axis. To apply the alternating rule, for example, if we consider A to be an outlier point because A lies outside the outer boundary, we can only consider the replacement of (p 1 or p 3 ); in this case, it will be replaced with p 1 . Similarly, consider different situations for the outliers. If B is an outlier point, we can replace it with p 2 . If C is an outlier point, we can replace it with p 3 and re-order the points. If F is an outlier point, we can replace it with p 3 . Muralikrishnan and Raja have discussed in detail the alternating exchange algorithm [21]. As illustrated in the flow chart in figure 3, if there is no outlier point, we assume the result to be an appropriate initial solution.

Best solution fitting function.
The best solution fitting function uses the initial solution obtained from the minimum zone fitting function to obtain an optimum solution. It also uses a simple alternating exchange rule to calculate all the possible solutions that can be obtained by replacing p i i = 1 ∼ (n − 3) with the current critical points (p 1 , p 2 , p 3 ). The function retains two points from the current critical points and replaces the third point. For p i < p 2 , we take p i = p 1 , while for p i > p 2 , we take p i = p 3 , then collect all the possible solutions. Among these solutions, the function selects the minimal h and then use its corresponding critical points to calculate the optimum solution as follows: • The p 1 p 3 bisector contains the best minimum zone centre; further, from the proposed small zone, the line segment O 1 O 2 is considered to be the best search line of the MZC centre. • O 1 O 2 , which is extremely small, is divided to produce m centre points; increasing the value of m helps precisely cover the line segment. • Equations (4) and (5) and m number of coordinate evaluation centres are used to obtain r o and h; the minimum constructed concentric circles division is adopted as the best minimum zone error solution.
The structure of the improved MZC algorithm for roundness error evaluation is shown in figure 3. It consists of a set of algorithms developed using MATLAB software. The first step is to select three random points representing the first iteration parameters. The second step involves using the developed fitting function to obtain the parameters of the minimum zone error evaluation. And then identify the inner and outer minimum zone boundaries. The third step is to use an alternating exchange principle to examine the validity of the current boundaries. If it confines all the datasets, then we regard the result as being the initial solution. Otherwise, we apply the alternating rule to replace one of the three currently selected points with the farthest point until we obtain a valid initial solution. The fourth step is to use a constructed best solution fitting function to calculate all the possible solutions from the corresponding dataset and select the best solution, representing the intended MZC of the roundness error.

Algorithm verification using practical datasets
Three different datasets were used to validate the proposed algorithm. The first dataset was taken from literature [11] and uses the PCTA. The second dataset originated in literature [23]. The third dataset was produced from a quality-control measurement system. This is currently under development, and the system and its simulation are described in [24].

Results
The results obtained from the adopted data information are used as benchmarks to track the performance of the proposed algorithm. As summarised in table 1, the accuracy of the MZ error evaluation depends on equally dividing m. Increasing the number of divisions is guaranteed to improve the accuracy of     The simulation results produced using the first dataset are shown in figure 4(a), where the critical points for the alternating exchange algorithm are 37, 46, 56, and 65. Figure 4(b) illustrates the results obtained with the proposed algorithm, where the critical points are 37, 46, and 56. Table 2 lists the results obtained with the proposed algorithm, where the MZC error evaluation is 0.0272 mm and the magnitude of the coordinate centre is 0.0023 mm, similar to that of the PCTA; further, themagnitude of the coordinate centre for thealternative exchange algorithm is 0.0024 mm. The proposed algorithm and PCTA method are slightly superior in terms of the centre error, although this does not affect the accuracy of the final result. The proposed algorithm provides an accurate result comparable to that obtained with PCTA and the exchange algorithm in terms of the minimum zone error and error magnitude of the coordinate centre.
The simulation results produced using the second dataset are presented in table 3. The critical points for the exchange algorithm are 7, 10, 11, and 19, while the points for the proposed algorithm are 1, 11, and 19. The calculated MZC error of the proposed algorithm is 0.008343 mm and that of the alternating exchange algorithm is 0.008359 mm. A slight variation was noted in the MZC error result. However, the magnitude of the coordinate centre eccentricity using the proposed algorithm is 0.0127 mm, while it is 0.0229 mm with the alternating exchange algorithm, pointing to the superior performance of the proposed algorithm considering the roundness error calculation.
Moreover, the simulation results obtained from the third dataset are shown in figure 5(a), where the critical points for the alternating exchange algorithm are 10, 21, 53, and 55. Figure 5(b) illustrates the results for the proposed algorithm, where the critical points are 10, 21, and 53. The results listed in table 4 indicate that the proposed algorithm performance follows similar results in structure as in the previous results. The MZC error of the proposed algorithm (0.0247 mm) is less than in the case of the alternating exchange algorithm (0.0248 mm), similarly, the centre error magnitude of the proposed algorithm (0.00512 mm) is less than 0.00553 mm. Comparing the MZC error and magnitude of the eccentricity, the proposed algorithm provides a better result. Generally, the proposed algorithm exhibits good performance with the comparison methods, as well as when using three instead of four candidate points, which provides more flexibility for detecting the optimum centre while enhancing the accuracy.

Conclusion
In this study, an improved minimum zone of the roundness error evaluation algorithm was developed using the alternating exchange method. The constructed minimum zone fitting function uses three candidate points to determine the expected centre coordinate, mean circle radius, and corresponding zone half-width. The initial solution was defined by applying an alternating exchange rule. The best solution function is constructed to obtain the optimal solution using the control points related to the initial solution. The validation results show that the proposed algorithm is accurate and guarantees a better approximation for the overall MZC of roundness error evaluation parameters. The use of three points provides more flexibility for detecting the optimum centre and allows the algorithm to run over the inadequacy of using the collinear candidate points in four selected points. Thus, this method improves the accuracy of the roundness evaluation of circularshaped parts, such as the bearing ring. The effects of eccentricity and radius of components for roundness measurement accuracy will be discussed in future works.

Data availability statement
The data that support the findings of this study are openly available at the following URL/DOI: http://dx.doi. org/10.1088/1757-899X/490/6/062052.