1 Introduction

Applying injection molds has become one of the main production methods in the modern manufacturing industry. NC multi-axis machine tools are commonly used for the machining of complex molds and dies [1]. The increasing demand for the geometric accuracy of products forces an increase in the accuracy of molds used in their production. In addition to the product quality, the accuracy of mold processing must ensure the proper functioning of the mold itself. One of the important problems in injection mold milling is to ensure the accuracy of fitting of the closing surfaces that are often freeform. Deviations of the treated surfaces from the nominal form cause leaks in the closure and, as a result, material leakage.

Due to the complex geometry of freeform surfaces, the design, manufacture, and accuracy assessment of such surfaces are performed in the CAD environment. Measurements are most often conducted using numerically controlled coordinate measuring machines (NC CMMs) equipped with touch probes; in consequence, the coordinates of the measurement points of a discrete distribution on the measured surface are obtained [2, 3]. At each measurement point, the local deviation, i.e. the distance between this measurement point and the CAD model, is determined.

In practice, coordinate measurement data are used in accuracy assessment and in machining program correction [3]. Raw measurement data contain information about deterministic and random phenomena occurring on surfaces as a result of the machining process, as well as about measurement noise [4,5,6]. The random component interferes with the inference about the surface accuracy and prevents effective correction of machining errors. Therefore, it is practical to separate the random component from the measurement data and to infer the accuracy of the machining on the basis of the deterministic component [7, 8]. Since the surface curvature is spatially variable at each point of a freeform surface, the distribution of machining forces and other phenomena occurring during both the machining and measuring processes is also spatially variable.

In order to separate the deterministic and the random component in spatial data, the regression analysis and spatial statistics methods can be applied [9, 10]. Yan et al. [5] applied Moran’s I statistics and B-spline modeling of the studied regression surface to decompose the components of free-form surface deviations, and assessed the coordinate measurement uncertainty of the surface on the basis of the separated random component. Chena et al. [11] proposed error compensation based on the systematic component of the deviations from the nominal surface. They, too, applied Moran’s I statistics and B-spline modeling to remove the random component from the data obtained from machine tool measurements in which they used a ball tip of 6 mm in diameter. This resulted in mechanical filtration of much information on the surface irregularities. It has to be remembered that the sampling step/grid size and the ball tip in themselves result in a geometric-mechanical filtration of surface irregularities [12, 13].

Paper [8] proposes the use of the CAD model machining pattern determined on the data obtained on a CMM, and spatial statistics for the correction of free surface milling errors. The machining pattern model was determined on the coordinate measuring machine data that is always more accurate than measurement data obtained in NC machine tool measurements, by averaging the deviation models determined for ten surfaces produced under the same conditions. The model determined in this way represented errors in the machining process, and it proved to be a very effective tool in error correction as the surface deviations after the correction were lower by 70%.

It is assumed that measurement points faithfully represent measured surfaces. However, measurement results are always burdened with uncertainty One of the reasons for measurement uncertainty is the sampling strategy whose selection is entirely dependent on the metrologist [3, 4, 13]. Depending on the diameter of the measuring tip and the size of the point grid (sampling step), the measurement data represent the measured surface with different accuracy. Considering the measurement time, the number of points should be as low as possible, while larger numbers of points characterize surfaces more accurately. Therefore, a strategy is intensely searched for in which the number of points would be as low as possible, and their distribution would enable an efficient surface assessment, i.e. the geometric deviation assessment with an acceptable measurement uncertainty. The simplest solution in freeform surface measurement is sampling along a regular grid of points [1].

With reference to freeform surfaces measured in a CAD environment, a CAD model of an actual surface, presented in one of the standard data exchange formats (e.g. IGES), could have a practical use in forecasting critical areas, in generating measurement points in these areas, in determining form deviations, as well as in performing measurements [6]. The same model can be used in the effective correction of the NC machine tool to improve the accuracy of manufactured workpieces [8, 11].

