Cutter abrasion loss modeling and predicting method based on Diffusion-EMCAform

Through the tool wear quantity modeling and prediction method based on Diffusion-EMCAformer, the problem of difficult tool wear quantity due to difficult processing materials is solved, and efficient and accurate prediction of wear quantity and tool service life optimization is achieved.

CN119820386APending Publication Date: 2025-04-15NANJING TECH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510230480.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-28
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

During the CNC machining of aerospace components, difficult materials can be processed to accurately predict the wear amount of tool, resulting in wasted tool service life and reduced processing accuracy.

Method used

The tool wear quantity modeling and prediction method based on Diffusion-EMCAformer is adopted. Multiple sensors are configured to collect multi-source data, wavelet denoising pre-processing, and a Diffusion-EMCAformer model is built for prediction.

Benefits of technology

It achieves efficient and accurate prediction of tool wear, especially in complex working conditions, and has good adaptability and robustness, reducing the downtime and cost of tool replacement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119820386A_ABST
    Figure CN119820386A_ABST
Patent Text Reader

Abstract

The invention discloses a tool abrasion loss modeling and predicting method based on a Diffusion-EMCAform, and the method comprises the steps: collecting a triaxial force signal and an acceleration signal in a machining process through a sensor, and carrying out the tool abrasion loss through a microscope; the method comprises the following steps: preprocessing signals acquired by a sensor based on a wavelet denoising technology of a double entropy optimization method; the method comprises the following steps: building a Diffusion-EMCAformer model, dividing input comprising a sensor signal, a time step signal and a diffusion step signal into a training set and a test set, and training an optimal model by using the training set; a test set of missing data is supplemented through a diffusion model, predicted abrasion loss and abrasion speed are tested on an optimal model, and then an improved arithmetic optimization algorithm is combined with fuzzy C-means clustering for classification to classify tool abrasion states. According to the method, efficient and accurate prediction of the abrasion loss of the tool is achieved, particularly, good adaptability and robustness are achieved under complex working conditions, and accurate abrasion loss prediction and maintenance suggestions are provided for machine tool maintenance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of machine tool manufacturing, and relates to tool wear modeling and prediction problems, in particular to a tool wear modeling and prediction method based on Diffusion-EMCAformer. Background Art

[0002] In order to ensure the comprehensive performance of aerospace products and their normal operation in extreme environments, difficult-to-process materials such as titanium alloys and high-temperature alloys are widely used in the manufacture of aerospace parts. During the CNC machining of parts, due to the high strength, high hardness and low thermal conductivity of difficult-to-process materials, the stress on the cutting tool tip is high, resulting in a high local temperature on the cutting edge, making the tool more prone to failure.

[0003] The wear of the tool plays a very important role in the remaining life of the tool and the forming of the workpiece surface; based on known knowledge, the state monitoring of the tool can be indirectly predicted using sensor methods. As the industry's requirements for processing accuracy and automation continue to increase, the concept of intelligent manufacturing is becoming more and more widely used in industry, and the prediction of tool wear has become a huge challenge facing intelligent manufacturing. In the traditional cutting process, the factory can only rely on the processing personnel to judge by cutting sound, chip color, cutting time, etc. This judgment method is highly subjective, so there are two inevitable problems:

[0004] 1. In actual processing, the downtime for tool replacement accounts for more than 20% of the total machine tool downtime, and the cost of tools and tool replacement accounts for 3% to 12% of the total processing cost. The traditional method of relying on manual experience to determine the time node for tool replacement results in a serious waste of tool life.

[0005] 2. Prediction based on data collected by a single sensor is often affected by interference from complex processing sites, resulting in unsatisfactory prediction accuracy. In normal processing, depending on the processing task, the noise contained in a single data will have an adverse effect on the prediction result, making it impossible to fully utilize the processing data.

[0006] Usually, due to the development of new product models and changes in customized requirements, the historical data samples of manufacturing equipment are incomplete and lack sufficient data for prediction. Summary of the invention

[0007] In view of the problems in the above-mentioned prior art, the present invention proposes a tool wear modeling and prediction method based on Diffusion-EMCAformer, designs Diffusion-EMCAformer as a tool wear prediction model, uses multi-source data collected by sensors as input, and uses wavelet denoising method to pre-process the collected data on this basis to establish a tool wear prediction model, then generates data by collecting sensors under variable working conditions, and finally uses fuzzy C-means clustering to achieve rapid and accurate prediction of tool wear under variable working conditions. The method proposed by the present invention is expected to achieve efficient and accurate prediction of tool wear, especially with good adaptability and robustness under complex working conditions.

[0008] In order to achieve the above technical objectives, the present invention provides the following technical solutions:

[0009] A tool wear modeling and prediction method based on Diffusion-EMCAformer specifically includes the following steps:

[0010] S1. Configure measuring instruments:

[0011] Configure online measuring instruments: install X, Y, and Z-axis force sensors between the worktable and the workpiece, and install X, Y, and Z-axis acceleration sensors on the workpiece; X, Y, and Z-axis force sensors are used to detect vibration force signals during processing and convert them into electrical signals, and X, Y, and Z-axis acceleration sensors are used to detect accelerations of the processed workpiece in all directions and convert them into electrical signals; set the sampling frequencies of the force sensor and the acceleration sensor to be the same;

[0012] Configure offline measuring instruments: After the machine tool operation is completed, configure a microscope to measure the tool wear;

