Prediction of surface location error in milling considering the effects of uncertain factors

Machining accuracy of a milled surface is influenced by process dynamics. Surface location error (SLE) in milling determines final dimensional accuracy of the finished surface. Therefore, it is critical to predict, control, and minimize SLE. In traditional methods, the effects of uncertain factors are usually ignored during prediction of SLE, and this would tend to generate estimation errors. In order to solve this problem, this paper presents methods for probabilistic analysis of SLE in milling. A dynamic model for milling process is built to determine relationship between SLE and cutting parameters using full-discretization method (FDM). Monte-Carlo simulation (MCS) method and artificial neural network (ANN) based MCS method are proposed for predicting reliability of the milling process. Finally, a numerical example is used to evaluate the accuracy and efficiency of the proposed method.


Introduction
Cutting vibrations can adversely affect machining accuracy of a workpiece during the milling process. For example, vibrations between the tool and workpiece could result in errors in finished surface. And these errors make workpiece features differ from the original design (Bachrathy et al., 2016;Li et al., 2014;Urbikain et al., 2017). Difference between desired and actual surfaces due to deviation in tool and workpiece compliances from specifications is called surface location error (SLE) (Schmitz and Ziegert, 1999;Mann et al., 2005). Therefore, it is critical to build a dynamic model to predict SLE in milling. Mann et al.(2005) proposed an approach for simultaneous prediction of SLE in milling using Temporal Finite Element Analysis (TFEA). This method was then generalized for helical end mills (Mann et al., 2008). Schmitz and Mann (2006) presented an analytical method to compute SLE based on frequency domain and harmonic balance analysis. Insperger et al. (2006) decomposed the governing equation used to describe a typical milling process into two parts (ordinary differential equation part and delay-differential equation part) and obtained SLE by solving ordinary differential equations. Recently, Ding et al. (2011Ding et al. ( , 2015 generalized the full-discretization method and harmonic differential quadrature method to further improve efficiency of SLE prediction in milling. Moreover, Eksioglu et al. (2012) utilized an integral equation based method to predict SLEs in flexible milling systems. Kiran et al. (2017) presented a two degree of freedom (DOF) closed-form frequency domain solution for SLE prediction, which took into account tool and workpiece flexibility.
The above methods have laid the foundation for SLE prediction in milling. As a result, underlying principle of milling dynamics is fairly well established. However, all these models assume that parameters of the milling process such as depth of cut, feed per tooth and cutting force are deterministic. Actually, these parameters are random in practical engineering due to uncertainty factors in real manufacturing environment, which would in turn influence the milling process (Sims et al., 2010;Graham et al., 2013;Hajdu et al., 2016). In this paper, a practical method is proposed to predict SLE in milling considering the effects of uncertain factors. First, a mathematical model of milling dynamics considering regenerative effect is presented in a state space form. Next, a fulldiscretization method (FDM) is used to calculate the SLE in milling. This is followed by probabilistic analysis of SLE Figure 1. Dynamic model for the milling process. F t j , F n j -tangential and normal cutting force components for j th cutter tooth (N); ϕ j -angular position of the j th cutter tooth (rad); -spindle speed (r min −1 ); a e -radial depth of cut (mm).
in milling using Monte-Carlo simulation (MCS) method and artificial neural network (ANN) based MCS method. In the end, a numerical application is provided to verify the accuracy and efficiency of the proposed approach.

SLE prediction in milling
As depicted in Fig. 1, governing equation of cutter dynamics under dynamic milling force can be described as (Insperger et al., 2006;Ding et al., 2011Ding et al., , 2015 where, q(t) = [x(t), y(t)] T is a position vector; M, C and K are modal mass, damping, and stiffness matrices; a p denotes axial depth of cut (mm); K c (t) and f 0 are cutting force coefficient matrix and steady force excitation, which are defined as: where, sϕ j = sin ϕ j (t), cϕ j = cos ϕ j (t); ϕ j (t) = (2π /60)t + 2π (j − 1)/N is angular position of the j th cutter tooth; N is the number of cutter teeth; K t and K n are tangential and normal linearized cutting force coefficients; K te and K ne are tangential and normal edge coefficients; f t is feed per tooth; w(ϕ j (t)) is called window function which can be defined as: where, ϕ st and ϕ eX are start and exit angles of the j th cutter tooth.
If p(t) = Mq(t) + Cq(t)/2 and x(t) = [q(t) p(t] T , then Eq. (1) can be equivalently expressed as (Ding et al., 2011(Ding et al., , 2015: where, Equally divide T into r small discrete time units t such that T = r t For any time unit, Eq. (5) is represented as: where, in which, B(t) is periodical coefficient matrix; f (t) is static force item; y(t) and y(t − T ) denote status item timedelay item, respectively; B j = B(t j ), y j = y(t j ), f j = f (t j ), t j = j t. Solving Eq. (9) over the discretization period [t j , t j +1 ] gives: where, I is the identity matrix. The following discrete mapping relationship can be obtained by Eq. (14): where, Now, transition relation over one periodic time interval can be constructed by using sequence of matrices D j , E j , where, Steady-state coefficients of the lth cycle can be calculated similar to the TFEA method [5,6] for stable milling by substituting y * l = y l = y l−1 Finally, SLE can be calculated using the steady-state coefficient vector. A concise definition of SLE in Schmitz and Ziegert (1999) is used in this paper. As can be seen from Fig. 1, in up/down-milling, SLE is calculated applying steady-state vibration displacement of milling cutter with respect to the ideal surface when a tooth enters/exits the workpiece.

Probabilistic analysis of SLE
It is impossible to deterministically describe and exactly control physical parameters during the milling process. Therefore, most of variables used to predict SLE in milling are uncertain. For instance, machining deviation gives rise to the uncertainty of the structural dimension of the milling cutter. Milling parameters (e.g. depth of cut, feed per tooth and spindle speed) keep changing with the change of working conditions (e.g. power fluctuation, temperature change, process difference).
In probabilistic analysis of SLE in milling, sources of uncertainty are characterized and explicitly accounted for in the computation of the reliability where, x = [K t , K n , c x , c y , k x , k y , m x , m y , r c , a p , f t ] T is a variable vector used to predict SLE in milling, as described in section 2; The corresponding random vector is denoted with X and f X (x) denotes the probability density function (PDF); Z = g(x) = S lim − g SLE (x) is the response surface function in which g SLE (x) is SLE obtained from Eq. (26) and S lim is allowable value of SLE. Z = g(x) < 0 represents for the failure domain with regard to x ∈ X. In the failure domain, SLE exceeds its allowable value. Z = g(x) > 0 represents for the security domain. In the security domain, SLE is less than its allowable value. Z = g(x) = 0 0 represents for the limit state. In general, neither analytical nor numerical integration methods can easily solve the multiple integral involved in Eq. (27) because of its complicated integrand and high dimensionality.

Direct MCS
MCS is considered to be one of the most widely used methods for probabilistic analysis of mechanical systems due to its high accuracy and easy of application (Tian et al., 2015;Shen et al., 2013;Ahn et al., 2011). In the MCS techniques, sampling for each random variable is randomly selected based on distribution information of the random variable. These sample values are used to calculate the sample values of the SLE. Reliability of the milling process is estimated as the ratio of samples that are located in the safe domain.
As depicted in Fig. 2, the general procedure for probabilistic analysis of SLE during milling process by MCS can be summarized as follows: firstly, generate N MCS sets of random samples using the information of mean, standard deviation and PDF of random variables. Then, substitute each set of samples x k (k = 1, 2, . . . N MCS ) into Eq. (26) to obtain values of SLEs. Finally, frequency can be used to estimate reliability R of the milling process as follows: where N r is the number of samples which satisfy the condition g SLE (x k ) < S lim , N MCS is the total number of samples.

ANN based MCS
Generally, a huge number (thousands to millions) of random samples are needed to characterize the parameter space adequately. Numerical simulation procedure introduced in Sect. 2 to predict SLE in milling is used for probabilistic analysis of the SLE in milling. Hundreds of seconds are needed for each run. Therefore, this procedure can be time consuming if MCS is directly used. In this section, an ANN based MCS method is proposed for probabilistic analysis of SLE in milling.

Architecture of ANN
After successful training in ANN, correlation of mathematical relationships between multi-dimensional input/output data sets can be easily achieved (Arnaiz-González et al., 2016;Aydin et al., 2014;Asiltürk, 2012). In this paper, an ANN is used to fit the functional relationship between SLE and random variables. Next, the trained ANN instead of CFD is used for probabilistic analysis of SLE in milling. This allowed reduction in the total number of iterations required for numerical simulation.
There are a number of ANN paradigms. A multilayer feedforward back-propagation network (BP-ANN) (Gomes et al., 2011;Elhewy et al., 2006;Chojaczyk et al., 2015) is used in this study. The BP-ANN method is a well-known and widely used ANN paradigm. Generally speaking, an ANN structure usually consists of an input layer, one hidden layer, and an output layer. Each layer has its corresponding processing elements (PEs) and weight connections. Figure 3 shows a typical architecture of an ANN model. In the figure, the left column is input layer, right most column is output layer and middle column is hidden layer.
Number of neurons or nodes in input and output layers is determined by the number of input variables (x = [K t , K n , c x , c y , k x , k y , m x , m y , r c , f t ] T ) and SLE in milling (y = g SLE (x)), respectively. Whereas, number of neurons in the hidden layer was empirically determined. Using too few neurons in the hidden layer may prevent convergence of the training process. Alternatively, using too many neurons would increase training time and/or result in ANN losing its generalization attribute. In this study, number of nodes in the hidden layer is chosen as n 2 = 2 × n 1 + 1 (Patuwo et al., 1993), where n 1 is number of input variables. Then, the output of the ANN can be written as: where, n 2 is the number of nodes in the hidden layer, c is a constant, w i denotes weight between ith PE in the hidden layer and the output layer, ψ i (x) is output function of ith PE in the hidden layer, which can be defined as: where, w i,k denotes weight between kth PE in the input layer and ith PE in the hidden layer, b i is a constant. f (·) is activation function. Generally speaking, many kinds of functions such as sigmoid, hyperbolic tangent and Gaussian can be chosen as activation function. In this paper, sigmoidal functions are used because they are continuous and allow networks to be trained more effectively. The activation function used here can be defined as: where, β is the sigmoid slope, usually β = 1.
Equations (29) and (30) are rewritten in matrix way as: where, I is the identity matrix, W 1 and W 2 can be represented as: b n 2 w n 2,1 · · · w n 2 ,n 1    (33) W 2 = c w 1 · · · w n 1 T .
As for developing an ANN model to predict SLE in mill, the main goal is to obtain values of W 1 and W 2 by training. The back-propagation training technique is the most commonly used neural network method and is the method used to train all models in this study. Training is terminated as soon as the model reached a predetermined accuracy. Then, the trained ANN can be used for probabilistic analysis of SLE in milling to improve process efficiency.

Training data generation
In probabilistic analysis of SLE in milling applications, accuracy of ANN based MCS method depends largely on quality of trained ANN model. Furthermore, the accuracy of ANN model is mainly determined by number and "representative" of training samples. Several designs have been proposed in literature to generate training data. These include methods such as full factorial design (FFD) or random design. The main drawback of FFD is associated with large size of the total number of samples required for a high dimension problem. This is due to the fact that number of samples needed for analysis grows exponentially with number of variables. Alternatively, training samples can also be generated by a random generator. This method can obtain desired number of training samples follow a particular distribution. However, it cannot insure that the samples would fill the entire parameter space uniformly. To overcome these drawbacks, a partial factorial design like Latin Hypercube sampling (LHS) was proposed. LHS methodology can be considered to be an intermediate technique between FFD and random design. This method is considered to be a stratified sampling technique that provides an efficient way to sample random variables from their entire distributions. LHS has been applied to a wide range of probabilistic analysis problems, ranging from estimation of reliability (probability of failure), coefficient estimation for polynomial chaos, neural network, and other types of surrogate (Chojaczyk et al., 2015;Olsson et al., 2003). In the present study, LHS scheme is employed to generate random samples.
The conversion function used for the network is a sigmoid function. Both ends of the output curve of this function are smooth, but in the middle part, the curve varies drastically. Therefore, it is necessary to normalize input and output variables by replacing the original data with corresponding values in the interval (0, 1) to achieve faster convergence rate. Therefore, all training data is scaled using the following scaling equation:  where, x and ξ represent unscaled and scaled values of the training data, respectively, x min and x max are minimum and maximum values of the training data. As shown in Fig. 4, procedure of the probabilistic analysis of SLE in milling used the ANN-based MCS method as follows: (1) generate training samples using LHS scheme; (2) train ANN by back-propagation; (3) build explicit expression of SLE in milling using trained ANN model; and (4) calculate reliability using the trained ANN model and MCS.

Numerical example
Consider the following variables for a milling process, K t and K n are normal cutting force coefficients; c x and c y are modal damping coefficients; k x and k y are modal stiffness coefficients; m x and m y are modal masses; r c is radial immersion ratio; a p denotes axial depth of cut; f t is feed per tooth; and is spindle speed; the total number of the cutter teeth is 2; Probabilistic features (mean, standard deviation, distribution) of the random variables are described in Table 1.
We can obtain the results of deterministic analysis by substituting mean values of the variables into Eq. (26). The relationship between SLE and spindle rotation speed is indicated in Fig. 5. As shown in Fig. 5, the maximum absolute value of SLE is about 5.329 × 10 −5 m for a spindle speed of 1.387 × 10 4 r min −1 . From the results of deterministic analysis, we can learn that when the allowable value of SLE is bigger than S lim = 5.329 × 10 −5 m, the milling process is reliable for a spindle speed of 1.387 × 104 r min −1 and vice versa. Probabilistic analysis of SLE within this speed range is further analyzed.
The number of sample points needed to satisfactorily fit the relationship between SLE and the variables using ANN depend largely on the total number of random variables considered and nonlinearity of the milling process. Unfortunately, there is not a specific guideline or procedure for determining the number of sample points needed to obtain a high accuracy of BP-ANN model till now (Chojaczyk et al., 2015). As recommended, in this paper, ANN is trained with 500 sample points generated using Latin hypercube method.
A total of 100 samples uniformly distributed over the range of [µ x i − 3σ x i , µ x i + 3σ x i ] are used to verify accuracy of the trained BP-ANN. These test samples are substitute into the trained BP-ANN and CFD model to compute the SLE in milling, respectively. Results are shown in Fig. 6. Figure 7 shows the relative error of the BP-ANN in comparison  with the results obtained by CFD. These studies show that the trained BP-ANN yields a good approximation of SLE with less than 5 % prediction error. Therefore, the trained BP-ANN instead of the CFD model can be used for probabilistic analysis of SLE in milling.
Using the trained BP-ANN, reliability of the milling process is calculated. Figure 8 depicts reliability curve of the milling process when S lim = 5 × 10 −5 m. From the result, we can see that the minimum value of reliability is about 0.7342 when the allowable value of SLE is 5 × 10 −5 m. Moreover, in order to evaluate accuracy of the proposed approach, direct MCS which widely used in probabilistic analysis of mechanical systems is also applied to evaluate the reliability of the milling process. As shown in Fig. 8, the reliability curve obtained by direct MCS fits well with that derived from ANN based MCS.

Conclusion
Many traditional SLE prediction models ignore effect of uncertain factors (such as machining, assembling and measurement errors), which would tend to generate estimation errors. Therefore, in practical milling applications, variation in process parameters can cause the workpiece features to deviate from the original design. This results in undesirable machining accuracy and poor surface roughness of the workpiece. In this paper, MCS, ANN theory and machining dynamics principles are used to develop methods for probabilistic analysis of SLE in milling process. Compared with the conventional approaches, randomness of parameters is taken into account in the proposed approach, which makes the prediction of SLE in milling more correspond to engineering practice.
A significant improvement can be made in SLE prediction in milling, simply by taking parameter uncertainty into account. In addition, FDM is used to numerically predict SLE in milling for a time duration of several hundred seconds. It was observed that CPU time requirement for SLE prediction using FDM is higher compared to methods using a network model. In order to reduce total number of iteration for the numerical simulation, a BP-ANN model is trained to predict SLE in milling. Based on this, an ANN based MCS method is applied to predict the reliability of the milling process. This improvement dramatically shortens the time needed for probabilistic analysis of SLE milling. Use of the proposed ANN based MCS method would show its potential advantages for applications where repeated calculations of reliability are needed, for example, in reliability based design optimization of the processing parameter of milling.
Data availability. No data sets were used in this article.