A New Error Prediction Method for Machining Process Based on a Combined Model

Machining process is characterized by randomness, nonlinearity, and uncertainty, leading to the dynamic changes of machine tool machining errors. In this paper, a novel model combining the data processing merits of metabolic grey model (MGM) with that of nonlinear autoregressive (NAR) neural network is proposed for machining error prediction. The advantages and disadvantages of MGM and NAR neural network are introduced in detail, respectively. The combined model first utilizes MGM to predict the original error data and then uses NAR neural network to forecast the residual series of MGM. An experiment on the spindle machining is carried out, and a series of experimental data is used to validate the prediction performance of the combined model. The comparison of the experiment results indicates that combinedmodel performs better than the individual model.The two-stage prediction of the combinedmodel is characterized by high accuracy, fast speed, and robustness and can be applied to other complex machining error predictions.


Introduction
In recent years, machining accuracy has become one of the most critical criteria for the performance of machine tools, especially in the circumstances where the precision of machine components is related directly to the product quality.The modeling and prediction of machining errors are highly significant for the implementation of machining error compensation methods.As the machining process is very complicate, subject to the systemic and random factors and the coupling effect between the various factors, machining errors are inevitable.Therefore, the key problem to enhance the machining accuracy is to establish a scientific and reasonable prediction model.Some researchers [1] have concentrated on the development of machining error models by using various modeling methodologies during the last few decades.
The precision of the machining error is affected by many kinds of errors, including kinematic error, tool deformation error, tool rotation error, and thermal error [2].Many researches [3,4] have focused on the prediction of machined workpiece in recent years.But the most of existing prediction methods consider only one or two error types and ignore the inherent characteristics of the machining error data.In this article, the machining error, as a comprehensive reflection of various errors effects, is predicted by the optimized combined model.
The grey theory is established and developed originally by Chinese scholar Deng [5] in 1982.Compared with other mathematics models, grey theory can make full use of the discrete random data sequence to generate more regularly data information.Wu [6] et al. used a grey model based on the data characteristics of water consumption to simulate the water demands of one city from 2009 to 2015 and forecast it in 2016.Chen [7] proposed a grey model for damage prognosis of high-speed blades.However, considering the fact that grey system model requires that original data must be monotonically increasing or decreasing, some researches proposed optimized grey model.Shih et al. [8] improved the GM(1, 1) by changing the background and initial values.Cui et al. [9] provided the NGM(1, 1) based on the GM(1, 1), which belongs to an entirely optimized GM(1, 1).Chen et al. [10] proposed the MGM for predicting the varied capacity with discharge cycles in electric vehicles.
Artificial neural network (ANN) uses the mathematical method to abstract the human brain information processing unit, simplifies the biological neurons, and can effectively deal with the problems of nonlinearity, ambiguity, and uncertainty.Hence, it has been widely used for modeling nonlinear time series [11,12].Dynamic neural network has added the delay link or feedback link to have the ability of memory and dynamic tracking.Ma [13] proposes a dynamic fuzzy neural network to achieve high-precision forecasting for the wind speed.Typical dynamic neural networks are such as NAR (nonlinear autoregressive) neural networks.Kari [14] proposed a method to reproduce car kinematics during a collision using NAR model whose parameters are estimated by use of feedforward neural network.Ruiz [15] provided a methodology to predict future energy consumption using NAR and the nonlinear autoregressive neural network with exogenous inputs (NARX), respectively.
However, although optimized, the sole grey model fails to receive a perfect performance while its row data is nonlinear, and the prediction accuracy may decline gradually with the passage of time [16].Artificial neural network obtains good performance in the prediction of nonlinear system, but it generally requires a large number of training samples and thus needs a long training computation time as well as having poor generalization capability [17].With respect to the limitations of the sole prediction models, many scholars have proposed some combination models to fill the gap of each model.Khalil [18] applied a method of the combination of unsupervised k-means clustering algorithm and ANN to forecast hourly global horizontal solar radiation.Xiang et al. [19] developed a vector-angle-cosine hybrid model for thermal error prediction.
Analyzing the characteristics of different forecasting models, combining different forecasting models properly, and finding a more scientific and reasonable combination model become the key point to improve the prediction accuracy.Based on the above analysis, the combination forecasting model based on the MGM and NAR neural networks will be studied in this paper.Firstly, we describe the modeling process of the MGM and the NAR neural network, respectively, in Section 2. Then we present the combined model in Section 3 and validate the model through an experiment of spindle machining error in Section 4. In the last section, we give a conclusion and a discussion of future work.
A sequence of intermediate values of a cumulative sequence  (1) ( + 1) can be calculated: (1) ( + 1) = 1 2 [ (1) () +  (1) ( + 1)] ,  = 1, 2, . . .,  − 1 where  (1) ( + 1) is the background of the GM(1,1).The GM (1,1) model can be established: ( (1) ( + 1) −  (1) ()) +  (1) The least squares method can be used to estimate the parameters of the models a and b: where The approximate time response of the GM (1,1) model can be expressed as Substituting the model parameters estimated by ( 5) into ( 7) can be used to obtain a cumulative error accumulation sequence x(1) .Then we have the output of GM(1,1) as the restored error sequence through the following formula: As above stated, its modeling and prediction are based on all data when  ≤ .Due to the continuous development of the system, the impact of the old data will be gradually reduced, and the real significance of the model prediction accuracy of the impact of data is only a few of the data from the current data.Therefore, in order to improve the prediction accuracy of the GM(1, 1), this paper uses the MGM.
As an improved grey prediction model, the MGM(1, 1) can add new information and remove old information in what is also a metabolic process [21].According to the calculation process demonstrating the modeling steps of the MGM(1,1), however, the model has no feedback mechanism and lacks self-learning and self-organization ability in terms of dynamic machining errors.So we utilize the results of the MGM(1,1) as input to the NAR neural network and develop the second-step predicting of the combined model.

