Research on the novel hardware configuration methods of the contact R-test based on the constraint models

: R-test is widely used to measure the rotary axis error of five-axis machine tools due to its high accuracy and convenient. There are some deficiencies in the research on measurement performance optimization such as the customized design under certain requirements. The novel hardware configuration methods of the contact R-test are proposed in this paper to realize customization. Firstly, the theoretical measurement model and the calibration model are established to be used as the measurement accuracy evaluation model. Secondly, the influence of hardware parameters on the measurement performance indexes of the measurement system is analyzed and the corresponding constraint models for measurement performance are established. Thirdly, the optimal configuration methods of hardware parameters based on constraint models are proposed using exhaustive search method and variable parameter method respectively. Finally, a prototype that is configured with the hardware parameters based on the above configuration methods, is developed to calibrate on the Coordinate Measuring Machine(CMM) and complete the measurement performance evaluation. The evaluation results show that the hardware configuration methods meet the certain measurement requirements without range and precision waste. The proposed methods provide guidance and reference for the customized design of contact R-test.


Introduction
Five-axis CNC machine tools have been widely used in the processing of complex parts in some fields such as automobiles and aerospace due to the advantages of high cutting efficiency and flexible tool position adjustment. However, the introduction of two rotating shafts complicates the mechanical structure and control system of the five-axis machine tool, and additional rotation error items are added. At this stage, there is no unified standard and specification for the measuring method of the axis of rotation error. Although measuring tools such as Double ball-bar(DBB) [1,2] , laser tracker [3][4][5] and laser interferometer [6] can be used for identification and compensation, they all have certain limitations. In recent years, a high-efficiency and high-precision rotary axis error measuring device R-test has been developed. Similar to the DBB, the error measurement of the machine tool is achieved by the relative displacement of the master ball installed on the spindle and the three sensors installed on the base, and the R-test can obtain the three-directional relative displacement error.
Weikert firstly proposed the concept of the R-test, and proved its applicability in error  Lei Jiang is corresponding author: jianglei0506@163.com measurement of five-axis CNC machine tools through a series of simulation experiments [7] . And then the R-test has attracted more and more attention from academia and industry. On the one hand, R-test is used to identify the positioning error of the rotating axis based on the ISO 230-7 static test rules at first [8] , and then the error detection method based on R-test is rated as one of the international standards for the positioning accuracy detection of five-axis CNC machine tools 错误 ! 未 找到引用源。 , [10] . On the other hand, there are also related commercial products on the market, such as IBS in the Netherlands [11,12] and FIDIA in Italy [13] .
R-test is divided into non-contact and contact according to different structures. The measuring accuracy of the non-contact R-test is not affected by contact wear and it has high safety during dynamic measurement, but it has very high requirements on materials and measuring environment due to the influence of the sensor's structure and detection performance, requiring regular maintenance and calibration, and the solution algorithm is complex. The 3D probe of the contact R-test adopts three contact displacement sensors, the displacement of the master ball can be directly expressed by the output of the sensors. The more important thing is the contact displacement sensor has the characteristics of high reliability, low cost and simple operation.
Currently, the research of R-test mainly includes five-axis CNC machine tool error measurement using the R-test directly, structural parameter optimization and part of the function extension, shown as following: (1) Optimization of structural parameters Liu et al. obtained a spherical contact R-test device structure optimization design method based on the two indexes of maximum measuring space and measurement sensitivity, and search for the optimal value of these two key dimensions to complete structural optimization through Monte Carlo Method [14] . Li et al. derived the transformation model between the sensor reading and the three-direction displacement of the measuring sphere, and determined the main error factors affecting the error measurement device and analyzed the overall uncertainty of the device based on the model [15] . Jiang et al. improved the calculation accuracy and efficiency of the spherical center coordinates using the adaptive differential evolution algorithm, optimized the structural parameters based on the measurement performance indicators, and finally formed system optimization methods to balance the measurement accuracy and cost [16] .
(2) Static error measurement Ibaraki S et al. developed the corresponding software, which can graphically present the test trajectory measured to the R-test to help users more intuitively understand the error motion of the rotating axis. And realized in the CNC system Error compensation parameter through digitizing the geometric error of the rotating axis [17] . Li et al. designed a simple and unified measurement method based on RTCP motion, and verifies it in the A/C rotation axis error measurement process.
By minimizing the number of conditions of the recognition matrix, the recognition accuracy is increased by 97%, and finally the measurement efficiency of the rotary head is improved when the R-test detection system is used with auxiliary fixtures [18] . (3) Dynamic error measurement Zhong et al. proposed an S-shaped trajectory measuring method through scaling the machining path of the S-shaped test piece to the measuring range of the R-test to evaluate the dynamic accuracy of a five-axis machine tool, the dynamic accuracy of the five-axis machine tool can be reflected simply [19] . Brecher et al. proposed a dynamic R-test method for measuring the thermoelastic deviation of a five-axis machine tool under normal workshop environment temperature changes, the uncertainty of the measuring results and the correlation between the measuring error and the temperature were given [20] .  [22] . Weng et al. developed a new type of R-test measurement system in consideration of the limitation of traditional measuring methods of machine tool thermal error due to specific processing conditions to achieve accurate thermal volume error measurement [23] . Guo et al.
proposed a new type of non-contact R-test calibration scheme that reduced the positioning error of the calibration point and verification point by more than 80%, and verified the effectiveness of the method in an industrial robot error measuring experiment [24] .
Users pay more and more attention to the cost control of measuring instrument with the increasing demand of R-test in engineering applications for error measurement of rotating mechanisms such as machine tools and robots. Therefore, it is necessary to achieve cost control of measuring instrument by customized design for the lower cost contact R-test. However, there are still some problems that need to be further studied and resolved: (1) The hardware configuration of the R-test determines its measuring accuracy and range, and affects cost fluctuations at the same time. However, there is currently a lack of research on the hardware configuration of R-test for different performance requirements.
(2) The corresponding quantitative relationship between the performance indexes of the measurement system and the hardware parameters is not clear.
Therefore, this paper takes the flat contact R-test as the research object, proposes the hardware configuration methods to realize customization for the R-test, and the related methods can be easily extended to the contact R-test with other sensors. The main contribution points are as follows: (1) The theoretical measurement model and the calibration model are established to be used as an evaluation model to evaluate the measurement accuracy for the measuring system.
The influence of hardware parameters on the measurement performance indexes of the system is analyzed and the corresponding constraint models for measurement performance are established. (3) The corresponding influence laws between the hardware parameters and measurement performance are analyzed based on the constraint models using exhaustive search method and variable parameter method respectively to provide a reference for hardware parameters selection.
Henceforth, this paper is organized as follows: The flat contact R-test theoretical measurement model and calibration mode are established in Section 2. In Section 3, the hardware parameters and the performance indexes of the measurement system are defined, and the corresponding constraint models for measurement performance evaluation indexes are established. Subsequently, Section 4 introduces the optimal configuration methods of the geometric and precision parameters of hardware in detail. The case study for hardware configuration methods under certain requirements is verified and the performance evaluation results are analyzed in Section 5. Finally, some conclusions are drawn.

