Mathematical approach to the validation of functional surface texture parameter software

A new method for performance validation of surface texture parameter calculation software is introduced, focussing on functional surface texture parameters. Material ratio curves are defined algebraically and used to calculate functional surface texture parameters mathematically. Discrete datasets are created from the material ratio curves and input into three third-party parameter calculation software packages. Comparisons are made between the software-obtained parameter values and the mathematical values, identifying significant differences between them. Work is carried out to highlight inaccuracies introduced by sampling discrete datasets from mathematical representations, and it is shown that the resulting variations in parameter values are insignificant compared to the differences from the mathematical values.


Introduction
Surface texture parameters are quantitative descriptors of a surface that serve to capture certain information about the surface to be characterised and present that information as single values [1][2][3][4]. Each surface texture parameter has its own unique definition comprising an analytical operation that is performed on the function that describes the dependence on spatial location of the heights of the surface of interest [5]. It is through the agreed understanding and use of these parameters that valuable and repeatable information about a surface can be obtained and used to produce high quality precision parts with specific surface properties and performance characteristics [3,6,7]. Examples of surface texture control as a result of well-defined surface texture parameters include reduced wear, increased lubricant retention and reduced friction [8][9][10][11].

Software measurement standards
The definitions for the surface texture parameters are given mathematically and are published in ISO specification standards, ensuring international agreement. Surface topography data is measured at discrete spatial locations, and so the surface texture parameter definitions must be interpreted as numerical algorithms to be applied to the data, and usually applied as software. Several commercial software packages exist that perform this task, and it is necessary to provide a method of performance validation for this software to ensure it is meeting the levels of accuracy required in industry [12].
The current state of the art involves the use of software measurement standards to provide validation. Software measurement standards come in two types: type F1 reference data and type F2 reference software for profiles (or types S1 and S2 for areal) [13,14], and are typically provided by national measurement institutes (NMIs) [15][16][17][18][19][20]. Type F1 reference data comprises a set of surface measurement datasets with a set of corresponding surface texture parameter values that have been calculated by the NMI. Type F2 reference software is used to calculate surface texture parameter values for a given surface measurement dataset and are created with a focus on parameter value accuracy over speed or extra functionalities. However, type F2 reference software are still software implementations of the definitions, utilising finite precision arithmetic and numerical algorithms, and are still subject to some of the same sources of approximation as in commercial software [12,21]. Consequently, type F2 reference software may still return results that deviate from those obtained from an exact interpretation of the parameter definitions.

A mathematical approach
Recent work has highlighted some differences in the obtained parameter values returned by NMI reference software for a range of profile surface datasets [21,22]. These differences are due to differences in the implementations of the surface texture parameter calculations, and to the use of different approximations that are intrinsic to a numerical approach to interpreting the defined parameter definitions. The work in [21] was performed on profile surface texture parameters, however, it is expected that these differences would be present for the newer areal surface texture parameters [17].
An approach is introduced that seeks to develop a method for validating surface texture parameter calculation software in a way that removes reliance on type F2 reference software and their inherent inaccuracies. Such an approach could be used alongside the current practice of F2 reference software, and serve to create a more complete, traceable assessment of software for surface metrology. The new method involves creating surfaces that are mathematically defined using algebraic expressions that express their surface height as continuous functions of spatial location. Surface texture parameters for these surfaces are then evaluated accurately using the analytical definitions of the parameters given in [2]. This approach removes any approximations or inaccuracies that can be introduced when dealing with numerical methods. The resulting parameter values can then be used to validate and assess the performance of third-party surface texture parameter calculation software.
This paper focusses on the mathematical evaluation of 'functional' surface texture parameters, a series of parameters that are calculated from a material ratio curve and defined in [2]. The method used to define the surfaces is given in section 2, and the evaluation of the functional surface texture parameters is given in section 3. Section 4 contains a performance comparison with third-party surface texture parameter calculation software. In addition, section 5 explains some verification methods used in this work to ensure agreement between analytical and discrete surface representations. Final conclusions are given in section 6.