NAR Neural Network
In the first-step predicting, the machining errors are processed by the MGM(1,1) based on the linear time series.In all applications subject to high variations and rapid transients, however, the time series cannot be modeled by a linear model [22], and so a nonlinear model should be proposed for time series.As a dynamic recurrent neural network, the NAR neural network forms a discrete, nonlinear, autoregressive system including the input layers, hidden layers, and output layers.The model can be defined as  () =  [ ( − 1) ,  ( − 2) , . . .,  ( − )] +  () (9) where  is the number of delays, which is also the order of the NAR neural network.(⋅) is the unknown smooth function, () the output,  the time vector, and () the corresponding error item.
and   represent the weights;   is the input.The mathematics algorithm of the neural network is expressed as follows: )  = 1, 2, . . .;  = 1, 2, . . . (10) In time series prediction with neural networks, the main problems have usually been the selection of the length of the input vectors and the actual structure of the network [23].These problems are similar in all neural architectures.The order of the NAR neural network is determined according to the residual variance, which is judged according to the one-step prediction variance [24].As the order increases, the results of the one-step prediction are, respectively, calculated.However, the prediction accuracy of the neural network will not increase with the order increasing.Furthermore, increasing the number of orders makes the system more complex and restricts the computational power of the neural network.
The transfer function of the hidden layer is the most commonly used nonlinear excitation function: unipolar Sigmoid function.The function and its derivatives are continuous and have a very good effect on dealing with problems.The expression is The prediction performance of the network is decreasing because of the large range of the error data, and the output value of the activation function of the network output layer is restrictive.Therefore, it is necessary to normalize error data before training and forecasting.This paper is normalized by (12) so that each input sample data falls within the interval The structure and sample selection of NAR neural network have an important influence on the generalization ability of neural networks, and it is very important to choose a fast and effective training algorithm.The parameters   and   (weights) are estimated in the training process.In this paper, Bayesian regularization (BR) algorithm [25] is adopted to optimize the performance evaluation function of neural networks, which improves the generalization ability of neural networks and reduces the computational complexity.The BR algorithm is given by the following formula: where   is the sum of squares for all network weights,   is the sum of squares for all network errors,  and  are regularization coefficients.
where   is the network weight,   and   are the network expectations and actual values of the training samples of the group , respectively,  is the total number of network weights,  is the effective number of network parameters, and  0 is the network weight of ().
In summary, the modeling procedure of NAR neural network model is shown in Figure 2. When the NAR neural network is being established, the residual variance method is used to determine the order firstly.According to the Kolmogorov theorem [26], the number of hidden layer nodes can be set.The open loop model is used to train the NAR network to meet the error precision requirement and then convert it into closed loop mode for prediction.The outliers made the prediction by NAR neural networks difficult.

Prediction of Spindle Machining Error Based on Combined Model
By the researches mentioned, this paper indicates that forecasting the machining errors through the traditional grey model or the MGM can solely predict the trend of the original data sequence, but the prediction of the internal changes of the data is not enough.However, although the artificial neural network model can reflect the internal variation of machining error, it gradually deviates from the trend of the original data because of the delay nodes.These two methods have their own advantages, thus establishing a combination model to enhance the machining error prediction accuracy.The building process of the two constituent models is described as follows.
Firstly, the GM(1,1) is used to deal with the detected machining error data.Then the prediction results of the GM(1,1) are processed repeatedly by the metabolic model.Next the residual values with strong randomness are used as the input values of the NAR neural network for nonlinear fitting optimization.Bayesian regularization algorithm is used to train the NAR neural network to adjust the weights and thresholds of the network nodes.Finally, the residual prediction values are corrected to improve the prediction accuracy of the model.The schematic diagram is shown in Figure 3.