Structure description and parameter definition
As shown in Fig. 1, the structure of the flat contact R-test mainly includes a precise master ball and 3 same evenly distributed flat contact displacement sensors. The master ball is mounted on the spindle of the machine tool by the tool holder, and it is required that the center of the master ball must be on the axis of the spindle. The sensors are perpendicular to each other in space and fixedly connected to the base("sensor nest" [25] ) which is installed on the worktable. The top of the sensor is three contact planes perpendicular to the axis of the sensor.
Define the radius of the master ball as R, and the center points of the bottom as S1_1, S2_1 and S3_1 respectively which is formed the reference plane of the R-test, the elevation angle between the sensor axis and the reference plane as α, the angle between the projection lines of the sensor axis in the reference plane as β (The default is 120°), and the radius of the circle S1_1S2_1S3_1 as λ.
To simplify the calculation, the measurement coordinate system (CSYSM) is established with the intersection point of the three sensor axes as the origin OM. The coordinate axes are parallel to the X, Y, and Z feed axes of the machine tool. The XOY coordinate plane is parallel to the reference plane S1_1S2_1S3_1, and the axis of the first sensor is lied in the XOZ plane. and O′M (0, 0, zi_1) respectively.
During the measuring process, the sphere center coordinates under the CSYSM at any position can be calculated according to the readings li of the three sensors.

