Analysis of Characteristics of Non-Commercial Software Systems for Assessing Flatness Error by Means of Minimum Zone Method

As far as machine parts are concerned, accuracy can be defined in many aspects. In order for a workpiece to be functional, dimensional and surface roughness requirements are not enough. Accuracy of geometric elements and position tolerances is necessary information. The notation, definitions, interpretations and general values of geometric tolerances are defined by standards. Nevertheless, there are several mathematical methods of calculating values based on data measured by means of coordinate measuring machines. Standards demand the use of the minimum zone method in assessing form deviation without mentioning the way of obtaining it. In this paper, the minimum zone method, which is an iterative algorithm, was investigated. Thus, the result of flatness measurement was calculated by continuous approximation. There are various methods of defining the steps of iteration, affecting the length of time and accuracy of the flatness value. The aim of the research was to examine the characteristics of two non-commercial software solutions for assessing the minimum zone in comparison with the commercial CMM software. Based on the analysis, it can be concluded that the developed software solutions are efficient in assessing flatness error and that the differences between these and the commercial software are negligible.


INTRODUCTION
Machine parts with strict functional requirements usually have restrictions in terms of permissible form deviation. One of the most frequent form tolerances is flatness tolerance which is most commonly verified by means of coordinate measuring systems [1,2]. In order to achieve high accuracy when assessing flatness error, the most commonly used systems are coordinate measuring machines (CMM) with a measuring probe [3]. These machines are characterized by accurate determination of coordinates (x, y, z) of points from the examined surface. The coordinates of these points are further used to determine the substitute (reference) plane according to a given association criterion. Flatness error is the sum of distances between the reference plane and two points that are extremely remote from it. The process of determining flatness error is independent of coordinate sampling and is performed by means of the CMM software. This enables the analysis of flatness error for any set of points from any coordinate system [4,5].
ISO 1101:2017 standard demands that the minimum zone method (MZ) be used as the association criterion in assessing flatness error because it is in accordance with the mathematical definition of the tolerance zone [6]. However, the standard does not define the way of obtaining the minimum zone solution. As a result, there are many methodologies for determining the minimum zone. Flatness error values obtained using different methodologies are not uniform as it is in the case of least squares (LS). The success of the applied MZ methodology is reflected in the approximation of the assessed flatness error to the exact value. In coordinate metrology, a large number of factors affect measurement accuracy and comparison between the efficacies of different MZ methodologies can only be made for the same set of sampled points.
Accurate assessment of flatness error can be achieved by following the instructions of a new generation of geometrical product specifications (GPS) according to which the verification operator should be derived from the ideal, fully defined specification operator through the duality principle [7]. The assessed flatness value can be considered accurate for a particular CMM only in the case of the ideal verification operator which requires a large number of sampled points. Since sampling a surface with a large number of points is not economically justified in practice, simplified verification operators are used with the aim of obtaining an approximately exact flatness value with a reduced number of points [8]. The MZ method, unless sampling was performed in an adequate way, i.e. unless it contains coordinates of points with extreme values, cannot assess the exact value of flatness but only give the minimum value from the sampled points.
The literature review gives an insight into the use of various techniques in creating methodologies for obtaining MZ solutions, such as nonlinear optimization, metaheuristics, approximation method based on linear programming, convex hull method based on computational geometry etc. [9][10][11][12][13][14][15]. Only few of these have been implemented in commercial CMM software, whereas others have been developed for internal use of universities and scientific institutes. In these methodologies, the minimum zone solution is mostly arrived at by means of iterative searching, using the coordinates of sampled points. In the iterative process it is necessary to define the steps for searching. The search requires certain length of computation time which is one of the efficacy parameters of the chosen methodology. Accurate assessment is also one of the criteria for testing the used methodology. Values with a smaller flatness error are considered more accurate. However, the above mentioned discussion on accuracy should be taken into account. Thus, the accuracy of flatness error and the time needed for arriving at the solution are the criteria used for the analysis of characteristics of methodologies for obtaining the MZ flatness error.
In this research, two methodologies were tested, based on which software solutions were created. One solution was developed at the Obuda University in Budapest and the other was created in the Laboratory for Metrology at the University of Novi Sad. The results obtained by means of these programs were compared with the results of the commercial CMM software.