The problem of geometric accuracy becomes more complex when two surfaces are fitted together, especially when a tight fit is required. The gap created after closing the surfaces is the effect of summing the deviations of both these surfaces. This is the case with injection mold closing surfaces. Experimental determination of the gap size, e.g. using computed tomography, is not possible due to the low permeability of steel. In this study we propose an innovative approach. We assumed that to assess the accuracy of matching two freeform surfaces, the CAD models of both actual surfaces can be used and fitted together in the CAD software by simulating the mold closure, and then the spatial CAD model of the gap between the surfaces can be determined.

The present paper proposes a new method of simulation tests of the accuracy of fitting two freeform surfaces. For this purpose, the CAD models of both actual surfaces should be determined on the basis of the coordinate measurement data obtained in measurements along a regular grid of points in the UV space. The NURBS regression surface [14] is modeled on the measurement data, and an adequate regression model is sought using the iterative procedure. In the following steps of the procedure, the number of control points and/or the degree of the surface is/are changed, and the autocorrelation of the model residuals is tested with the use of the spatial statistics methods. The designated model is a CAD representation of the actual surface. The accuracy tests of the surface fitting are carried out virtually by fitting together both models in the CAD software. The outcome of the study was a spatial model of the gap between the surfaces, and the model dimensions were verified experimentally using a measuring microscope and a confocal microscope for freeform samples made of aluminum alloy.

2 Approach Description

In our simulation tests of the gap between the injection mold closing surfaces, CAD models representing the machined surfaces were used. In order to determine the actual surface CAD model, it is necessary to obtain the measurement data from coordinate measurements along a regular grid of points uniformly distributed on the surface. Depending on the measuring tip diameter and the measurement grid size (and thus the sample step length), the measurement data represent the measured surface with different accuracy. Statistical tests were performed, consisting in repeated measurements using different parameters—the measurement grid and measuring tip diameter—in order to determine the measurement uncertainty (Sect. 2.1).

The actual surface is the effect of a complex manufacturing process characterized by both deterministic and random spatial phenomena. While deterministic deviations are spatially correlated, spatially random deviations do not show spatial correlation [9, 10]. Data obtained in coordinate measurements include information of a spatial character, concerning surface deviations; they also include, in a much smaller proportion, measurement errors. In the methodology applied in the present paper, the different spatial nature of deviations is the basis for separating the random component and the deterministic component. For this purpose, the regression analysis, spatial statistics (Moran’s I statistics), iterative procedure, and NURBS modeling were used (Sect. 2.2). The defined smooth regression surface is the most probable model of the observed surface deviations. Superimposing this model onto the nominal CAD model makes it possible to obtain the model of the actual surface (MAS).

To determine the virtual CAD model of the gap between the surfaces fitted together, the MASes of both closing surfaces need to be determined. In the next step, the closure of both surfaces should be simulated in the CAD software, moving the MASes in the direction of the Z axis and disabling the remaining five degrees of freedom. The surface closure scheme in the injection mold is shown in Fig. 1.

Fig. 1
figure 1

The mold closing scheme

2.1 Freeform Surface Data Acquisition Using NC CMM

To acquire freeform surface data, coordinate measurements must be carried out along a regular grid of points, with an appropriately chosen sampling grid (step) and size of the ball tip. To measure a freeform surface on a CAD model base, the following must be performed:

  • Locating of the object and of the CAD model in a common coordinate system,

  • Generating measurement points on the CAD model,

  • An NC measurement,

  • A comparison of the measurement points with the corresponding points on the CAD model.

In touch measurements, the probe tip acts as a mechanical-geometric filter. It means that the range of information included in the measurement data is related to the probe tip size. In the presented experiments, an attempt to assess the influence of the measurement parameters on measurement uncertainty was made. For this purpose, statistical tests were carried out consisting in repeated measurements using various parameters. The loss of information on surface deviations was calculated in comparison to the results obtained during the sample calibration in an accredited laboratory, and the arithmetic means and estimates of the experimental errors were determined. The resulting values allowed us to take into account the contribution of measurement parameters in the uncertainty budget [3, 15].

2.2 MAS Designing Procedure

The measurement data obtained using specific measurement parameters (Sect. 2.1) formed the basis for determining the CAD model of deterministic deviations, and then for determining the MAS.

