A numerical control lathe tool residual life online prediction method
By combining CNN, LSTM, and PSO tool wear monitoring models with deep transfer learning and a three-stage Wiener process, and using Bayesian methods to update parameters in real time, the problems of randomness and individual differences in tool wear are solved, achieving accurate prediction of remaining tool life, supporting reasonable tool replacement strategies, and improving production efficiency and safety.
Patent Information
- Application Number
- CN202310715845.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-16
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2043-06-16
AI Technical Summary
Existing technologies fail to effectively account for the randomness and individual differences in tool wear when predicting remaining tool life, resulting in low prediction accuracy and impacting production efficiency and safety.
A tool wear monitoring model is established by combining convolutional neural networks (CNN), long short-term memory networks (LSTM), and particle swarm optimization (PSO). Tool degradation is described by combining deep transfer learning and the three-stage Wiener process, and the model parameters are updated in real time using a Bayesian method.
It enables precise monitoring of tool wear and real-time prediction of remaining tool life under different working conditions, improving prediction accuracy, supporting reasonable tool replacement strategies, and reducing machining costs and risks.
Smart Images

Figure CN116533063B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of numerical control lathe tools, and relates to an online prediction method for the residual life of a numerical control lathe tool, in particular to tool wear online monitoring modeling under single working condition, tool wear online monitoring modeling under multiple working conditions, and tool residual life online prediction modeling. BACKGROUND
[0002] Tool residual life prediction is crucial for formulating a reasonable maintenance strategy. If the tool residual life prediction value is too low, the tool is replaced or repaired before reaching the actual service life, which will lead to an increase in machine downtime, affect production and processing efficiency, and increase tool procurement costs. If the tool residual life prediction value is too high, the tool has reached the actual service life but is still in the processing state, which will cause the surface precision of the processed workpiece to be unqualified or scrapped, and even cause damage to the machine tool and harm the safety of the operator. Therefore, accurately predicting the tool residual life is the key to reducing the overuse and underuse rates of tools, maximizing tool use, and reducing processing costs.
[0003] At present, according to the input data used by the model, tool residual life prediction methods are divided into three categories: time series model prediction (with working time as input), artificial intelligence method prediction (with real-time working data as input), and random process model prediction (with degradation data as input). Time series models are suitable for processing historical failure data with rich history, while artificial intelligence methods are suitable for processing massive and complex processing process data. Neither time series models nor artificial intelligence methods take into account the randomness of tool degradation. However, even the same type of tool has commonality in design and materials, but due to different processing conditions, there are also significant individual differences. Tool wear process is related to external factors such as surface roughness, material properties, lubrication state, and surface coating, which will bring uncertainty to the tool degradation process. Therefore, it is more reasonable to describe tool wear degradation with a random process to calculate the tool residual life. However, the establishment of a tool wear degradation model requires degradation data as input, which needs to be obtained offline, affecting the continuity of mechanical processing. Therefore, due to the complexity of the system, the availability of data, and application limitations, there is no universally accepted best model. Some researchers use a hybrid prediction method that combines multiple prediction methods to avoid the shortcomings of a single prediction method to some extent, and combines the advantages of multiple prediction methods to improve model prediction accuracy while reducing computational complexity. However, there are relatively few related studies at present.
[0004] In practical applications, it is known that the tool will work under different machining conditions. The residual life prediction model based on historical data information without considering the actual tool wear state in the field is one-sided. The tool residual life is closely related to the tool wear state and external environment, etc. Therefore, it is necessary to establish a tool wear monitoring model with strong generalization and high precision, update the tool degradation model parameters in real time, and continuously approach the tool wear degradation trend, while iteratively updating the residual life estimation at each moment. SUMMARY
[0005] The advanced methods in the fields of tool wear monitoring and residual life prediction are combined to improve the performance of tool residual life prediction by utilizing their advantages. Considering the variability of working conditions, a deep transfer learning method is used to monitor the current tool wear; considering the individual differences and wear degradation rate differences of the tool, a three-stage Wiener process is used to describe the tool wear degradation process; combining the tool wear monitoring output and the Bayesian updating method, an online tool residual life prediction model is established.
[0006] To solve the above technical problems, the present application is realized by adopting the following technical solutions, which are described in combination with the drawings as follows:
[0007] A numerical control lathe tool residual life online prediction method comprises the following steps:
[0008] Step one, combine the advantages of convolutional neural network (CNN) and long short-term memory network (LSTM), and use particle swarm optimization (PSO) to iteratively solve the optimal values of the learning rate and hidden layer neurons of LSTM, thereby establishing a CNN-PSO-LSTM model to realize online monitoring of tool wear under single working condition;
[0009] Step two, based on the CNN-PSO-LSTM model, set the machining parameters, and use the transfer learning method to monitor the tool wear under variable working conditions;
[0010] Step three, considering the difference of tool wear rate in three stages, the tool degradation process is described based on three-stage Wiener process, and then the residual life estimation of the tool is obtained according to the concept of first arrival time;
[0011] Step four, use Bayesian method and combine tool wear monitoring value to update model parameters in real time, and then get the updated estimation of tool residual life.
[0012] The specific method of tool wear online monitoring modeling under single working condition in step one is as follows:
[0013] (1) CNN layer
[0014] A CNN (Neural Network Convergence) is a deep neural network that uses a multi-layered structure to process data. A typical CNN consists of an input layer, hidden layers, and an output layer. The input layer of a CNN model can process multi-dimensional data, accepting one-dimensional or two-dimensional arrays. One-dimensional arrays are typically time or frequency sampling points, while two-dimensional arrays usually contain data from multiple channels. Before inputting data into the hidden layers of a CNN for learning, the input data needs to be normalized to unify the data dimensions. Standardizing the input data improves both the learning efficiency and computational performance of the CNN.
[0015] The hidden layers mainly consist of convolutional layers, pooling layers, and fully connected layers. The convolutional layer extracts features from the input data. After feature extraction, it outputs a large number of features, but not all of these features are important. These features are then passed to the pooling layer for feature selection and information filtering, thus achieving feature compression. The fully connected layer non-linearly combines the features extracted and selected by the convolutional and pooling layers to obtain the target output. Therefore, the fully connected layer does not have the ability to extract and select features from the data; it completes the learning objective task based on the higher-order features output from the previous layer.
[0016] In CNNs, the upstream layer of the output layer is usually a fully connected layer, and its structure and working principle are the same as those of the output layer in traditional feedforward neural networks.
[0017] (2) LSTM layer
[0018] LSTM is better suited for processing long-term data sequences because it can use gating units to determine whether information is useful, thus deciding whether to retain or forget it. These gating units include input gates, forget gates, and output gates. LSTM also incorporates cell states, which evolve throughout the LSTM data processing steps, undergoing only minor linear interactions, making information transfer easier without altering its structure. The LSTM data processing steps are as follows:
[0019] 1) A sigmoid layer (forget gate layer) determines the information of the cell state that needs to be removed. The input is the module output h from the previous time step. t-1 Input x at the current time t Then, after passing through a sigmoid layer, the output f is obtained. t Its value ranges from [0,1]. This is compared to the cell state C at the previous time step. t-1 Multiply each element one by one. If the value is 0, discard the corresponding information; otherwise, retain the corresponding information. This process can be represented as:
[0020] f t =σ(W f ·[h t-1 ,x t]+b f )
[0021] where W f and b f represent the weight matrix and bias, respectively. σ(·) is the sigmoid function, whose value range is [0, 1], 0 means not passing, and 1 means passing completely.
[0022] 2) The information needed to be stored in the cell state is determined by a sigmoid layer (input gate layer) and a tanh layer. The output i t of the sigmoid layer determines the updated information. At the same time, the tanh layer creates a candidate value vector which determines the information to be added to the cell state. The above steps can be expressed as:
[0023] i t = σ(W i · [h t-1 , x t ]+b i )
[0024]
[0025] where W i and W c represent the weight matrix; b i and b c represent the bias parameter.
[0026] 3) The cell state C t-1 is updated to the cell state C t . First, the cell state C t-1 is multiplied by f t , which removes the information that has been decided to be forgotten, and then i t is multiplied by to add the information to the cell state C t . It can be expressed as:
[0027]
[0028] 4) The output at the current time is determined by a sigmoid layer (output gate layer) and a tanh layer. First, a sigmoid layer is run to determine the information of the cell state to be output. At the same time, the output h t also depends on the cell state C t , which passes through the tanh layer and then corresponds to the point multiplication of the output o t of the sigmoid layer, so that the output h t at the current time can be obtained. It can be expressed as:
[0029] o t= σ (W o · [h t-1 , x t ] + b o )
[0030] h t = o t * tanh (C t )
[0031] (3) PSO algorithm
[0032] PSO simulates the behavior of birds in a bird flock to obtain food, and constantly updates its own position according to the movement of individuals and the movement of the entire bird flock, so as to realize the best formation movement. In the algorithm, the speed and position of each particle are dynamically adjusted according to the movement of itself and other particles, and the optimal particle is approached, and then the optimization is realized.
[0033] In the solution search space with Y parameters, a particle group consisting of D particles is set. Let X i = (x i1 , x i2 , …, x iY ) be the position of the i-th particle, V i = (v i1 , v i2 , …, v iY ) be the optimization speed of the i-th particle, where i = 1, 2, …, D. p best = (p i1 , p i2 , …, p iY ) represents the optimal position searched by the i-th particle, and g best (p g1 , p g2 , …, p gY ) represents the optimal position searched by the entire particle group after iteration. The particle speed and position iteration update of the k-th iteration follow the following formula:
[0034]
[0035]
[0036] In the formula, c1 and c2 are learning factors, c1 represents the individual learning ability of the particle, and c2 represents the global learning ability of the particle, which is usually taken as [0-2]. k is the current iteration number, which can be selected according to the actual situation; r1 and r2 are random numbers in [0, 1], and y represents the y-th parameter to be estimated of each particle. The steps of the PSO algorithm are as follows:
[0037] 1) Initialize the number of particle groups, set the learning factor value, and set the initial position and initial speed of the particle;
[0038] 2) Calculate the individual fitness value by fitness function, set the individual optimal value as the group optimal value;
[0039] 3) Update the particle velocity and position according to formula (1), (2), and calculate the fitness value of the individual in the new position;
[0040] 4) Calculate the minimum value of the current fitness of the particle and the individual extreme fitness, and assign it to the individual extreme fitness, and record the current parameter value;
[0041] 5) Compare the individual extreme value with the group optimal value, take the minimum value of the individual extreme value and the group optimal value, then assign it to the group optimal value;
[0042] 6) If the iteration number is less than the set value, return to 3), otherwise, the algorithm ends, and the optimal parameter value is output.
[0043] The specific method of the tool wear online monitoring modeling under multiple working conditions in step two is as follows:
[0044] In deep transfer learning, there are two important basic concepts, namely "domain" and "task". The domain (Domain, D) can be understood as a certain field at a certain time, which is composed of a data set X and the distribution P(X) of the data, that is, D={X, P(X)}. The task (Task, T) is the goal to be completed, which is composed of sample label Y and prediction function f(·), that is, T={Y, Q(Y|X)}. The field whose knowledge has been acquired and is to be transferred is defined as the source domain (Source Domain) represented as D s :
[0045]
[0046] And the field to be learned due to lack of knowledge is defined as the target domain (Target Domain) represented as D t :
[0047]
[0048] The source domain task is represented by T s , T s ={Y s , Q s (Y|X)}. The target domain task is represented by T t , T t ={Y t , Q t (Y|X)}.
[0049] Deep transfer learning is generally aimed at different domains (i.e. D s ≠ D t ) or different tasks (i.e. Ts ≠T t ) are divided into four cases. When the domains are different, there are two cases, which are different data feature spaces (i.e., X s ≠X t ) or different distributions (i.e., P s (x i )≠P t (x j )) respectively. When the tasks are different, there are two cases, which are different sample labels (Y s ≠Y t ) or different conditional distributions (i.e., Q s (Y|X)≠Q t (Y|X)) respectively. According to the above cases, the transfer learning uses corresponding rules to transfer the knowledge in D s to D t according to the similar information between the two domains, so as to achieve the expected target task of the target domain.
[0050] The model-based transfer focuses on how to obtain the common parameters or prior distribution of the source domain data space model and the target domain data space model, and then the knowledge transfer can be realized through some processing methods. It can train a deep network with good effect as a pre-training model using a large amount of data, and then fine-tune it to improve the prediction model accuracy. Fine-tuning generally processes different according to the size of the target domain data set. When the size of the data set is relatively small, freeze all network layers of the pre-training model except the fully connected layer, and only train the fully connected layer. The fully connected layer can be customized manually as needed.
[0051] The domain adaptation degree is used to measure the similarity of the feature distribution of the target domain and the source domain, the maximum mean difference MMD is used to calculate the similarity between the two domains, and the similarity between the two domains is increased as the optimization criterion.
[0052]
[0053] H represents a reproducing kernel Hilbert space; represents a feature mapping function that maps the original sample features to H; E[·] represents a mathematical expectation calculation function.
[0054] The specific method of tool residual life prediction in step three is as follows:
[0055] (1) Model assumption
[0056] 1) When the tool wear exceeds the preset threshold for the first time, the tool service life ends, and the tool residual life is only determined by the tool wear.
[0057] 2) The degradation amount of each stage of tool wear follows normal distribution, and the tool wear degradation process can be described by Wiener process.
[0058] 3) Considering the difference of tool degradation under different machining conditions, the drift coefficient μ and the diffusion coefficient σ are both random variables. The prior distribution of μ follows normal distribution with variance c and mean d, and the prior distribution of σ follows inverse gamma distribution with shape parameter a and size parameter b. The prior joint distribution of μ and σ follows normal inverse gamma distribution, that is: 2 2
[0059]
[0060] (2) Three-stage Wiener process model
[0061] The tool wear process is divided into three stages, and the wear process of each stage can be described by Wiener process. The tool wear degradation model X(t) is defined as:
[0062]
[0063] In the formula, x0 represents the initial value of tool wear; t1 and t2 represent the time when the turning point occurs; μ1 and σ1 represent the drift coefficient and diffusion coefficient of the initial wear stage degradation process respectively; μ2 and σ2 represent the drift coefficient and diffusion coefficient of the normal wear stage degradation process respectively; μ3 and σ3 represent the drift coefficient and diffusion coefficient of the rapid wear stage degradation process respectively; w1 represents the threshold value of the initial wear stage; w2 represents the threshold value of the normal wear stage; B(t) is the standard Brownian motion.
[0064] (3) Tool remaining useful life (RUL) distribution
[0065] Let δ r represent the tool wear amount from the initial time to the first time it exceeds the rth wear stage threshold w r , 1≤r≤3, w3 is the tool wear threshold. According to the definition, δ r can be represented as:
[0066] δ r = inf{t: X(t) ≥ w r , t > 0}............................ (4)
[0067] According to formula (4) and the homogeneous Markov property of Wiener process, δ r can also be represented as:
[0068] δ r = δr-1 +inf{t:X'(t)≥w r -w r-1 ,t>0}.................................(5)
[0069] where X'(t) = μ r t+σ r B(t) ; let w0= 0, δ0= 0.
[0070] Let the time variation of each stage be Δδ r = δ r -δ r-1 ; the threshold variation be Δw r = w r -w r-1 , according to equation (5) we have:
[0071] Δδ r = inf{t:X'(t)≥Δw r ,t>0}.......................................(6)
[0072] Since the time of the first arrival of the threshold of the Wiener process obeys inverse Gaussian distribution, it is considered that δ r obeys inverse Gaussian distribution, according to equation (6) we have:
[0073]
[0074] The tool life T can be expressed as:
[0075] T = Δδ1+ Δδ2+ Δδ3...............................................(8)
[0076] According to the convolution integral formula, the probability density function (PDF) of T is:
[0077]
[0078] Therefore, the expected estimate of T can be expressed as:
[0079]
[0080] When the tool wear X(τ) at a certain time τ is known, the remaining tool life L τ can be expressed as:
[0081]
[0082] According to equation (11), Lτ The PDF of L can be expressed as:
[0083]
[0084] The remaining tool life L τ The expected estimate of L can be expressed as:
[0085]
[0086] (4) Model parameter estimation based on EM algorithm
[0087] When the tool wear threshold is determined, the PDF is determined by Wiener process model parameters and, so parameter estimation of and is needed. Assuming that unknown parameters μ and σ 2 are random variables, so the unknown parameters in the prior distribution of the parameters can be estimated according to the historical wear data and historical life time data of the same type of tool.
[0088] EM algorithm is an algorithm for iteratively calculating the maximum likelihood estimate of the parameter, which can solve the problem of hidden variables in the probability function. EM algorithm mainly includes E-step and M-step two steps, E-step is to calculate the expected value, that is, given the observation data and the current estimate of the parameter, the conditional expectation value of the hidden variable is calculated; M-step is the maximum step, that is, given the hidden variable estimate value obtained in the last step, the maximum likelihood estimate of the parameter model is obtained, and the expected estimate value of the unknown variable is obtained. The core idea of EM algorithm is to start from the initial value of the target parameter, and alternately perform E-step and M-step steps, so as to obtain the optimal solution of the unknown parameter.
[0089] The specific method of tool remaining life online prediction in step four is as follows:
[0090] Bayesian method is to start from the prior knowledge of the parameter and the sample, and then get the posterior distribution, so as to make statistical inference. Let a group of observation samples be x1, x2,…, x n , the observation sample distribution is f(x|θ), and the joint density function of the sample is:
[0091]
[0092] The prior density function of parameter θ is represented by π(θ), and the posterior distribution density function of θ is:
[0093]
[0094] Since the difference of prior distribution will directly affect the posterior distribution calculated by formula (15), thereby affecting the model results, therefore, determining the prior distribution is a crucial step of the Bayesian method. 2 The prior distribution of sigma is inverse gamma distribution, and the prior distribution of mu is normal distribution.
[0095] The Bayesian estimation of the parameter can be calculated by formula (15):
[0096]
[0097] In the formula, the integral interval theta is the value range of the parameter theta.
[0098] Compared with the prior art, the present application has the beneficial effects that:
[0099] The tool remaining life online prediction of the present application combines tool wear online monitoring and tool remaining life real-time prediction advanced method, realizes real-time prediction of tool remaining life, not only considers tool variable working condition machining condition, but also considers tool three-stage wear rate difference and individual difference, lays a model foundation for numerical control lathe tool replacement or maintenance strategy. BRIEF DESCRIPTION OF DRAWINGS
[0100] Figure 1 It is the flow chart of the numerical control lathe tool remaining life online prediction method of the present application;
[0101] Figure 2 It is the numerical control lathe tool wear monitoring model of the present application;
[0102] Figure 3 It is the PSO-LSTM optimization flow chart of the present application;
[0103] Figure 4 It is the model migration learning model of the present application;
[0104] Figure 5 It is the tool flank wear data;
[0105] Figure 6 It is the time domain dimension characteristic value of the vibration signal;
[0106] Figure 7 It is the time domain dimensionless characteristic value of the vibration signal;
[0107] Figure 8 It is the frequency domain characteristic value of the vibration signal;
[0108] Figure 9 It is the time-frequency domain characteristic value of the vibration signal;
[0109] Figure 10 is a tool wear monitoring result based on the CNN-PSO-LSTM model of the application;
[0110] Figure 11 is a tool wear monitoring result based on the CNN-PSO-LSTM model of the application; DETAILED DESCRIPTION
[0111] The application will be described in detail below with reference to the accompanying drawings:
[0112] Referring to Figure 1 The tool remaining life online prediction method of the numerical control lathe of the application comprises the following steps: establishing a CNN-PSO-LSTM model to realize online monitoring of tool wear under a single working condition; using a transfer learning method to monitor tool wear under varying working conditions; based on historical data, using a three-stage Wiener process to describe the tool degradation process and solve the tool remaining life; using a Bayesian method to update the model parameters to obtain real-time updated tool remaining life.
[0113] I. Tool wear monitoring under a single working condition
[0114] CNN can adaptively extract multi-dimensional spatial features from original signals, but it cannot effectively process time series signals. However, LSTM has a significant effect on processing time series signals, but it consumes a lot of time in feature extraction. Combining the two can avoid the shortcomings of both models, enhance the feature extraction capability of time series data, and reduce the training time. Referring to Figure 2 , the CNN layer adopts the structure of "convolution layer-pooling layer-batch normalization layer-activation function layer-convolution layer-pooling layer-batch normalization layer-activation function layer". During the training process, each layer is updated in real time. Although the data has been normalized before inputting into the model, it cannot be guaranteed that the data distribution will not change during the training process, so batch normalization is used to normalize the data input distribution of each hidden layer to a standard normal distribution with a variance of 1 and a mean of 0, thereby speeding up the training. The activation function mainly helps to express complex features through nonlinear transformation, and the Relu function is selected as the activation function. The Relu function is essentially a piecewise function that assigns all negative values to 0 and keeps positive values unchanged. The spatial features output by the CNN layer are converted into sequence data by the Flatten layer and input into the LSTM layer. In order to avoid overfitting, a Dropout layer is added to the model.
[0115] The learning rate and the number of hidden layer neurons of LSTM are optimized using the PSO algorithm to improve the accuracy of the LSTM layer. The optimization process is shown in Figure 3Firstly, the training set is re-divided, part of which is used as the training set of the LSTM network, denoted as P1 set; and part of which is used as the optimization set of the PSO algorithm, denoted as P2 set. Then, the particle population is initialized, and the particle dimension is 2D; then, in each iteration, the P1 set is used as the training set, and the P2 set is used as the test set to simulate the LSTM prediction process, and the optimal solution that minimizes the prediction error is selected in several iterations. The Adam optimizer is selected to adjust the model weight and reduce the model error.
[0116] The features output by the LSTM network layer are processed through two fully connected layers to output the tool wear amount.
[0117] II. Tool wear monitoring under variable working conditions
[0118] Reference Figure 4 For tool wear monitoring under variable working conditions, the changes of three machining parameters, i.e., cutting speed, cutting depth and feed speed, need to be considered, and the machining parameters are not set in the tool wear monitoring CNN-PSO-LSTM model under single working condition. In the present application, the actual values of the machining parameters are used as feature values, and a connection function is used to connect the machining parameter feature values before the fully connected layer.
[0119] The parameters of the CNN layer and the Flatten layer in the tool wear monitoring CNN-PSO-LSTM model under single working condition are fixed; the parameters of the LSTM layer and the fully connected layer are updated and trained to minimize the maximum mean difference, so as to realize tool wear monitoring under variable working conditions.
[0120] III. Tool residual life prediction
[0121] The tool wear process experiences three stages, and the tool wear rates in the three stages are obviously different. The tool wear rate is the smallest when the tool is in the normal wear stage; the tool wear rate is larger when the tool is in the initial wear stage and the rapid wear stage. Therefore, a three-stage Wiener process model is established considering the differences in tool wear rates in the three stages and the differences between individuals.
[0122] Suppose there are (m+n) tool data samples of the same type. For m tools (numbered 1, 2, …, m), the tool wear values are measured at the same time interval Δt; for n tools (numbered m+1, m+2, …, m+n), the time δ r , 1≤r≤3, is recorded for the tool to reach the rth wear stage boundary value for the first time from the initial time. In the rth wear stage, the jth tool wear value collected by the ith tool is x i,j,r , and k i tool wear values are collected for each tool. The δ r of the ith tool is δ i,r , then:
[0123]
[0124] δ i,r =[δ m+1,r δ m+2,r …δ m+n,r ]
[0125] Let the increment of tool wear Δx i,j,r of each tool in each stage i,j,r -x i,j-1,r , and the increment of time Δδ i,r =δ i,r -δ i,r-1 , then:
[0126]
[0127] Δδ i,r =[Δδ m+1,r Δδ m+2,r …Δδ m+n,r ]
[0128] Let θ be the unknown hyper-parameter in the prior distribution of the drift coefficient and the diffusion coefficient of the Wiener process, and the complete likelihood function of tool wear degradation data Δx is:
[0129] l(θ|Δx)=p(Δx|μ,σ 2 )·p(μ,σ 2 |θ)
[0130] where p(·) is the probability density function.
[0131] The complete likelihood function of tool first passage time data Δδ is:
[0132] l(θ|Δδ)=p(Δδ|μ,σ 2 )·p(μ,σ 2 |θ)
[0133] The joint likelihood function of the two types of tool data is:
[0134] l(θ|Δx,Δδ)=l(θ|Δx)·l(θ|Δδ).................................(18)
[0135] According to equation (18), the complete log-likelihood function of the data samples of the rth tool wear stage is:
[0136]
[0137] where k i,r is the number of tool wear values collected by the ith tool in the rth wear stage, and Δwr = w r - w r-1 , 1 < r < 3, μ i,r is the drift coefficient of the ith tool in the rth wear stage, σ i,r is the diffusion coefficient of the ith tool in the rth wear stage, Δδ i,r is the first passage time variable of the ith tool in the rth wear stage.
[0138] When the tool wear threshold is determined, the PDF of the tool remaining life is determined by the Wiener process model parameters μ and σ 2 , so the parameter estimation of μ and σ 2 is needed;
[0139] Assuming that the unknown parameters μ and σ 2 are random variables, the unknown parameters in the prior distribution are estimated according to the historical wear data and the historical life time data of the same type of tool;
[0140] According to equation (19), the conditional expectation of the hidden variable that needs to be calculated in the E-step is
[0141] For the samples with tool wear data, i.e. 1 < i < m, let θ t,r be the current parameter estimation value in the rth wear stage, θ t,r = {a t,r , b t,r , c t,r , d t,r}, and the last tool wear value of the ith tool in the rth wear stage, then the conditional expectation of the hidden variable is shown in equations (20)-(23):
[0142]
[0143]
[0144]
[0145]
[0146] For the samples with tool life time data, i.e. m < i < m+n, the conditional expectation of the hidden variable is shown in equations (24)-(27):
[0147]
[0148]
[0149]
[0150]
[0151] In the formula, ψ(·) is the logarithmic gamma function.
[0152] Unknown hyperparameter a in M-step r ,b r ,c r ,d r The iterative formula for the (t+1)th iteration is shown in equations (28)-(31):
[0153]
[0154]
[0155]
[0156]
[0157] When the given error or the given number of iterations is reached, the iteration stops and the parameter values are output.
[0158] IV. Online Prediction of Remaining Tool Life
[0159] Suppose the real-time wear data of a cutting tool at the r-th wear stage is:
[0160] Δy r =[Δy 1,r Δy 2,r …Δy kr,r ],
[0161] According to equation (15), the parameters μ and σ in the r-th tool wear stage can be obtained. 2 The posterior distribution π(μ) r ,σ r 2 |Δy r )for:
[0162]
[0163] In the formula, PDF of real-time wear data distribution; For the model parameters in the r-th wear stage The prior distribution of .
[0164] Based on equation (32) and the properties of the conjugate prior distribution, the parameters μ and σ of the r-th tool wear stage can be obtained. 2 The posterior distribution is:
[0165]
[0166] wherein,
[0167]
[0168]
[0169]
[0170] According to the above steps, the real-time updating of the degradation model parameter distribution in each tool wear stage can be realized.
[0171] When the joint posterior distribution of the model parameters is determined, the marginal posterior distribution thereof can be obtained by calculation. Since the joint posterior distribution of the degradation model parameters and in this paper is a normal-inverse gamma distribution, the marginal posterior distribution of is subject to a non-central t distribution with a mean of and a degree of freedom, and the marginal posterior distribution of is subject to an inverse gamma distribution with a shape parameter and a scale parameter. According to equation (33) and the minimum criterion of the square loss function, the Bayesian estimation values of the parameters μ and σ 2 are respectively:
[0172]
[0173] According to equation (13), the updated estimation value of the tool RUL can be obtained.
[0174] Embodiment
[0175] Online prediction of tool residual life of numerical control lathe
[0176] A turning test was carried out on a certain type of numerical control lathe. In order to make an accurate and comprehensive analysis within a reasonable number of test times and a reasonable number of combinations of cutting parameters, an L9(3 3 ) orthogonal test scheme of numerical control lathe tool degradation was formulated under 3 factors and 3 levels, as shown in columns 1-4 of Table 1. The tool life under each combination of cutting parameters is shown in column 5 of Table 1.
[0177] Table 1 Orthogonal test scheme
[0178]
[0179] In the study of tool wear online monitoring, the model needs to be tested, so select the longest tool life G1 cutting parameter combination and add one more tool to test, recorded as G10, record its turning 160 min data. The tool degradation test online collects the sensor vibration signals of the tool full life cycle under 9 working conditions, in addition, the tool flank wear value is measured offline after every 2 passes. The original signal corresponding to each tool wear value is a(n, 3) tensor. Under 9 working conditions, 1477 groups of VB value data are collected, and the flank wear curve is drawn for reference Figure 5 . The obtained original signal is analyzed and processed to obtain the time domain features, frequency domain features and time-frequency domain features of the signal. Take G2 group as an example, obtain the characteristic value for reference Figure 6-9 .
[0180] The data feature set space size of G1 group tool data is 240 x 3 x 18 (240 unit passes, 3 channel signal data and 18 features). 80% of the data volume is used as the training set, and 20% is used as the validation set, and the VB value measured offline is used as the label. In order to keep the dimension of each feature value consistent, the tool vibration signal feature data needs to be normalized before inputting the model, this paper carries out Z-score processing on the data, and the processing formula is shown in formula (35):
[0181]
[0182] In the formula, x is the original feature data, μ is the mean of the original feature data, and σ0 is the variance of the original feature data.
[0183] Python is used to establish the CNN-PSO-LSTM model, and the signal feature data processed by formula (35) is input into the CNN-PSO-LSTM model. The CNN network layer extracts data features through two convolution, maximum pooling and batch normalization operations, the size of the convolution kernel is [5, 5], and the step is 3; the size of the maximum pooling layer is [2, 2], and the step is 1; the PSO algorithm is used to iteratively solve the initial parameters and ranges in table 2, and the optimization result is p = 56 and q = 0.0021;
[0184] Table 2 PSO-LSTM model initial parameters and ranges
[0185]
[0186] The proportion of the Dropout layer is set to 0.5; the root mean square error (RMSE) is used as the loss function L; the training period is set to 300 times; the learning rate of the Adam optimizer is selected to adjust the parameters, so that the parameters remain stable during updating, and the model effect is guaranteed.
[0187] The characteristic data of the tool in the G10 group after processing is input into the model for verification, and the result is shown in Figure 10 . The dashed line represents the true value of tool wear, the solid line represents the monitoring value of tool wear, and the bar chart represents the absolute value of the difference between the true value and the monitoring value.
[0188] RMSE and mean absolute percentage error (MAPE) are two indicators often used in model evaluation, which evaluate the accuracy of each model by calculating the deviation between the monitoring value and the true value. The RMSE and MAPE evaluation index calculation formulas are:
[0189]
[0190]
[0191] In the formula, x k is the true value of tool wear, x k is the tool wear value output by the monitoring model, and n is the sample size. The lower the RMSE and MAPE values obtained by formulas (36) and (37), the better the model effect.
[0192] The monitoring results of the CNN-PSO-LSTM model are compared with other commonly used methods, and the index values of the model are calculated, as shown in Table 3.
[0193] Table 3 Model evaluation index
[0194]
[0195] As can be seen from Table 3, the RMSE and MAPE values of the CNN-PSO-LSTM model are smaller, and the effect is better.
[0196] Based on the CNN-PSO-LSTM model under single working condition, considering the change of cutting parameters (i.e. cutting speed, feed speed and cutting depth), the method of transfer learning is used to establish the tool wear monitoring model under variable working conditions.
[0197] The transfer learning method based on the model is used, the CNN-PSO-LSTM model trained under single condition is used as the basis, the parameters of the CNN layer and the Flatten layer in the CNN-PSO-LSTM model are fixed, the parameters in the module are kept unchanged, the parameters of the LSTM layer and the fully connected layer are updated and trained, so that the maximum mean difference is minimized, thereby realizing the tool wear monitoring under variable working conditions. The transfer learning process is shown in Figure 4 .
[0198] The data set of the tool in the G2 group is normalized and input into the model for fine tuning, and the result is as shown in Figure 11The dashed line represents the true value of tool wear, the solid line represents the monitored value of tool wear, and the bar chart represents the absolute value of the difference between the true value and the monitored value.
[0199] To verify the effectiveness of the migration model, this section compares the monitoring results of the G2 group of tools using the migration model and the non-migrated source domain model using the RMSE and MAPE evaluation indicators, as shown in Table 4.
[0200] Table 4 Evaluation indicators of the migration model and the non-migration model
[0201]
[0202] As shown in Table 4, the two evaluation indicators of the migration model are smaller than those of the non-migration model, proving that the precision of the migration model is higher than that of the non-migration model, thereby verifying the effectiveness of the migration method and achieving the monitoring of tool wear using vibration signal features under varying working conditions.
[0203] In this paper, the G1, G3-G5 groups of tools provide tool wear data, and the G6-G9 groups of tools provide life time data. The VB value data measured by each tool is divided into three parts according to the tool wear stage, and w1 = 0.13 mm and w2 = 0.2 mm are determined based on the analysis of the collected wear data. The K-S (Kolmogorov-Smirnov) test is performed on the three-stage data of each tool to determine whether the sample data in each stage satisfies the normal distribution assumption, thereby determining whether the tool degradation process can be described by a three-stage Wiener process. The Minitab software is used to solve the test probability P. When the P value is greater than the significance level of 0.05, it is considered that the sample data comes from a normal distribution population, and the tool wear process can be described by a Wiener process. The calculation result Δt = 4 min is shown in Table 5.
[0204] Table 5 P values of 9 tools
[0205]
[0206] As shown in Table 5, the P values of the 9 tools are greater than 0.05, so the sample data passes the test, and the tool wear process can be described by a three-stage Wiener process.
[0207] The EM algorithm is used to solve the unknown hyperparameters, and the results are shown in Table 6.
[0208] Table 6 Model parameter estimates based on the three-stage Wiener process
[0209]
[0210] Similarly, taking the tool data set of G2 group as an example, the tool RUL values are calculated when t = 20 min, t = 40 min, t = 60 min, t = 80 min, t = 100 min and t = 120 min, and the model prediction values and the true values are compared, and the calculation results are shown in Table 7.
[0211] Table 7 Tool RUL prediction based on three-stage Wiener process
[0212]
[0213] The tool degradation is described by using a commonly used method of single-stage Wiener process, so as to calculate the tool remaining life estimate value, and the calculation results are shown in Table 8.
[0214] Table 8 Tool RUL prediction based on single-stage Wiener process
[0215]
[0216] The RMSE and MAPE of the two models are calculated respectively, and the calculation results are shown in Table 9.
[0217] Table 9 Evaluation index of tool RUL prediction model
[0218]
[0219] It can be seen from the evaluation index that the RMSE and MAPE values based on the three-stage Wiener process model are smaller than those based on the single-stage Wiener process model, and the effect is better.
[0220] The tool wear value output by the tool wear monitoring model is taken as a new sample input, the tool RUL is estimated online by using the Bayesian method, the unknown parameter estimate obtained by the EM algorithm is taken as the prior information, the model parameters are updated according to formula (34), and the Bayesian estimate values of the model parameters μ and σ 2 are obtained. The updating results are substituted into formula (13) to obtain the RUL of the tool. The results are shown in Table 10.
[0221] Table 10 Online prediction of tool RUL based on Bayesian updating
[0222]
[0223] As can be seen from Table 10, the tool RUL prediction value obtained by using the tool RUL prediction model based on Bayesian updating almost covers the true value, so the accuracy of this method can be proved.
[0224] The AIC (Akaike information criterion) criterion is used to judge the fitting degrees of the tool wear degradation models under the EM parameter estimation and the Bayesian estimation. The AIC value calculation formula is represented as:
[0225] AIC=-2lnL+2k……….…………….…………….(38)
[0226] In the formula, L is a likelihood function value, and k is the number of model parameters. The smaller the AIC value is, the better the fitting effect of the model data is. According to the formula (38), the AIC value is calculated, and the results are shown in Table 11.
[0227] Table 11 AIC value comparison effect
[0228]
[0229] According to the results in Table 11, it can be seen that the AIC value of the model based on the Bayesian method is smaller than that of the model based on the EM algorithm, so the superiority of the tool RUL online prediction model based on the Bayesian update is proved.
[0230] On the basis of obtaining the experimental data set, the tool wear monitoring under single working condition and variable working condition is realized. The tool wear monitoring model combining CNN and LSTM is established under single working condition, the optimal values of the learning rate and the hidden layer neuron number of the LSTM in the model are iteratively solved by using the PSO algorithm, and the monitoring accuracy is further improved. Based on the CNN-PSO-LSTM model, the machining parameters are set, and the tool wear monitoring model under variable working condition is established by using the transfer learning method. The tool wear degradation process is described by using the three-stage Wiener process, the model is parameter estimated by using the EM algorithm according to the historical data, and thus the tool RUL estimation value is obtained. The observation value output by the tool wear monitoring model is taken as a new sample, the model parameters are updated by using the Bayesian method, and thus the tool RUL prediction model which can be updated online is established.
Claims
1. An online prediction method for the remaining life of a lathe tool, comprising the following steps: Step one, combining the advantages of CNN and LSTM, and using PSO to iteratively solve the optimal values of the learning rate and hidden layer neurons of LSTM, thereby establishing a CNN-PSO-LSTM model to realize online monitoring of tool wear in a single working condition; Step two, based on the CNN-PSO-LSTM model, set the machining parameters, and use the transfer learning method to monitor the tool wear in varying conditions; Step three, considering the difference in tool wear rate in the three stages, describe the tool degradation process based on the three-stage Wiener process, and then obtain the tool remaining life estimate according to the concept of first passage time; the three stages are the initial wear stage, the normal wear stage, and the rapid wear stage; Step four, using the Bayesian method and combining the tool wear monitoring value, the model parameters are updated in real time, and then the updated estimate of the tool remaining life is obtained; The specific method for establishing a CNN-PSO-LSTM model in step one to monitor tool wear in a single working condition is as follows: The CNN-PSO-LSTM model mainly consists of a CNN layer and a PSO-LSTM layer; The CNN layer adopts the structure of "convolution layer-pooling layer-batch normalization layer-activation function layer-convolution layer-pooling layer-batch normalization layer-activation function layer"; The convolution layer extracts features from the input data; The pooling layer selects and filters the features output by the convolution layer, thereby achieving the purpose of feature compression; Batch normalization is used to normalize the data input distribution of each hidden layer to a standard normal distribution with a variance of 1 and a mean of 0, thereby speeding up the training; The activation function layer uses the Relu function as the activation function to assign all negative values to 0 and keep the positive values unchanged; The spatial features output by the CNN layer are converted into sequence data by the Flatten layer and input into the LSTM layer, and the learning rate and the number of hidden layer neurons of the LSTM layer are optimized using the PSO algorithm; a Dropout layer is added after each LSTM layer to avoid overfitting; The features output by the LSTM layer are processed by two fully connected layers to output the tool wear; The Adam optimization algorithm is used for gradient calculation, iterative adjustment of model weights, and reduction of monitoring error selection; The specific method for monitoring tool wear in varying conditions in step two is as follows: For tool wear monitoring in varying conditions, the changes in cutting speed, cutting depth, and feed rate need to be considered, and the CNN-PSO-LSTM model for tool wear monitoring in a single working condition does not set the machining parameters. The actual values of the machining parameters are used as feature values, and a connection function is used to connect the machining parameter feature values before the fully connected layer; The parameters of the CNN layer and the Flatten layer in the tool wear monitoring CNN-PSO-LSTM model under a single working condition are fixed; the parameters of the LSTM layer and the fully connected layer are updated and trained so that the maximum mean difference is minimized, thereby realizing tool wear monitoring under variable working conditions.
2. The online tool residual life prediction method of the numerical control lathe according to claim 1, characterized in that: The specific steps of optimizing the learning rate and the number of hidden layer neurons of the LSTM by using the PSO algorithm are as follows: Firstly, the training set is further divided, part of which is used as the training set of the LSTM, denoted as P1 set; and part of which is used as the optimization set of the PSO algorithm, denoted as P2 set; Then, the particle population is initialized, and the particle dimension is 2D; Next, in each iteration, the P1 set is used as the training set, the P2 set is used as the test set, the tool wear monitoring process is simulated by using the LSTM, and the optimal solution that minimizes the prediction error is selected in several iterations.
3. The online tool residual life prediction method of the numerical control lathe according to claim 1, characterized in that: The specific method of tool residual life estimation in step three is as follows: (1) Model assumption 1) When the tool wear exceeds the preset threshold for the first time, the tool service life ends, and the tool residual life is determined only by the tool wear; 2) The degradation amount of tool wear in each stage follows a normal distribution, and the Wiener process is used to describe the tool wear degradation process; 3) Considering the difference of tool degradation under different machining conditions, the drift coefficient μ and the diffusion coefficient σ are both random variables; the prior distribution of μ obeys the normal distribution with variance c and mean d, and the prior distribution of σ 2 obeys the inverse gamma distribution with shape parameter a and size parameter b, and the prior joint distribution of μ and σ 2 obeys the normal inverse gamma distribution, that is: (2) Three-stage Wiener process model The tool wear process is divided into three stages, and the Wiener process is used to describe the wear process in each stage. The tool wear degradation model X(t) is defined as: In the formula, x0 represents the initial tool wear value; t1 and t2 represent the time when the turning point occurs; μ1 and σ1 represent the drift coefficient and diffusion coefficient of the initial wear stage degradation process, respectively; μ2 and σ2 represent the drift coefficient and diffusion coefficient of the normal wear stage degradation process, respectively; μ3 and σ3 represent the drift coefficient and diffusion coefficient of the rapid wear stage degradation process, respectively; w1 represents the threshold value of the initial wear stage; w2 represents the threshold value of the normal wear stage; and B(t) is a standard Brownian motion. (3) Tool residual life RUL distribution Let δ r denote the amount of wear of the tool during the degradation process from the initial time to the first time it exceeds the rth wear stage threshold w r r, 1≤r≤3, w3is the tool dulling threshold; by definition, δ r is given by: delta r = inf{t: X(t) >= w r , t > 0} (4) According to equation (4) and the homogeneous Markov property of the Wiener process, δ r Also, it can be expressed as: delta r = delta r-1 + inf{t: X'(t) >= w r - w r-1 , t > 0}.................................(5) where X'(t) = μ r t + σ r B(t); let w0= 0, δ0= 0; Let the amount of time change for each stage be Δδ r = δ r - δ r-1 ; and the threshold amount of change be Δw r = w r - w r-1 From equation (5), we get: Δδ r = inf{t:X'(t) ≥ Δw r ,t > 0} (6) Since the time of the first passage threshold of the Wiener process obeys inverse Gaussian distribution, it is considered that δ r obeys inverse Gaussian distribution, according to formula (6), it can be obtained that The tool life T can be represented as: T=Δδ1+Δδ2+Δδ3...................................................(8) According to the convolution integral formula, the probability density function (PDF) of T is: Therefore, the expected value of T can be represented as: When the tool wear amount X(τ) at a certain time τ is known, the tool remaining useful life L τ may be expressed as: According to equation (11), L τ The PDF of L can be expressed as: The desired estimate of the tool's remaining useful life L τ may be expressed as: (4) Model parameter estimation based on EM algorithm Suppose there are (m+n) sets of historical data samples of the same type of tool, for m sets of tools numbered 1, 2,..., m, the tool wear values are measured at the same time interval Δt; for n sets of tools numbered m+1, m+2,..., m+n, the time δ required for the tool to reach the rth wear stage boundary value for the first time from the initial time is recorded r , 1≤r≤3; in the rth wear stage, the jth tool wear value collected by the ith tool is x i,j,r , and k i tool wear values are collected for each tool, and the δ r of the ith tool is δ i,r , then: δ i,r = [δ m+1,r δ m+2,r … δ m+n,r ] Let the wear increment of each tool per stage be Δx i,j,r = x i,j,r - x i,j-1,r , the time variable Δδ i,r = δ i,r - δ i,r-1 then: Δδ i,r = [Δδ m+1,r Δδ m+2,r … Δδ m+n,r ] Let θ be the unknown hyperparameter in the prior distribution of the drift coefficient and diffusion coefficient in the Wiener process, the complete likelihood function of the tool wear degradation data Δx is: l(0|Ax) = p(Ax | m, s) - p(m, s | 0) 2 ) - p(m, s | 0) 2 ) wherein is a probability density function; The complete likelihood function of the tool first passage time data Δδ is: l(0|A5) = p(A5 | m, s) - p(m, s | 0) 2 ) - p(m, s | 0) 2 ) The joint likelihood function of the two types of tool data is: l(θ|Δx,Δδ)=l(θ|Δx)·l(θ|Δδ).....................................(18) According to formula (18), the complete log-likelihood function of the data sample of the rth tool wear stage is represented as: wherein k i,r is the number of tool wear values collected for the ith tool in the rth wear stage, Δw r = w r - w r-1 , 1 < r < 3, μ i,r is the drift coefficient for the ith tool in the rth wear stage, σ i,r is the diffusion coefficient for the ith tool in the rth wear stage, Δδ i,r is the first passage time variable for the ith tool in the rth wear stage; When the tool wear threshold is determined, the PDF of the tool remaining life is given by the Wiener process model parameters μ and σ 2 determined, parameter estimation of μ and σ 2 is therefore required; Assume unknown parameters μ and σ 2 are random variables, the unknown parameters in the prior distribution of parameters are estimated according to the historical wear data and the historical life time data of the same type of tool; From equation (19), the conditional expectation of the latent variables that needs to be computed in the E-step is and For the samples with tool wear data, i.e., 1≤i≤m, let θ t,r be the current parameter estimate for the rth wear stage, θ t,r = {a t,r ,b t,r ,c t,r ,d t,r}, be the last tool wear value of the ith tool in the rth wear stage, then the conditional expectation of the latent variable is given by equations (20)-(23): For the sample with tool life time data, i.e. m < i ≤ m + n, the conditional expectation of the latent variable is shown in formula (24) to formula (27): In the formula, ψ(·) is a logarithmic gamma function; Unknown hyperparameter a in M-step r ,b r ,c r ,d r The iteration formula of the n+1th is shown in equations (28)-(31): When a given error is reached or a given number of iterations is reached, the iteration is stopped and the parameter value is output.
4. The numerical control lathe tool residual life online prediction method according to claim 1, characterized in that: The specific method of updating the residual life estimation of the tool in step four is as follows: Suppose that the real-time wear data of a tool in the rth wear stage is: Δy r = [Δy 1,r Δy 2,r … Δy kr,r ], parameters μ and σ in the rth tool wear phase 2 posterior distribution of is: wherein is the PDF of the real-time wear data; is the prior distribution of the model parameters in the rth wear phase; According to equation (32) and the properties of the conjugate prior distribution, the posterior distribution of the rth tool wear stage parameter μ and σ is obtained as 2 p(μ, σ | y) = p(y | μ, σ) p(μ, σ) In the formulae, According to the above steps, the real-time updating of the degradation model parameter distribution in each tool wear stage can be realized. When the joint posterior distribution of the model parameters is determined, its marginal posterior distribution is obtained by calculation; the joint posterior distribution of the degenerate model parameters μ and σ 2 is a normal-inverse gamma distribution, the marginal posterior distribution of μ obeys a non-central t distribution with mean d' and degree of freedom 2a', and the marginal posterior distribution of σ 2 obeys an inverse gamma distribution with shape parameter a' and scale parameter b'; according to formula (33) and the minimum criterion of the square loss function, the Bayesian estimation values of the parameters μ and σ 2 are respectively: The updated estimation value of the tool RUL is obtained according to formula (13).
Citation Information
Patent Citations
Machine tool cutter residual life prediction method based on LSTM + CNN
CN110472800A
Mechanism-data fusion driven variable working condition tool wear state monitoring method
CN114102260A
Load prediction method based on PSO-CNN-LSTM model
CN114707750A