Mathematically defined surfaces
The new approach to the validation of surface texture parameter calculation software relies on mathematical definitions of surfaces. These definitions comprise analytical functions that describe the height of the surface at any given (x, y) point, and are used to calculate surface texture parameter values.
The calculation of functional surface texture parameters first relies on obtaining a material ratio curve for the surface under evaluation, S mr (c). The material ratio curve, defined in [2], describes the ratio of the area of the material at a specified height, c, to the evaluation area, which is the portion of the surface for specifying the area under evaluation. Another, more statistical interpretation of the material ratio curve is that it is the cumulative probability function of the height values within the evaluation area. An example material ratio curve for a profile surface measurement is shown in figure 1.
As the material ratio curve forms the basis of the functional surface texture parameters, it is not necessary to explicitly define a surface using an analytical function. Instead, a material ratio curve can be analytically defined, and functional surface texture parameters can be calculated directly from that. This approach simplifies the process and removes the complexities of requiring a mathematical operation to relate a surface height function to its cumulative probability function.
As the material ratio curve only relates surface height to material ratio, the curve can be defined using a relation between just two variables. As material ratio curves are often displayed with the material ratio on the horizontal axis (keeping the surface height values on the vertical axis as is the case for a traditional profile  [2]. For the material ratio curve, the Y-axis defines the surface height from the lowest measured value and the X-axis defines the material ratio as a percentage. For the profile measurement, the X-axis is a distance in one direction. surface measurement), it has been decided to define the material ratio curve using the inverse material ratio, S mc (m r ), with the material ratio, m r , as the independent variable expressed as a percentage, and the surface height as the dependent variable.
It is worth noting here that the work in this paper defines vertical range with the lowest surface height as 0 m m . This choice differs from the convention used in [2], in which height values are taken from the reference plane, and has been made solely to simplify the graphs and equations for the purpose of this paper. The shape of the material ratio curve and final mathematical values are not affected by this choice. For a function to represent a physically realistic material ratio curve of a measurement, it must adhere to the following conditions: • The value of S mc (m r ) corresponding to a material ratio value of 100% is zero, equivalent to the lowest surface height.
• The value of S mc (m r ) corresponding to a material ratio value of 0% is the highest surface height value, equivalent to the distance from the lowest surface height.
• The material ratio curve is monotonically nonincreasing. That is, the gradient of the curve must never be positive.
These conditions ensure that the mathematically defined curve represents a physically realistic material ratio curve by ensuring that it encompasses the full range of material ratios between 0% and 100%, and that a decrease in specified surface height guarantees that no decrease in the value of material ratio is obtained.
For this paper, material ratio curves are represented using third degree polynomial functions. Such functions are easily able to satisfy the conditions listed above. It should be stated here that third degree polynomials are not the only option available to produce mathematical material ratio curves, and any function that satisfies the requirements of reproducing a physically realistic curve can be used. An example material ratio curve is shown in figure 2, and is defined mathematically using the following polynomial: where Z Range is the vertical height range of the material ratio curve. For the work presented in this paper, Z Range =1 μ m.

Material ratio curve evaluation
Defining a surface mathematically using a material ratio curve allows for functional surface texture parameters to be calculated without the need for an analytical representation of the height values of the surface. Whilst this approach makes calculating the functional parameters easier, a discrete dataset describing the height values of the surface is still required for use with surface texture parameter calculation software. A discrete dataset representation of the defined surface can be obtained by sampling the inverse material ratio curve to obtain height values. Material ratio values, in the closed interval [0%, 100%], can be input into the material ratio curve equation, such as that given in equation (1), and corresponding height values will be returned.
It is important that a uniform distribution of material ratio values is used to ensure a representative distribution of returned height values. An example dataset created by sampling the material ratio curve defined in equation (1) is shown in figure 3. An array of 250 000 material ratio values uniformly-spaced between 0% and 100% was input into equation (1) to obtain an array of height values. The height values are then structured into a 500×500 2D array to produce a surface height dataset, arranged in such a way as to ensure there are no discontinuous steps in data height across the surface.

Parameter evaluation
With the surface defined and sampled, the surface is represented as both a mathematical material ratio function, and as a discrete dataset. To evaluate the performance of surface texture parameter calculation software, the mathematical function is used to obtain parameter values. These parameter values can then be used as a reference against which the parameter calculation software can be assessed.

Equivalent straight line
The evaluation of functional surface texture parameters first requires the calculation of the equivalent straight line. As detailed in clause 5.2 of [2], the equivalent straight line is calculated for the central region, which is defined by the smallest gradient secant of the material ratio curve that intersects at two points and encapsulates 40% of the material ratio. As the material ratio curve must be monotonically decreasing, calculating the central region can be achieved by minimising the height difference between two evaluation points on the material ratio curve that are 40% apart. Minimising the height difference can be achieved by finding the value of the material ratio at which the gradient of the function describing the difference between two heights 40% apart is zero, given by For the example material ratio curve given in equation (1), the difference is given by the equation and a value for the upper central region material ratio, m r,u , of 70%. The equivalent straight line is defined as the straight line within the central region that gives the least square deviation in the direction of the surface ordinates. To calculate the equivalent straight line, a linear least-squares fit must be applied to the material ratio curve within the central region. This fitting is implemented by using a continuous version of the regular discrete linear least-squares operation.
A linear approximation to the material ratio curve within the central region is required of the form Finally, substituting equation (4) into equation (5) gives