The theoretical measurement model
To achieve the goal of using the measuring instrument to characterize the coordinates of points in space, a measurement model between the sensor readings and the coordinates of the sphere center must be established. According to the relationship of the point Si_0 on the line OMSi_1, the following position expression can be constructed as When the measuring instrument is in the ideal initial position, the sphere center is at the origin of the CSYSM, and the readings li of the three sensors are all half-range l0/2. The center of the detection plane Si_0 is the tangent point between the ball and the detection plane, and there is a geometric relationship as Assuming that the normal vector of the detection plane of the three sensors is ni =(ai, bi, ci), i=1,2,3, the normal equation of the three detection planes can be expressed as Since the distance between the sphere center and the detection plane is always R, assuming that the detection plane and the axis of the sensor is keeping in an ideal vertical state, the expression of the coordinates of the sphere center P concerning the sensor's reading li is obtained as Then the theoretical measurement model can be expressed as Eqs. (6), which is used as the follow-up measurement accuracy evaluation model for measuring instrument.
And the coordinates of the sphere center can be calculated according to ai, bi, ci, xi_1, yi_1, zi_1 and the sensor reading li based on the measurement Eqs. (6), the solution model is

The calibration model
The determination of the sensor position is a necessary condition for solving the spherical center coordinates. However, it can be known from the structural characteristics of the R-test that the position coordinates of the sensors are directly affected by the installation errors of the sensors, which include the installation angle deviation Δαi between the sensor axis and the Z-axis of the CSYSM, and the angle deviation Δβi projected on the reference plane of the three sensor axes. In general, the sensor installation error can be eliminated during the instrument calibration process, and the most common calibration methods mainly include two methods: preliminary calibration and on-machine calibration [16] . Moving the feed axis of the calibration equipment accurately in the CSYSM, the sphere center is located at 6 arbitrary calibration points Pj (xj, yj, zj), j=1,2,...,6 within the measuring range of the sensor. Substituting the calibration point coordinates into the Eqs.

The definition of hardware parameters
It can be seen from Eqs. (7) and Eqs. (8)  When calibration is completed, the inherent errors of the hardware have the greatest impact on the measurement accuracy of the measurement system. The inherent errors of hardware are directly reflected in the geometric parameters which include the range of the sensor l0 and the radius of the ball R and precision parameters which include the precision of the sensor reading ΔLi, i=1,2,3 and the ball radius ΔR. The geometric parameters affect the spatial movement range of the sphere center, and the precision parameters directly affect the solution accuracy of the sphere center coordinates, which in turn affects the accuracy of the R-test error measurement data. In addition, it can be known from the structural characteristics of the R-test that the radius of the sensor detection plane (Defined as ri, i=1,2,3) are also one of the important factors affecting the moving range of the sphere center.
Tab. 1 Error term affecting the performance of flat contact R-test.

Definition Value
The installation angle deviation between the sensor axis and the Z-axis of the CSYSM. Δα The angle deviation projected on the reference plane of the three sensor axes. Δβ The installation position error of sensors.
The direction deviation of the sensor detection plane normal vector.
The positioning error of calibration equipment.

The definition of measurement system performance indicators
The performance evaluation indexes of the R-test mainly include measuring stability, measuring space and measurement accuracy. To improve the adaptability and safety of the flat contact R-test, it is necessary to maximize the measuring stability and the measuring space at the same time under the premise of ensuring measurement accuracy.
(1) Measuring stability The measuring stability characterizes the magnitude of the sensor's reading change Δli , i=1,2,3 when there is a small amount of position change at the sphere center. The relational expression is , 1, 2,3 (9) where ΔP = (Δx, Δy, Δz), and the Jacobian matrix J represents the mapping relationship between ΔP and Δli , which is only related to the installation angle of the sensor [16] . The smaller amplitude of Δli, the better measuring stability.
(2) Measuring space As shown in Fig. 2, the measuring space represents a range of movement of the sphere center within the range of the sensors, is represented by S. According to the structural characteristics of the flat contact R-test, the movement range of the sphere center should be limited to a cylinder with a ground radius of ri and a height of l0 for a single sensor during the measurement process, and then the measuring space of the R-test is the intersection of three angled cylinders, which should be larger than the required measurement range. In theory, the larger the measuring space, the larger the machine tool error range that the instrument can measure and the higher the safety.
However, after the structural parameters of the measuring device are determined, the measuring space is limited by the sensor range, the sensor's detection plane radius and the ball radius. So the range of the sensor and the radius of the ball needs to be optimized for a specific measuring space requirement, to avoid waste of space. number of the matrix formed by the partial derivative of the sphere center coordinates relative to the sensor reading [16] , and the detailed solution process will not be repeated here.  (2) The constraint model of measuring space As for the measuring space, when the sensor installation angles are certain, it is simultaneously affected by the sensor range, the sensor detection plane radius and the ball radius. When the positions of the sensors are fixed, define the normal vector of the detection plane at the bottom plane of the sensor as Vi , i=1,2,3, and the distance from the center of the sphere to the bottom plane of the sensor as di, i=1,2,3. According to the spatial geometric position relationship between the sensors and the ball, the constraint equation can be obtained _1 0 , 1, 2,3 0 (11) Therefore, the influence relationship between measuring space and hardware parameters can be expressed as Eqs. (12) to Eqs.(14)    3  tan  tan  2  2  2  2  sec  0  3  3  tan  tan  2  2  2  2   3  tan  sec  2 2 sec 0