[0013] S2. Obtain processing information and form sample data:

[0014] The force signals and acceleration signals collected by sensors in the three directions of X, Y, and Z are measured online when a three-edge tool is milling a workpiece, forming 6 columns of input data; each workpiece is cut multiple times during processing; the 6 columns of input signals collected by the sensor during each cutting and the tool wear measured offline after each cutting are recorded;

[0015] S3, data storage and transmission:

[0016] The force signals, acceleration signals and tool wear collected by different sensors are stored in the local database, and the database data is stored in the server. Based on the OPC UA protocol, the data collected by the sensor is transmitted to the client for subsequent processing;

[0017] S4. Preprocess the collected data:

[0018] First, the force signal and acceleration signal are decomposed into high-frequency modes and low-frequency modes through wavelet transform, and then the double entropy optimization method is used to optimize the denoising threshold. The signal is denoised in combination with the soft threshold method, and the denoised signal is reconstructed through inverse wavelet transform. Then, the reconstructed signal is standardized to obtain a three-dimensional signal tensor, and then the decomposed signal tensors are connected according to the dimension of the sampling frequency to finally obtain a three-dimensional signal matrix X(I×L×K), where I is the number of tool cutting times, L is the number of signals collected by the sensor during each cutting, and K is the number of signal types collected by the sensor.

[0019] S5. Build Diffusion-EMCAformer model:

[0020] Build an EMCAformer encoder that includes multi-dimensional convolutional attention and feedforward neural network; combine with the diffusion model, and use sensor signal embedding, time step information embedding and diffusion step information embedding as the model input, and output the tool wear prediction value after being processed by multi-layer EMCAformer encoder and one-dimensional convolution module;

[0021] S6. Perform model training:

[0022] The three-dimensional signal matrix X(I×L×K) obtained in step S4 is used as the sensor signal embedding, and the label sample data obtained in step S2 is used as the learning label of the model. The data is divided into a training set and a validation set in a ratio of 80%:20%, and a loss function is set for training to obtain the optimal model.

[0023] S7. Test using the optimal model:

[0024] Based on the optimal model obtained in step S6, the force signal and acceleration signal collected by the sensor in real time are used in combination with the diffusion model to perform time series expansion on the sensor data under the current processing condition, and the sensor signal data of the future time step is generated. The expanded sensor signal data is preprocessed in the same way as in step S4, and the processed test set is input into the Diffusion-EMCAformer model saved in the offline training stage to predict the tool wear at the current moment and the future moment.

[0025] S8. Prediction results analysis and tool maintenance suggestions:

[0026] According to the tool wear predicted in step S7, the tool wear prediction results are divided into three categories: initial wear, stable wear and rapid wear based on the fuzzy C-means clustering algorithm FCM; based on the prediction results, suggestions for tool replacement and machine tool maintenance are provided to on-site operators.

[0027] Based on the above technical solution, the present invention has at least the following beneficial effects:

[0028] 1. In the data preprocessing stage, the dual entropy optimization method combined with wavelet transform is introduced to denoise and reconstruct the input data; while effectively removing noise and retaining important features in the signal, the denoising process is optimized, the data quality is significantly improved, the interference of noise on model prediction is reduced, and the prediction accuracy of the model is further improved.

[0029] 2. Using multi-source data of force signals and acceleration signals from the X, Y, and Z axes collected by sensors as input, the model can fully reflect the working status of the tool, thereby more accurately capturing the characteristics of tool wear. Compared with single sensor data, the fusion of multi-dimensional data further enhances the robustness and generalization ability of the model. It avoids the adverse effects of anomalies in a single data source on the prediction results.

[0030] 3. Using the multi-scale convolutional attention mechanism in the EMCAformer encoder and the unique multi-scale deep convolutional block, it can capture relevant information of different scales, enhance feature representation, and improve the performance of the model when processing complex time series data. In multivariate time series prediction, it can learn the weights between different variables, highlight the variables that have a greater impact on the prediction results, and suppress the influence of noise variables, thereby improving the prediction accuracy; at the same time, the diffusion model Diffusion is introduced for data filling and enhancement to deal with the incompleteness of historical data samples. Reasonable repair of missing data based on the diffusion model ensures the integrity of data samples. In the case of incomplete samples, the data quality required for model training can still be guaranteed, thereby improving the prediction accuracy of the model.

[0031] 4. The tool wear degree is classified by combining the improved arithmetic optimization algorithm AAOA with fuzzy C-means clustering FCM, which has the global optimization ability of AAOA and the fuzzy processing advantages of FCM. It enhances the global search ability of the algorithm while avoiding falling into local optimality, ensuring that the accuracy and stability of classification can be effectively improved. It is suitable for classification tasks that process complex, uncertain and noisy data. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0033] Figure 1 It is the overall flow chart of the method proposed by the present invention;

[0034] Figure 2 A schematic diagram of the sensor layout and a flowchart of the experimental training in the present invention;

[0035] Figure 3This is a structural framework diagram of the Diffusion-EMCAformer model designed in the method proposed in the present invention;

[0036] Figure 4 This is a comparison chart of the actual value of the flank wear amount and the model prediction value in the C1 working condition during the cutting process;

[0037] Figure 5 This is a comparison chart of the actual value of the flank wear amount and the model prediction value in the C4 working condition during the cutting process;

