Method for predicting surface quality of workpiece milled by micro-texture ball-end milling cutter under heat-assisted laser
By establishing the BO-Transformer-LSTM regression analysis model, the problems of unstable noise reduction and poor decomposition accuracy of workpiece surface quality prediction in the prior art are solved, and efficient prediction of the surface roughness of titanium alloy workpieces are achieved, and the stability and quality of the processing process are improved.
Patent Information
- Application Number
- CN202510406390.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2025-08-15
Smart Images

Figure CN120492830A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method for predicting the surface quality of a workpiece milled by a ball-end milling cutter, and belongs to the technical field of surface quality prediction. Background Art
[0002] With the rapid development of aerospace, medical equipment and high-end manufacturing industries, titanium alloys are widely used in the above fields due to their excellent mechanical properties, corrosion resistance and high temperature resistance. Due to the high strength and low thermal conductivity of titanium alloys, the milling force and milling temperature during processing are high, and the tool wear is serious, which directly affects the surface quality of the workpiece, resulting in problems such as reduced production efficiency and increased processing costs. Studies have found that inserting micro-textures on the tool surface can reduce the tool-chip contact area, capture impurities such as abrasive particles and chips, and significantly reduce the cutting force and cutting temperature, thereby improving the tool cutting performance and enhancing the workpiece surface quality. However, during the laser processing process to prepare micro-textures, problems such as remelting layer stacking, microcracks, and residual stress concentration will occur around and inside the texture. Therefore, heat-assisted processing technology is used to reduce the remelting layer stacking, inhibit the growth of microcracks, and avoid residual stress concentration.
[0003] Workpiece surface roughness is a key indicator of machining quality and performance, primarily because it directly impacts a workpiece's friction, wear, lubrication, and sealing properties. Predicting workpiece surface quality using vibration signals is a common method, but existing surface quality prediction methods often suffer from unstable noise reduction, poor decomposition accuracy, and low prediction accuracy.
[0004] Therefore, it is urgent to propose a method to predict the surface quality of workpieces milled by micro-textured ball-end milling cutters under thermal-assisted laser to solve the above technical problems. Summary of the Invention
[0005] To address the aforementioned issues, a method for predicting the surface quality of workpieces milled with a micro-textured ball-end milling cutter using a thermally assisted laser is provided. A brief overview of the invention is provided below to provide a basic understanding of certain aspects of the invention. It should be understood that this overview is not an exhaustive overview of the invention. It is not intended to identify key or important aspects of the invention, nor is it intended to limit the scope of the invention.
[0006] The technical solution of the present invention:
[0007] A method for predicting the surface quality of a workpiece milled by a micro-textured ball-end milling cutter under thermally assisted laser processing comprises the following steps:
[0008] Step 1: Data processing;
[0009] Step 2: Convert the normalized data into cell array format;
[0010] Step 3: Define the optimization goal. In Bayesian optimization, BOFunction completes model training and validation internally and returns the loss value.
[0011] Step 4: Define the hyperparameter search space, including the number of neurons in the LSTM layer, the initial learning rate, and the L2 regularization coefficient;
[0012] Step 5: Perform Bayesian optimization to find parameters and extract the optimal parameter values from the optimization results;
[0013] Step 6: Build a model suitable for deep learning of time series forecasting;
[0014] Step 7. Set training options;
[0015] Step 8. Use the trainNetwork function to train the model and use the trained model to predict the training set and test set;
[0016] Step 9: Denormalize the prediction results to restore them to the scale of the original data and convert the data into double precision type;
[0017] Step 10. Use the analyzeNetwork function to view the network structure of the model.
[0018] Preferably, step 1 comprises the following steps:
[0019] Step 1.1: Import the dataset.
[0020] Step 1.2: Dataset partitioning: Separate input features and output labels, divide the dataset into training and test sets, set the ratio of the training set to the total dataset, and use the randperm function to randomly shuffle the dataset.
[0021] Step 1.3: Calculate the number of training set samples and input feature dimensions;
[0022] Step 1.4: Use the mapminmax function to normalize the data of the training set and test set to the range [0,1].
[0023] Preferably: in step 1, the vibration signal obtained after SSA-VMD-SE noise reduction by the multi-physical field signal acquisition device is detected by a rotary dynamometer, a thermal imager, a noise sensor, and an acceleration sensor to detect the original signal and transmit it to the data acquisition system. Vibration monitoring uses a three-axis acceleration sensor installed at a key position of the spindle box. Noise collection uses a high-precision sound level meter, which is arranged 500 mm away from the processing area; all sensor signals are recorded in real time by the data acquisition system to ensure that the dynamic characteristics of the processing process can be fully captured.
[0024] Preferably: In step 4, when defining the hyperparameter search space of the LSTM model, the number of neurons in the LSTM layer, the initial learning rate, and the L2 regularization coefficient are specifically defined as follows:
[0025] The number of neurons in the LSTM layer is 50-200 (integer), the optimization range of the initial learning rate is [0.001, 0.1], and the optimization range of the L2 regularization coefficient is set to [0.001, 0.1].
[0026] Preferably, step 6 includes:
[0027] Position encoding layer: adds position information to the input sequence data to enhance the model's perception of order;
[0028] Self-attention layer: captures global dependencies within the sequence;
[0029] Causal self-attention: Set 'AttentionMask' to 'causal' to prevent future information leakage during time series forecasting;
[0030] LSTM layer: extracts time series features and outputs the result of the last time step;
[0031] Residual connection: Add the input and the output of the positional encoding to alleviate the vanishing gradient problem.
[0032] Preferably, step 7 includes an optimization algorithm, a maximum number of training times, a gradient threshold, and a learning rate adjustment factor, wherein the optimization algorithm selects the Adam gradient descent algorithm; the maximum number of training times is 200 times; the gradient threshold is 1; and the learning rate adjustment factor is 0.1.
[0033] Preferably: in step 10, the root mean square error, coefficient of determination, mean absolute error, mean absolute percentage error, mean deviation error and mean square error of the training set and the test set are calculated and the results are displayed.
[0034] Preferably: before starting step 1, close the alarm message, close all open graphics windows, clear the workspace variables, and clear the command line window to create a clean environment for subsequent code execution.
[0035] Preferably, the method further includes step 11, drawing a graph, including a comparison graph of the prediction results of the training set and the test set, an error graph, and a linear fitting graph, for intuitively displaying the performance of the model.
[0036] Preferably: the surface quality prediction method of a workpiece milled by a micro-textured ball-end milling cutter under thermal-assisted laser processing is applied to the surface quality prediction of a titanium alloy workpiece milled by a micro-textured ball-end milling cutter under thermal-assisted laser processing.
[0037] The present invention has the following beneficial effects:
[0038] The present invention processes and predicts the surface roughness of the workpiece by establishing a BO-Transformer-LSTM regression analysis model. The vibration signal obtained after noise reduction processing has stable noise reduction and good decomposition accuracy. The training set determination coefficient and test set determination coefficient predicted by the BO-Transformer-LSTM regression analysis model can accurately predict the surface roughness of the workpiece, thereby ensuring the stability of the cutting process and the processing quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 The data of the workpiece surface roughness measured for the first time.
[0040] Figure 2 The data of the workpiece surface roughness measured for the first time.
[0041] Figure 3 The data of the workpiece surface roughness measured for the first time.
[0042] Figure 4 The data of the workpiece surface roughness measured for the first time.
[0043] Figure 5 Diagram of the equipment required for milling vibration signal acquisition.
[0044] Figure 6 This is the flow chart of the Transformer-LSTM model.
[0045] Figure 7 This is the effect diagram of the real value training set.
[0046] Figure 8 This is the effect diagram of the real value test set. DETAILED DESCRIPTION
[0047] To make the objectives, technical solutions, and advantages of the present invention more clearly apparent, the present invention is described below using specific embodiments shown in the accompanying drawings. However, it should be understood that these descriptions are merely illustrative and are not intended to limit the scope of the present invention. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present invention.
[0048] Specific implementation method 1: Combination Figure 1-8 This embodiment describes a method for predicting the surface quality of a workpiece milled by a micro-textured ball-end milling cutter under thermally assisted laser processing, comprising the following steps:
[0049] Step 1: Before processing the data in step 1, close the alarm information, close all open graphics windows, clear the workspace variables, and clear the command line window to create a clean environment for subsequent code execution before processing the data.
[0050] Step 1 includes the following steps:
[0051] Step 1.1: Import the dataset using Matlab's readmatrix function.
[0052] Step 1.2: Dataset partitioning: Separate input features and output labels. The input features are the dataset (vibration signal eigenvalues). The dataset is divided into a training set and a test set. The training set is set to account for 70% of the total dataset. The last column in the dataset is the output (surface roughness of the workpiece). The randperm function (a built-in function in Matlab) is used to randomly shuffle the dataset. This disrupts any possible sequential features, ensuring that the model learns real patterns and diversification, thereby improving training effectiveness.
[0053] Step 1.3: Calculate the number of training set samples and input feature dimensions;
[0054] Step 1.4: Use the mapminmax function (a tool for data normalization in Matlab) to normalize the data of the training set and test set to the range [0, 1]. Data normalization is to eliminate dimensional differences and accelerate model convergence. The test set must use the normalization parameters of the training set to avoid data leakage.
[0055] Step 2: Convert the normalized data into a cell array format. You can use the num2cell function to convert and verify it with the iscell function. This step is based on Matlab, and the data is flexible and manipulable.
[0056] Step 3: Define the optimization objective. In Bayesian optimization, BOFunction (optimization function objective) completes model training and validation internally and returns the loss value (such as RMSE); thus reducing the loss during prediction.
[0057] Step 4. Define the hyperparameter search space, including the number of neurons in the LSTM layer (NumOfUnits), the initial learning rate (InitialLearnRate), and the L2 regularization coefficient (L2Regularization);
[0058] In step 4, when defining the hyperparameter search space of the LSTM model, the number of neurons in the LSTM layer, the initial learning rate, and the L2 regularization coefficient are key hyperparameters. Their value ranges and data types need to be clearly defined. The specific definitions are:
[0059] The number of neurons in the LSTM layer is 50-200 (integer), the optimization range of the initial learning rate is [0.001, 0.1], and the optimization range of the L2 regularization coefficient is set to [0.001, 0.1]. The present invention selects a specific range based on the complexity of the task to avoid fitting problems, achieves a balance between complexity and required performance when building the model, stabilizes training, improves training efficiency and prediction accuracy, and realizes the most appropriate parameters for predicting the surface roughness of the workpiece;
[0060] Step 5: Execute the Bayesian optimization library to find the hyperparameters of the LSTM model, extract the optimal parameter values from the optimization results, and achieve the best surface roughness prediction performance; extract the optimal parameters;
[0061] Step 6: Build a model suitable for deep learning of time series forecasting;
[0062] Step 6 includes:
[0063] Position encoding layer (positionEmbeddingLayer): adds position information to the input sequence data to enhance the model's perception of order;
[0064] Self-attention layer: captures global dependencies within the sequence;
[0065] Causal self-attention ('AttentionMask', 'causal'): Set 'AttentionMask' to 'causal' to prevent future information leakage during time series forecasting;
[0066] LSTM layer: further extracts time series features and outputs the results of the last time step;
[0067] Residual connection: The input and the output of the positional encoding are added together through the addition layer (implementing the residual connection operation layer) to alleviate the vanishing gradient problem. This invention creatively combines the above components to effectively handle the complex dynamic behavior in time series data, and their combined effects improve prediction performance.
[0068] Step 7. Set training options;
[0069] In step 7, the optimization algorithm, maximum number of training times, gradient threshold, and learning rate adjustment factor are included. The optimization algorithm selects the Adam gradient descent algorithm; the maximum number of training times is 200 times; the gradient threshold is 1; and the learning rate adjustment factor is 0.1.
[0070] Step 8. Use the trainNetwork function (a function in Matlab's built-in deep learning toolbox) to build and train the model, and use the trained model to predict the training set and test set. The training process is simple and easy, with a high degree of automation.
[0071] Step 9: Denormalize the prediction result to restore it to the scale of the original data and convert the data into double precision type; the predicted value of the workpiece surface roughness can be obtained;
[0072] Step 10. Use the analyzeNetwork function (analyze and visualize the structure of neural networks in Matlab) to view the network structure of the model, which further improves the accuracy of the workpiece surface roughness prediction;
[0073] In step 10, the root mean square error (RMSE), coefficient of determination (R2), mean absolute error (MAE), mean absolute percentage error (MAPE), mean bias error (MBE), and mean square error (MSE) of the training set and test set are calculated and displayed;
[0074] It also includes step 11, drawing graphs, including a comparison graph of the prediction results of the training set and the test set, an error graph, and a linear fit graph, to intuitively demonstrate the performance of the model.
[0075] The surface quality prediction method of workpieces milled by micro-textured ball-end milling cutters under thermal-assisted laser processing is applied to the surface quality prediction of titanium alloy workpieces milled by micro-textured ball-end milling cutters under thermal-assisted laser processing; the present invention takes thermal-assisted laser processing of textured carbide ball-end milling cutters as the object, builds a milling and performance testing test platform, and obtains the vibration signal after SSA-VMD-SE denoising; finally, a BO-Transformer-LSTM regression analysis model is established to predict the surface roughness of the workpiece. The vibration signal obtained after denoising solves the problems of unstable denoising and poor decomposition accuracy. The training set determination coefficient and test set determination coefficient predicted by the BO-Transformer-LSTM regression analysis model can accurately predict the surface roughness of the workpiece, thereby ensuring the stability of the cutting process and the processing quality.
[0076] Example 1:
[0077] Combine Figure 1-8 As shown in the figure, the surface quality prediction method of the workpiece milled by a micro-textured ball-end milling cutter under thermal-assisted laser processing is applied to the surface quality prediction of the titanium alloy workpiece milled by a micro-textured ball-end milling cutter under thermal-assisted laser processing. The material of the cemented carbide ball-end milling cutter is YG8; the material of the titanium alloy milled is Ti6Al4V; the composite coating preparation process of the cemented carbide surface is carried out using AlSiTiN and AlCrN;
[0078] The experimental parameters shown in Table 1 were designed. A total of 28 parameter combinations were designed, involving the following three types of variables: laser parameters, tool texture parameters, and thermal assist parameters. Each parameter combination corresponds to a 15,000 mm continuous cutting experiment using a dedicated carbide tool. During the experiment, a three-axis accelerometer was used to collect milling vibration signals in real time. All tools used the same base material to ensure parameter comparability.
[0079] Table 1 Tool test parameters
[0080]
[0081]
[0082] The VDL-1000E three-axis vertical machining center is used for milling processing. The equipment configuration is as follows: Figure 5 As shown in the figure, a segmented processing strategy is implemented during the milling process. The processing is paused after each predetermined cutting length is completed. The surface roughness measuring instrument is used to detect the surface morphology of the workpiece. The surface roughness distribution characteristics obtained are shown in the figure. Figures 1 to 4 As shown, the experimental system is equipped with a multi-physics field signal acquisition device;
[0083] The vibration signal is obtained through the multi-physics field signal acquisition device after SSA-VMD-SE noise reduction. The rotational dynamometer can be used to measure the force of the rotating textured carbide ball-end milling cutter during the processing. The thermal imager is used to detect the temperature distribution of the textured carbide ball-end milling cutter during the processing. The noise sensor can collect the noise signal during the processing. The acceleration sensor can measure the vibration acceleration of the textured carbide ball-end milling cutter during processing. The collected data is transmitted to the data acquisition system. The vibration monitoring uses a three-axis acceleration sensor installed at a key position of the spindle box. The noise is collected using a high-precision sound level meter, which is arranged 500mm away from the processing area. All sensor signals are recorded in real time by the data acquisition system to ensure that the dynamic characteristics of the processing process can be fully captured.
[0084] The collected milling vibration signals include three directions: X, Y, and Z. This experiment preprocesses the X-axis milling vibration signal;
[0085] The 26 sets of characteristic values after filtering are used as input values, and the measured surface roughness of the workpiece is used as output value. Each workpiece is collected four times, and 112 sets of data are obtained;
[0086] In the BO-Transformer-LSTM regression model prediction, 70% of the samples in the dataset are randomly selected for training and the remaining 30% are used for testing.
[0087] like Figure 6The figure shows a deep learning model that integrates LSTM (Long Short-Term Memory) and Transformer structures. The input layer includes multiple input data "X1" as initial information.
[0088] The LSTM layer includes multiple "LSTMs" corresponding to "X1" to receive input data and extract time series features in the sequence.
[0089] Transformer Encoder Layer is the Transformer encoder layer, including:
[0090] Multi-Head Attention: Capture input sequence information by working simultaneously with multiple attention heads;
[0091] Add&Norm (residual connection and normalization): The input and the output of the attention mechanism are added to alleviate the gradient vanishing problem, making the model training more stable;
[0092] Feed Forward (Feedforward Neural Network): Performs nonlinear transformation on the data processed by the attention mechanism to further extract features; performs residual connection and normalization through "Add&Norm" again.
[0093] Linear (fully connected layer): performs linear transformation on the features output by the Transformer Encoder Layer and adjusts the feature dimension to adapt to subsequent tasks;
[0094] Softmax (for machine learning of multi-classification problems): converts Linear output into a probability distribution and outputs the predicted probability;
[0095] Output: The final output model prediction results.
[0096] from Figure 7 It can be seen that the model performs well on the training set (Rc 2 ≈0.98, RMSE≈0.0059), the predicted values are highly consistent with the true values, indicating that the model fits the training data very well, and the RMSE value is extremely low, indicating that the prediction deviation of the model on the training set is very small;
[0097] from Figure 8 As can be seen from the test set effect diagram, the model performs well on unseen data (Rp 2 ≈0.98, RMSE≈0.0066), with industrial-grade prediction capabilities, further verifying the model's performance in extreme values, real-time performance, robustness, etc., and continuously monitoring performance degradation in the production environment; Figure 8 and Figure 7It can be seen that the performance of the training set and the test set is highly consistent, the model is not overfitted, and is suitable for actual deployment.
[0098] It should be noted that in the above embodiments, as long as the technical solutions are not contradictory, they can be permuted and combined. Those skilled in the art can exhaust all possibilities based on the mathematical knowledge of permutations and combinations. Therefore, the present invention will no longer describe the technical solutions after permutations and combinations one by one, but it should be understood that the technical solutions after permutations and combinations have been disclosed by the present invention.
[0099] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A method for predicting the surface quality of workpieces milled with a micro-textured ball-end milling cutter under thermally assisted laser processing, characterized by: The following steps are involved: Step 1: Data processing; Step 2: Convert the normalized data into cell array format; Step 3: Define the optimization goal. In Bayesian optimization, BOFunction completes model training and validation internally and returns the loss value. Step 4: Define the hyperparameter search space, including the number of neurons in the LSTM layer, the initial learning rate, and the L2 regularization coefficient; Step 5: Perform Bayesian optimization to find parameter combinations and extract the optimal parameter values from the optimization results; Step 6: Build a model suitable for deep learning of time series forecasting; Step 7. Set training options; Step 8. Use the trainNetwork function to train the model and use the trained model to predict the training set and test set; Step 9: Denormalize the prediction results to restore them to the scale of the original data and convert the data into double precision type; Step 10. Use the analyzeNetwork function to view the network structure of the model.
2. The method for predicting the surface quality of a workpiece milled with a ball-end milling cutter using a thermally assisted laser is according to claim 1, characterized in that: Step 1 includes the following steps: Step 1.1: Import the dataset. Step 1.2: Dataset partitioning: Separate input features and output labels, divide the dataset into training and test sets, set the ratio of the training set to the total dataset, and use the randperm function to randomly shuffle the dataset. Step 1.3: Calculate the number of training set samples and input feature dimensions; Step 1.4: Use the mapminmax function to normalize the data of the training set and test set to the range [0,1].
3. The method for predicting the surface quality of a workpiece milled with a micro-textured ball-end milling cutter using a thermally assisted laser according to claim 2, characterized in that: In step 1, the vibration signal obtained after SSA-VMD-SE noise reduction by the multi-physics field signal acquisition device is detected by the rotational dynamometer, thermal imager, noise sensor, and acceleration sensor, and the initial information is transmitted to the data acquisition system. Vibration monitoring uses a three-axis acceleration sensor installed at a key position of the spindle box, and noise collection uses a high-precision sound level meter, which is arranged 500 mm away from the processing area. All sensor signals are recorded in real time by the data acquisition system to ensure that the dynamic characteristics of the processing process can be fully captured.
4. The method for predicting the surface quality of a workpiece milled with a micro-textured ball-end milling cutter using a thermally assisted laser according to claim 2, characterized in that: In step 4, when defining the hyperparameter search space of the LSTM model, the number of neurons in the LSTM layer, the initial learning rate, and the L2 regularization coefficient are specifically defined as: The number of neurons in the LSTM layer is 50-200 (integer), the optimization range of the initial learning rate is [0.001, 0.1], and the optimization range of the L2 regularization coefficient is set to [0.001, 0.1].
5. The method for predicting the surface quality of a workpiece milled with a ball-end milling cutter using a thermally assisted laser according to claim 4, characterized in that: Step 6 includes: Position encoding layer: adds position information to the input sequence data to enhance the model's perception of order; Self-attention layer: captures global dependencies within the sequence; Causal self-attention: Set 'AttentionMask' to 'causal' to prevent future information leakage during time series forecasting; LSTM layer: extracts time series features and outputs the result of the last time step; Residual connection: Add the input and the output of the positional encoding to alleviate the vanishing gradient problem.
6. The method for predicting the surface quality of a workpiece milled with a micro-textured ball-end milling cutter using a thermally assisted laser according to claim 5, characterized in that: Step 7 includes the optimization algorithm, maximum number of training times, gradient threshold, and learning rate adjustment factor. The optimization algorithm selects the Adam gradient descent algorithm; the maximum number of training times is 200 times; the gradient threshold is 1; and the learning rate adjustment factor is 0.
1.
7. The method for predicting the surface quality of a workpiece milled with a micro-textured ball-end milling cutter using a thermally assisted laser according to claim 6, characterized in that: In step 10, the root mean square error, coefficient of determination, mean absolute error, mean absolute percentage error, mean deviation error, and mean square error of the training set and test set are calculated and displayed.
8. The method for predicting the surface quality of a workpiece milled with a micro-textured ball-end milling cutter using a thermally assisted laser according to claim 7, characterized in that: Before starting step 1, close the warning message, close all open graphics windows, clear the workspace variables, and clear the command line window to create a clean environment for subsequent code execution.
9. The method for predicting the surface quality of a workpiece milled with a micro-textured ball-end milling cutter using a thermally assisted laser according to claim 7, characterized in that: It also includes step 11, drawing graphs, including a comparison graph of the prediction results of the training set and the test set, an error graph, and a linear fit graph, to intuitively demonstrate the performance of the model.
10. The method for predicting the surface quality of a workpiece milled with a micro-textured ball-end milling cutter using a thermally assisted laser according to any one of claims 1 to 9, characterized in that: The surface quality prediction method of workpiece milled with micro-textured ball-end milling cutter under thermal-assisted laser processing is applied to the surface quality prediction of titanium alloy workpiece milled with micro-textured ball-end milling cutter under thermal-assisted laser processing.