DEVELOPED SOFTWARE SOLUTIONS BASED ON THE MINIMUM ZONE METHOD
The existing methodologies for the assessment of flatness error which are based on the minimum zone criterion are more or less complex. The time necessary for finding the solution varies. With some "fast" methods, the accuracy of assessment is neglected for the purpose of shorter computation time. Apart from accuracy and computation time, the efficacy of a method is also reflected in easy comprehension and use, as well as in giving information concerning the reference plane equation and coordinates of extreme points. Minimum zone criteria which are implemented in commercial CMM software programs are usually a 'black box' for the user. Only insight into flatness error is provided, whereas the parameters of the reference plane equation and coordinates of extreme points remain unknown. Knowing these values is very useful, for example, when assessing measurement uncertainty of a specific task, following the standard guide for the assessment of measurement uncertainty (GUM) [16].

ObU MZ Method
The first MZ method named UbU MZ was developed in the BánkiDonát Faculty of Mechanical and Safety Engineering at the University of Budapest. Regarding the ObU MZ method, flatness error can be defined as the difference between the minimum and the maximum distance of a set of points from a plane. With the minimum zone method, the direction of the plane which ensures the smallest difference should be determined. A plane can be defined by a point (Po) and the normal vector (N). The distance of a point (Pi) is calculated by Eq. (1): Flatness error is the difference between the farthest and the closest point (2): The best direction can be determined by the searching algorithm. The value of the Po point is insignificant, so it is Po = (0; 0; 0). The direction can be defined by the normal vector, but only the x and y coordinates are modified (Fig.  1). During the iteration process only Nx and Ny values are changed (Nz = 1). In one cycle, only one coordinate value is changed with δ step. Thus, the result of four neighbours should be calculated and compared in every cycle (Fig. 2).
The δ step can be defined in several ways. Three methods were applied and compared: 1) Random method: ( ) 6 10 Random 0 -1 δ 2) Decreasing random method, where i is the number of iteration cycles, so the step is smaller and smaller, but the random nature does not change: In Eq. (6), the parameter D has been defined by the position of the plane, and it is insignificant in evaluating flatness error. The reference plane can be placed in any point belonging to the set of points sampled by the CMM. The position of the plane in space for angle values ξ and θ, and the position of the reference plane parameters A, B and C are determined using the iterative procedure, Fig. 3. In other words, the plane rotates around a randomly chosen point in space, and the minimum distance between the sampled points is sought according to the definition of the flatness tolerance zone. Steps of rotation around x and z axes are defined as the ratio between angles ξ and θ and the number of the defined steps (see [17] for details). It is necessary to define the number of steps before software calculation. Every time the reference plane takes a certain position in space which is defined by angles ξ and θ, the software will register the parameters of the normal vector of the reference plane and flatness error. The action will be repeated for all the defined steps and the software will register the normal vector of the reference plane whose position gives the smallest flatness error for the observed set of sampled points. The flow chart of this software solution is shown in Fig. 4.

ANALYSIS OF CHARACTERISTICS OF SUGGESTED MZ METHODOLOGIES 3.1 Experimental Method
The algorithms were compared on six machined flat surfaces of the same dimensions 175 × 155 mm. The test surfaces were machined using different technologies, methods and machine tools (Tab. 1.) Surfaces #1 and #2 were machined in a conventional and CNC milling machine by zig-zag technology, with the same cutting speed and feed per tooth. Surfaces #3 and #4 were machined by face turning with the same parameters, except the feed. As for #5 and #6 surfaces, face milling technology was applied with the same tool and parameters, and with different tool path strategies. The coordinate values of the investigated flat surfaces were measured by means of MitutoyoCrysta-Plus 544 coordinate measuring machine, with the maximum permissible error amounting to MPEE= (2,2 + 4 L / 1000) µm (L is the length of measurement expressed in mm). The measurement was performed in a discrete sampling mode with a contact probe whose stylus tip diameter is r = 1,5 mm. Sampling was carried out in 1020 uniformly distributed points on the examined surface. The number of 1020 is insufficient to meet the demands of the new generation of GPS about the ideal verification operator (the number of points for the given surface and stylus tip diameter would be larger than 72 000). However, the aim of this paper was not to determine the exact flatness value but to compare flatness errors for the same set of points obtained using different MZ methodologies. Flatness errors assessed by means of Kotem Smart commercial software for this set of points were taken as reference values.
The reference values can be seen in Tab. 2.