[0038] Figure 6 This is a comparison chart of the actual value of the flank wear of the C6 working condition during the cutting process and the model predicted value. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0040] Although the steps in the present invention are arranged with numbers, they are not used to limit the order of the steps. Unless the order of the steps is clearly stated or the execution of a certain step requires other steps as a basis, the relative order of the steps can be adjusted. It is understood that the term "and / or" used in this article involves and covers any and all possible combinations of one or more of the associated listed items.

[0041] In this embodiment, the tool is processed according to the processing method and sensor recommended by the American PHM Society in 2010 regarding tool wear. High-speed CNC machine tool, the experimental tool is a 3-edge tungsten carbide ball end milling cutter, and the cutting material is stainless steel (HRC-52). The main equipment parameters of the experiment are shown in Table 1, the cutting parameters of the experiment are shown in Table 2, and the number of samples for each working condition is shown in Table 3.

[0042] Table 1 Main experimental equipment

[0043]

[0044] Table 2 Experimental processing parameters

[0045]

[0046] Table 3 Number of samples for each working condition

[0047] Working conditions C1 C4 C6 Sample size 315 315 315

[0048] Based on the above experimental equipment, processing parameters and sample quantity, as Figure 1As shown, a tool wear modeling and prediction method based on Diffusion-EMCAformer proposed by the present invention is shown, which specifically includes the following steps:

[0049] S1. Configure measuring instruments:

[0050] Configure online measuring instruments: install X, Y, and Z-axis force sensors between the worktable and the workpiece, and install X, Y, and Z-axis acceleration sensors on the workpiece; X, Y, and Z-axis force sensors are used to detect vibration force signals during processing and convert them into electrical signals, and X, Y, and Z-axis acceleration sensors are used to detect accelerations of the processed workpiece in all directions and convert them into electrical signals; set the sampling frequencies of the force sensor and the acceleration sensor to be the same;

[0051] Configure offline measuring instruments: After the machine tool operation is completed, configure a microscope to measure the tool wear;

[0052] In this embodiment, according to the experimental equipment in Table 1 above, Figure 2 The force sensor and acceleration sensor are installed in the form shown, and the sensor is calibrated, that is, a Kistler three-axis dynamometer is installed between the workbench and the workpiece, and three Kistler piezoelectric accelerometers are installed on the workpiece.

[0053] S2. Obtain processing information and form sample data:

[0054] The force signals and acceleration signals collected by the sensors in the three directions of X, Y, and Z are measured online when the three-edge tool is milling the workpiece, forming 6 columns of input data; each workpiece is cut 315 times during processing, and the tool moves along the set direction to cut the same distance during cutting, which is considered one cutting; the 6 columns of input signals collected by the sensor during each cutting are recorded, and then combined with the tool wear measured offline after each cutting to form label sample data;

[0055] In this embodiment, the flank wear of the tool is measured; the sensor output signal is amplified by a Kistler charge amplifier and then collected using NIDAQ PCI 1200 with a sampling frequency of 50KHZ; after the tool completes 108mm end milling along the X direction, the LEICAMZ12 microscope is used to measure the flank model of the tool offline, and each tool is cut 315 times to obtain 315 flank wear values, that is, one stroke is 315 cuts, and the original signal corresponding to each flank wear value is a tensor of (n,6); wherein n represents the number of signals collected;

[0056] Since the frequency used is too high, the data exceeds 20w; therefore, the 6 sensor signals collected in each stroke are downsampled separately to obtain the input signal tensor data of size (5000,6), and the tensors corresponding to 315 strokes are merged to obtain the original signal input matrix of size (315,5000,6).

[0057] S3, data storage and transmission:

[0058] The force signals, acceleration signals and tool wear collected by different sensors are stored in the local database, and the database data is stored in the server. Based on the OPC UA protocol, the data collected by the sensor is transmitted to the client for subsequent processing;

[0059] S4. Preprocess the collected data:

[0060] First, the force signal and the acceleration signal are decomposed into high-frequency modes and low-frequency modes by wavelet transform, and then the denoising threshold is optimized by dual entropy optimization method, and the signal is denoised by combining the soft threshold method, and the denoised signal is reconstructed by inverse wavelet transform; as a preferred implementation, the denoising process is specifically as follows:

[0061] Wavelet denoising uses discrete wavelet transform DWT and uses DB8 as the basis function to decompose the signal. The input original signal x(t) is decomposed by wavelet to obtain detail coefficients d at different scales. j and approximation coefficient a J , j represents the decomposition scale, and the decomposition scale set in this embodiment is 2;

[0062] The signal decomposition formula is expressed as:

[0063]

[0064] Among them, a J (t) is the Jth-order approximation coefficient, representing the lowest frequency mode, d j (t) is the detail coefficient of the jth level, representing the high-frequency mode;

[0065] In the denoising process, the present embodiment adopts a dual entropy optimization method to further optimize the denoising process; first, the signal and H of the original signal are calculated respectively. signal and noise entropy H noise ; Signal entropy is the entropy of the low-frequency part of the input original signal, which represents the effective amount of information, and noise entropy is the entropy of the high-frequency part of the original signal;

[0066] In this embodiment, the signal entropy and noise entropy are calculated by the probability distribution of the approximation coefficient and detail coefficient obtained by wavelet transform; the calculation formula of information entropy is expressed as:

[0067]

[0068] Among them, P(a J (t) i ) is the probability distribution of the approximation coefficient;

