Training method and device of thermal error prediction model, storage medium and electronic equipment

By filtering temperature key point data and optimizing the structural parameters of the BiLSTM model using the weighted averaging algorithm, the problems of overfitting and local optimization of BiLSTM network during training are solved, the thermal error prediction accuracy is improved, and the long sequence dependence processing capability is achieved.

CN119988978APending Publication Date: 2025-05-13SHENYANG UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510127013.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-28
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

BiLSTM networks are prone to overfitting and local optimization problems during training, and when the data volume is small, it is difficult to effectively deal with long sequence dependencies, resulting in low thermal error prediction accuracy.

Method used

By obtaining the temperature data of the machine tool spindle, the temperature data is screened using principal component analysis method and random forest method to obtain temperature key point data, a data set is constructed, and the optimal structural parameters of the bidirectional long and short-term memory neural network model are determined using the weighted average algorithm to optimize the model training process.

Benefits of technology

It effectively solves the problems of overfitting and local optimization in the training process of BiLSTM network, improves the prediction accuracy of the thermal error prediction model, can better handle long sequence dependence, and improves the prediction effect of thermal error of machine tool spindles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119988978A_ABST
    Figure CN119988978A_ABST
Patent Text Reader

Abstract

The invention provides a training method and device of a thermal error prediction model, a storage medium and electronic equipment. The training method of the thermal error prediction model comprises the steps of obtaining temperature data of a machine tool spindle; screening the temperature data by adopting a principal component analysis method and a random forest method to obtain temperature key point data; constructing a data set based on the temperature key point data; determining an optimal structure parameter of the bidirectional long-short-term memory neural network model based on a weighted average algorithm; the data set is adopted to train the bidirectional long-short-term memory neural network model optimized according to the weighted average algorithm to obtain the thermal error prediction model, the problem that the BiLSTM network is prone to overfitting and local optimum in the training process is effectively solved, meanwhile, the thermal error prediction model obtained through training can better process long sequence dependence, and the thermal error prediction accuracy is improved. The prediction precision of the thermal error is improved, and the thermal error of the machine tool spindle can be better predicted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of error detection technology, and in particular to a training method, device, storage medium and electronic device for a thermal error prediction model. Background Art

[0002] With the continuous development of modern manufacturing, the demand for high-precision processing in various industries continues to grow, and the requirements for machine tool processing accuracy are becoming more and more stringent. A large number of studies have shown that thermal errors account for 40% to 70% of the overall error of machine tools, and the spindle is the main component of CNC machine tools. Therefore, establishing a high-precision thermal error prediction model to reduce the thermal error of the machine tool spindle is of great significance to improving the processing accuracy of CNC machine tools.

[0003] In the relevant technical solutions, a variety of prediction models are proposed to predict the thermal error of machine tool spindles. Although the current research on the prediction of thermal errors of CNC machine tool spindles has made certain progress, with the continuous improvement of CNC machine tool processing accuracy, the prediction problem of thermal errors of electric spindles still needs further in-depth exploration. Therefore, it is of great significance to construct a thermal error prediction model with higher prediction accuracy.

[0004] The bidirectional long short-term memory neural network (BiLSTM) is composed of a forward and reverse LSTM structure, which can simultaneously obtain the forward and backward information of the input sequence. Compared with the unidirectional LSTM, BiLSTM has stronger modeling capabilities and can capture more time series features. Compared with other conventional neural network models, BiLSTM effectively avoids the gradient vanishing and gradient exploding problems by introducing LSTM units, and can better handle long sequence dependencies, thereby improving the prediction accuracy of the model. However, due to its complex bidirectional structure, BiLSTM usually consumes more time during training, and is prone to overfitting and other problems when the amount of data is small. Summary of the invention

[0005] The present invention aims to at least solve the problems existing in the prior art or related art that BiLSTM usually consumes more time during the training process and is prone to overfitting when the amount of data is small.

[0006] To this end, a first aspect of the present invention is to provide a training method for a thermal error prediction model.

[0007] A second aspect of the present invention is to provide a training device for a thermal error prediction model.

[0008] A third aspect of the present invention provides a readable storage medium.

[0009] A fourth aspect of the present invention provides an electronic device.

[0010] In view of this, according to the first aspect of the present invention, the present invention provides a training method for a thermal error prediction model, including: obtaining temperature data of a machine tool spindle; using a principal component analysis method and a random forest method to screen the temperature data to obtain temperature key point data; constructing a data set based on the temperature key point data; determining the optimal structural parameters of a bidirectional long short-term memory neural network model based on a weighted average algorithm; and using the data set to train the bidirectional long short-term memory neural network model optimized according to the weighted average algorithm to obtain a thermal error prediction model.

[0011] The technical solution of the present invention proposes a training method for a thermal error prediction model. The thermal error prediction model trained by running the above-mentioned thermal error prediction model training method effectively solves the problems of overfitting and local optimality that are prone to occur in the BiLSTM network during the training process. At the same time, the proposed thermal error prediction model can better handle long sequence dependencies, improve the prediction accuracy of thermal errors, and thus better predict the thermal error of the machine tool spindle.

[0012] Specifically, when establishing a thermal error prediction model, too many temperature measurement points will cause the model to overfit, increase the complexity of the model, and thus reduce the prediction accuracy. Too few temperature measurement points will reduce the generalization ability of the model and fail to accurately capture the comprehensive impact of temperature changes on thermal errors.

[0013] Based on this, the principal component analysis method and random forest method are used to screen the temperature data, which can effectively reduce the dimension of the data and remove redundant features, thereby improving the calculation efficiency of the model.

[0014] In addition, the weighted average algorithm is used to determine the optimal structural parameters of the bidirectional long short-term memory neural network model, so that the trained thermal error prediction model shows better prediction effect, thereby improving the accuracy of the prediction.

[0015] In addition, the training method of the thermal error prediction model proposed in this application also has the following additional technical features.

[0016] In some technical schemes, optionally, the temperature data includes temperature variables collected from different temperature measurement points, and the temperature data is screened using a principal component analysis method and a random forest method to obtain temperature key point data, specifically including: based on the temperature data, determining the sample covariance and the sample correlation coefficient, the sample covariance is the covariance between the temperature variables at different temperature measurement points, and the sample correlation coefficient is the correlation coefficient between the temperature variables at different temperature measurement points; solving the correlation matrix determined by the sample correlation coefficient to determine the screening matrix; determining the principal component variables based on the screening matrix and the temperature data; solving the covariance matrix determined by the sample covariance to obtain a solution result; based on the solution result, determining a first matrix, the first matrix is ​​a matrix composed of target principal component variables, and the target principal component variables are principal component variables whose cumulative variance is greater than a first set value; performing dimensionality reduction processing on the temperature data based on the first matrix to obtain the reduced dimensionality data; based on the random forest model constructed by the random forest method, evaluating the reduced dimensionality data to determine the temperature key point data in the temperature data.

