Machine tool spindle thermal error modeling method

Through the combination of the CNN-BiLSTM-Attention model and the frost optimization algorithm RIME, the problem that a single temperature measurement point cannot capture the complex thermal deformation of the machine tool spindle is solved, more efficient thermal error prediction is achieved, and the accuracy of precision machining is improved.

CN118672209APending Publication Date: 2024-09-20DONGGUAN UNIV OF TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410628932.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-21
Publication Date
2024-09-20

Smart Images

  • Figure CN118672209A
    Figure CN118672209A
Patent Text Reader

Abstract

The invention relates to a machine tool spindle thermal error modeling method, which adopts a CNN-BiLSTM-Attention model to solve the problem of complex internal mechanism of machine tool thermal error, and introduces a frost ice optimization algorithm RIME to systematically adjust and optimize parameters of the CNN-BiLSTM-Attention model so as to improve the prediction precision and efficiency of the model in a complex and dynamic environment. A soft rime search strategy for algorithm search is provided by simulating the motion of soft rime particles and utilizing the strong randomness and coverage of the rime part, so that the algorithm can quickly cover the whole search space in early iteration and is not prone to falling into local optimum, and in addition, a hard fog puncture mechanism is further provided, so that the algorithm can quickly search the rime in the search space. The algorithm is utilized by simulating a cross behavior between hard fog intelligent agents; finally, a selection mechanism of a meta-heuristic algorithm is improved, and a positive greedy selection mechanism is provided; the RIME algorithm with better performance is provided by combining the three mechanisms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of thermal error of a machine tool spindle, and in particular to a thermal error modeling method of a machine tool spindle. Background Art

[0002] In CNC machining, the thermal deformation caused by the temperature rise of machine tool spindle and other components causes the originally correct relative position between the tool and the workpiece on the machine tool to change, resulting in machining errors. With the continuous advancement of precision manufacturing technology, the requirements for the accuracy and surface quality of workpieces are constantly increasing. Many studies have pointed out that thermal errors can account for 40% to 70% of the total error in precision machining. In view of this, thermal error compensation has become the main method to improve accuracy.

[0003] When studying the thermal deformation behavior of machine tool spindles, the method of relying on a single temperature measurement point has obvious limitations. The thermal deformation characteristics of machine tool spindles are usually nonlinear and affected by the complex interaction of multiple factors, so it is difficult for a single temperature measurement point to accurately capture these complex nonlinear effects. In addition, the temperature and thermal deformation characteristics of machine tool spindles have obvious time-varying properties, and a single measurement point cannot effectively track thermal errors that change over time. More importantly, a single temperature measurement point cannot provide information about the global temperature distribution of the machine tool spindle. In fact, the temperature distribution inside the machine tool has significant spatial variability, which cannot be reflected by a single measurement point. Summary of the invention

[0004] The purpose of the present invention is to provide a method for modeling thermal errors of machine tool spindles, which adopts the CNN-BiLSTM-Attention model to solve the complex internal mechanism problem of machine tool thermal errors, and introduces the frost ice optimization algorithm RIME to systematically adjust and optimize the parameters of the CNN-BiLSTM-Attention model to improve the prediction accuracy and efficiency of the model in complex and dynamic environments.

[0005] In order to achieve the above purpose, the technical solution adopted by the present invention is: a method for modeling thermal errors of a machine tool spindle, comprising the following steps:

[0006] Step 1: Initialize the population and parameters: Use the learning rate of the CNN-BiLSTM-Attention model, the convolution kernel size of the CNN layer, and the number of neurons in the BiLSTM layer as the parameters to be optimized for the RIME algorithm. Initialize the number of rime agents to 20 to obtain the initialized rime population:

[0007]

[0008] Step 2: Build the CNN-BiLSTM-Attention model and determine the fitness function: Traverse the Rime Agent and initialize the optimal fitness, optimal prediction value, optimal network and optimal network parameters;

[0009] Step 3: Use a soft frost search strategy to switch between large-scale exploration and small-scale development

[0010]

[0011] in, is the new position of the particle after update, R factor =r1·cosθ·β, The parameter r1 is a random number in the range of (-1,1). r1 controls the direction of particle movement and changes with the number of iterations together with cosθ. β is the environmental factor.

[0012] Step 4: Use hard frost ice puncture mechanism to achieve effective information exchange between individuals

[0013]

[0014] in is the new position of the particle after update, R best,j is the jth particle of the best rime individual in the rime population, norm(R ij ) The normalized value of the current individual fitness value;