[0069] The calculation formula of noise entropy is expressed as:

[0070]

[0071] Among them, P(d j (t) i ) is the probability distribution of detail coefficients;

[0072] The optimal denoising threshold is selected by maximizing the difference between signal entropy and noise entropy; the formula is expressed as:

[0073] Threshold final = argmax(H signal -H noise );

[0074] Among them, Threshold final is the optimal denoising threshold.

[0075] After obtaining the optimal denoising threshold, we calculate the detail coefficient d j (t) De-noising; use the soft threshold method for denoising:

[0076] d j (t) denoised =sign(d j (t))×max(|d j (t)|-Threshold final ,0);

[0077] Among them, d j (t) denoised is the detail coefficient after denoising, sign(.) is the sign function;

[0078] This process removes the noise and retains the low-frequency effective components in the signal.

[0079] After the threshold is determined and denoised, the present embodiment uses the inverse wavelet transform (IDWT) to reconstruct the signal according to the denoised approximation coefficient and detail coefficient; then the reconstructed signal is standardized to obtain a three-dimensional signal tensor, and then the decomposed signal tensor is connected again according to the dimension of the sampling frequency to obtain a three-dimensional signal matrix X (I × L × K) after denoising, where I is the number of tool cutting times, L is the number of signals collected by the sensor during each cutting, and K is the number of signal types collected by the sensor; in the present embodiment, this three-dimensional signal matrix is ​​represented by X (315 × 5000 × 6);

[0080] Step S4 effectively removes noise from the force signal and acceleration signal collected by the sensor, so that key features can be better retained for extraction.

[0081] In addition, for the flank wear measured in 315 strokes, this embodiment constructs a tensor of size [315, 1] ​​as a label for supervised learning of the Diffusion-EMCAformer model; in order to avoid the network from being unable to converge due to the presence of abnormal data in the sample data and to improve the learning speed of the network, the flank wear is also standardized, and the formula is expressed as follows:

[0082]

[0083] Where, y(t) is the wear of the flank surface, y min and max are the minimum and maximum values ​​of y(t) respectively.

[0084] So far, we have obtained the three-dimensional signal matrix X (315 × 5000 × 6) as the input of the Diffusion-EMCAformer model and the standardized flank wear amount y as the model learning label. norm (t); The Diffusion-EMCAformer model used in this embodiment is specifically introduced below.

[0085] S5. Build Diffusion-EMCAformer model:

[0086] Build an EMCAformer encoder that includes multi-dimensional convolutional attention and feedforward neural network; combine with the diffusion model, and use sensor signal embedding, time step information embedding and diffusion step information embedding as the model input, and output the tool wear prediction value after being processed by multi-layer EMCAformer encoder and one-dimensional convolution module;

[0087] As a preferred embodiment, Figure 3 As shown, step S5 specifically includes:

[0088] S51, the input signal is divided into three parts: sensor signal X (315 × 5000 × 6), time step information and diffusion step information; the sensor signal is embedded into the 128-dimensional space through the linear layer, the time step information is embedded into the 128-dimensional space through sine and cosine position encoding, and the diffusion step information is embedded into the 128-dimensional space through the embedding layer; the three parts of the embedding results are added to form the input matrix of the Diffusion-EMCAformer model;

[0089] The embedding process of each part and the process of obtaining the input matrix are expressed as follows:

[0090] E s =W s X+b s arcsinθ;

[0091] E t =PositionalEncoding(t,128);

[0092] E d =W d d+b d ;

[0093] E=E s +E t +E d ;

[0094] Among them, W s is the weight matrix of the linear transformation, b s is the bias vector, t is the time step index, the PositionalEncoding function uses sine and cosine functions to encode the time step information, d is the diffusion step index, W d is the weight matrix of the diffusion step embedding layer, D(n) is the diffusion step index of the nth sample, and the sensor signal embedding E is obtained. s , time step information embedding E t and diffusion step information embedding E d Finally, the three are added together to form the final model input matrix E.

[0095] S52. Build a Diffusion-EMCAformer model whose core consists of three layers of EMCAformer modules; each EMCAformer module includes two encoding layers and two decoding layers;

[0096] In the encoding layer, the input data is processed by two layers of encoding in sequence. Each layer contains a multi-dimensional convolutional attention layer and a feedforward network, and layer normalization is performed after the multi-dimensional convolutional attention layer and the feedforward network. The multi-scale features of the input signal are enhanced and captured by the multi-dimensional convolutional attention layer, and the deep-level features are extracted by the feedforward network to obtain the final output features of the current encoding layer. The output of the first encoding layer is used as the input of the second encoding layer, and the output of the second encoding layer is used as the input of the decoding layer.

[0097] More specifically, in this embodiment, the multi-dimensional convolutional attention module first obtains the channel attention map A through the channel attention block for the input feature E c , and then multiply it element by element with the input feature to enhance the important channel features to obtain E′. The formula is expressed as:

[0098] E′=A c ⊙E;

[0099] Among them, ⊙ represents element-by-element multiplication;

[0100] The feature E′ after enhancing the channel feature first obtains the spatial attention map A through the spatial attention block s , and then perform element-by-element multiplication of the spatial attention map and the feature to enhance the important spatial position features; the formula is expressed as:

[0101] E″=A s ⊙E′;

[0102] The spatially enhanced feature E″ is processed by multi-scale convolution blocks to obtain the final output feature; the formula is expressed as

