Method and system for predicting thread grinding force based on random forest algorithm
The grinding force prediction model is constructed through the random forest algorithm with adaptive weight adjustment, which solves the problem of insufficient grinding force calculation accuracy, realizes efficient and accurate grinding force prediction, optimizes grinding parameters, improves processing efficiency and quality, and reduces production costs.
Patent Information
- Application Number
- CN202510338033.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-07-25
AI Technical Summary
The existing grinding force calculation methods have limited accuracy when facing variable processing conditions. Traditional methods cannot cover all processing conditions and parameter ranges, resulting in large deviations in grinding values. Machine learning algorithms such as BP neural networks and support vector machines are prone to overfitting or noise-sensitive when training data is insufficient or structure is complex.
The random forest algorithm with adaptive weight adjustment is adopted to build a random forest model through data collection and preprocessing, and use multi-source information during the grinding process to select feature parameters for training, generate training sets, reduce the risk of overfitting, and improve the robustness and accuracy of the model.
Accurate prediction of thread grinding force is achieved, processing efficiency and quality is improved, workpiece damage and grinding wheel wear is reduced, grinding processing is supported, grinding parameters are optimized to reduce production costs.
Smart Images

Figure CN120372430A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of machining, and relates to a method and system for predicting thread grinding force based on a random forest algorithm. Background Art
[0002] Thread grinding in planetary roller screw pairs is a very important process. Accurate prediction of grinding force is of great significance for improving machining efficiency and reducing energy consumption. Traditional grinding force calculations are carried out by methods such as building theoretical models or empirical formulas. When facing changing machining conditions, since the grinding process involves multiple complex factors, such as grinding depth, cutting speed, workpiece movement speed, grinding wheel characteristics (such as grain size, hardness, binder), and cooling conditions, the interaction between these factors makes the calculation of grinding force extremely complex, resulting in large numerical deviations and limited accuracy in grinding. In empirical formulas, the grinding force has a power function relationship with grinding parameters (grinding wheel linear speed, feed speed, grinding depth), and a large amount of experimental data is required to fit the coefficients. Moreover, it is limited to the three grinding elements and cannot cover all machining conditions and parameter ranges, leading to deviations in actual applications.
[0003] In recent years, machine learning algorithms have been increasingly widely used in the field of prediction. They have advantages such as high efficiency, adaptability, and flexibility in predicting data. In particular, non-linear models such as neural networks and support vector machines can learn non-linear relationships in data, which makes them have better effects in predicting complex and non-linear pattern data.
[0004] The training process of the BP neural network algorithm is relatively long and requires a large amount of data and computing resources. If the training data is not sufficient or the model structure is too complex, the BP neural network is prone to overfitting. The support vector machine algorithm performs well in processing high-dimensional data, but is sensitive to noise or outliers, which will have a certain impact on the prediction results. Summary of the Invention
[0005] The technical problem to be solved by the present invention is: The present invention proposes a method and system for predicting thread grinding force based on a random forest algorithm with adaptive weight adjustment. Through steps such as data collection and preprocessing, and optimization and construction of the random forest algorithm model, accurate prediction of thread grinding force is achieved.
[0006] The technical solution adopted by the present invention is: A method for predicting thread grinding force based on a random forest algorithm, including:
[0007] Collect relevant parameters X1, X2, ……, X m during the thread grinding process and the corresponding generated grinding force Y to generate a grinding parameter dataset where X mnDenote the parameter X during the nth grinding process m as the experimental data value; both m and n are positive integers;
[0008] Normalize the data in the grinding parameter dataset to eliminate the dimensions of different parameters;
[0009] Select characteristic parameters from parameters X1, X2, ……, X m and retain the normalized experimental data values corresponding to the characteristic parameters to generate a training set;
[0010] Construct a random forest model and use the training set to train the random forest model;
[0011] Save the trained random forest model, input the thread grinding parameters to be predicted into the trained random forest model, and the random forest model calculates the predicted value of the grinding force according to the input thread grinding parameters.
[0012] Furthermore, the normalization processing of the data in the grinding parameter dataset includes:
[0013] Select the maximum value X 1max 、X 2max ……X mmax for each column of the grinding parameter dataset, and compare each column of data with the maximum value of each column to obtain the normalized value:
[0014]
[0015] Furthermore, the characteristic parameters include: grinding depth, feed rate, and wheel linear speed.
[0016] A system for predicting thread grinding force based on the random forest algorithm, comprising:
[0017] A data acquisition and preprocessing module, used to collect relevant parameters X1, X2, ……, X m during the thread grinding process and the generated grinding force Y to generate a grinding parameter dataset wherein, X mn denotes the experimental data value of parameter X during the nth grinding process m ; both m and n are positive integers; normalize the data in the grinding parameter dataset to eliminate the dimensions of different parameters;
[0018] A feature extraction module, used to select characteristic parameters from parameters X1, X2, ……, X m and retain the normalized experimental data values corresponding to the characteristic parameters to generate a training set;
[0019] A model construction module for constructing a random forest model, training the random forest model using a training set, and obtaining a trained random forest model.
[0020] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0021] A device for predicting thread grinding force based on a random forest algorithm, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above method are implemented.
[0022] The advantages of the present invention compared with the prior art are as follows:
[0023] 1. The present invention constructs a grinding force prediction model using a random forest algorithm, which can make full use of multi-source information in the thread grinding process and improve the accuracy of prediction. Compared with traditional prediction methods, such as empirical formulas or simple linear regression models, the present invention can more directly reflect the relationship between grinding parameters and grinding force, thereby providing more reliable prediction results.
[0024] 2. The present invention uses a random forest algorithm to build multiple decision trees and perform ensemble learning, which can effectively reduce the overfitting risk of a single model and improve the robustness of the overall model. This means that even in the face of data noise or outliers, the present invention can still maintain stable prediction performance and provide more reliable guidance for thread grinding processing.
[0025] 3. Through the grinding force prediction method provided by the present invention, the grinding force prediction values under different combinations of grinding parameters can be quickly obtained. This helps to optimize the grinding parameters, find the best processing conditions, thereby improving the efficiency and quality of grinding processing. At the same time, this also provides strong support for the automation and intelligence of thread grinding processing.
[0026] 4. By improving the accuracy of grinding force prediction and optimizing the grinding parameters, the present invention helps to reduce problems such as workpiece damage and grinding wheel wear caused by excessive grinding force, thereby reducing production costs. In addition, by optimizing the grinding parameters, the processing efficiency can also be improved, further reducing production costs. Description of the Drawings
[0027] Figure 1 is a schematic diagram of the random forest algorithm based on the present invention;
[0028] Figure 2 is a schematic flowchart of the random forest algorithm based on the present invention. Detailed Embodiments
[0029] The present invention will be described with reference to the accompanying drawings.
[0030] The principle of the random forest algorithm is as Figure 1 shown, and the specific detailed flowchart of the present invention is as Figure 2 shown.
[0031] A method for predicting the grinding force of threads based on the random forest algorithm, the method comprising the following steps:
[0032] 1. Data acquisition and preprocessing
[0033] Collect the relevant parameters involved in the thread grinding process and the grinding force generated during the corresponding process. The relevant parameters include grinding speed, feed speed, wheel type, etc., represented by X1, X2... X m For example, taking the first column as an example, the specific numerical values of the grinding parameters are represented by X 11 , X 12 ... X 1n , and the grinding force result is represented by Y. Preprocess the data, that is, perform normalization processing on the data to eliminate the dimensional differences between different parameters. Both m and n are positive integers.
[0034]
[0035] Select the maximum value of each column, denoted as X 1max , X 2max ... X mmax , and divide each column of data by the maximum value of each column to obtain the normalized value.
[0036]
[0037] 2. Feature selection and extraction:
[0038] According to the characteristics and experience of thread grinding, select the characteristic parameters that have a significant impact on the grinding force, with the aim of screening and optimizing the feature set. Generally, the grinding depth, feed speed, and wheel line speed are selected as the characteristic parameters in grinding, and the experimental data of these three items after normalization processing are retained.
[0039] 3. Construct a random forest model:
[0040] Use the data after preprocessing and feature extraction as the training set to construct a random forest model. During the model construction process, the parameters of the random forest - the number of decision trees and the minimum number of leaves - determine the performance of the model. More trees can improve the stability and accuracy of the model, but will increase the training time. The minimum number of leaves controls the growth of the tree. A smaller value may lead to overfitting, and a larger value may cause a large deviation in the model. Adjust adaptively according to the size of the data.
[0041] Number of decision trees:
[0042] tree = n + 80 * e^(-0.015 * m * n)
[0043] Minimum number of leaves:
[0044] leaf = 1, (n / m < 1000)
[0045] 2, (n / m > 1000)
[0046] 4. Grinding force prediction:
[0047] Save the trained random forest model, and input the thread grinding parameters to be predicted into the trained random forest model. The model calculates the predicted value of the grinding force according to the input parameters and outputs the prediction result to provide guidance for thread grinding.
[0048] A system for predicting thread grinding force based on the random forest algorithm, comprising:
[0049] A data acquisition and preprocessing module, used to acquire relevant parameters X1, X2, ……, X m during the thread grinding process and the corresponding generated grinding force Y, and generate a grinding parameter data set wherein, X mn represents the experimental data value of parameter X during the nth grinding process m ; m and n are both positive integers; normalize the data in the grinding parameter data set to eliminate the dimensions of different parameters;
[0050] A feature extraction module, used to select feature parameters from parameters X1, X2, ……, X m and retain the normalized experimental data values corresponding to the feature parameters to generate a training set;
[0051] A model construction module, used to construct a random forest model, and use the training set to train the random forest model to obtain the trained random forest model.
[0052] A computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0053] An apparatus for predicting thread grinding force based on the random forest algorithm, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above method are implemented.
[0054] Example:
[0055] The experimental data of the grinding force of nanocrystalline cemented carbide is shown in Table 1.
[0056] Table 1 Grinding Data
[0057]
[0058]
[0059] 1. Data collection and preprocessing:
[0060] The data in this study is from published literature, which is complete and accurate, so there is no need to remove outliers and missing values. Code is written to normalize the data to eliminate the dimensional differences between different parameters. Normalization is a common data preprocessing technique used to convert data with different ranges or dimensions to a unified scale. The maximum value of each column of data is determined, and the data in each column is linearly transformed to between 0 and 1. The normalized grinding data is organized into a table, as shown in Table 2.
[0061] Table 2 Grinding Data after Normalization
[0062]
[0063]
[0064] 2. Feature selection and extraction:
[0065] The workbench speed, grinding depth, and wheel line speed are used as feature parameters, which serve as the input variable source for predicting the grinding force results. If there are many elements that can be used as feature parameters, the column of feature parameters that has little or no influence on the grinding force can be removed.
[0066] 3. Construct a random forest model:
[0067] Randomly select 12 groups of data as training samples, and write and run the MATLAB program code. By calculation, set the number of decision trees to 50 and the minimum number of leaves to 1, and use the TreeBagger function in MATLAB to establish a random forest model. Save the trained network net and input ps_input in the workspace as net.mat and ps_input.mat and store them in the current path.
[0068] 4. Grinding force prediction:
[0069] Organize the data features to be predicted into a table, as shown in Table 3. Run the predict.m file to obtain the predicted grinding force results.
[0070] Table 3 Data Features to be Predicted
[0071] Grinding depth Feed rate Wheel surface speed 0.005 38 25 0.015 38 15
[0072] The obtained prediction results are organized into a table and compared with the prediction method used in the original literature, as shown in Table 4. It can be seen that the error between the values predicted by the random forest algorithm and the true values is smaller than the result predicted by the BP neural network.
[0073] Table 4 Comparison of prediction results
[0074]
[0075] The parts not detailed in the present invention belong to the well-known technologies in the art.
Claims
1. A method for predicting thread grinding force based on the random forest algorithm, characterized in that Including: Collect relevant parameters X1, X2, ……, X during the thread grinding process m and the corresponding generated grinding force Y to generate a grinding parameter data set where X mn represents the experimental data value of parameter X during the nth grinding process m ; m and n are both positive integers Normalize the data in the grinding parameter dataset to eliminate the dimension of different parameters; Select characteristic parameters from parameters X1, X2, ……, X m and retain the experimentally measured data values after normalization corresponding to the characteristic parameters to generate a training set; Construct a random forest model and use the training set to train the random forest model; Save the trained random forest model, input the thread grinding parameters to be predicted into the trained random forest model, and the random forest model calculates the predicted value of the grinding force according to the input thread grinding parameters.
2. The method for predicting the grinding force of a screw thread based on the random forest algorithm according to claim 1, wherein The normalization process of the data in the grinding parameter dataset includes: Select the maximum value X of each column of the grinding parameter data set 1max 、X 2max ……X mmax ,Compare each column of data with the maximum value of each column to obtain the normalized value:
3. A method for predicting the grinding force of threads based on the random forest algorithm according to claim 1, characterized in that The characteristic parameters include: grinding depth, feed speed, and grinding wheel linear speed.
4. A system for predicting the grinding force of threads based on the random forest algorithm, characterized in that, Including: Data acquisition and preprocessing module, which is used to collect relevant parameters X1, X2, ……, X m during the thread grinding process and the corresponding generated grinding force Y, and generate a grinding parameter dataset wherein, X mn represents the experimental data value of parameter X m during the nth grinding process; m and n are both positive integers; the data in the grinding parameter dataset is normalized to eliminate the dimensions of different parameters; A feature extraction module, which is used to select feature parameters from parameters X1, X2, ……, X m and retain the experimental data values after the corresponding normalization processing of the feature parameters to generate a training set; A model construction module for constructing a random forest model, using the training set to train the random forest model, and obtaining the trained random forest model.
5. A system for predicting thread grinding force based on the random forest algorithm according to claim 4, characterized in that, The normalization process of the data in the grinding parameter dataset includes: Select the maximum value X of each column in the grinding parameter data set 1max , X 2max ……X mmax , and compare each column of data with the maximum value of each column to obtain the normalized value:
6. The system for predicting the thread grinding force based on the random forest algorithm according to claim 5, wherein The characteristic parameters include: grinding depth, feed speed, and grinding wheel linear speed.
7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 3.
8. An apparatus for predicting the thread grinding force based on the random forest algorithm, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 3.