[0017] In this technical solution, the temperature key point data are screened out so that the bidirectional long short-term memory neural network model optimized according to the weighted average algorithm can be trained using the screened temperature key point data and the corresponding thermal error data to obtain a thermal error prediction model.

[0018] In this process, the principal component analysis method can be used to extract principal components from temperature data that can effectively reflect data characteristics, thereby reducing data redundancy and noise and improving data availability.

[0019] It means that the use of principal component analysis method can also effectively reduce the dimension of data and reduce the computational complexity of random forest model training.

[0020] In the above technical solution, the random forest method can be used to directly process the data after dimensionality reduction, evaluate its importance, and then filter out the temperature key point data from the temperature data.

[0021] In this process, the multicollinearity between multiple measurement points can be reduced, the dimension of the data can be reduced, and redundant features can be removed, thereby improving the calculation efficiency of the model.

[0022] In some technical schemes, optionally, the correlation matrix determined by the sample correlation coefficient is solved to determine the screening matrix, specifically including: solving the correlation matrix determined by the sample correlation coefficient to determine P eigenvalues ​​of the correlation matrix, where P is a positive integer; selecting the number of principal component variables based on the contribution rate of the temperature variable; determining the unit eigenvectors of the first M eigenvalues ​​based on the contribution rate of the temperature variable, where M is a positive integer less than or equal to P; and determining the screening matrix based on the unit eigenvectors of the first M eigenvalues ​​and the number of principal component variables.

[0023] In this technical solution, the correlation matrix determined by the sample correlation coefficient is solved so as to determine the number of principal component variables based on the P eigenvalues ​​obtained by the solution. After determining the number of principal component variables, a screening matrix can be directly constructed based on the unit eigenvectors of the first M eigenvalues ​​so as to use the screening matrix to process the temperature data and obtain the principal component variables.

[0024] In some technical solutions, optionally, a random forest model constructed based on the random forest method evaluates the data after dimensionality reduction to determine the temperature key point data in the temperature data, specifically including: using the random forest model constructed based on the random forest method to train the random forest model constructed based on the random forest method using the data after dimensionality reduction to obtain an evaluation result output by the random forest model, the evaluation result including the degree of influence of each target principal component variable on the temperature change of the machine tool spindle; based on the evaluation result, determining the temperature key point data in the temperature data.

[0025] In this technical solution, a random forest model constructed using the random forest method is used to evaluate the data after dimensionality reduction, so as to screen out the target principal component variables that have a greater impact on the temperature change of the machine tool spindle from the data after dimensionality reduction. Then, by tracing back to the original temperature measurement points, it is determined which measurement points have a significant impact on the temperature change of the machine tool spindle, and the key temperature measurement points are screened out for subsequent thermal error modeling.

[0026] In this process, the temperature key point data that has a significant impact on the temperature change of the machine tool spindle can be screened out from the temperature data, thereby reducing the redundancy and noise of the data and improving the availability of the data.

[0027] In some technical schemes, optionally, the optimal structural parameters of the bidirectional long short-term memory neural network model are determined based on a weighted average algorithm, specifically including: randomly generating a candidate solution matrix, wherein each candidate solution in the candidate solution matrix serves as a structural parameter; when the current number of iterations is less than or equal to the maximum number of iterations, calculating the weighted average position of the current race according to the fitness of each participant; determining the value of the mathematical expression of the candidate solution in the search phase based on the weighted average position; selecting a movement strategy or an exploration strategy based on the value of the mathematical expression of the candidate solution in the search phase to update the candidate solution; based on the updated candidate solution, updating the fitness of each participant; determining the optimal candidate solution based on the updated fitness of each participant and the global optimal position to obtain the optimal structural parameters.

[0028] In this technical solution, a weighted average algorithm can be used to solve the optimal structural parameters suitable for the bidirectional long short-term memory neural network model, so that the trained thermal error prediction model shows a better prediction effect.

[0029] Specifically, the weighted average algorithm is used to optimize the parameters of the bidirectional long short-term memory neural network model, which effectively solves the problems of overfitting and local optimality that easily occur in the training process of the bidirectional long short-term memory neural network model. It can better handle long sequence dependencies and improve the prediction accuracy of thermal errors.

[0030] In some technical solutions, optionally, the optimal candidate solution is determined based on the fitness of each participant after the update and the global optimal position to obtain the optimal structural parameters, specifically including: based on the fitness of each participant after the update being better than the fitness corresponding to the global optimal position, the updated candidate solution is taken as the optimal candidate solution; if the fitness of each participant after the update is not better than the fitness corresponding to the global optimal position, the candidate solution is updated until the current number of iterations after the update is greater than the maximum number of iterations.

[0031] In this technical solution, in the process of optimizing the parameters of the bidirectional long short-term memory neural network model using the weighted average algorithm, the fitness of each participant can be compared with the global optimal position when the number of iterations reaches the maximum number of iterations, thereby ensuring that the optimal structural parameters are found for the bidirectional long short-term memory neural network model, thereby solving the problem of overfitting and local optimality that the bidirectional long short-term memory neural network model is prone to during training, and can better handle long sequence dependencies and improve the prediction accuracy of thermal errors.

[0032] In some technical solutions, optionally, a data set is constructed based on temperature key point data, specifically including: obtaining thermal error data corresponding to the temperature key point data; associating the temperature key point data with the corresponding thermal error data as training samples in the data set; wherein the data set includes a training set and a test set, wherein the training set is used to train a bidirectional long short-term memory neural network model optimized according to a weighted average algorithm, and the test set is used to verify the trained thermal error prediction model.

[0033] According to the second aspect of the present invention, the present invention provides a training device for a thermal error prediction model, comprising: an acquisition unit for acquiring temperature data of a machine tool spindle; a screening unit for screening the temperature data using a principal component analysis method and a random forest method to obtain temperature key point data; a construction unit for constructing a data set based on the temperature key point data; a determination unit for determining the optimal structural parameters of a bidirectional long short-term memory neural network model based on a weighted average algorithm; and a training unit for training the bidirectional long short-term memory neural network model optimized according to the weighted average algorithm using the data set to obtain a thermal error prediction model.