[0103] E″′=Conv 1×1 (E″,W p1 )+BN(E″);

[0104]

[0105] Among them, W p1 is the weight matrix of the point convolution, is the weight matrix of the depthwise separable convolution of the kth scale, k is the number of scales, DepthwiseConv is the depthwise convolution operation, BN is batch normalization, Concat is the concatenation of the outputs of all scales in the channel dimension, and ChannelShuffle is the channel shuffle; k is the output of the kth depth-wise separable convolution, and O is the final output of the multi-dimensional convolutional attention module.

[0106] In the decoding layer, the output of the encoding layer is processed by two layers of decoding in sequence. Each decoding layer is processed by the multi-head attention layer and the cross attention mechanism to fuse the features of the encoding layer, and then passes through the feedforward network. Layer normalization is performed after the multi-head attention layer, the cross attention layer and the feedforward network. The output of the first decoding layer is used as the input of the second decoding layer. The output of the second decoding layer is processed by linear layer transformation, layer normalization and feature segmentation to process the decoding output. Finally, the output of the EMCAformer module of the current layer is obtained through residual connection.

[0107] The structure of each layer of EMCAformer modules is the same. The input of the first layer is the input matrix obtained in step S51, and the input of the second and third layers are the output of the previous layer. The feature information is extracted through the three layers of EMCAformer modules to obtain the encoding result.

[0108] S53. The encoding result is then processed through two layers of one-dimensional convolution. The first layer is the convolution processing layer, which slides the convolution kernel along the time dimension to extract local features and introduce nonlinearity through the ReLU activation function. The second layer is the output convolution layer, which reduces the number of channels from 128 to 1 through convolution, performs average pooling on the time dimension, and finally outputs a shape of X(315×1) to obtain the predicted value of tool wear for each sample.

[0109] S6. Perform model training:

[0110] The three-dimensional signal matrix X (315×5000×6) obtained in step S4 is used as the sensor signal embedding, and the label sample data obtained in step S2 is used as the learning label of the model. It is divided into a training set and a validation set in a ratio of 80%:20%, and the loss function is set for training to obtain the optimal model; Figure 1 As shown, working conditions 1 and 2 are used for model training, while working condition 3 is used for prediction of the optimal model.

[0111] As a preferred implementation, step S6 uses the Adam optimizer for supervised training, takes the mean square error MSE as the loss function, and uses the early stopping mechanism to prevent overfitting:

[0112] Let the output of the training model be y pre , and the corresponding label data actual wear amount is expressed as y true , the mean square error is expressed as:

[0113]

[0114] The parameters of the model are optimized by the Adam optimizer. During the training process, the learning rate is gradually reduced as the training progresses to ensure the stable convergence of the model. The learning rate of the Adam algorithm is set to 0.01. The number of iterations is selected as 100 times. During the training process, the model is verified once every 10 epochs, and the best MSE on the verification set is recorded and tracked. When the performance of the model on the verification set is better than the previous best record, the model parameters are saved; at the same time, an early stopping mechanism is added to the training. When the loss on the verification set no longer decreases within three consecutive rounds of training, the training is automatically stopped to prevent the model from overfitting the training set. The optimal model is obtained after multiple rounds of training.

[0115] S7. Test using the optimal model:

[0116] Based on the optimal model obtained in step S6, the processing signal collected by the sensor in real time is used in combination with the diffusion model to perform time series expansion on the sensor data under the current processing condition, and the sensor signal data of the future time step is generated. The expanded sensor signal data is preprocessed in the same way as in step S4, and the processed test set is input into the Diffusion-EMCAformer model saved in the offline training stage to predict the tool wear at the current moment and the future moment.

[0117] As a preferred implementation, step S7 specifically includes:

[0118] S71, configure the sensor in the manner of step S1, perform real-time processing, obtain sample data in the manner of step S2 and save the data in the manner of step S3; then obtain the signal tensor during the current real-time processing in the manner of step S4;

[0119] S72. Predict future sensor data based on known historical data through a diffusion model; by adding a small amount of noise to the data at each time step, the original data gradually diffuses forward to a standard Gaussian distribution; for a given original data x 0 , the formula for forward diffusion is expressed as:

[0120]

[0121] Among them, x t represents the data at the tth time step, β t is a hyperparameter that controls the amount of noise, N represents the normal distribution, and I is the identity matrix;

[0122] S73, entering the prediction stage, the diffusion model gradually generates future sensor data from noise through the reverse diffusion process; in the future time step, the model inputs noise and generates prediction data through reverse diffusion through denoising; the formula for reverse diffusion is expressed as:

[0123]

[0124] Among them, μ θ (x t ,t) is the mean value predicted by the neural network, Σ θ (x t ,t) is the predicted covariance matrix, θ is the learnable parameter of the model;

[0125] In this embodiment, forward diffusion is the process of training model learning data being destroyed by noise. S72 provides the knowledge basis of "how to extract meaningful information from noise", so that S73 can generate new data that conforms to the real data distribution from random noise;

[0126] S74. Perform multiple iterations, and the model gradually generates predicted future sensor data from the noise at the future time step; then the predicted complete sensor data is still processed according to step S4, and finally input it to the final model to obtain the wear amount at the current moment and the predicted wear at the future moment.

[0127] S8. Prediction results analysis and tool maintenance suggestions:

[0128] According to the tool wear amount predicted in step S7, based on the fuzzy C-mean clustering algorithm FCM, the tool wear amount prediction results are divided into three categories: initial wear, stable wear and rapid wear; according to the prediction results, the on-site operators provide suggestions for tool replacement and machine tool maintenance;

[0129] As a preferred implementation, step S8 specifically includes:

[0130] S81. Based on the tool wear amount predicted in step S7, calculate the wear speed at each time point, perform moving average smoothing processing on the wear speed data, and then perform Z-Score standardization of the wear value and wear speed respectively;

[0131] S82. Set the initial clustering center for the fitness function optimization, and dynamically adjust the inertia weight during the FCM iterative update process through the improved arithmetic optimization algorithm AAOA, and use the triangular variation strategy to introduce randomness to avoid falling into the local optimal solution;

[0132] More specifically, step S82 specifically includes:

[0133] Define the fitness function, use the objective function of FCM as the fitness function to calculate the fitness value of each individual; the smaller the fitness value, the better the initial cluster center combination corresponding to the individual; the formula of the objective function J of FCM is expressed as:

[0134]

[0135] Among them, J is the objective function, n is the number of sample points, c is the number of cluster centers, and u ij is the sample point x i With cluster center v j The membership degree, m is the fuzzy index, ||x i -v j || is the sample point x i With cluster center v j The Euclidean distance between

[0136] Through the iterative process of optimizing FCM by AAOA, the combination of cluster centers that minimizes the objective function J is found as the optimal initial cluster center. In this embodiment, in AAOA, the optimization of the initial cluster center of FCM is achieved through a population evolution process; in population evolution, each generation of the algorithm is composed of multiple individuals, and individuals represent potential solutions. The quality of each individual is measured by the fitness value. Individuals with high fitness represent better solutions, and individuals with low fitness represent worse solutions. Through the evolutionary process, the algorithm gradually selects and optimizes individuals to find the optimal solution; according to the dynamic adjustment of fitness, areas with higher density are preferentially selected as initial cluster centers.

[0137] In addition, the inertia weight is dynamically adjusted to control the balance between global search and local search in AAOA. A larger inertia weight will allow the algorithm to search more widely, while a smaller inertia weight will gradually focus the search on the current optimal solution for fine-tuning to avoid local optimal solutions. The calculation formula for the inertia weight h at the current iteration is:

[0138]

[0139] Among them, h max and h min are the maximum and minimum values ​​of the inertia weight, respectively, iter max is the maximum number of iterations, iter is the current number of iterations;

[0140] In AAOA, the triangle mutation strategy increases the diversity of the solution space by generating new candidate solutions. In the early stages of AAOA, the algorithm generates new solutions through more "aggressive" triangle mutations, thereby enhancing the global search capability, avoiding the dilemma of falling into the local optimal solution, and exploring the solution space extensively. As the number of iterations increases, AAOA will gradually reduce the intensity of mutation, which helps the algorithm turn to more refined local optimization, accurately adjust the details of the solution, and find a more accurate global optimal solution.

[0141] By combining the triangle mutation strategy, the dynamic adjustment of the inertia weight and the dynamic regulation of the density factor, AAOA can effectively optimize the initial clustering center of FCM and avoid falling into the local optimal solution.

[0142] S83. Use the FCM optimized by the initial cluster center to classify the wear value and wear speed data after Z-Score standardization. For each data point, calculate its membership degree, and classify the wear data into three clusters according to the membership degree; analyze the wear degree represented by each cluster, and calculate the comprehensive wear degree of each cluster by combining the characteristics of the wear value and the wear speed;

[0143] Each data point x i The membership matrix formula is expressed as:

[0144]

[0145] The formula for the comprehensive wear degree of each cluster is expressed as:

[0146]

[0147] Among them, x i represents the i-th data point, v j represents the jth cluster center, c is the number of clusters, m is the fuzzy index, ||x i -v j || represents the data point x i To cluster center v j The Euclidean distance of i and w i Respectively represent the wear speed and wear value of the i-th data point, α and β represent the weight coefficients for balancing the influence of the wear speed and the wear value. In this embodiment, α=0.6, β=0.4;

[0148] According to the comprehensive wear degree, the wear data in each cluster are respectively mapped to different wear conditions, including initial wear, stable wear and rapid wear;

[0149] S84. Provide suggestions for tool replacement and machine maintenance to on-site operators based on different wear conditions.

[0150] The final result is as follows Figure 4-6 As shown, there are comparison diagrams showing the actual value and model predicted value of the back tool wear under C1, C4 and C6 working conditions respectively; it can be seen from the figure that the three curves are significantly divided into three areas, corresponding to the three wear conditions of initial wear, stable wear and rapid wear, and even under a variety of working conditions, the method proposed in the present invention can not only vividly display the tool wear condition in a quantitative way, but also the predicted value of the wear amount is close to the actual value.

[0151] To sum up, the present invention can realize efficient and accurate prediction of tool wear by introducing multi-source signal fusion, wavelet denoising preprocessing and Diffusion-EMCAformer model, especially has good adaptability and robustness under complex working conditions.

[0152] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.

[0153] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.

Claims