Verification of the Developed Software Solutions
Regarding the implementation of ObU MZ, the value of flatness is generally higher with the decreasing random method (2), than with the random (1) and the constant (3) method, but every value is higher than the reference values. The standard deviation of 100 repetitions with method 1 is the largest, so in that case several repetitions and the selection of the smallest values are necessary (Fig. 5). With methods 2 and 3, the standard deviation is very small (with method 3 it is 0), so the number of repetitions can be decreased.
The required cycles till the stop condition and the processing time are proportional (Fig. 6). One iteration cycle takes about 0,007 sec. With methods 1 and 2, a limited number of cycles are enough to find the solution, and the number of cycles is similar with the six specimens (13 -52; 5 -14). But with method 3, where the results are the same in every run (no deviation), the required iteration cycle is between 1 and 917, depending on the specimens. Based on the ObU MZ, in the case of random iteration step (1), the accuracy of the algorithm is good, but the repeatability is poor (large deviation). One calculation is fast, but in order to get the accurate value, many repetitions are needed. The accuracy of the decreasing random method (2) is not so good, but the difference is small. The repeatability is good; there are small differences between the results of the repeated runs. Therefore, the running time is short. The constant method (3) performs good accuracy and the best repeatability. However, because of much iteration, the running time is very long (Fig. 7). Therefore, the random iteration step (1) is preferred, irrespective of the number of the necessary repetitions. This does not pose a problem because the running time is short. With OPPBM, the accuracy of flatness error evaluation, and the time needed for the execution of the program based on the algorithm depends on the number of iterations of ξ and θ. It is necessary to define the number of iterations before calculating. The steps of rotation around x and z axes are calculated as a ratio between maximum angles and the appropriate number of the defined steps. The paper [14] shows that the required accuracy is achieved with a large number of iterations, but the process is timeconsuming.
The results of implementation of the OPPBM MZ were compared with the ObU MZ / 1 and the reference values. As Fig. 8   It can be concluded based on the analysis that the developed software solutions are efficient in assessing flatness error and that the differences between these and the commercial software are negligible. To test the statistical significance of commercial (COTEM) and developed software (ObU and OPPBM), paired sample t-test was used. Paired sample t-test compares means where the two groups are correlated such as data from the commercial and ObU software (t = 0,93; p = 0,397), and commercial and OPPBM software (t = −1,24; p = 0,270). The p-value greater than 0,05 indicates that there is no statistical significance between the mentioned software. In this case, the null hypothesis is accepted for both tests. In other words, the mean difference between COTEM, ObU (mean difference = 0,0175) and, OPPBM (mean difference = −0,0002) is not significant. Additionally, these software programs are not specific to a particular coordinate measurement system and they can analyse points of coordinates obtained from a variety of measurement systems such as industrial CT, photogrammetry, optical and laser scanners etc.

CONCLUSION
The standards demand that the MZ method be used as an association criterion in measuring form deviation by means of a CMM. Nevertheless, the standards do not propose a methodology for assessing this deviation. There are more than ten different methodologies for assessing flatness error based on the MZ method. The efficacy of a methodology is assessed based on several criteria. This paper presents and analyses two methodologies which were compared with each other and with the commercial software. The results have shown that the software solutions developed using these methodologies have satisfactory performance. According to paired sample t-test the mean difference between the commercial and developed software was established. It was found that there was no statistical significance of comparing software.
As a result, it is feasible to further develop these software solutions to be used for assessing other dimensional and geometrical tolerances as well. With enough effort, these two software solutions could be commercialized and used for different coordinate measuring systems.