[0034] In addition, the training device for the thermal error prediction model proposed in this application also has the following additional technical features.

[0035] In some technical schemes, optionally, the temperature data includes temperature variables collected from different temperature measurement points, and the screening unit is specifically used to: determine the sample covariance and the sample correlation coefficient based on the temperature data, the sample covariance is the covariance between the temperature variables at different temperature measurement points, and the sample correlation coefficient is the correlation coefficient between the temperature variables at different temperature measurement points; solve the correlation matrix determined by the sample correlation coefficient to determine the screening matrix; determine the principal component variables based on the screening matrix and the temperature data; solve the covariance matrix determined by the sample covariance to obtain a solution result; determine the first matrix based on the solution result, the first matrix is ​​a matrix composed of target principal component variables, and the target principal component variables are principal component variables whose cumulative variance is greater than a first set value; perform dimensionality reduction processing on the temperature data based on the first matrix to obtain the reduced dimensionality data; evaluate the reduced dimensionality data based on the random forest model constructed based on the random forest method to determine the temperature key point data in the temperature data.

[0036] In some technical schemes, optionally, the screening unit is specifically used to: solve the correlation matrix determined by the sample correlation coefficient to determine P eigenvalues ​​of the correlation matrix, where P is a positive integer; select the number of principal component variables based on the contribution rate of the temperature variable; determine the unit eigenvectors of the first M eigenvalues ​​based on the contribution rate of the temperature variable, where M is a positive integer less than or equal to P; determine the screening matrix based on the unit eigenvectors of the first M eigenvalues ​​and the number of principal component variables.

[0037] In some technical solutions, optionally, the screening unit is specifically used to: use the reduced-dimensional data to train a random forest model constructed based on the random forest method to obtain an evaluation result output by the random forest model, the evaluation result including the degree of influence of each target principal component variable on the temperature change of the machine tool spindle; based on the evaluation result, determine the temperature key point data.

[0038] In some technical schemes, optionally, the determination unit is specifically used to: randomly generate a candidate solution matrix, wherein each candidate solution in the candidate solution matrix serves as a structural parameter; when the current number of iterations is less than or equal to the maximum number of iterations, calculate the weighted average position of the current race according to the fitness of each participant; determine the value of the mathematical expression of the candidate solution in the search phase based on the weighted average position; select a movement strategy or an exploration strategy based on the value of the mathematical expression of the candidate solution in the search phase to update the candidate solution; based on the updated candidate solution, update the fitness of each participant; determine the optimal candidate solution based on the updated fitness of each participant and the global optimal position to obtain the optimal structural parameters.

[0039] In some technical solutions, optionally, the determination unit is specifically used to: based on the fitness of each participant after the update being better than the fitness corresponding to the global optimal position, take the updated candidate solution as the optimal candidate solution; if the fitness of each participant after the update is not better than the fitness corresponding to the global optimal position, update the candidate solution until the current number of iterations after the update is greater than the maximum number of iterations.

[0040] In some technical schemes, optionally, a construction unit is specifically used to: obtain thermal error data corresponding to temperature key point data; associate the temperature key point data with the corresponding thermal error data as training samples in a data set; wherein the data set includes a training set and a test set, wherein the training set is used to train a bidirectional long short-term memory neural network model optimized according to a weighted average algorithm, and the test set is used to verify the trained thermal error prediction model.

[0041] According to a third aspect of the present invention, the present invention provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, a training method for a thermal error prediction model as described above is implemented.

[0042] According to a fourth aspect of the present invention, the present invention provides an electronic device comprising a processor and a memory, wherein the memory stores programs or instructions that can be executed on the processor, and when the programs or instructions are executed by the processor, the steps of the training method of the thermal error prediction model as described above are implemented.

[0043] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] 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:

[0046] Figure 1 The flowchart of the traditional BiLSTM is shown;

[0047] Figure 2 A schematic flow chart of a method for training a thermal error prediction model in an embodiment of the present invention is shown;

[0048] Figure 3 A schematic diagram showing the distribution of temperature and displacement sensors in an embodiment of the present invention is shown;

[0049] Figure 4 A schematic diagram showing the temperature rise of each measuring point of the machine tool spindle in an embodiment of the present invention is shown;

[0050] Figure 5A schematic diagram showing an axial thermal error curve of a machine tool spindle in an embodiment of the present invention is shown;

[0051] Figure 6 A schematic diagram of temperature key point screening in an embodiment of the present invention is shown;

[0052] Figure 7 A schematic diagram showing the construction of a WAA-BiLSTM thermal error prediction model in an embodiment of the present invention is shown;

[0053] Figure 8 A schematic diagram showing thermal error prediction curves of different models in an embodiment of the present invention is shown;

[0054] Fig. 9 A schematic diagram showing thermal error residual curves of different models in an embodiment of the present invention is shown;

[0055] Fig.10 A schematic block diagram of a training device for a thermal error prediction model in an embodiment of the present invention is shown;

[0056] Fig.11 A schematic block diagram of an experimental device in an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0058] In order to more clearly understand the above aspects, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0059] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.

[0060] The following is an explanation of the terms mentioned in this application.

[0061] 1. Weighted average algorithm (WAA) is a new meta-heuristic algorithm proposed by Jun Cheng in 2024. In each iteration, the algorithm first establishes the weighted average position of the entire population. The WAA algorithm has a variety of exploration strategies and precise development strategies. The algorithm is highly compatible and can be combined with a variety of algorithms. It includes the following stages:

[0062] (1) Initialization phase:

[0063] In the initialization phase, a candidate solution matrix is ​​randomly generated , the formula is:

[0064]

[0065] in, is a random number between 0 and 1, and Respectively The next and previous term of Wei.

[0066] (2) Calculate the weighted average position

[0067] In this phase, the weighted average position is calculated by first calculating the fitness of each participant and rearranging the population according to one of the two quality characteristics: larger is better or smaller is better; secondly, the top candidate solutions to calculate the weighted average position, the mathematical expression is as follows:

[0068]

[0069]

[0070] For the case where smaller is better:

[0071]

[0072] For the case where bigger is better:

[0073]

[0074] in, is the total number; is the i-th candidate solution; To calculate the fitness value function; is the sum of all fitness of the selected candidate solutions; is the weighted average position; is the current iteration number; is the maximum number of iterations; is the number of candidate solutions selected.