Functional surface texture parameters
With the equivalent straight line calculated, the functional surface texture parameters can be obtained. The simplest parameter is the S k parameter, which is defined as the distance between the highest and lowest levels of the core surface, and can be evaluated as for the example from equation (1). S mr1 and S mr2 are obtained by finding the material ratio values that correspond to the points on the material ratio curve that have the same surface height values as those obtained by evaluating S eq (0%) and S eq (100%), respectively; that is, for S mr1 for example, by finding the solution for m r of the equation which is a third-degree polynomial equation that is solvable using a general formula [23].  The next parameters of interest are S pk and S vk . These parameters are defined such that they represent the height of right-angled triangles that have S mr1 and S mr2 as the widths of their bases, respectively, and that are of the same areas as the 'hill area' and 'dale area' respectively. The hill and dale areas are defined as the areas above and below the material ratio curve which delimit the core height S k and are shown graphically in figure 5. Mathematically, these areas, denoted by S a1 and S a2 , can be obtained by integrating the material ratio curve to obtain the area enclosed between the material ratio limits of interest. For S a1 , the material ratio range is  Substituting the required expressions into these equations for the example defined in equation (1), whether performed manually or using a symbolic mathematics software package, is a straightforward task that results in long equations that do not need to be written in their entirety here. Evaluated numerically, these equations give The final set of parameters included in this work are the volume surface texture parameters. These relatively simple parameters stem from two integral functions, the void volume and the material volume where K is a scaling factor to convert to millilitres per metre squared. For the work in this paper, which has been operating in units of micrometers, K=1. With these functions defined, the volume surface texture parameters can be obtained by evaluating the two equations for different values of p and q. Evaluating V v (p) for the example given in equation (1)  = --- A similar expression can be obtained for V m (p). Evaluating both allows the following volume parameters to be obtained:

Comparison with existing software
A mathematically defined material ratio curve has been used to obtain accurate parameter values that are calculated according to the mathematical definitions given in [2]. These parameter values can now be used as a reference against which the results returned by surface texture parameter software can be compared.
To perform the comparison, the material ratio curve must be sampled to create a discrete dataset, as explained in section 2.1. A total of five material ratio curves were defined from third degree polynomials for use in this comparison, shown in figure 6, and mathematical parameter values were calculated for each. Three surface texture parameter calculation software packages were used in the comparison, however, not all of them gave the option to calculate every required functional surface texture parameter. For each software package, all additional surface dataset processing was disabled and only the parameter calculation was performed. figure 7 shows the results obtained by parameter calculation software for the five material ratio curves, normalised to the mathematical value. Note that some parameters were not available on all parameter calculation software packages, and so some bars are not present.
From the results, it is clear that there is some discrepancy between the values obtained by each software package. Software A obtains values more consistently close to the mathematical value, with some compared to the mathematical value seen for S pk and S vk for the edge case curve. Software C performs similarly to A for the parameters it is able to calculate, however, volume parameters were not available. Software C also showed a tendency to overestimate the S pk and S mr1 parameters. Software B shows the largest consistent deviation from the mathematical value for the first five material ratio parameters, however, volume parameters showed good agreement. In particular software B showed consistent overestimation of the S k parameter, with values differing by over 50% in some cases when compared to the mathematical value. Software B also showed consistent underestimation of S mr1 , S pk and S vk , differing by as much as 20% for the edge case curve. Figure 7(b) shows a more detailed zoom of figure 7(a) to better highlight the small-scale deviations. Here, software A and C deviate around 1% from the mathematical value.
These results highlight the need for a new approach to providing reference values and assessing the performance of parameter calculation software, as each software package is giving different results when compared to the mathematically-defined reference. Without a traceable, mathematically obtained value, the performance of parameter calculation software cannot be adequately assessed [12].

Verification of the dataset
As the parameter calculation software operates on a discrete dataset instead of the mathematical function, it is important that the dataset is an appropriately accurate representation, and that any errors that may affect the results are identified.

Dataset height order assessment
As the only aspect of the discrete dataset of interest is the derived material ratio curve, in principle how the discrete height values are organised across the surface should not be significant. In reality, the parameter calculation software may process the height values in a way that is dependent on the height arrangement.
Four different datasets were created that contain the same height values arranged in the following orders: 1. Linearly increasing along each row, where each subsequent row increases carrying on from the row above. This method is used in the rest of the paper; 2. Linearly increasing, with alternate rows flipped; 3. Linearly increasing, with alternate columns flipped; 4. Random order.
Each of these datasets were processed by the three parameter calculation software packages. Software A and C showed no change in parameter values with different ordering, suggesting that their implementations calculating the material ratio curve and its associated parameters are independent of the arrangement of the dataset height values. As software A and C showed no change due to dataset height arrangement, they are not included in figure 8. Software B, however, showed significant variation in the obtained parameter values, as shown in figure 8. Such variation in the obtained parameter values shows a significant dependence on the structure of the surface dataset under test. Because of this, the results shown in figure 7 for software B are not completely representative of the software performance. A different structure will likely result in different parameter values for software B, which may or may not be closer to the mathematical values.