1. A tool wear modeling and prediction method based on Diffusion-EMCAformer, characterized in that: The specific steps include: S1. Configure measuring instruments: Configure online measuring instruments: install X, Y, and Z-axis force sensors between the worktable and the workpiece, and install X, Y, and Z-axis acceleration sensors on the workpiece; X, Y, and Z-axis force sensors are used to detect vibration force signals during processing and convert them into electrical signals, and X, Y, and Z-axis acceleration sensors are used to detect accelerations of the processed workpiece in all directions and convert them into electrical signals; set the sampling frequencies of the force sensor and the acceleration sensor to be the same; Configure offline measuring instruments: After the machine tool operation is completed, configure a microscope to measure the tool wear; S2. Obtain processing information and form sample data: The force signals and acceleration signals collected by sensors in the three directions of X, Y, and Z are measured online when a three-edge tool is milling a workpiece, forming 6 columns of input data; each workpiece is cut multiple times during processing; the 6 columns of input signals collected by the sensor during each cutting and the tool wear measured offline after each cutting are recorded; S3, data storage and transmission: The force signals, acceleration signals and tool wear collected by different sensors are stored in the local database, and the database data is stored in the server. Based on the OPC UA protocol, the data collected by the sensor is transmitted to the client for subsequent processing; S4. Preprocess the collected data: First, the force signal and acceleration signal are decomposed into high-frequency modes and low-frequency modes through wavelet transform, and then the double entropy optimization method is used to optimize the denoising threshold. The signal is denoised in combination with the soft threshold method, and the denoised signal is reconstructed through inverse wavelet transform. Then, the reconstructed signal is standardized to obtain a three-dimensional signal tensor, and then the decomposed signal tensors are connected according to the dimension of the sampling frequency to finally obtain a three-dimensional signal matrix X(I×L×K), where I is the number of tool cutting times, L is the number of signals collected by the sensor during each cutting, and K is the number of signal types collected by the sensor. S5. Build Diffusion-EMCAformer model: Build an EMCAformer encoder that includes multi-dimensional convolutional attention and feedforward neural network; combine with the diffusion model, and use sensor signal embedding, time step information embedding and diffusion step information embedding as the model input, and output the tool wear prediction value after being processed by multi-layer EMCAformer encoder and one-dimensional convolution module; S6. Perform model training: The three-dimensional signal matrix X(I×L×K) obtained in step S4 is used as the sensor signal embedding, and the label sample data obtained in step S2 is used as the learning label of the model. The data is divided into a training set and a validation set in a ratio of 80%:20%, and a loss function is set for training to obtain the optimal model. S7. Test using the optimal model: Based on the optimal model obtained in step S6, the force signal and acceleration signal collected by the sensor in real time are used in combination with the diffusion model to perform time series expansion on the sensor data under the current processing condition, and the sensor signal data of the future time step is generated. The expanded sensor signal data is preprocessed in the same way as in step S4, and the processed test set is input into the Diffusion-EMCAformer model saved in the offline training stage to predict the tool wear at the current moment and the future moment. S8. Prediction results analysis and tool maintenance recommendations: According to the tool wear predicted in step S7, the tool wear prediction results are divided into three categories: initial wear, stable wear and rapid wear through the fuzzy C-means clustering algorithm FCM; based on the prediction results, suggestions for tool replacement and machine tool maintenance are provided to on-site operators.

2. The tool wear modeling and prediction method according to claim 1, characterized in that: The dual entropy optimization method in step S4 is specifically: First calculate the signal entropy H of the decomposed signal signal and noise entropy H noise , and then select the optimal denoising threshold Threshold by maximizing the difference between signal entropy and noise entropy final ; The signal decomposition formula is expressed as: The calculation formulas for signal entropy and noise entropy are: The optimal denoising threshold calculation formula is: Threshold final =argmax(H signal -H noise ); Among them, x(t) is the original input signal, a J (t) is the J-th approximation coefficient, which represents the lowest frequency mode, that is, the signal part, d j (t) is the detail coefficient of the jth level, which represents the high-frequency mode, that is, the noise part, and i represents the i-th sampling point of the original signal; P(a J (t) i ) is the probability distribution of the approximation coefficient, P(d j (t) i ) is the probability distribution of detail coefficients.

3. The tool wear modeling and prediction method according to claim 1, characterized in that: Step S5 specifically includes: S51, the input signal is divided into three parts: sensor signal, time step information and diffusion step information; the sensor signal is embedded into 128-dimensional space through the linear layer, the time step information is embedded into 128-dimensional space through sine and cosine position encoding, and the diffusion step information is embedded into 128-dimensional space through the embedding layer; the embedding results of the three parts are added to form the input matrix of the Diffusion-EMCAformer model; S52. Build a Diffusion-EMCAformer model whose core consists of three layers of EMCAformer modules; each EMCAformer module includes two encoding layers and two decoding layers; In the encoding layer, the input data is processed by two layers of encoding in sequence. Each layer contains a multi-dimensional convolutional attention layer and a feedforward network, and layer normalization is performed after the multi-dimensional convolutional attention layer and the feedforward network. The multi-scale features of the input signal are enhanced and captured by the multi-dimensional convolutional attention layer, and the deep-level features are extracted by the feedforward network to obtain the final output features of the current encoding layer. The output of the first encoding layer is used as the input of the second encoding layer, and the output of the second encoding layer is used as the input of the decoding layer. In the decoding layer, the output of the encoding layer is processed by two layers of decoding in sequence. Each layer is fused with the features of the encoding layer through the multi-head attention layer, the cross attention layer and the feedforward network in sequence, and layer normalization is performed after the multi-head attention layer, the cross attention layer and the feedforward network. The output of the first decoding layer is used as the input of the second decoding layer, and the output of the second decoding layer is processed by linear layer transformation, layer normalization and feature segmentation to process the decoding output. The decoded output after segmentation is then embedded as the output, and the output of the EMCAformer module of the current layer is obtained through residual connection. The structure of each layer of EMCAformer modules is the same. The input of the first layer is the input matrix obtained in step S51, and the input of the second and third layers are the output of the previous layer. The feature information is extracted through the three layers of EMCAformer modules to obtain the encoding result. S53. The encoding results are then processed through two layers of one-dimensional convolution. The first layer is the convolution processing layer, which slides the convolution kernel along the time dimension to extract local features and introduce nonlinearity through the ReLU activation function. The second layer is the output convolution layer, which reduces the number of channels from 128 to 1 through convolution, performs average pooling on the time dimension, and finally obtains the predicted value of tool wear for each sample.