[0075] (3) Define the search phase: exploration or exploitation

[0076] The mathematical expression for the search phase to determine candidate solutions is as follows:

[0077]

[0078] when When , the candidate solutions will move according to the development capabilities; when When , the candidate solution will move according to the exploration ability; is a constant.

[0079] (4) Development stage

[0080] WAA adopts three movement strategies to explore the search space.

[0081] The first strategy focuses on using the search space, which is determined by the weighted average position of the current entire population, the individual optimal position, and the global optimal position. The mathematical expression is as follows:

[0082]

[0083] in, , , A random value between 0 and 1; used to adjust the search space to the individual's best position and the global optimal position Around the expansion.

[0084] The second strategy focuses on utilizing the search space established between the weighted average position of the entire group and the personal best position. In this strategy, the position of the global best position is ignored, which reduces the search space of this strategy compared to the first strategy. The search space is established by the following formula:

[0085]

[0086] in, , A random value between 0 and 1.

[0087] Compared with the first strategy, this moving strategy tends to improve convergence speed and accuracy.

[0088] The third strategy focuses on exploiting the search space established between the weighted average position of the entire population and the global optimal position. The position update for each candidate is calculated as follows:

[0089]

[0090] in, , A random value between 0 and 1.

[0091] The search space of the third strategy is relatively narrow compared to the first two strategies. Moving from the global optimal position to the weighted average position will improve the convergence speed and accuracy.

[0092] (5) Exploration phase

[0093] The first exploration strategy uses the Levy flight method to explore the area around the global optimal position. The mathematical expression is shown as follows:

[0094]

[0095] in, The step length for Levy's flight; The global optimal solution is The first iteration Locations, is the i-th candidate solution in The j-th position at the iteration.

[0096] The second exploration strategy is to redistribute candidate solutions in the search space, as follows:

[0097]

[0098] in, and is the minimum of the lower and upper bounds in all dimensions.

[0099] 2. BiLSTM model.

[0100] BiLSTM can effectively capture the dependencies between the past and the future in sequence data by combining the characteristics of traditional long short-term memory neural network (LSTM) and bidirectional computing. The key advantage of BiLSTM is that the bidirectional structure allows the network to access the past and future information of the sequence at the same time, thereby enhancing the model's understanding ability. For the input at time t, the calculation process is as follows:

[0101]

[0102]

[0103]

[0104] in, and are the outputs of the forward and backward passes at the current moment respectively; and are the outputs of the forward and backward passes at the previous moment respectively; , , , , , is the weight, is the bias term, where the BiLSTM flow chart is as follows Figure 1 shown.

[0105] 3. Principal component analysis method.

[0106] Principal Component Analysis (PCA) is a multivariate dimensionality reduction analysis method that aims to extract principal components that can effectively reflect data characteristics from a data set through linear transformation, thereby reducing data redundancy and noise and improving data availability. PCA can effectively reduce the dimension of data and reduce the computational complexity of random forest model training.

[0107] Assume that the temperature variable collected by the temperature sensors arranged at various positions of the machine tool spindle is , whose n observation groups are , .

[0108] The calculation steps of principal component analysis are as follows:

[0109] (1) Calculate the sample covariance Correlation coefficient with sample , the specific formula is as follows:

[0110]

[0111]

[0112]

[0113] Based on this, the calculation formulas of the sample covariance matrix V and correlation matrix R are as follows:

[0114]

[0115]

[0116] (2) Solve for the p eigenvalues ​​of the correlation matrix R, denoted as .

[0117] (3) The number of principal components is selected using the contribution rate of the principal components. The contribution rate of the i-th principal component is , that is, the degree to which the first i principal components retain the original information.

[0118] (4) Calculate the unit eigenvector corresponding to the first m eigenvalues .

[0119] (5) Calculate the principal components of X , thus obtaining the principal component variables .

[0120] 4. Random forest method.

[0121] Random Forest (RF) is an ensemble learning method based on decision trees, which is commonly used in classification and regression tasks.

[0122] In one embodiment of the present application, Figure 2 As shown, a training method for a thermal error prediction model is provided, comprising:

[0123] Step 201, obtaining temperature data of a machine tool spindle;

[0124] Step 202, using principal component analysis method and random forest method to screen the temperature data to obtain temperature key point data;

[0125] Step 203, constructing a data set based on the temperature key point data;

[0126] Step 204, determining the optimal structural parameters of the bidirectional long short-term memory neural network model based on a weighted average algorithm;

[0127] Step 205 , using the data set to train the bidirectional long short-term memory neural network model optimized according to the weighted average algorithm to obtain a thermal error prediction model.

[0128] An embodiment of the present invention proposes a training method for a thermal error prediction model. The thermal error prediction model trained by running the above-mentioned thermal error prediction model training method effectively solves the problems of overfitting and local optimality that are prone to occur in the BiLSTM network during the training process. At the same time, the proposed thermal error prediction model can better handle long sequence dependencies, improve the prediction accuracy of thermal errors, and thus better predict the thermal error of the machine tool spindle.

[0129] Specifically, when establishing a thermal error prediction model, too many temperature measurement points will cause the model to overfit, increase the complexity of the model, and thus reduce the prediction accuracy. Too few temperature measurement points will reduce the generalization ability of the model and fail to accurately capture the comprehensive impact of temperature changes on thermal errors.

[0130] Based on this, the principal component analysis method and random forest method are used to screen the temperature data, which can effectively reduce the dimension of the data and remove redundant features, thereby improving the calculation efficiency of the model.

[0131] In addition, the weighted average algorithm is used to determine the optimal structural parameters of the bidirectional long short-term memory neural network model, which can match the optimal structural parameters for the bidirectional long short-term memory neural network model, so that the trained thermal error prediction model shows a better prediction effect, thereby improving the prediction accuracy. Among them, the bidirectional long short-term memory neural network model optimized according to the weighted average algorithm can be understood as the model when the bidirectional long short-term memory neural network model adopts the optimal structural parameters.

