1. Introduction
In response to the needs of manufacturing applications, the international industry, academia, and research institution sustain the research on improving the machining accuracy of the machine through hardware improvement or software-based error compensation. For production lines with high-precision requirements, due to the tight tolerance zone design of each process, high-specification and high-precision machines are usually required for each process, resulting in higher hardware costs for the production line. Therefore, if the real-time error measurement and compensation in the manufacturing process enable the front and back processes to perform matching error compensation processing, then the matching between the processes can be greatly improved and the re-work rate and defect rate can be reduced, thereby reducing the manufacturing cost of the production line.
In addition, in the production of precision industrial products, it is often necessary to individually manufacture components and then perform the precision assembly. The assembly matching accuracy depends on the requirements of individual processing accuracy and the selection of two components (part and counterpart) with the smallest matching error. At present, most of the production methods in the industry are mass production, and then suitable part and counterpart are manually matched and selected for assembly. However, due to the different manufacturing processes of the parts and the counterparts, and the different manufacturing tolerance ranges, the cost of maintaining manufacturing accuracy is high; additionally, the manual selection is time-consuming and inefficient. The online curve shape measurement and matching error compensation system proposed in this research is to parallel and efficiently measure the error of the part on the production line, and then convert it into the correction error of the counterpart to be machined, afterward automatically generate the numerical control (NC) processing program with the correction. With high-efficiency information communication, the suitable counterpart is machined, so that the matching accuracy between the part and its counterpart is improved in the low-cost and high-efficiency manufacturing process. Another advantage of this method is that there is no need to require strict tolerances in every manufacturing process, which makes the production line more robust and results in lower production costs.
The matching shapes between the part and its counterpart can be divided into straight, triangle, and curve types. Our previous study proposed matching error compensation methods for straight and triangle matching [
1,
2]. This research proposes more complex matching shapes that are curved matching error measurement and compensation methods to meet the industry’s demand for complex assembly matching. The proposed method can be used for automated production lines with CNC machine tools, robotic arms, and measurement systems. The autoerror compensation module and production line monitoring module can be integrated with the automation production line to improve production line efficiency, and greatly reduce unnecessary manual matching costs. The compensation method used in the research is passive compensation. By measuring the positional coordinates of the mating area of the part, the deviation and geometric error of the mating area are automatically calculated, and then the measured error is converted into a correction amount for its counterpart through the error conversion module. Subsequently, use the established NC program autoidentification and compensation module to compensate the correction amount to the corresponding section of the NC program, and finally use the compensated NC program to machining the counterpart, thus the counterpart can be accurately matched with the part.
In the past, many studies have investigated error compensation methods to improve the machining accuracy of the machine. Wang et al. [
3] proposed an on-machine and vision-based measurement method to measure the volume error of a micromachine tool then compensated to the machining trajectory. Zhang et al. [
4] used Cross Grid Encoder KGM181 to measure and identify the geometric error and developed an automatic compensation system module. Jia et al. [
5] comprehensively summarized and classified contouring-error reduction methods for three-axis and five-axis CNC. The advantages and disadvantages of different kinds of methods were discussed and compared. Yang et al. [
6] improved the tracking accuracy of the CNC machine tool by establishing a two-stage feedforward friction compensation model. Experimental verification was also conducted and showed that the proposed method could improve the tracking accuracy of CNC machine tools by around 20%. Wan et al. [
7] proposed a three-axis CNC geometric error model using a homogeneous transformation matrix, which converts high-order nonlinear spatial geometric problems into algebraic equations by fitting geometric error components through a cubic polynomial function. Nghiep et al. [
8] investigated the mechanism of tool deflection error, then minimized the deflection error by controlling the cutting parameters and suitable lubrication mode. Zhao et al. [
9] proposed an effective error compensation method with a new error prediction model and error compensation strategy for coordinated five-axis machine tools. The influence of the coordinated workspace of prismatic joints (CWP) and the coordinated workspace of revolute joints (CWR) on the objective error was investigated, then it was combined with the interpolation algorithm to predict the relative position and orientation error. Zhou et al. [
10] investigated nonlinearity error on five-axis CNC machining. A close-form representation of the envelope surface methods was proposed to calculated the nonlinearity error. The Cutter location data from commercial computer aided manufacturing (CAM) and practical machining experiment were collected and compared to determine the surface deviation. Shi et al. [
11] investigated the degradation of contouring accuracy of machine tools caused by transient backlash error (TBE). A mathematical model for feed drive with backlash was developed from full-closed loop type feed drive. Based on this model, the TBE was demonstrated. Simulation and experiment were carried out for validation, and it showed the magnitude of TBE could be forecasted if the open-loop gains and the backlash widths are identified. Bi et al. [
12] proposed an adaptive machining method for curved contour based on a novel isometric mapping. The method includes three steps: the first, using a laser scanner based on-machine measurement (OMM) system to obtain the real geometry of the deformed surface. The second, establish an isometric mapping between two sets of points. The accuracy of matching between the nominal surface and the actual surface is defined according to the deviation of the geodesic distance of the two sets of points. The third adaptively adjusts the toolpath according to the result of isometric surface mapping to compensate for the deformation error. Simulation and machining experiments were carried out to prove the feasibility and effectiveness of the proposed method. Huang et al. [
13] developed a new elastic deformation compensation interpolation (MEDCI) algorithm to generate a modified position command, thereby reducing the tracking error caused by elastic deformation.
Monitoring and control of the manufacturing process are important for the development of manufacturing industries. Process monitoring is the manipulation of sensor measurement (e.g., vibration, force, temperature) in determining the state of processes. Different real-time monitoring techniques to monitor the manufacturing process have been investigated, such as Dinardo et al. [
14] used vibration signals to continuously monitoring the machine condition. This approached allows for self-assessment of health and degradation status of the machine system. Teti et al. [
15] provided a comprehensive review of sensor technology, signal processing, and decision-making strategies for machining monitoring. Different techniques and methods of signal feature extraction and feature integration for decision making were elaborated and discussed. Han et al. [
16] proposed a novel method to predict health management of complex multi-state manufacturing systems. The hard failure and soft failure of the manufacturing system were defined. With considering the functional dependence of the manufacturing component and soft failure, developed Remaining Useful Life (RUL) method. The functional importance of the manufacturing component was defined and used for optimizing the process of manufacturing system maintenance decision making.
For high-precision products, measurement accuracy plays a key role. The Coordinate Measuring Machine (CMM) is widely used in industry to evaluate dimensional and geometric characteristics of complex high precision parts. However, due to the demand for shorter cycle times of measurement tasks, in such conditions, dynamic errors will certainly have a much more influence on the measurement accuracy. Echerfaoui et al. [
17] investigated the dynamic errors in the CMM through experimental work. Experimental design and statistical analysis tools were combined to evaluate the measurement parameters effects at high measuring velocity, then these parameters were used to investigate the variation of dynamic error. Ostrowska et al. [
18] developed a virtual articulated arm coordinate measuring machine (VAACMM) using three different metrological models. Verification method based on measurements of multi-feature check standard and posterior predictive p-value test was proposed for assuring the correct functioning of developed VAACMM. Xing [
19] et al. proposed a method that combined volumetric errors (VEs), vector similarity measures (VSMs), and the exponentially weighted moving average (EMWA) for machine tool accuracy monitoring. Simulation machine error data and the real machine tool test were carried out to verified the proposed method. The results showed that VE is significant for monitoring the machine tool accuracy condition, and VSMs work well in VE feature extraction. Yang et al. [
20] developed a high-accuracy online prediction algorithm of five-axis contouring errors according to three-point arc approximation (TPAA). The experiment results showed that the proposed TPAA algorithm can predict contouring error with higher accuracy than linear segment approximation (LSA). Tang et al. [
21] approached a new analyzing method to calculate the straightness and angular errors according to measuring guideway surface and fitting curve. Jia et al. [
22] proposed the Non-Uniform Rational B-Splines (NURBS) interpolator method for the calculation of the contour error. A parameter compensation-based second-order Runge–Kutta method was used to precisely calculate the new interpolation-point parameter. Mao et al. [
23] proposed a new method based on resampling to create surface fitting for the data from the Coordinate Measuring System. The method consists of three parts: NURBS curve fitting for each row, resampling on the fitted curve, and surface fitting from the resampled data. The numerical experiments were conducted with simulation and practical data. The results demonstrated fast, effective, and robust calculation.
The previous research on error compensation mostly focused on the improvement of the processing accuracy of a single part and less focused on the assembly parts. This research focuses on the measurement and error compensation for high-precision assembly matching. The error of a part is measured in real time on the production line, then the error compensation value for its counterpart is calculated according to the error of the part. Furthermore, the error compensation value is compensated into the counterpart NC program. Finally, the counterpart is machined using a compensated NC program. Thereby, if an error exists on a part, the error is autocompensated to its counterpart to be machined, so that the high-precision matching assembly can be obtained. In the past, our research team has proposed compensation methods for straight and triangle matching errors [
1]. This paper extends a method for measuring and error compensation for curved and complex matching errors. In
Section 2, the matching error measurement and compensation methods were described and elaborated.
Section 3 described the online error measurement and compensation system developed based on the proposed method. In
Section 4, the experiments and verification results were presented and discussed. Finally, the conclusion was summarized in
Section 5.
2. Methodology
In the matching error measurement and compensation method, the user needs to define the key nodes in the mating area of a part, then the coordinate of the key nodes is directly measured on the production line to create the actual size and geometric profile. The tolerance chain in the design was included in the calculation of the theoretical minimum and maximum dimensions of the part. Subsequently, the size and geometric profile obtained from the measured part are compared with the theoretical size and geometric profile to determine the size and profile error of the part, and then convert into the compensation value of the counterpart to be machined. Finally, a corrected counterpart NC program is autogenerated according to the compensation value, then machine the counterpart that matching to the part. The methodology includes: (1) the selection of the key nodes, (2) measurement methods, (3) curved contour reconstruction, (4) error comparison, and (5) error conversion and NC program autocorrection.
2.1. Selection of Key Nodes
Before calculating the error and compensation, the product needs to be measured by the measurement instrument. First, it is necessary to define the key measurement points in the part mating area, so that the complete measurement information of the actual size and contour profile can be obtained and reconstructed. There are three types of matching assembly shapes between the part and counterpart, namely straight line, triangle, and curved. The straight line matching focuses on straight and length. To construct a straight line, two points are needed. The triangle matching focuses on the triangle side length and the angle. To construct a triangle, it is necessary to create two lines and the angle between the line must be known. Therefore, four points are needed to create two lines and using dot product equation to obtain the length of two lines and the angle between the lines. For the curve shape, the required points to construct a hill or valley are at least three points. However, for large hills or valleys, it is recommended to add one point for every increase of 5 mm. To construct the curve shape, the polynomial regression and least squares methods were used. The number of points will influence the accuracy of the curve construction. More number of points will provide higher accuracy of curve reconstruction, but it will take a longer measurement time. Alternatively, a fewer number of points will result in lower accuracy of curve reconstruction, but shorter measurement time. The mating error of the part can be obtained by comparing the actual shape after machining and the theoretical shape from the CAD. Furthermore, this mating error value is used to modify the shape of its counterpart to obtain precision matching in assembly.
2.2. Measurement Method
The point-to-point measurement method in the Renishaw Equator 300 is used to measure the part. This method uses several points to reconstruct the shape of the part. First, the origin position of the machining coordinate system must be checked, then the coordinates of the key points must be measured according to this coordinate system; furthermore, the actual curve must be reconstructed based on the measured coordinates. Subsequently, the actual curved and theoretical curved (from CAD drawing) is compared, and then the deviation is calculated between the theoretical point and the actual point.
Figure 1 shows the mating area that consists of a straight line, triangle, and curve shape. The two key measurement points of the straight line are the point P1 and P2 in
Figure 1a. The coordinates of P1 and P2 can be directly measured by the Renishaw Equator 300 measurement instrument. The length of the straight line can be obtained through these two points. For the angle of the triangle shape, the angle between the two lines can be calculated using a dot product, for example,
can be calculated using Equation (1).
For the curve shape, the point-to-point measurement method is used instead of the scanning measurement method. The advantage of using the point-to-point method is that it only needs several points to construct the curve, and the measurement time is short compared with the scanning method that uses numerous points and a longer measurement time. However, the number of points will affect the accuracy of the curve reconstruction. More points will produce higher accuracy of curve shape but longer measurement time is required as a consequence; on the other hand, fewer points will result in lower accuracy, but the measurement time is shorter. For example, ten points were taken while measuring the curve, as shown in
Figure 1c.
As is known, the measurement has some degree of errors that may come from the instrument or loading/unloading. The Renishaw Equator 300 that used in this study is an automated flexible gauge that employs the comparator principle via RenCompare software to account for the influence of systematic effects associated with Coordinate Measurement System (CMS) [
24,
25]. The parallel kinematic-based mechanism is used in the Equator instrument to minimize the machine’s dynamic errors at high measurement speed. To handle the temperature effect of the environment, the re-mastering process can be managed with the built-in sensor and software configuration [
26]. Accordingly, in comparative coordinate measurements, the main uncertainty contributors are environmental effect, machine repeatability, calibrated master part, part fixture, sampling strategy, and the geometric element best-fit algorithm. The critical factor that affects to coordinate measurement machine is the part-alignment procedure used to define the coordinate system or frame of reference. In coordinate measurement, an improper part fixture set-up influences the measurement accuracy. When each part is fixed within 1 mm relative to the master part, size and position measurements made immediately following re-mastering may have a comparison uncertainty of ±2 μm relative to the certified measurement of the master part. Angular misalignment can be avoided by using an appropriate fixture for part holding. However, clamping the part to be inspected in the proper position and orientation is not always easy. To minimize the loading/unloading errors, the Erowa Power Chuck tooling system with repeatability <5 μm was used to hold the part.
The uncertainty of Equator comparator measurement for touch-trigger probing (TTP) mode is less than 0.6 μm. The number of probing points has no significant influence on the comparator measurement uncertainty, and comparison uncertainty is less than 0.5 μm for the angular misalignment within a range of ±1 mm. A large number of contact points provides smaller measurement uncertainty. The length measurement uncertainty of the Equator comparator remains below ±2 μm when the fixture/component is relocated within an error range of ±1 mm (fixture requirement is according to the Equator system specification) [
1].
For the part-alignment in the measurement, the coordinate translation and rotation conversion as shown in
Figure 2 were performed. The rotation conversion formula can be expressed as Equation (2).
where
,
are coordinate after rotation; X, Y are coordinate before rotation;
,
are center of rotation (reference point).
2.3. Fitting Method
The straight line fitting and geometric angle fitting are common problems in engineering applications. The least squares (LS) or total least squares (TLS) method can be used to fit the two-dimensional straight line. However, the LS or TLS method cannot be directly used to fit the three-dimensional spatial straight line due to the large number of equations to be solved; the solving process is relatively cumbersome, with poor practicability. Therefore, the three-dimensional problem is converted into a two-dimensional problem, then LS or TLS methods are used to fit the straight line. Polynomial curve fitting is a common method of data fitting. Polynomials can be used to fit data points in two ways. First, the polynomial passes through all the data points, and second, the polynomial does not necessarily pass through any of the points, but gives a good approximation of the data overall.
Figure 3 illustrates N data points with their corresponding coordinates (X
1, Y
1), (X
2, Y
2)… (X
N, Y
N) and curve-fitted line. For a given coordinate, such as (X
i, Y
i), a deviation D
i exists between the corresponding value on the Y-axis and the Y value on the curve C. This deviation value can be positive, negative, or zero. The maximum order of the polynomial is dictated by the number of data points used to generate it, and can be calculated as m = N − 1. The polynomial can be created passing through all the points when the polynomial of the degree is N − 1. On the other hand, if the polynomial of the degree is less than N − 1, the polynomial does not pass through any of the points, but overall approximates the data. The general form of polynomials function can be written as Equation (3).
where
are the coefficients, and
n is the order of the polynomials.
The higher degree polynomials may give a larger error or are more likely to overfit. To obtain the best fit curve line to data points, the least squares method was used to minimize the sum of the squares of the residuals at all the data points. In addition, to avoid overfitting problems in curve construction using the polynomials method, regularization was used in the least squares to control the overfitting. The smaller the value, the better the fitting degree. The minimum sum of squares of error can be calculated using Equation (4).
The polynomial curve fitting with the minimum sum of squares of error can be calculated using Equation (5).
2.4. Error Comparison
The theoretical coordinate of the key points of the workpiece can be obtained from the CAD drawing, whereas the actual coordinates of the workpiece can be obtained by measuring the machined workpiece. For instance,
Figure 4 illustrates the theoretical shape (dashed line) of a part. Assuming that the theoretical coordinates of the pick point are (6,5), then this coordinate value will be entered into the proposed error compensation system setting. After machined the part, the actual shape of the part was measured by using Renishaw Equator 300 instrument. The measurement probe will touch two points (keypoint 1 and 2) on the side a and (keypoint 3 and 4) on side b. Subsequently, straight line a’ and line b’ were constructed according to those points, and the intersection point between straight lines a’ and b’, which is (8,6), was obtained, as shown in
Figure 4. The error is determined by comparing between actual part coordinate value and theoretical part coordinate value. In addition, the tolerance chain is also included in the error comparison. The maximum and minimum dimension of part is calculated according to the tolerance chain. For the error of part in the tolerance chain, it does not need to compensate to the counterpart. On the other hand, if the error of the part exceeds the tolerance chain, it is needed to compensate the error to the counterpart.
2.5. Error Conversion
The actual measurement information is provided in CSV format. Therefore, a CSV data-parsing module was established to analyze the content of the source file and determine whether the data content belongs to the part or counterpart.
To easily understand the error conversion, an illustration assembly between part and counterpart is depicted in
Figure 5. To convert the part error to the counterpart error, the first step is to measure the actual shape of the part, as shown in the red solid line in
Figure 6a, then calculate the deviation between actual coordinates and theoretical coordinates (including the tool diameter). Since positive and negative signs will affect the cutting tool direction in the machining process, a vector method that has magnitude and direction is used for conversion. In a cartesian coordinate system, the components of the vector are the projections of the vector along the X and Y direction. After the deviation value was obtained, then the coordinate of the counterpart is corrected according to the deviation value of the part. The counterpart correction coordinate can be calculated by using Equation (6). The shape of the counterpart after compensation is shown in the red solid line in
Figure 6b. The assembly matching before and after compensation is shown in
Figure 6c,d.
where:
,
are the actual coordinates of the part;
,
are error amount
X and
Y;
is the cutting tool diameter;
,
are the corrected coordinates of the counterpart.
2.6. Autogeneration of an Error-Compensated NC Program
To achieve online automatic error compensation, the above-mentioned error conversion results need to be inserted into the NC machining program to correct the cutting tool path. Therefore, it is necessary to declare the processing block for error compensation in the system in advance. In the setting section on the human–machine interface, the key measurement point and the corresponding NC program block is designed. The system will automatically search and identify the set block in the original NC program according to the key measurement setting, then integrate the error compensation amount into the X-, Y-, and Z-coordinate value of the block.
The NC cutting process generally consists of G00, G01, G02, and G03. In this research, Regular Expressions in the C# programming language is used to identify a single block. Regular Expressions is a way to search a pattern with a certain rule string; therefore, this method is suitable for searching NC code in a single block. To automatically generate an error-compensated NC program for a counterpart, the first step is to find the block number to be compensated. After the deviation value is obtained by subtracting the actual coordinate from the theoretical coordinate of the part, then the coordinate of the counterpart is corrected according to the deviation value of the part. The detail of the auto-generated error compensation NC program can be seen in the previous work [
1].
The total time for the compensation can be calculated using Equation (7):
where
is the number of key measurement points;
is the velocity of touchpoint (max 10 mm/s based on Renishaw manual reference);
is the distance between the probe and key measurement point (mm);
is the calculation time of deviation (s).