[0015] Step 5: Use the forward greedy mechanism to filter out inferior solutions and retain the best solutions: compare the fitness value of the agent after the update with the fitness value of the agent before the update. If the fitness value after the update is better than the value before the update, a replacement occurs, and the agent whose solution is to be replaced is found at the same time;

[0016] Step 6: Import the CNN-BiLSTM-Attention model and update the optimal fitness, optimal prediction value, optimal network and optimal network parameters;

[0017] Step 7: Determine whether the termination condition is met and set the maximum number of iterations in the model to 20;

[0018] Step 8. Export the optimal fitness, optimal prediction value, optimal network and optimal network parameters of the CNN-BiLSTM-Attention model and analyze the training results.

[0019] Preferably, the CNN-BiLSTM-Attention model includes an input layer, a CNN layer, a BiLSTM layer and an Attention layer. The CNN layer extracts features from the input data by setting multiple convolution kernels. The BiLSTM is composed of two LSTMs, one of which processes the input sequence forward and the other processes the sequence backward. After the processing is completed, the outputs of the two LSTMs are concatenated. An Attention mechanism is added after the BiLSTM to weight the hidden states of all steps and focus on the more important hidden state information in the entire text.

[0020] Preferably, the input layer specifies the input format of the data (batch size, time steps, feature dimension), batch size: for the data collected in the experiment, the batch size refers to the number of experimental data under different working conditions imported into the model together, and the batch size is set to 1 in the model; time steps (TIME_STEPS): the number of time points included in each input data, and the time steps are set to 3 in the model; feature dimension (INPUT_DIMS): the dimension of the input data. The experimental data contains 3 temperature field measurement points, so the input data dimension is set to 3.

[0021] Preferably, the forward LSTM output is:

[0022] Forget Gate: Input Gate: unit: Output Gate: Final output: Backward LSTM output:

[0023] Forget Gate: Input Gate: unit: Output Gate: Final output: The output in BiLSTM is the hidden state of the forward LSTM and the backward LSTM at each time step t and The specific calculation formula for this process step is:

[0024] The technical effects of the present invention are:

[0025] The CNN-BiLSTM-Attention model is used to solve the problem of machine tool thermal error, which has a complex internal mechanism. The frost optimization algorithm RIME is introduced to systematically adjust and optimize the parameters of the CNN-BiLSTM-Attention model to improve the prediction accuracy and efficiency of the model in complex and dynamic environments. By simulating the movement of soft rime particles and taking advantage of the strong randomness and coverage of the rime part, a soft rime search strategy for algorithm search is proposed, which enables the algorithm to quickly cover the entire search space in early iterations and is not easy to fall into local optimality. In addition, a hard fog puncture mechanism is proposed to utilize the algorithm by simulating the cross-behavior between hard fog agents. Finally, the selection mechanism of the metaheuristic algorithm is improved, and a positive greedy selection mechanism is proposed; this paper combines the above three mechanisms to propose a better RIME algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 Schematic diagram of CNN-BiLSTM-Attention.

[0027] Figure 2 Flowchart of optimizing CNN-BiLSTM-Attention for RIME.

[0028] Figure 3 Result diagram of temperature data and thermal deformation data.

[0029] Figure 4 This is a comparison chart of the prediction effects. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings. The description in this part is only exemplary and explanatory and should not have any limiting effect on the scope of protection of the present invention.

[0031] CNN-BiLSTM-Attention model Figure 1 As shown,

[0032] 1) Input layer: First, the first layer is the input layer, which specifies the input format of the data (batch size, number of time steps, feature dimension).

[0033] Batch size: For experimental data, the batch size refers to the number of experimental data under different working conditions that are imported into the model together. The batch size is set to 1 in the model.

[0034] Time steps (TIME_STEPS): The number of time points included in each input data. The time steps in the model are set to 3;

[0035] Feature Dimension (INPUT_DIMS): The dimension of the input data. The experimental data contains 3 temperature field measurement points, so the input data dimension is set to 3.

[0036] 2) CNN layer

[0037] Feature extraction is performed on the input data by setting multiple convolution kernels.

[0038] 3) BiLSTM layer (bidirectional LSTM)

[0039] The LSTM layer can effectively process long-term dependencies in sequence data. Due to the bidirectional reading ability of BiLSTM, it can better understand the regularity of the sequence.

[0040] BiLSTM is composed of two LSTMs, one processes the input sequence forward; the other processes the sequence backward, and after processing, the outputs of the two LSTMs are concatenated.

[0041] Forward LSTM output:

[0042] Forget Gate: Input Gate: unit: Output Gate: Final output: Backward LSTM output:

[0043] Forget Gate: Input Gate: unit: Output Gate: Final output: The output in BiLSTM is the hidden state of the forward LSTM and the backward LSTM at each time step t and The specific calculation formula for this process step is as follows:

[0044]

[0045] 4) Attention

[0046] BiLSTM needs to capture sequence information step by step. Its performance on long sequences will gradually decay as the number of steps increases, making it difficult to retain all useful information. Adding an Attention mechanism after BiLSTM can weight the hidden states of all steps and focus on the more important hidden state information in the entire text.

[0047] RIME Optimizes CNN-BiLSTM-Attention

[0048] 1) Initialize the population and parameters: The learning rate of the CNN-BiLSTM-Attention model, the convolution kernel size of the CNN layer, and the number of neurons in the BiLSTM layer are used as the parameters to be optimized for the RIME algorithm. The number of rime agents is initialized to 20 to obtain the initialized rime population:

[0049]

[0050] 2) Build a CNN-BiLSTM-Attention model and determine the fitness function: Traverse the Rime Agent and initialize the optimal fitness, optimal prediction value, optimal network and optimal network parameters;

[0051] 3) Adopt soft frost search strategy to switch between large-scale exploration and small-scale development

[0052]

[0053] in, is the new position of the particle after update, R factor =r1·cosθ·β, The parameter r1 is a random number in the range of (-1,1). r1 controls the direction of particle movement and changes with the number of iterations together with cosθ. β is the environmental factor.

[0054] 4) Adopt hard frost ice puncture mechanism to achieve effective information exchange between individuals

[0055]

[0056] in is the new position of the particle after update, R best,j is the jth particle of the best rime individual in the rime population, norm(R ij ) The normalized value of the current individual fitness value;

[0057] 5) Use the positive greedy mechanism to filter out inferior solutions and retain the best solutions: compare the fitness value of the agent after the update with the fitness value of the agent before the update. If the fitness value after the update is better than the value before the update, a replacement occurs, and the solution agent of both agents is replaced at the same time;

[0058] 6) Import into the CNN-BiLSTM-Attention model and update the optimal fitness, optimal prediction value, optimal network and optimal network parameters;

[0059] 7) Determine whether the termination condition is met and set the maximum number of iterations in the model to 20;

[0060] 8) Export the optimal fitness, optimal prediction value, optimal network and optimal network parameters of the CNN-BiLSTM-Attention model and analyze the training results.

[0061] Experimental design

[0062] The core goal of this application is to explore the thermal error characteristics of the T-7 three-axis CNC machine tool for drilling and tapping, and to establish an effective thermal error model based on this. To achieve this goal, this application carefully designs and builds a comprehensive platform that includes thermal error modeling and experimental verification.

[0063] The first step of the experimental process is to determine the key temperature monitoring points of the spindle, which is achieved by applying the fuzzy clustering method. The accurate selection of these measuring points is crucial to capture the thermal behavior of the spindle under different working conditions. The determined measuring points include the middle end of the spindle, the upper end of the screw, and the machine bed. Temperature sensors are deployed at these strategic locations to monitor and record the temperature changes of the spindle in real time during operation. This study conducted an idling experiment of the spindle at the same speed at different ambient temperatures. Under the condition of a spindle speed of 10,000 rpm, the ambient temperature was heated at 10°C, 20°C, 30°C, and 40°C for 4 hours, cooled for 2 hours, heated for 4 hours twice, and cooled for 10 hours while collecting data without interruption. According to the actual processing requirements, one set of experimental data was collected at ambient temperatures of 10°C, 30°C, and 40°C, and five sets of experimental data were collected at an ambient temperature of 20°C. The thermal deformation of the spindle was accurately measured using a micrometer, so as to obtain detailed data on the temperature and thermal deformation of the machine tool during actual processing.

[0064] Original experimental data

[0065] The 8 sets of data collected are spliced ​​in time series to obtain the temperature data and thermal deformation data results as shown in the figure. Figure 3 As shown;

[0066] Comparison of RIME-CNN-BiLSTM-Attention and CNN-BiLSTM-Attention spindle thermal error model training

[0067] Comparison of prediction results

[0068] Divide the above data into training set (0.7), validation set (0.1), and test set (0.2) according to time series

[0069] Prediction effect comparison Figure 4 As shown:

[0070] Evaluation Metrics

[0071] The root mean square error (RMSE), mean absolute error (MAE) and goodness of fit (R 2 ) to evaluate the two models, and the calculation formula is as follows:

[0072]

[0073] Among them, y k and k are the actual output and expected output of the kth sample respectively, and N is the total number of samples; the smaller the MSE, the better the fitting degree.