[0132] In some embodiments, optionally, the temperature data includes temperature variables collected from different temperature measurement points, and the temperature data is screened using a principal component analysis method and a random forest method to obtain temperature key point data, specifically including: based on the temperature data, determining the sample covariance and the sample correlation coefficient, the sample covariance is the covariance between the temperature variables at different temperature measurement points, and the sample correlation coefficient is the correlation coefficient between the temperature variables at different temperature measurement points; solving the correlation matrix determined by the sample correlation coefficient to determine the screening matrix; determining the principal component variables based on the screening matrix and the temperature data; solving the covariance matrix determined by the sample covariance to obtain a solution result; based on the solution result, determining a first matrix, the first matrix is ​​a matrix composed of target principal component variables, and the target principal component variables are principal component variables whose cumulative variance is greater than a first set value; performing dimensionality reduction processing on the temperature data based on the first matrix to obtain data after dimensionality reduction; and evaluating the data after dimensionality reduction based on a random forest model constructed by the random forest method to determine the temperature key point data.

[0133] In this embodiment, the temperature key point data is screened out so that the bidirectional long short-term memory neural network model optimized according to the weighted average algorithm is trained using the screened temperature key point data and the corresponding thermal error data, thereby obtaining a thermal error prediction model.

[0134] In this process, the principal component analysis method can be used to extract principal components from temperature data that can effectively reflect data characteristics, thereby reducing data redundancy and noise and improving data availability.

[0135] It means that the use of principal component analysis method can also effectively reduce the dimension of data and reduce the computational complexity of random forest model training.

[0136] In the above embodiment, the random forest method can be used to directly process the data after dimensionality reduction, evaluate its importance, and then filter out the temperature key point data from the temperature data.

[0137] In this process, the multicollinearity between multiple measurement points can be reduced, the dimension of the data can be reduced, and redundant features can be removed, thereby improving the calculation efficiency of the model.

[0138] In some embodiments, optionally, the correlation matrix determined by the sample correlation coefficient is solved to determine the screening matrix, specifically including: solving the correlation matrix determined by the sample correlation coefficient to determine P eigenvalues ​​of the correlation matrix, where P is a positive integer; selecting the number of principal component variables based on the contribution rate of the temperature variable; determining the unit eigenvectors of the first M eigenvalues ​​based on the contribution rate of the temperature variable, where M is a positive integer less than or equal to P; and determining the screening matrix based on the unit eigenvectors of the first M eigenvalues ​​and the number of principal component variables.

[0139] In this embodiment, the correlation matrix determined by the sample correlation coefficient is solved so as to determine the number of principal component variables based on the P eigenvalues ​​obtained by the solution. After determining the number of principal component variables, a screening matrix can be directly constructed based on the unit eigenvectors of the first M eigenvalues ​​so as to use the screening matrix to process the temperature data and obtain the principal component variables.

[0140] In some embodiments, optionally, a random forest model constructed based on the random forest method evaluates the data after dimensionality reduction to determine the temperature key point data, specifically including: using the data after dimensionality reduction to train the random forest model constructed based on the random forest method to obtain an evaluation result output by the random forest model, the evaluation result including the degree of influence of each target principal component variable on the temperature change of the machine tool spindle; based on the evaluation result, determining the temperature key point data in the temperature data.

[0141] In this embodiment, a random forest model constructed using the random forest method is used to evaluate the data after dimensionality reduction, thereby screening out target principal component variables that have a greater impact on the temperature change of the machine tool spindle from the data after dimensionality reduction, and then by tracing back to the original temperature measurement points, it is determined which measurement points have a significant impact on the temperature change of the machine tool spindle, and the key temperature measurement points are screened out for subsequent thermal error modeling.

[0142] In this process, the temperature key point data that has a significant impact on the temperature change of the machine tool spindle can be screened out from the temperature data, thereby reducing the redundancy and noise of the data and improving the availability of the data.

[0143] In the above embodiment, the temperature data is screened by using the principal component analysis method and the random forest method, and the step of obtaining the temperature key point data is mainly divided into the following four steps, namely:

[0144] (1) Preprocessing the collected data of the machine tool spindle at 4000 r / min helps PCA dimensionality reduction.

[0145] (2) Calculate the covariance matrix and perform eigenvalue decomposition, select the principal components with cumulative variance exceeding 90%, and map the original data to the principal component matrix for dimensionality reduction.

[0146] (3) The random forest model is trained using the data after PCA dimension reduction, and the principal components that are most important to the temperature change of the machine tool spindle are screened out based on the feature importance evaluation of the RF model.

[0147] (4) Analyze the importance of the principal components of the RF output, trace back to the original temperature measurement points, and determine which measurement points have a significant impact on the spindle temperature change. Filter out the key temperature measurement points, that is, the temperature key point data, for subsequent thermal error modeling.

[0148] The temperature measurement points are screened through the above steps for subsequent spindle thermal error modeling.

[0149] In some embodiments, optionally, the optimal structural parameters of the bidirectional long short-term memory neural network model are determined based on a weighted average algorithm, specifically including: randomly generating a candidate solution matrix, wherein each candidate solution in the candidate solution matrix serves as a structural parameter; when the current number of iterations is less than or equal to the maximum number of iterations, calculating the weighted average position of the current race according to the fitness of each participant; determining the value of the mathematical expression of the candidate solution in the search phase based on the weighted average position; selecting a movement strategy or an exploration strategy based on the value of the mathematical expression of the candidate solution in the search phase to update the candidate solution; based on the updated candidate solution, updating the fitness of each participant; determining the optimal candidate solution based on the updated fitness of each participant and the global optimal position to obtain the optimal structural parameters.

[0150] In this embodiment, a weighted average algorithm can be used to solve the optimal structural parameters suitable for the bidirectional long short-term memory neural network model, so that the trained thermal error prediction model shows a better prediction effect.

[0151] Specifically, the weighted average algorithm is used to optimize the parameters of the bidirectional long short-term memory neural network model, which effectively solves the problems of overfitting and local optimality that easily occur in the training process of the bidirectional long short-term memory neural network model. It can better handle long sequence dependencies and improve the prediction accuracy of thermal errors.

[0152] In some embodiments, optionally, the optimal candidate solution is determined based on the fitness of each participant after the update and the global optimal position to obtain the optimal structural parameters, specifically including: based on the fitness of each participant after the update being better than the fitness corresponding to the global optimal position, the updated candidate solution is taken as the optimal candidate solution; if the fitness of each participant after the update is not better than the fitness corresponding to the global optimal position, the candidate solution is updated until the current number of iterations after the update is greater than the maximum number of iterations.