The methodology consists in iterative modeling of the regression surface on the measured deviations, and in assessing the spatial randomness of the model residuals with the Moran’s I test at the consecutive iteration stages. In order to determine a model representing deviations, the NURBS method is applied. The NURBS surface of the p degree in the u direction and the q degree in the v direction is a vector function of two variables [14]. In iterative modeling, the number of control points is changed in both directions (for the subsequent surface degrees), and the model residuals are tested at each stage. This methodology makes it possible to reject deviations (and other effects) of random character from measurement data, according to the developed criterion [10, 11]. The regression model representing deterministic deviations takes on the CAD parametric form. The deviation model superimposed on a nominal CAD model brings about the MAS. The digital data processing procedure leading to obtaining the MAS is presented in the block diagram in Fig. 2. The obtained model is a universal tool to be used in the production of parts containing freeform surfaces, both in the machining step and in the accuracy assessment.

Fig. 2
figure 2

MAS determining procedure

The model designed in this way was verified experimentally and applied in the correction of machining programs for freeform surfaces of varied shapes, e.g. [8]. Our research showed great effectiveness of this model.

3 Experimental Research

3.1 CMM Data Acquisition

The methodology is presented on the example of the experiment performed on freeform surfaces made of aluminum alloy, with the bases measuring 50 × 50 mm (Fig. 3a), obtained in the milling process using a ball-end mill of 6 mm in diameter, rotational speed equal to 8000 rev/min, working feed of 800 mm/min and zig-zag cutting path in the XY plane (Ra = 1.71 μm). The measurements were carried out on a Global Performance CMM (PC DMIS software), MPEE = 1.5 + L/333. The measurement uncertainty for the form deviation with reference to datum features, estimated using the EMU software developed at the University of Bielsko-Biala, Poland, by Jakubiec [15], was equal to u = 0.9 μm. The CMM was equipped with a Renishaw SP25 probe with a 20 mm stylus with a ball tip of 2 mm. The grid of points u × v, 625 pts (25 rows × 25 columns; ~ 2 mm × ~ 2 mm) on each surface was applied. The CAD models of these surfaces were cut from the models of the closing surfaces of an injection mold. Figure 3b shows the measurement paths distribution on the measured surfaces. Maps of local deviations are presented in Fig. 4, and the measurement results can be seen in Table 1.

Fig. 3
figure 3

Measurements with CMM: a surface image during measurement and b distributions of measurement paths on CAD models in PC DMIS software

Fig. 4
figure 4

Maps of local deviations

Table 1 Measurement results

Tests on the spatial autocorrelation of the observed deviations were subsequently carried out. The computation results show a clear positive autocorrelation of the deviations. Further, the spatial models of the regression surfaces (DRMs) need to be determined.

3.2 MASes Modeling

The regression models of the observed deviations were constructed according to the procedure presented in Fig. 2. In the subsequently constructed models, the number of control points and the surface degrees in both directions were changed. The model residuals were examined each time, and the maximum and minimum values, arithmetic mean, probability distribution (the distribution normality was verified with the Kolmogorov–Smirnov test), and the I spatial autocorrelation coefficient were determined (1). The relationships between the deviations at the measurement points were made dependent on the reciprocals of the distance between the points [6, 8]. The elements of the weighting matrices, defining the dependencies between the deviations at points i and j, were determined from the dependence (2), assuming the value of the constant k = 3. In all the statistical tests, the confidence level P = 0.95 was adopted. The model with the smallest number of control points and the lowest surface degrees in the U and V directions, for which the model residuals met the criteria of a normal distribution and of spatial randomness, was adopted as an adequate one. In the case under discussion, the criterion was met for the number of control points amounting to 17 × 16 for the left surface, and 15 × 16 for the right surface, with the number of the surface degrees being 3 × 3. Maps of the DRMs can be found in Fig. 5, and the characteristics of the models—in Table 2. The statistical characteristics of the rejected model residuals are depicted in Table 3 and Fig. 6.

Fig. 5
figure 5

Maps of the DRMs

Table 2 Characteristics of the DRMs
Table 3 Characteristics of model residuals
Fig. 6
figure 6

Characteristics of model residuals: a probability distributions and b maps