Discretisation error
When sampling the mathematical material ratio curve to create a dataset, only a finite number of evaluations are performed. Because of this sampling, information is inevitably lost when moving from a continuous to a discrete representation, resulting in potential inaccuracies in the calculation of parameter values compared to the mathematical value. In principle, higher density datasets should contain more information about the surface, and so should allow parameter values to be obtained that are closer to the mathematical definition. This comes at a cost of dataset file size and computation time.   (1).  Table 1 shows the effects of varying the dataset density on the calculated functional parameter values for the material ratio curve defined in equation (1). This is performed by averaging adjacent height values from a high density 2000×2000 dataset to create smaller datasets. Only one dataset height arrangement has been used here to focus the analysis solely on discretisation error, and reduce the number of presented results. The volume parameters obtained by software A and B show convergence towards the mathematical value with increasing dataset density, suggesting the mathematical value could be reached given a sufficiently dense dataset. Such a result implies that the effect of discretisation is the primary contributor to the parameter value error.
The results for the remaining material ratio parameters also show convergence, however, the majority of these do not appear to be converging on the mathematical value. This is shown in figure 9, in which the values for the S k , S pk and S mr2 parameters have been extracted from table 1 to highlight the results more clearly. Software B shows the most obvious signs of convergence, while software A and C show more variation, particularly for S k and S pk . The lack of clear convergence on the mathematical value suggests that without the effect of discretisation, there would still remain an error in the calculated parameter values. These results would imply that there is an additional source(s) of error causing the deviation from the mathematical value. Considering computation time, which for some software packages can be substantially longer for higher density datasets, increasing the dataset density in order to obtain more accurate values delivers diminishing returns for these parameters.

Conclusions
The work presented in this paper introduces a new method for validation and performance assessment of surface texture parameter calculation software, focussing on functional parameters. By using mathematical functions to define material ratio curves, surface texture parameters can be calculated accurately, respecting the definitions of the parameters given in standards. The resulting parameter values can be used as reference values against which third-party software can be compared, confident in the quality of the given reference values. In addition, the new validation method provides the first steps in developing a new way to test software whilst still leaving freedom for software developers to design their own implementations depending on their specific constraints, such as accuracy, speed or resource usage. This approach is an improvement over the current practice of using reference software, which may have the effect of forcing particular implementations upon software developers.
By using the material ratio curve as the basis of the definition of the surface, discrete dataset representations of the surface can be created by sampling the curve. These datasets can be input into third-party software and used to test the performance of the surface texture parameter calculation methods and algorithms used. Additional work was carried out to analyse the created datasets and assess whether the methods used to produce a discrete representation of the surface significantly impact the functional parameter values obtained by the software. This work Figure 9. S k , S pk and S mr2 parameter values obtained by each software package for a range of increasing dataset sizes given in table 1, normalised to the mathematical values. Note that the Y-axis scales are not consistent across all sub-figures due to the variation in ranges for different parameters and software. revealed a dependence on dataset height order for software B.
The results of the comparison performed in this paper reveal differences between the parameter values obtained by software and the values calculated mathematically. The reasons for these differences are unknown, as they are subject to the specific algorithms used within the software. Irrespective of the reasons, the differences highlight a need to move toward utilising mathematically defined surfaces to provide traceable methods of verifying the calculation of surface texture parameters. This approach can be combined with existing methods, which allow for the assessment of more realistic surface datasets, to provide a more complete and traceable method of surface texture parameter calculation validation.

Future work
Moving on from this work, the next step is to produce a similar framework for the popular height parameters S q , S sk , S ku , etc., developing mathematically defined surfaces and the necessary mathematical operations to calculate accurate values for these parameters. This work will help toward obtaining a complete collection of mathematically calculable surface texture parameters for [2].
In addition, future work will aim to develop metrics that can deliver simple performance assessments of third-party surface texture parameter calculation software. This work will streamline the experience for third-party software users/developers, and provide objective comparisons of the obtained parameter values and the mathematical parameter values. Such metrics will need to account for some of the effects observed in this work, such as sampling variations, and determine at what point is the performance of software acceptable, given that it is unlikely that any software will be able to return the mathematically-obtained reference value due to the limits of a discrete representation.