[0074]

[0075] Among them, Res{N} is the set of absolute residuals.

[0076]

[0077] in, Represents the average value of the actual output of all sample points, R 2 The closer it is to 1, the better the model fits the data.

[0078] Comparison of evaluation indicators:

[0079]

[0080] The experimental results show that compared with the CNN-BiLSTM-Attention model, the RIME-CNN-BiLSTM-Attention model reduces the root mean square error from 7.7255 to 3.6961, the mean absolute error from 6.4955 to 2.8485, and the goodness of fit increases from 97.89% to 98.87%, thus confirming the superiority of the model.

[0081] It should be noted that, in this article, the terms "comprises", "includes" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or apparatus that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or apparatus.

[0082] This article uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only used to help understand the method and core ideas of the present invention. The above is only a preferred implementation of the present invention. It should be pointed out that due to the limitations of textual expression and the objective existence of infinite specific structures, ordinary technicians in this technical field can make several improvements, modifications or changes without departing from the principles of the present invention, and can also combine the above technical features in an appropriate manner; these improvements, modifications, changes or combinations, or the direct application of the inventive concept and technical solution to other occasions without improvement, should be regarded as the protection scope of the present invention.

Claims

1. A method for modeling thermal errors of a machine tool spindle, characterized in that: The steps include: Step 1: Initialize the population and parameters: Use the learning rate of the CNN-BiLSTM-Attention model, the convolution kernel size of the CNN layer, and the number of neurons in the BiLSTM layer as the parameters to be optimized for the RIME algorithm. Initialize the number of rime agents to 20 to obtain the initialized rime population: Step 2: Build the CNN-BiLSTM-Attention model and determine the fitness function: Traverse the Rime Agent and initialize the optimal fitness, optimal prediction value, optimal network and optimal network parameters; Step 3: Use a soft frost search strategy to switch between large-scale exploration and small-scale development in, is the new position of the particle after the update, The parameter r1 is a random number in the range of (-1, 1). r1 controls the direction of particle movement and changes with the number of iterations together with cosθ. β is the environmental factor. Step 4: Use hard frost ice puncture mechanism to achieve effective information exchange between individuals in is the new position of the particle after update, R best,j is the jth particle of the best rime individual in the rime population, norm(R ij ) The normalized value of the current individual fitness value; Step 5: Use the forward greedy mechanism to filter out inferior solutions and retain the best solutions: compare the fitness value of the agent after the update with the fitness value of the agent before the update. If the fitness value after the update is better than the value before the update, a replacement occurs, and the agent whose solution is to be replaced is found at the same time; Step 6: Import the CNN-BiLSTM-Attention model and update the optimal fitness, optimal prediction value, optimal network and optimal network parameters; Step 7: Determine whether the termination condition is met and set the maximum number of iterations in the model to 20; Step 8. Export the optimal fitness, optimal prediction value, optimal network and optimal network parameters of the CNN-BiLSTM-Attention model and analyze the training results.

2. A method for modeling thermal errors of a machine tool spindle according to claim 1, characterized in that: The CNN-BiLSTM-Attention model includes an input layer, a CNN layer, a BiLSTM layer, and an Attention layer. The CNN layer extracts features from the input data by setting multiple convolution kernels. The BiLSTM is composed of two LSTMs, one for forward processing of the input sequence; the other for reverse processing of the sequence. After processing, the outputs of the two LSTMs are concatenated. An Attention mechanism is added after the BiLSTM to weight the hidden states of all steps and focus attention on the more important hidden state information in the entire text.

3. A method for modeling thermal errors of a machine tool spindle according to claim 2, characterized in that: The input layer specifies the input format of the data (batch size, time steps, feature dimension). Batch size: for the data collected from the experiment, the batch size refers to the number of experimental data under different working conditions that are imported into the model together. The batch size is set to 1 in the model. Time steps (TIME_STEPS): the number of time points included in each input data. The time steps are set to 3 in the model. Feature dimension (INPUT_DIMS): the dimension of the input data. The experimental data contains 3 temperature field measurement points, so the input data dimension is set to 3.

4. A method for modeling thermal errors of a machine tool spindle according to claim 1, characterized in that: Forward LSTM output: Forget Gate: Input Gate: unit: Output Gate: Final output: Backward LSTM output: Forget Gate: Input Gate: unit: Output Gate: Final output: The output in BiLSTM is the hidden state of the forward LSTM and the backward LSTM at each time step t and The specific calculation formula for this process step is:

Citation Information

Cited By

  • Traffic state refined identification method for phase type intersection

    CN119229653A