Experimental Verification and Model Comparison
Spindle parts are commonly found in mechanical parts, and the machining accuracy of the spindle has a very large impact on the assembly process.Taking the spindle machining error data as an example, the modeling and prediction of the model are analyzed.As shown in Figure 4, the specimen used in this research is a spindle with a length of 126 mm, and this paper selects the right end length of 56 mm with dimensional accuracy requirements of Φ24ℎ8 ( 0 −0.033 ) as the measuring section of the spindle machining error.
The parts are processed on a CNC lathe with FANUC CNC system.The cutting fluid is used and left of the spindle is fixed, and the right side is machined.The machining process of the spindle is completed by two steps: roughing and finishing.The tool is made of carbide (YT15) machine tool.The rough and fine cutting parameters are shown in Table 1.
On the same CNC lathe, 120 pieces are machined by continuous cutting with one cutting tool, and the spindle machining error is detected according to the order of processing.In the measurement, a total of 120 sample values are collected.According to the order of processing, 10 pieces of data are recorded in each group, a total of 12 groups, as shown in Table 2.The spindle machining error sequence is shown in Figure 5.
In order to compare the prediction results, the relative error test and the posterior difference test are used to judge the MGM and the combined model.x(i) x(i)  (1) The Relative Error.The original sequence and residuals are known as  (0) and , respectively; then the relative error is The average relative error is (2) The Posterior Difference.Let the variance of the original data sequence  (0) and the residual sequence  be  2 1 and  2 2 , respectively.The posterior difference ratio is The small error probability is According to the size of P and C, the prediction accuracy of the model can be divided into four categories: "good", "qualified", "hard", and "unqualified".As shown in Table 3, the final prediction accuracy level is max{C level, P level}.
In order to verify the effectiveness of the combined model and compare it with the predicted results of the metabolic grey model alone, in this paper, the first 100 pieces of data were used as the training data and the latter 20 pieces of data were used to validate the data.
In the MGM, the first 100 pieces of data are accumulated and the estimated values of the MGM parameters are derived according to (5).The predictive value of the MGM is derived from formula (8).In this paper, the order of the NAR neural network is 7.The number of hidden nodes in the NAR neural network is 15.As shown in Figure 3, the output of the model is the spindle machining error, so the output layer node is set to 1.According to the NAR neural network theory and the modeling process, the MATLAB software is used to model and predict the spindle machining error data sequence.The results of the MGM and the combined model are shown in Figure 6.The prediction accuracy is shown in Table 4.
It can be seen from Figure 6 that the prediction results of the combined model are closer to the actual value of the spindle machining error, which can reflect the trend of the actual spindle machining error and have high prediction accuracy.
As you can see from Table 4, the average relative error of combined model is reduced from 0.157 to 0.042, decreased by 73%, and the posterior difference ratio decreased from 0.521 to 0.226, reaching level 1.The small error probability is improved, but it still belongs to level 1.Finally, the prediction accuracy of the combination model reaches level 1, which has been improved greatly.The combined model can be used to predict spindle machining errors and provide technical support for error compensation.

Conclusion
In this paper, a combined model for spindle machining error modeling is proposed to predict the machining accuracy of machine tools, considering the dynamic and nonlinearity of  the machining error based on the time series.This paper mainly achieved the following results: (1) The forecast combination based on the MGM and NAR neural network can be used to predict the spindle machining error of machine tools.The GM(1,1) and ANN, as two individual modeling processes, are optimized by the (2) Taking the advantages of the metabolic model and the dynamic neural network model, the two models are combined to effectively avoid the defects of the single model information processing and greatly improve the prediction accuracy of the spindle machining error.The optimized order of NAR neural network can be determined by minimizing the residual variance according to the one-step prediction variance.
(3) Comparing with other models, the combined model has the advantages of simple algorithm, high prediction accuracy, fast modeling speed, and low requirement of the original modeling data.It can be applied to other complex data sequence processing.
The results of this study provide further research assumptions.On the one hand, if the weights of the two coupled models can be calculated according to different data characteristics, a better prediction model can be obtained.On the other hand, the impacts of time correlations among the prediction errors in combinations can be considered.

Figure 2 :
Figure 2: Flow chart of NAR neural network prediction model.
Processing name cutting parameters Rotating speed n (r/min)Cutting depth   (mm) Feed rate  (mm/r

Figure 3 :
Figure 3: Schematic diagram of the combined model based on metabolic and neural network.

Figure 6 :
Figure 6: Comparison of different prediction models.

Table 3 :
Reference table of inspection accuracy level.

Table 4 :
Comparison of model prediction accuracy.