Optimized configuration of the hardware parameters based on the constraint models
It can be seen from the above analysis that the geometric parameters and precision parameters of the hardware directly affect the measurement performance of the R-test. Therefore, the optimized configuration methods for the hardware parameters based on the constraint models are proposed, which guide the customized configuration of the R-test in practical applications and avoid waste of hardware range and precision. The optimization configuration process is shown in Fig. 4.

Determine sensor installation angle based on measuring stability constraint model
It can be known from the optimization method in the literature [16] and Eqs.(10) that the measuring stability of the R-test is only related to the sensor elevation angle α, and is not affected by the sensor range l0 and the ball radius R. Therefore, the maximum measuring stability can be ensured by determining the parameter of the sensor elevation angle α, and the maximum measuring stability can be obtained when α is 35.3°.

The configuration optimization of hardware geometric parameters based on the measuring space constraint model
After the value of α is fixed, the size of the measuring space is mainly limited by the hardware parameters which include sensor range l0, the sensor detection plane radius ri and the ball radius R according to Eqs. (12) to Eqs. (14). To study the selection of hardware configuration for certain measuring space requirements, an optimal configuration method based on the exhaustive search is proposed. Assuming that the three sensors are of the same type, the detection plane radius(r1=r2=r3=r) and range are the same. According to the R-test measuring characteristics and the five-axis machine tool RTCP movement principle, the sensor range needs to ensure that the moving range of the ball is greater than the maximum error of the rotating shaft (Generally no more than 0.1mm), and a safety margin needs to be set to move the sphere center to the origin of the CSYSM more conveniently. The selection of the radius of the ball needs to consider the range of the sensor and the radius of the detection plane to a certain extent.
Step 7: If all the point coordinates in Step 6 meet the constraint equations, output the hardware parameter combination; if not, update the combination value, and repeat Step 5 and Step 6 until all combinations are filtered.
Step 8: Obtain all hardware parameter configuration combinations that meet the certain requirements of the measuring space.

Optimal configuration of hardware precision parameters based on the measurement accuracy constraint model
For measuring instrument with certain hardware geometric parameters, it can be seen that the precision parameters of hardware which include the reading precision ΔLi of the sensor and the radius precision ΔR of the ball, mainly affect the solution accuracy of the sphere center coordinates and directly affect the final measuring accuracy of the measuring instrument according to the measuring Eqs. (6) in Section 2.2. In general, the higher the precision of the hardware, the higher the cost, and when a certain precision limitation is reached, the price of hardware will increase geometrically. However, the precision selection of hardware needs to be certain by actual measuring requirements in actual engineering applications. So to ensure the accuracy of the measuring instrument and avoid the waste of hardware precision, the precision of the sensors and the ball must be reasonably configured.
Assuming that the three sensors have the same indication precision(ΔL1=ΔL2=ΔL3=ΔL), the method of variable parameters is used to analyze and observe the influence of the precision of the sensor's indication and the ball radius on the final measuring accuracy of the measuring instrument based on the Eqs. (6). And the sensitivity coefficient is used to characterize the degree of influence more intuitively. To calculate the sensitivity coefficient based on the R-test complex model more accurately and quickly, the understanding of the evaluation model is reduced to an empirical first-order Taylor series expansion based on the measured sensitivity coefficient [26] , and the sensitivity coefficient is also defined based on the variable parameter method, the calculation Step are as follows: Step 1: Substitute the calibration point coordinates Pj and corresponding sensor readings li into Eq.(8) and calculate the normal vector ni of the detection plane of the three sensors and the sensor position coordinates Si_1; Step 2: Substitute ni and Si_1 obtained in Step 1 into Eqs. (7) to obtain the coordinates of the sphere center under ideal conditions at any position; Step 3: Substitute the indication error of sensors ΔL and the radius error of ball ΔR into the Eq. (7), the sensitivity solution model of the sphere center coordinates change ΔP relative to the sensor precision ΔL and the sphere radius precision ΔR is obtained: (15) Step 4: Define the reasonable change interval of ΔL as ±δ, the change step length is e, and the number of step lengths is n; Step 5: Calculate the indication value ΔLm (m=1,2,...,n) corresponding to each step respectively; Step 6: Ensure that the rest of the input is unchanged, and calculate the change in sphere center coordinates (ΔxLm, ΔyLm, ΔzLm) corresponding to ΔLm according to the Eq.(15); Step 7: Calculate the change in sphere center coordinates (ΔxRm, ΔyRm, ΔzRm) corresponding to ΔRm according to the calculation principle from step 4 to step 6; Step 8: Obtain the regular distribution diagram between hardware precision parameters(ΔL and ΔR) and the solution accuracy of the sphere center coordinates; Step 9: Calculate the mean value of the change in the center of the sphere by Eq.
Step 10: Calculate the mean value of the change in the sphere center coordinates relative to ΔR using the method in Step (4) to Step (7) Step 11: Normalization and dimensionless processing, to obtain the sensitivity coefficients cL and cR corresponding to ΔL and ΔR respectively, and then provide reference and guidance for the precision selection of hardware according to the precision influence law and the corresponding sensitivity coefficients of the two.