[0153] In this embodiment, in the process of optimizing the parameters of the bidirectional long short-term memory neural network model using the weighted average algorithm, the fitness of each participant can be compared with the global optimal position when the number of iterations reaches the maximum number of iterations, thereby ensuring that the optimal structural parameters are found for the bidirectional long short-term memory neural network model, thereby solving the problem of overfitting and local optimality that the bidirectional long short-term memory neural network model is prone to during the training process, being able to better handle long sequence dependencies, and improving the prediction accuracy of thermal errors.

[0154] In some embodiments, optionally, a data set is constructed based on temperature key point data, specifically including: obtaining thermal error data corresponding to the temperature key point data; associating the temperature key point data with the corresponding thermal error data as training samples in the data set; wherein the data set includes a training set and a test set, wherein the training set is used to train a bidirectional long short-term memory neural network model optimized according to a weighted average algorithm, and the test set is used to verify the trained thermal error prediction model.

[0155] In some embodiments, in order to verify the accuracy of the bidirectional long short-term memory neural network model optimized by the weighted average algorithm, an electric spindle of a five-axis machining center is used for testing. The maximum machining speed of the spindle of the machine tool is 8000r / min.

[0156] In this experiment, a total of 8 temperature measurement points were set up near the heat source of the machine tool spindle. The temperature sensor uses a magnetic temperature sensor to collect signals in real time. The temperature range is -60℃ to 180℃, and the accuracy level is 1 / 3B. The collected signals are automatically read and saved by the dedicated host computer software. For the measurement of the axial thermal error of the machine tool spindle, the cylindrical test rod is installed on the electric spindle using the tool handle, and the eddy current displacement sensor is fixed on the workbench by a fixture, while ensuring that the sensor probe is parallel to the end face of the test rod. The distribution of temperature and displacement sensors is shown in the figure. Figure 3 The temperature sensor number and specific location are shown in Table 1. The machine tool spindle is tested at an idling speed of 4000r / min. Before the no-load test of the thermal error of the machine tool spindle, the machine tool must be fully cooled. The cooling time is required to be more than 24 hours. The experiment is carried out for 240 minutes, and the experimental data is recorded every 1 minute.

[0157] Table 1

[0158] Sensor No. Specific location Sensor No. Specific number T1 Spindle rear bearing T5 Spindle front bearing T2 Cantilever beam T6 Oil outlet T3 Rear bearing cavity T7 Ambient temperature T4 Rear bearing flange T8 Oil inlet

[0159] Through the above experiments, the temperature rise curves and axial thermal error curves of each measuring point are as follows Figure 4 and Figure 5 As shown. Figure 4Analysis shows that the temperature measurement point data show a trend of change in two stages: the temperature rise stage and the temperature dynamic balance stage. The temperature rise change is most significant at the temperature measurement point T3, which is located in the inner cavity of the rear bearing of the spindle; the temperature measurement points T6 and T8 are the oil outlet and oil inlet of the coolant. The fluctuation is because the coolant takes away most of the heat of the motor stator, causing the coolant temperature to rise. When the coolant temperature is greater than the set value, the oil cooler starts to work, thereby reducing the coolant temperature.

[0160] from Figure 5 Analysis shows that the thermal error curve increases with the increase of temperature, and when the temperature reaches thermal equilibrium, the thermal error curve gradually tends to be stable.

[0161] The principal component analysis combined with the random forest method was used to screen the key points of the machine tool spindle temperature. Figure 6 The screening results shown in the figure finally select T1, T3, T5, and T7 for the subsequent spindle thermal error modeling.

[0162] In the above embodiment, the temperature rise data collected at a speed of 4000 r / min is used as input, and the axial thermal error data is used as output of the thermal error prediction model, such as Figure 7 As shown, it mainly includes the following steps:

[0163] Step 1: Data preprocessing, using the screened temperature rise and thermal error data of T1, T3, T5, and T7 temperature measurement points as the data set, and dividing the training set and the test set in a ratio of 7:3.

[0164] Step 2: In the initialization phase of the WAA algorithm, a set of candidate solutions is randomly generated according to the defined search space, and each candidate solution represents a set of possible parameter combinations of the BiLSTM model.

[0165] Step 3: For each candidate solution (i.e., a set of BiLSTM model parameters), apply it to the BiLSTM network model and train the model using the training set.

[0166] Step 4: Sort the candidate solutions according to the fitness value, select some candidate solutions to calculate the weighted average position, which will be used to determine the subsequent search direction. Determine the search stage, and decide whether to proceed to the development stage or the exploration stage according to the calculation of formula (6); when When , the development phase is carried out, the first mobile strategy, the second mobile strategy or the third mobile strategy is randomly selected to update the parameters of the BiLSTM model; when The exploration phase is carried out at the same time, and the parameters of the BiLSTM model are updated according to two exploration strategies.

[0167] Step 5: Calculate the fitness value of the updated candidate solution and compare it with the current global optimal solution. If the fitness value of the updated solution is better, update the global optimal solution and its corresponding model parameters.

[0168] Step 6: Determine whether the maximum number of iterations has been reached. If the stopping condition is met, stop the iteration and output the result; otherwise, return to step 4 and continue to the next iteration.

[0169] Among them, the optimal hyperparameters of the final BiLSTM network using the WAA algorithm (that is, the optimal structural parameters in this application) are shown in Table 2.

[0170] Table 2

[0171] parameter Value Hidden layer node 1 241 Hidden layer node 2 169 Learning efficiency 0.001845 Activation Function RELU Optimizing functions ADM Loss Function RMSE

[0172] After saving the trained thermal error prediction model, the WAA-BiLSTM, GWOA-BiLSTM, PSO-CNN, and BiLSTM network models are used to predict the axial thermal error of the machine tool spindle. These four models all use the same training set and test set.

[0173] The advantages of the WAA optimization algorithm can be verified by comparing it with the GWOA-BiLSTM and BiLSTM models, and the advantages and disadvantages of different types of neural networks can be verified by comparing it with the PSO-CNN model. Figure 8 Schematic diagram showing thermal error prediction curves of different models in an embodiment of the present invention, Fig. 9 A schematic diagram showing thermal error residual curves of different models in an embodiment of the present invention is shown.

[0174] like Figure 8 As shown in the figure, compared with other modeling methods, the WAA-BiLSTM model shows better prediction effect, and its prediction curve is closer to the true value curve and has a higher degree of fitting.

[0175] like Fig. 9 As shown in the figure, the residual curve of the WAA-BiLSTM modeling method fluctuates very little and is closer to 0 overall, which indicates that the prediction effect is more accurate. In order to more intuitively evaluate the accuracy of the model prediction results, this paper calculates the mean absolute error (MAE), root mean square error (RMSE) and determination coefficient (R²) of the model. The evaluation indicators are shown in Table 3.

