Milling surface residual stress prediction method driven by mechanism and data fusion
By fusing the milling surface residual stress mechanism model with the data-driven model, the CNN-LSTM-Attention prediction model is constructed, and combined with the mechanism model calculation results in the loss function, the problem of insufficient prediction accuracy under variable operating conditions in the existing technology is solved, and high-precision surface residual stress prediction is achieved.
Patent Information
- Application Number
- CN202510204271.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-06-17
AI Technical Summary
The existing milling surface residual stress prediction method has insufficient prediction accuracy under small sample variable operating conditions and cannot be effectively generalized, resulting in low prediction accuracy.
The mechanism and data fusion-driven method is used to fuse the surface residual stress mechanism model with the data-driven model, and the prediction model is constructed through convolutional neural network (CNN), long and short-term memory (LSTM) and attention layer. Combined with the calculation results of the mechanism model in the loss function, the model training process is optimized to improve generalization performance.
Effective generalization under small sample variable operating conditions improves the accuracy of the prediction of residual stress on the milling surface, reduces the time and cost of model construction, and improves physical consistency and interpretability.
Smart Images

Figure CN120163044A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of non-destructive monitoring of surface residual stress, and specifically relates to a prediction method for milling surface residual stress driven by mechanism and data fusion. Background Technique
[0002] Due to the combined influence of mechanical load and thermal stress on the workpiece surface during the milling process, residual stress is likely to be generated on the workpiece surface during milling. The magnitude and tensile-compressive state of the surface residual stress will affect the fatigue life of the workpiece, and excessive surface residual stress will cause the workpiece to easily warp and bend. Therefore, predicting the surface residual stress of the workpiece generated during the milling process is of great significance for controlling the surface integrity of the milled workpiece and improving the machining performance.
[0003] During the milling process, the surface residual stress is jointly affected by factors such as cutting force heat, spindle speed, and feed rate. There have been some studies and applications on the prediction of surface residual stress. For example, Chinese Patent Application No. CN202310554802.6 discloses a method for establishing a prediction model of grinding residual stress based on the maximum abrasive grain cutting depth and neural network. The parameters and residual stress data are obtained through grinding experiments, and the feed speed, abrasive belt linear speed, and maximum cutting depth of the abrasive grain are used as the input of the GRNN neural network to establish a residual stress prediction model. Chinese Patent No. ZL202111349342.0 discloses a method for predicting surface residual stress based on machine tool energy consumption. The surface strain energy is calculated based on the experimentally measured energy consumption, and a data set is constructed by combining the experimentally measured surface residual stress. The surface residual stress prediction is realized through the SVM model. To sum up, most of the existing surface residual stress prediction methods obtain the surface residual stress data set based on the experimentally set working conditions, and realize the surface residual stress prediction by training a machine learning model.
[0004] The existing milling surface residual stress prediction methods have the following deficiencies: In order to further accurately output the control strategy during the cutting process to achieve surface residual stress control, the prediction model needs to maintain stable prediction accuracy under variable working conditions. However, the acquisition cost of surface residual stress data is high, and most of the existing surface residual stress prediction methods rely on limited residual stress data under experimentally set working conditions to train the model. Therefore, machine learning methods such as SVM cannot be effectively generalized when facing new process parameters and state data, resulting in low prediction accuracy. Summary of the Invention
[0005] In view of this, the purpose of the present invention is to provide a milling surface residual stress prediction method driven by mechanism and data fusion, which considers the dynamic change of surface residual stress during the cutting process, fuses the surface residual stress mechanism model and the data-driven model, predicts the surface residual stress of the workpiece during the milling process, and can effectively generalize and improve the prediction accuracy when facing new process parameters and state data.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] A milling surface residual stress prediction method driven by mechanism and data fusion includes the following steps:
[0008] Step 1: Data acquisition
[0009] Collect multi-channel data including milling process parameters and multiple cutting force signals, as well as experimental observation values of milling surface residual stress;
[0010] Step 2: Construct a milling surface residual stress prediction model
[0011] The milling surface residual stress prediction model includes a convolutional neural network CNN layer, a long short-term memory LSTM layer, and an attention layer; the convolutional neural network CNN layer is used to extract signal data of multi-channel data to reduce the interference of noise signals and non-discriminatory information and obtain more surface residual stress feature information; the long short-term memory LSTM layer is used to capture the long-term correlation and non-linear dynamic features of sequence data from the surface residual stress feature information; the attention layer is used to dynamically assign weights to different features to improve the convergence speed and generalization performance of the model;
[0012] Step 3: Construct a loss function based on the residual stress mechanism model;
[0013] Calculate the mechanical stress distribution and thermal stress distribution according to the residual stress mechanism, then the stress at any point on the workpiece is the superposition of mechanical stress and thermal stress; construct a loss function based on the consistency between the prediction results of the milling surface residual stress prediction model and the experimental observation values and the calculation results obtained based on the residual stress mechanism:
[0014] Loss = Loss D (Rs true , Rs pre ) + γLoss P (Rs phiz , Rs pre )
[0015] Where: Loss represents the loss function; Rs true is the experimental observation value of the milling surface residual stress; Rs preis the predicted value of the milling surface residual stress prediction model; Rs phiz is the calculated value obtained based on the residual stress mechanism; Loss D (Rs true , Rs pre ) represents the consistency between the prediction result of the milling surface residual stress prediction model and the experimental observation result; Loss P (Rs phiz , Rs pre ) represents the consistency between the prediction result of the milling surface residual stress prediction model and the calculated result obtained based on the residual stress mechanism; γ is the Loss P coefficient;
[0016] Step Four: Model Training
[0017] Train the milling surface residual stress prediction model based on the constructed loss function, and optimize the coefficient γ using an optimization algorithm to obtain the optimal coefficient γ;
[0018] Step Five: Prediction of Milling Surface Residual Stress
[0019] Collect multi-channel data including milling process parameters and multiple cutting force signals in real time, and input the collected multi-channel data into the constructed milling surface residual stress prediction model to obtain the predicted value of the milling surface residual stress.
[0020] Furthermore, according to the Boussinesq equation in contact mechanics, calculate the stress distribution under the milling mechanical load:
[0021]
[0022]
[0023] where: σ x represents the stress component in the x direction; σ z represents the stress component in the z direction; τ xz represents the tangential stress in the xz direction; a and b are the boundaries of the loaded area; s is the distance between the contact element and the coordinate origin; p(s) and q(a) are the stress distribution functions.
[0024] Furthermore, the thermal stress consists of three parts: the thermal stress caused by the body force, the surface tension caused by the temperature, and the hydrostatic pressure. Then the thermal stress distribution is:
[0025]
[0026] where: represents the thermal stress in the x direction; represents the thermal stress in the z direction; (x, z) represents the thermal tangential stress in the xz direction; α is the thermal diffusivity; E represents the elastic modulus; v represents the Poisson's ratio; T represents the temperature distribution; t is the integration variable; p(t) represents the distribution function; G is the plane strain Green's function.
[0027] Furthermore, the stress distribution of the workpiece is:
[0028] [σ] = [σ M + [σ T
[0029] where: [σ] represents the stress distribution; [σ M represents the mechanical stress distribution; [σ T represents the thermal stress distribution.
[0030] Furthermore, during the model training process, with the goal of minimizing Loss, it is expressed as:
[0031]
[0032] where:
[0033]
[0034] where: represents the consistency between the prediction result of the milling surface residual stress prediction model and the experimental observation result; represents the consistency between the prediction result of the milling surface residual stress prediction model and the calculation result obtained based on the residual stress mechanism.
[0035] Furthermore, the particle swarm optimization algorithm PSO is used to optimize the coefficient γ.
[0036] Furthermore, the particle swarm optimization algorithm with asynchronous learning factors AsyLnCPSO is used to optimize the loss function coefficient γ.
[0037] The beneficial effects of the present invention are as follows:
[0038] The method for predicting the milling surface residual stress driven by the mechanism and data fusion of the present invention considers the dynamic change of the surface residual stress during the cutting process, fuses the surface residual stress mechanism model and the data-driven model, predicts the surface residual stress of the workpiece during the milling process, solves the problem of insufficient prediction accuracy of the existing surface residual stress prediction method under small samples and variable working conditions, and finally realizes the prediction of the milling surface residual stress under small samples and variable working conditions. That is, the method of the present invention can effectively generalize when facing new process parameters and state data, and improve the prediction accuracy. Specifically, the present invention has the following technical effects:
[0039] (1) By establishing a mechanism model for the surface residual stress in the milling process, the results of the mechanism model are incorporated into the loss function of the data-driven model. Compared with traditional methods, it is not necessary to conduct a large number of experiments to obtain labeled data, reducing the time and cost of model construction and improving the prediction accuracy of the model under small sample and variable working conditions.
[0040] (2) The present invention takes into account the deviation between the model prediction value and the mechanism model, improving the physical consistency and interpretability of the model.
[0041] (3) The present invention uses an improved particle swarm optimization algorithm to optimize the loss function coefficients. By balancing the proportion of the deviation between the model prediction result, the real experimental data, and the output of the mechanism model in the loss function, the prediction accuracy of the model is improved.
[0042] (4) The method of the present invention obtains multi-directional cutting force data based on a cutting force sensor, extracts multi-channel data from the multi-directional cutting force signal through CNN, uses LSTM to capture the long-range correlation and non-linear dynamic characteristics of the sequence data from continuous time-series data, and introduces an attention mechanism Attention to dynamically assign weights to different features, improving the convergence speed and generalization performance of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] To make the objectives, technical solutions, and beneficial effects of the present invention clearer, the following drawings are provided for the description of the present invention:
[0044] Figure 1 is the flow chart of the milling surface residual stress prediction method driven by the mechanism and data fusion of the present invention;
[0045] Figure 2 is the network structure diagram of the CNN-LSTM-Attention model;
[0046] Figure 3 is the flow chart of optimizing the loss function coefficient γ using the asynchronous learning factor particle swarm optimization algorithm AsyLnCPSO. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0047] The following further describes the present invention in conjunction with the drawings and specific embodiments, so that those skilled in the art can better understand the present invention and implement it, but the embodiments given are not intended to limit the present invention.
[0048] As Figure 1 shown, the milling surface residual stress prediction method driven by the mechanism and data fusion in this embodiment includes the following steps:
[0049] Step 1: Data acquisition
[0050] Collect multi-channel data including milling process parameters and multiple cutting force signals, as well as experimental observations of the residual stress on the milled surface.
[0051] Step 2: Construct a prediction model for the residual stress on the milled surface (CNN-LSTM-Attention model)
[0052] As Figure 2 shown, the prediction model for the residual stress on the milled surface in this embodiment includes a Convolutional Neural Network (CNN) layer, a Long Short-Term Memory (LSTM) layer, and an Attention layer. The CNN layer is used to extract the signal data of the multi-channel data to reduce the interference of noise signals and non-discriminatory information and obtain more characteristic information of the residual stress on the surface. The LSTM layer is used to capture the long-range correlation and non-linear dynamic characteristics of the sequence data from the characteristic information of the residual stress on the surface. The Attention layer is used to dynamically assign weights to different features to improve the convergence speed and generalization performance of the model.
[0053] Specifically, during the milling process, multi-directional cutting force signals are collected by sensors. The cutting force signals contain noise signals and non-discriminatory information, and the different channel data including process parameters and multi-directional cutting force signals all contain state information characterizing the residual stress on the surface. Therefore, by using CNN to extract the signal data of multiple channels, the interference of noise signals and non-discriminatory information can be reduced, and more characteristic information of the residual stress on the surface can be obtained.
[0054] At the same time, the multi-directional cutting force signals collected during the milling process change continuously over time, and the characteristic of the residual stress on the surface hidden in the continuous signals also has the characteristics of time series. Therefore, by using LSTM to capture the long-range correlation and non-linear dynamic characteristics of the sequence data from the continuous time series data, it is beneficial to predict the residual stress on the milled surface at different times.
[0055] Furthermore, the influence degrees of the multi-directional cutting force signals and process parameters on the residual stress on the surface are different. Aiming at the problem that the CNN-LSTM model is prone to underfitting due to insufficient information extraction or information repetition when processing multi-channel spatio-temporal sequence data, the attention mechanism Attention is introduced to dynamically assign weights to different features to improve the convergence speed and generalization performance of the model.
[0056] Step 3: Construct a loss function based on the residual stress mechanism model;
[0057] To solve the generalization performance problem caused by insufficient labeled data under small samples and variable working conditions, the surface residual stress mechanism model is integrated into the loss function of the CNN-LSTM-Attention model. First, calculate the mechanical and thermal stress loads during the milling process, and calculate the mechanical stress distribution and thermal stress distribution according to the residual stress mechanism. In this embodiment, according to the Boussinesq equation in contact mechanics, the stress distribution under the calculated milling mechanical load is obtained:
[0058]
[0059]
[0060] where: σ x represents the stress component in the x direction; σ z represents the stress component in the z direction; τ xz represents the tangential stress in the xz direction; a and b are the boundaries of the loaded area; s is the distance between the contact element and the coordinate origin; p(s) and q(a) are stress distribution functions.
[0061] The thermal stress consists of three parts: the thermal stress caused by the body force, the surface tension caused by the temperature, and the hydrostatic pressure. Then the thermal stress distribution is:
[0062]
[0063] where: represents the thermal stress in the x direction; represents the thermal stress in the z direction; (x,z) represents the tangential thermal stress in the xz direction; α is the thermal diffusion coefficient; E represents the elastic modulus; v represents the Poisson's ratio; T represents the temperature distribution; t is the integration variable; p(t) represents the distribution function; G is the plane strain Green's function.
[0064] The stress at any point on the workpiece is the superposition of the mechanical stress and the thermal stress. The stress distribution of the workpiece is:
[0065] [σ] = [σ M + [σ T
[0066] where: [σ] represents the stress distribution; [σ M represents the mechanical stress distribution; [σ T represents the thermal stress distribution.
[0067] Aiming at the problems of insufficient generalization performance of surface residual stress under small samples and variable working conditions, and easy underfitting of the model, to improve the physical consistency of the prediction model, during the model training process, the mechanism model is incorporated into the loss function of the CNN-LSTM-Attention model. That is, in this embodiment, the loss function is constructed based on the consistency between the prediction results of the milling surface residual stress prediction model and the experimental observation values and the calculation results obtained based on the residual stress mechanism:
[0068] Loss=Loss D (Rs true ,Rs pre )+γLoss P (Rs phiz ,Rs pre )
[0069] Where: Loss represents the loss function; Rs true is the experimental observation value of the milling surface residual stress; Rs pre is the predicted value of the milling surface residual stress prediction model; Rs phiz is the calculated value obtained based on the residual stress mechanism; Loss D (Rs true ,Rs pre ) represents the consistency between the prediction result of the milling surface residual stress prediction model and the experimental observation result; Loss P (Rs phiz ,Rs pre ) represents the consistency between the prediction result of the milling surface residual stress prediction model and the calculated result obtained based on the residual stress mechanism; γ is the Loss P coefficient.
[0070] Step 4: Model training
[0071] Train the milling surface residual stress prediction model based on the constructed loss function, and optimize the coefficient γ using an optimization algorithm to obtain the optimal coefficient γ.
[0072] During the model training process, with the goal of minimizing Loss, it is expressed as:
[0073]
[0074] Where:
[0075]
[0076] Where: represents the consistency between the prediction result of the milling surface residual stress prediction model and the experimental observation result; It represents the consistency between the prediction results of the milling surface residual stress prediction model and the calculation results obtained based on the residual stress mechanism.
[0077] The coefficient γ affects the prediction accuracy of the model by changing the proportion of the deviation between the prediction results of the CNN-LSTM-Attention model and the real experimental data and the output of the mechanism model. To balance the magnitude of γ and prevent the deviation between the prediction model and the real data from increasing due to an overly large γ, resulting in a reduction in the prediction accuracy of the model; and an overly small γ leading to the inability of the prediction model to ensure a certain physical consistency, such that the model cannot fully learn the potential laws and characteristics of the change of residual stress with time-varying factors such as cutting force under small samples, resulting in a reduction in the generalization performance. Therefore, the magnitude of the coefficient γ is optimized.
[0078] The overall loss value Loss of the CNN-LSTM-Attention model in the test set test is used as the evaluation index for the coefficient γ. Considering that Loss test needs to be obtained through model training. To quickly obtain the optimal result, the particle swarm optimization algorithm PSO with high computational efficiency and strong fast search ability is selected to optimize the coefficient γ.
[0079] Aiming at the problem that the particle swarm optimization algorithm PSO is prone to falling into local optimum when dealing with complex optimization problems, further preferably, the asynchronous learning factor particle swarm optimization algorithm AsyLnCPSO is used to optimize the loss function coefficient γ. The optimization process is as Figure 3 shown.
[0080] Step Five: Prediction of Milling Surface Residual Stress
[0081] Multichannel data including milling process parameters and multiple cutting force signals are collected in real time, and the collected multichannel data are input into the constructed milling surface residual stress prediction model to obtain the predicted value of the milling surface residual stress.
[0082] The technical effects of the milling surface residual stress prediction method driven by the mechanism and data fusion of the present invention are described below in conjunction with specific examples.
[0083] 1. Aluminum Alloy Milling Processing Experimental Environment (Taking a Specific CNC Milling Machine as an Example)
[0084] To prove the milling surface residual stress prediction method driven by the mechanism and data fusion proposed in this embodiment, taking the milling processing experiment as an example, the equipment used in the experiment is shown in Table 1.
[0085] Table 1 Main Equipment Used in the Experiment
[0086]
[0087] The tool used in the aluminum alloy milling experiment is a solid carbide end mill with a diameter of 8 mm. The workpiece is 7075 aluminum alloy with dimensions of 50 mm × 20 mm × 20 mm. Dry cutting is used to mill the workpiece, and the cutting speed v, feed rate f, and cutting depth a p , and cutting width a e are selected as the objects. The orthogonal experimental design method is used to design the milling experiment group for aluminum alloy components. The orthogonal experimental parameter levels are set as shown in the following table. There are a total of 25 groups of milling experiments, and the specific milling experimental parameters are shown in Table 3. After the milling experiment is completed, the residual stress on the milling surface is obtained through the stress test system.
[0088] Table 2 Setting of orthogonal experimental parameter levels
[0089]
[0090] Table 3 Milling experimental parameters
[0091]
[0092]
[0093] 2. Performance of the residual stress prediction model
[0094] Combined with the cutting force data, an unlabeled dataset of residual stress is constructed. Combined with the small-sample labeled data of experimentally measured residual stress, a fused dataset of residual stress on the milling aluminum alloy surface is established. The entire dataset is divided into a training set and a test set in a ratio of 7:3. During the training process of the surface residual stress prediction model driven by mechanism and data fusion, the unlabeled data and the labeled data are combined through the residual stress mechanism model and the Loss function calculation formula. The prediction accuracy of the proposed method in the test set is 93.32%. To further illustrate the effectiveness of the method in this embodiment, the mean absolute error MAE and the root mean square error RMSE are selected as evaluation indicators, and the prediction results of the surface residual stress mechanism model and the CNN-LSTM-Attention model are compared. The results are shown in Table 4.
[0095] Table 4 Comparison of surface residual stress prediction results
[0096]
[0097] The above-described embodiments are only preferred embodiments given to fully illustrate the present invention, and the protection scope of the present invention is not limited thereto. Equivalent substitutions or transformations made by those skilled in the art on the basis of the present invention are all within the protection scope of the present invention. The protection scope of the present invention shall be subject to the claims.
Claims
1. A method for predicting residual stress on a milling surface driven by mechanism and data fusion, characterized in that: The steps include: Step 1: Data Collection Collect multi-channel data including milling process parameters and multiple cutting force signals as well as experimental observations of residual stress on the milled surface; Step 2: Constructing a prediction model for residual stress on milling surface The milling surface residual stress prediction model includes a convolutional neural network (CNN) layer, a long short-term memory (LSTM) layer and an attention layer; the convolutional neural network (CNN) layer is used to extract signal data from multi-channel data to reduce interference from noise signals and non-identification information and obtain more surface residual stress feature information; the long short-term memory (LSTM) layer is used to capture the long-range correlation and nonlinear dynamic characteristics of sequence data from the surface residual stress feature information; the attention layer is used to dynamically give weights to different features to improve the convergence speed and generalization performance of the model; Step 3: Construct loss function based on residual stress mechanism model; According to the residual stress mechanism, the mechanical stress distribution and thermal stress distribution are calculated respectively, and the stress at any point on the workpiece is the superposition of mechanical stress and thermal stress. The loss function is constructed based on the consistency between the prediction results of the milling surface residual stress prediction model and the experimental observation values and the calculation results based on the residual stress mechanism: Loss=Loss D (Rs true ,Rs pre )+γLoss P (Rs phiz ,Rs pre ) Among them: Loss represents the loss function; Rs true is the experimental observation value of the residual stress on the milling surface; Rs pre is the predicted value of the milling surface residual stress prediction model; Rs phiz is the calculated value based on the residual stress mechanism; LossD(Rs true ,Rs pre ) indicates the consistency between the prediction results of the milling surface residual stress prediction model and the experimental observation results; Loss P (Rs phiz ,Rs pre ) represents the consistency between the prediction results of the milling surface residual stress prediction model and the calculation results based on the residual stress mechanism; γ is Loss P coefficient; Step 4: Model training The milling surface residual stress prediction model is trained based on the constructed loss function, and the coefficient γ is optimized using an optimization algorithm to obtain the optimal coefficient γ; Step 5: Prediction of residual stress on milling surface Multi-channel data including milling process parameters and multiple cutting force signals are collected in real time, and the collected multi-channel data are input into the constructed milling surface residual stress prediction model to obtain the predicted value of the milling surface residual stress.
2. The method for predicting residual stress on a milling surface driven by mechanism and data fusion according to claim 1 is characterized in that: According to the Boussinesq equation in contact mechanics, the stress distribution under milling mechanical load is calculated: Where: x represents the stress component in the x direction; σ z represents the stress component in the z direction; τ xz represents the tangential stress in the xz direction; a and b are the boundaries of the loaded area; s is the distance between the contact element and the coordinate origin; p(s) and q(s) are stress distribution functions.
3. The method for predicting residual stress on a milling surface driven by mechanism and data fusion according to claim 1 is characterized in that: Thermal stress consists of three parts: thermal stress caused by body force, surface tension caused by temperature, and hydrostatic pressure. The distribution of thermal stress is: in: represents the thermal stress in the x-direction; represents the thermal stress in the z direction; (x,z) represents the thermal tangential stress in the xz direction; α is the thermal diffusion coefficient; E represents the elastic modulus; v represents the Poisson's ratio; T represents the temperature distribution; t represents the integral variable; p(t) represents the distribution function; and G represents the plane strain Green's function.
4. The method for predicting residual stress on a milling surface driven by mechanism and data fusion according to claim 1 is characterized in that: The stress distribution of the workpiece is: [s]=[s] M ]+[s T ] Where: [σ] represents the stress distribution; [σ M ] represents the mechanical stress distribution; [σ T ] represents the thermal stress distribution.
5. The method for predicting residual stress on a milling surface driven by mechanism and data fusion according to claim 1 is characterized in that: During the model training process, the goal is to minimize Loss, which is expressed as: in: in: It shows the consistency between the prediction results of the milling surface residual stress prediction model and the experimental observation results; It shows the consistency between the prediction results of the milling surface residual stress prediction model and the calculation results based on the residual stress mechanism.
6. The method for predicting residual stress on a milling surface driven by mechanism and data fusion according to claim 1 is characterized by: The particle swarm optimization algorithm PSO is used to optimize the coefficient γ.
7. The method for predicting residual stress on a milling surface driven by mechanism and data fusion according to claim 6 is characterized by: The particle swarm optimization algorithm AsyLnCPSO with asynchronous learning factor is used to optimize the loss function coefficient γ.
Citation Information
Patent Citations
Surface residual stress monitoring method based on machine tool energy consumption
CN114036847B
Grinding residual stress prediction model establishment method based on maximum abrasive particle cutting depth and neural network
CN116611325A