As it can be observed while comparing Figs. 4, 5, Tables 1, and 2, the designed deviation regression models adequately represent the measurement data.

We obtained the MASes by superimposing the regression models for the deviations of both surfaces on the nominal CAD models according to the procedure shown in Fig. 2.

3.3 Simulating Accuracy of Fitting Two Surfaces

The next step included using the MASes of the closing surfaces to simulate the accuracy of fitting of these surfaces. We carried out the accuracy tests virtually by fitting together both models in the CAD software. The models were then moved virtually one to the other in the Z axis direction (Sect. 2, Fig. 1). The result of the study was a spatial CAD model of the gap between the closing surfaces. Figure 7 presents the obtained spatial model of the gap, while Fig. 8 illustrates a map of this model with the critical dimension. The dimensions of the designated gap are given in Table 4.

Fig. 7
figure 7

CAD model of the gap between surfaces

Fig. 8
figure 8

The map of the gap model and the critical area dimension

Table 4 Dimensions of the gap model (mm)

3.4 Experimental Verification of the Gap Model

The advantage of the method presented in this article lies in the possibility of assessing the dimensions of the gap between the two closing surfaces of an injection mold virtually, since it is not possible to measure this gap. In order to prove the credibility of the method, we verified it experimentally by comparing the dimensions of the obtained CAD model of the gap between the samples representing fragments of the mould closing surfaces to the dimensions of the actual gap between these surfaces. To that end, the workpiece showed in Fig. 3a was cut in two. The freeform surfaces were closed by sliding the two parts together along the Z axis, ensuring they did not rotate or move along the remaining axes (as showed in Fig. 1), and then fixed together. The imitation of a fragment of an actual injection mold, obtained in this way, was later cut parallel to the Y axis at sections X = 4.38 mm and X = 12.00 mm with a wire-cut electrical discharge machine. Figure 9a shows the effect of this operation. The subsequent gap measurements were performed using a Vision Engineering Falcon video measuring microscope, and verified measurement results using Olympus OLS4000 confocal microscope. Examples of microscopic views can be seen in Fig. 9b, c, and the comparison results—in Table 5.

Fig. 9
figure 9

a Samples prepared to be measured; examples of microscopic views of the gap, b a measuring microscope screen (mm, magnification ×100), c a confocal microscope screen (μm, magnification ×1073)

Table 5 Results of comparative tests (mm)

In our previous research, we had verified the CAD model of the actual surface and found out that the application of this model both in measurements and in machining program correction proved effective. On the basis of the above, we predicted that the verification of the model of the gap determined by fitting together two models of the actual surfaces would be positive. The presented results of our research (Table 5) clearly confirm the accuracy of these predictions. The dimensions of the CAD model of the gap and these of the actual gap between the surfaces vary by an average of 10% (the actual gap dimensions are on average 2 μ larger than the dimensions of the gap model), which sufficiently verifies the method proposed in this article and makes it a useful tool in analyzing and improving the accuracy of injection molds production.

4 Conclusions

The challenge in the milling of mold freeform closing surfaces lies in the enhancement of the tightness of their fit. In the proposed approach to predicting the accuracy of fitting two freeform surfaces, the regression models of the actual surfaces were developed. These models were NURBS surfaces determined on the coordinate measurement data and were the most probable representations of the actual surfaces. The designed models were then adjusted in the CAD software, thus creating a 3D virtual gap between these surfaces.

Our experimental research was carried out on milled samples imitating the closing freeform surfaces of the injection mold. The surface profile heights, determined in coordinate measurements, were 0.0149 mm and 0.0299 mm, while the maximum width of the gap model after their closure was 0.0284 mm. The experimental verification of the gap model dimensions with the use of a measuring microscope for measuring the actual gap showed differences by an average of 10%. Such results justify the application of the model developed by us to represent the gap between the surfaces in analyzing the injection mold accuracy.

The advantage of the proposed method of simulation tests of the accuracy of fitting two freeform surfaces lies in the possibility of estimating the spatial CAD model of the gap between the surfaces. On this basis, corrections may be calculated to compensate for any machining errors and the errors of both surfaces might be corrected by modifying the nominal CAD model and then by additional machining of only one of the two surfaces.