[0176] Table 3

[0177] Model RMSE MAE <![CDATA[R 2 ]]> WAA-BiLSTM 0.1083 0.0868 0.9808 GWOA-BiLSTM 0.1558 0.12603 0.9601 PSO-CNN 0.1824 0.1379 0.9453 BiLSTM 0.1927 0.1532 0.9391

[0178] According to Table 3, the prediction accuracy of the WAA-BiLSTM model is higher.

[0179] Specifically, compared with GWOA-BiLSTM, the RMSE of the WAA-BiLSTM model is reduced by 30.4% and the MAE is reduced by 31.12%. Compared with PSO-CNN, the RMSE of the WAA-BiLSTM model is reduced by 40.6% and the MAE is reduced by 37.05%. Compared with BiLSTM, the RMSE of the WAA-BiLSTM model is reduced by 43.8% and the MAE is reduced by 43.3%.

[0180] Therefore, it can be concluded that the WAA algorithm can improve the prediction performance of the BiLSTM network model.

[0181] In the embodiment of the present application, the five-axis machining center electric spindle is taken as the research object, the key measurement points of the spindle temperature are screened and the spindle thermal error prediction model is established, and the conclusions are as follows:

[0182] (1) A PCA-RF temperature key point screening method is proposed. PCA can effectively reduce the dimension of many relevant original temperature data to avoid the risk of overfitting, while RF can directly process the reduced-dimensional data and evaluate its importance. Finally, the PCA-RF algorithm is used to screen 8 temperature measurement points to 4 temperature measurement points, which effectively reduces the multicollinearity between multiple measurement points and provides a basis for subsequent thermal error modeling.

[0183] (2) A thermal error prediction model based on WAA-BiLSTM was established, and the WAA algorithm was used to optimize the parameters of the BiLSTM network model, which effectively solved the problems of overfitting and local optimality that the BiLSTM network is prone to during the training process; it can better handle long sequence dependencies and improve the prediction accuracy of thermal errors.

[0184] (3) To verify the superiority of the proposed modeling method, the prediction performance of the WAA-BiLSTM model was compared with that of the GWOA-BiLSTM, PSO-CNN and BiLSTM network models. The RMSE of the WAA-BiLSTM model was reduced by 30.4%, 40.6% and 43.8%, respectively, and the MAE was reduced by 31.12%, 37.05% and 43.3%, respectively. It was verified that the proposed WAA-BiLSTM model has high prediction accuracy and provides a new method for predicting thermal errors of machine tool spindles.

[0185] In one embodiment, if Fig.10As shown, the present invention provides a training device 1000 for a thermal error prediction model, including: an acquisition unit 1002, used to acquire temperature data of a machine tool spindle; a screening unit 1004, used to screen the temperature data using a principal component analysis method and a random forest method to obtain temperature key point data; a construction unit 1006, used to construct a data set based on the temperature key point data; a determination unit 1008, used to determine the optimal structural parameters of a bidirectional long short-term memory neural network model based on a weighted average algorithm; a training unit 1010, used to use the data set to train the bidirectional long short-term memory neural network model optimized according to the weighted average algorithm to obtain a thermal error prediction model.

[0186] In some embodiments, optionally, the temperature data includes temperature variables collected from different temperature measurement points, and the screening unit 1004 is specifically used to: determine the sample covariance and the sample correlation coefficient based on the temperature data, the sample covariance is the covariance between the temperature variables at different temperature measurement points, and the sample correlation coefficient is the correlation coefficient between the temperature variables at different temperature measurement points; solve the correlation matrix determined by the sample correlation coefficient to determine the screening matrix; determine the principal component variables based on the screening matrix and the temperature data; solve the covariance matrix determined by the sample covariance to obtain a solution result; determine the first matrix based on the solution result, the first matrix is ​​a matrix composed of target principal component variables, and the target principal component variables are principal component variables whose cumulative variance is greater than a first set value; perform dimensionality reduction processing on the temperature data based on the first matrix to obtain data after dimensionality reduction; evaluate the data after dimensionality reduction based on the random forest model constructed by the random forest method to determine the temperature key point data in the temperature data.

[0187] In some embodiments, optionally, the screening unit 1004 is specifically used to: solve the correlation matrix determined by the sample correlation coefficient to determine P eigenvalues ​​of the correlation matrix, where P is a positive integer; select the number of principal component variables based on the contribution rate of the temperature variable; determine the unit eigenvectors of the first M eigenvalues ​​based on the contribution rate of the temperature variable, where M is a positive integer less than or equal to P; determine the screening matrix based on the unit eigenvectors of the first M eigenvalues ​​and the number of principal component variables.

[0188] In some embodiments, optionally, the screening unit 1004 is specifically used to: use the reduced-dimensional data to train a random forest model constructed based on the random forest method to obtain an evaluation result output by the random forest model, the evaluation result including the degree of influence of each target principal component variable on the temperature change of the machine tool spindle; based on the evaluation result, determine the temperature key point data in the temperature data.

[0189] In some embodiments, optionally, the determination unit 1008 is specifically used to: randomly generate a candidate solution matrix, wherein each candidate solution in the candidate solution matrix serves as a structural parameter; when the current number of iterations is less than or equal to the maximum number of iterations, calculate the weighted average position of the current race according to the fitness of each participant; determine the value of the mathematical expression of the candidate solution in the search phase based on the weighted average position; select a movement strategy or an exploration strategy based on the value of the mathematical expression of the candidate solution in the search phase to update the candidate solution; based on the updated candidate solution, update the fitness of each participant; determine the optimal candidate solution based on the updated fitness of each participant and the global optimal position to obtain the optimal structural parameters.

[0190] In some embodiments, optionally, the determination unit 1008 is specifically used to: based on the fitness of each participant after the update being better than the fitness corresponding to the global optimal position, take the updated candidate solution as the optimal candidate solution; if the fitness of each participant after the update is not better than the fitness corresponding to the global optimal position, update the candidate solution until the current number of iterations after the update is greater than the maximum number of iterations.

[0191] In some embodiments, optionally, construction unit 1006 is specifically used to: obtain thermal error data corresponding to temperature key point data; associate the temperature key point data with the corresponding thermal error data as training samples in a data set; wherein the data set includes a training set and a test set, wherein the training set is used to train a bidirectional long short-term memory neural network model optimized according to a weighted average algorithm, and the test set is used to verify the trained thermal error prediction model.