Case calculation
Take specific measurement requirements (The measuring space is 0.3*0.3*0.3mm 3 , and the measurement accuracy is 4μm) as an example. The configuration method in section 4.2 is used to realize the configuration of hardware geometric parameters, and the method in section 4.3 is used to realize the configuration of hardware precision parameters.
(1) Hardware geometric parameter configuration In general, the geometric error of the rotary axis of a five-axis machine tool does not exceed 0.3mm. Therefore, the moving range of the sphere center x, y, z are all set as [-0.3mm, 0.3mm].
The initial preset calculation parameters are set as shown in Tab (2) Hardware precision parameter configuration Considering that the precision of the three sensors is the same, the contour diagram between the accuracy of the X-direction, Y-direction, and Z-direction coordinate of the sphere center and the precision of the sensor and the ball can be calculated according to Eq.    Fig. 8 The diagram of the relationship between the calculation accuracy of the sphere center Z-direction coordinate and the precision parameters of the hardware. Fig. 9 The sensitivity coefficient of the influence of hardware precision on the solution accuracy of sphere center coordinates.

Hardware selection and prototype development
Configure the hardware parameters of the measurement requirements according to the measurement requirements and the analysis results in Section 5.1: (1) The sensor range is selected as 1mm(The maximum stroke 1.1mm, the and the maximum sampling frequency is approximately 400Hz), the detection plane radius of the sensor is 3.5mm, and select 15mm for the radius of the ball; (2) The precision of the sensor's indication is selected to be 1μm, and the precision of the ball radius is controlled to be within 2μm.
Select KEYENCE GT-S1 contact displacement sensor and D6L50M5 standard ceramic ball to develop a prototype (As shown in Fig. 10), and the R-test software is developed using Qt. Fig. 10 The picture of the developed prototype.

The evaluation of measuring space
The calibration experiment on a CMM, as shown in Fig. 11

The evaluation of measurement accuracy
To make the moving coordinates of the verification point more accurate, a laser interferometer is used to verify the calibration accuracy, which is shown in Fig. 13. Calculate the sphere center coordinates solution uncertainty based on the GUM and MCM, and compare with the actual verification point coordinate accuracy. The evaluation results of the sensor position calibration uncertainty are shown in Tab. 6, and the calibration uncertainty of the sphere center is 2.141μm, 2.763μm and 3.991μm respectively, which is consistent with the 1000 verification point errors in the actual calibration experiment as shown in Fig. 14. It can also be seen that the R-test with the selected hardware precision parameters configured according to the method in Section 4.2 meets the measurement requirements of 4μm. Fig. 15 shows the on-machine measurement on the MIKRON machine tools using the prototype, and the measurement results show that the performance of the protype can meet the required measurement requirements.

Conclusions
In this paper, the novel hardware parameters configuration methods for the contact R-test are proposed to realize customization. The theoretical measurement model and the calibration model are established to evaluate the measurement accuracy of the measurement system. The constraint models for the measurement performance indexes of the system relative to hardware parameters are established, and to realize the optimal configuration of hardware parameters according to the constraint model through exhaustive search method and variable parameter method respectively. A prototype is developed according to the configuration methods, and a calibration experiment is carried out on a CMM. The verification results indicate that the optimized configuration methods of the hardware parameters can achieve the goal of customized configuration according to certain measurement requirements without precision and range waste. The hardware configuration methods proposed in this paper provide an important reference for the actual development and use of the R-test.