4. The tool wear modeling and prediction method according to claim 3, characterized in that: The multi-dimensional convolutional attention layer in step S52 enhances and captures the multi-scale features of the input signal as follows: In the multi-dimensional convolutional attention module, the input feature E first obtains the channel attention map A through the channel attention block. c , and then multiply it element by element with the input feature to enhance the important channel features to obtain E′. The formula is expressed as: And′=A c ⊙E; Among them, ⊙ represents element-by-element multiplication; The feature E′ after enhancing the channel feature first obtains the spatial attention map A through the spatial attention block s , and then perform element-by-element multiplication of the spatial attention map and the feature to enhance the important spatial position features; the formula is expressed as: And″=A s ⊙And′; The spatially enhanced feature E″ is processed by multi-scale convolution blocks to obtain the final output feature; the formula is expressed as E″′=Conv 1×1 (E″,W p1 )+BN(E″); Among them, W p1 is the weight matrix of the point convolution, is the weight matrix of the depthwise separable convolution of the kth scale, k is the number of scales, DepthwiseConv is the depthwise convolution operation, BN is batch normalization, Concat is the concatenation of the outputs of all scales in the channel dimension, and ChannelShuffle is the channel shuffle; k is the output of the kth depth-wise separable convolution, and O is the final output of the multi-dimensional convolutional attention module.

5. The tool wear modeling and prediction method according to claim 1, characterized in that: In step S6, the Adam optimizer is used for supervised training, and the mean square error (MSE) is used as the loss function, and the early stopping mechanism is used to prevent overfitting.

6. The tool wear modeling and prediction method according to claim 1, characterized in that: Step S7 specifically includes: S71, configure the sensor in the manner of step S1, perform real-time processing, obtain sample data in the manner of step S2 and save data in the manner of step S3; then obtain the tensor connection matrix during the current real-time processing in accordance with step S4; S72, predicting future sensor data based on known historical data through a diffusion model; adding a small amount of noise to the data at each time step so that the original data gradually diffuses forward to a standard Gaussian distribution; for a given original data x0; S73, entering the prediction phase, the diffusion model gradually generates future sensor data from noise through a reverse diffusion process; in future time steps, the model inputs noise and generates prediction data through reverse diffusion through denoising; S74, perform multiple iterations, and the model gradually generates predicted future sensor data from the noise of future time steps; then the predicted complete sensor data is still processed according to step S4, and finally input into step S5 to build the Diffusion-EMCAformer model to obtain the wear amount at the current moment and the predicted wear at the future moment.

7. The tool wear modeling and prediction method according to claim 1, characterized in that: Step S8 specifically includes: S81, based on the tool wear amount predicted in step S7, calculate the wear speed at each time point, perform moving average smoothing on the wear speed data, and then perform Z-Score standardization on the wear value and the wear speed respectively; S82, set the fitness function to optimize the initial cluster center, and dynamically adjust the inertia weight during the FCM iterative update process through the improved arithmetic optimization algorithm AAOA, and use the triangular mutation strategy to introduce randomness to avoid falling into the local optimal solution; S83. Use the FCM optimized by the initial cluster center to classify the wear value and wear speed data after Z-Score standardization. For each data point, calculate its membership degree, and classify the wear data into three clusters according to the membership degree; analyze the wear degree represented by each cluster, combine the characteristics of the wear value and the wear speed, calculate the comprehensive wear degree of each cluster, and correspond the wear data in each cluster to different wear conditions according to the comprehensive wear degree. The wear conditions include: initial wear, stable wear and rapid wear; S84. Provide suggestions for tool replacement and machine maintenance to on-site operators based on different wear conditions.

8. The tool wear modeling and prediction method according to claim 7, characterized in that: In step S82: The objective function of FCM is used as the fitness function to calculate the fitness value of each individual. The smaller the fitness value, the better the initial cluster center combination corresponding to the individual. The formula of the objective function J of FCM is expressed as: Among them, n is the number of sample points, c is the number of cluster centers, and u ij is the sample point x i With cluster center v j The membership degree, m is the fuzzy index, ||x i -v j || is the sample point x i With cluster center v j The Euclidean distance between The formula for dynamically adjusting the inertia weight is expressed as: Among them, h max and h min are the maximum and minimum values ​​of the inertia weight, respectively, iter max is the maximum number of iterations, iter is the current number of iterations, and h is the inertia weight of the current iteration.