[0192] In some embodiments, the present invention provides a readable storage medium storing a program or instruction, which, when executed by a processor, implements a training method for a thermal error prediction model as described above.

[0193] In some embodiments, Fig.11 As shown, the present invention provides an electronic device 1100, including a processor 1102 and a memory 1104, wherein the memory 1104 stores programs or instructions that can be executed on the processor 1102, and when the programs or instructions are executed by the processor 1102, the steps of the training method of the thermal error prediction model as described above are implemented.

[0194] In the text description of the present invention, it is understood that, except for explicit provisions and limitations, the terms "installation", "connection" and "connection" should be understood in a broad sense. For example, it can be fixed connection, detachable connection, or integral connection; it can be mechanical structure connection or electrical connection; it can be direct connection between the two, or indirect connection between the two through an intermediate medium, or it can be internal communication between two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0195] In the claims, specification and drawings of the present invention, the description of the terms "one embodiment", "some embodiments", "specific embodiments" and the like means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In the claims, specification and drawings of the present invention, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0196] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for training a thermal error prediction model, characterized in that: include: Get the temperature data of the machine tool spindle; The temperature data are screened using a principal component analysis method and a random forest method to obtain temperature key point data; Constructing a data set based on the temperature key point data; Determine the optimal structural parameters of the bidirectional long short-term memory neural network model based on the weighted average algorithm; The data set is used to train the bidirectional long short-term memory neural network model optimized according to the weighted average algorithm to obtain a thermal error prediction model.

2. The training method of the thermal error prediction model according to claim 1, characterized in that: The temperature data includes temperature variables collected from different temperature measurement points. The temperature data are screened using the principal component analysis method and the random forest method to obtain temperature key point data, which specifically includes: Based on the temperature data, determine a sample covariance and a sample correlation coefficient, wherein the sample covariance is the covariance between temperature variables at different temperature measurement points, and the sample correlation coefficient is the correlation coefficient between temperature variables at different temperature measurement points; Solving a correlation matrix determined by the sample correlation coefficients to determine a screening matrix; determining principal component variables based on the screening matrix and the temperature data; Solving the covariance matrix determined by the sample covariance to obtain a solution result; Based on the solution result, determining a first matrix, wherein the first matrix is ​​a matrix composed of target principal component variables, and the target principal component variables are principal component variables whose cumulative variance is greater than a first set value; Performing dimensionality reduction processing on the temperature data based on the first matrix to obtain dimensionality reduced data; The random forest model constructed based on the random forest method is used to evaluate the data after dimensionality reduction to determine the temperature key point data in the temperature data.

3. The training method of the thermal error prediction model according to claim 2, characterized in that: Solving the correlation matrix determined by the sample correlation coefficient to determine the screening matrix specifically includes: Solving the correlation matrix determined by the sample correlation coefficient to determine P eigenvalues ​​of the correlation matrix, where P is a positive integer; Selecting the number of principal component variables based on the contribution rate of the temperature variable; Determine the unit eigenvectors of the first M eigenvalues ​​based on the contribution rate of the temperature variable, where M is a positive integer less than or equal to P; A screening matrix is ​​determined based on the unit eigenvectors of the first M eigenvalues ​​and the number of the principal component variables.

4. The training method of the thermal error prediction model according to claim 2, characterized in that: The random forest model constructed based on the random forest method evaluates the reduced-dimensional data to determine the temperature key point data in the temperature data, specifically including: The random forest model constructed based on the random forest method is trained using the dimension-reduced data to obtain an evaluation result output by the random forest model, wherein the evaluation result includes the influence degree of each target principal component variable on the temperature change of the machine tool spindle; Based on the evaluation result, key temperature measurement point data in the temperature data is determined.

5. The method for training a thermal error prediction model according to any one of claims 1 to 4, characterized in that: The optimal structural parameters of the bidirectional long short-term memory neural network model are determined based on the weighted average algorithm, specifically including: Randomly generate a candidate solution matrix, wherein each candidate solution in the candidate solution matrix serves as a structural parameter; When the current iteration number is less than or equal to the maximum iteration number, the weighted average position of the current race is calculated according to the fitness of each participant; Determining the value of the mathematical expression of the candidate solution in the search phase based on the weighted average position; Select a movement strategy or an exploration strategy based on the value of the mathematical expression of the candidate solution in the search phase to update the candidate solution; Based on the updated candidate solution, update the fitness of each participant; The optimal candidate solution is determined based on the fitness of each participant after the update and the global optimal position to obtain the optimal structural parameters.

6. The method for training a thermal error prediction model according to claim 5, characterized in that: The method of determining the optimal candidate solution based on the fitness of each participant after the update and the global optimal position to obtain the optimal structural parameters specifically includes: Based on the fitness of each participant after the update being better than the fitness corresponding to the global optimal position, the updated candidate solution is used as the optimal candidate solution; If the fitness of each participant after the update is not better than the fitness corresponding to the global optimal position, the candidate solution is updated until the current number of iterations after the update is greater than the maximum number of iterations.

7. The method for training a thermal error prediction model according to any one of claims 1 to 4, characterized in that: The constructing of a data set based on the temperature key point data specifically includes: Acquire thermal error data corresponding to the temperature key point data; Associating the temperature key point data with the corresponding thermal error data as training samples in the data set; The data set includes a training set and a test set, wherein the training set is used to train the bidirectional long short-term memory neural network model optimized according to the weighted average algorithm, and the test set is used to verify the trained thermal error prediction model.

8. A training device for a thermal error prediction model, characterized in that: include: An acquisition unit, used for acquiring temperature data of a machine tool spindle; A screening unit, used to screen the temperature data using a principal component analysis method and a random forest method to obtain temperature key point data; A construction unit, used for constructing a data set based on the temperature key point data; A determination unit, used for determining the optimal structural parameters of the bidirectional long short-term memory neural network model based on a weighted average algorithm; A training unit is used to use the data set to train the bidirectional long short-term memory neural network model optimized according to the weighted average algorithm to obtain a thermal error prediction model.

9. A readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by a processor, the training method of the thermal error prediction model according to any one of claims 1 to 7 is implemented.

10. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method for training a thermal error prediction model as claimed in any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Improved principal component regression machine tool thermal error modeling method based on density clustering

    CN120541508A