Lathe thermal error adaptive compensation method and system based on deep neural network

Through the adaptive compensation method of lathe thermal error based on deep neural network, the problem of insufficient accuracy in the face of complex error sources is solved, and higher processing accuracy and stability are achieved, adapt to complex environments and continuously optimized.

CN119472502APending Publication Date: 2025-02-18SHAANXI HIGH END MASCH TOOL INNOVATION RES CO LTD

Patent Information

Application Number
CN202411538232.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The traditional lathe thermal error compensation method is difficult to effectively solve when facing complex, multi-dimensional and nonlinear error sources, resulting in insufficient lathe machining accuracy and stability.

Method used

Adaptive compensation method for lathe thermal error based on deep neural network is adopted to collect multiple environments and workpiece temperature data in real time, and the deep neural network model with multi-layer perceptron structure is constructed, and the model parameters are updated in real time through adaptive learning mechanism to Adapt to the changes in errors under different seasons, time periods and processing conditions.

Benefits of technology

It significantly improves the machining accuracy and stability of the lathe, can better adapt to the complex and variable processing environment, continuously optimize the model, and improve product consistency and quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119472502A_ABST
    Figure CN119472502A_ABST
Patent Text Reader

Abstract

The invention discloses a lathe thermal error adaptive compensation method based on a deep neural network, and the method specifically comprises the steps: carrying out the denoising and normalization processing of data, and dividing the data into a training set and a test set; training a deep neural network model by using the training set data, and updating parameters of the deep neural network model in real time through an adaptive learning mechanism to obtain a deep neural network model with an optimal working condition; thermal errors of all the motion axes are predicted through the model, compensation values are fed back to control systems of all the motion axes, and real-time compensation is achieved. The invention also discloses a lathe thermal error adaptive compensation system based on the deep neural network. The system comprises a data acquisition module, a deep neural network model training module and a compensation control module. According to the method, through an adaptive learning mechanism of the deep neural network model, the thermal error change of each motion axis under different seasons, different time periods and machining conditions can be dynamically responded, and the machining precision of the lathe is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of CNC machine tool control, and specifically relates to a lathe thermal error adaptive compensation method based on a deep neural network, and also relates to a lathe thermal error adaptive compensation system based on a deep neural network. Background Art

[0002] In the actual machining process of the lathe, the positioning error of each moving axis is affected by many factors, such as ambient temperature, temperature of the screw and nut, spindle speed, feed speed and process time during machining. Traditional thermal error compensation methods are often unable to cope with complex, multi-dimensional and nonlinear error sources. In order to solve these problems, a deep neural network (DNN) is used to establish a thermal error model, and through the adaptive learning function, the model is dynamically updated according to the data fed back by the user, so that it can better adapt to the error compensation needs in different seasons, different time periods and various machining conditions, so as to improve the machining accuracy and stability of the lathe.

[0003] Chinese patent (application number: 201810936815.9, publication number: CN 108803486 B, publication date: 2021.02.02) discloses a method for thermal error prediction and compensation of CNC machine tools based on parallel deep learning networks. First, a heat source measurement point is selected on the CNC machine tool, and the temperature value of the heat source measurement point and the thermal error value of the spindle at the corresponding time point are detected as sample data; a deep learning thermal error prediction model based on a parallel deep belief network is established and trained; the predicted thermal error value is used as the compensation translation to achieve real-time compensation of thermal error. This method has the advantages of being able to accurately characterize the complex mapping relationship between the monitoring temperature signal and the thermal error in the case of big data, which is conducive to improving the accuracy of thermal error prediction and compensation. Although the three deep belief networks in the model are used to predict the thermal error values ​​of the spindle in the X, Y, and Z axis directions respectively, there may be a certain correlation between the thermal errors of the spindle in different axis directions. The model cannot make full use of this correlation, which reduces the prediction accuracy. On the other hand, the synergy between the three networks is too strong, which will lead to overfitting or excessive sensitivity to thermal errors in a certain direction, affecting the stability of the model.

[0004] The Chinese patent (application number: 202010391543.6, publication number: CN 111596612 A, publication date: 2020.08.28) discloses a method and system for thermal error compensation of CNC machine tools based on workpiece size data. Through process capability index analysis based on machining procedures, the key temperature points are analyzed from the measured temperature data of the cutting work; a CNC machine tool thermal error model based on workpiece size detection data is constructed through a multi-layer perceptron neural network, and then the motion compensation amount is obtained, and thermal error compensation is realized through the external coordinate zero point offset function of the CNC machine tool. This method takes into account the thermal deformation of the machine tool and the workpiece caused by the machining process, and effectively compensates for the thermal error of the machine tool under actual machining conditions. Thermal error compensation is realized through the external coordinate zero point offset function of the CNC machine tool, which depends on the stability and reliability of the CNC machine tool control system. If the control system of the CNC machine tool fails or is disturbed, the coordinate zero point offset may be inaccurate, affecting the effect of thermal error compensation. Summary of the invention

[0005] The purpose of the present invention is to provide a lathe thermal error adaptive compensation method based on deep neural network, which optimizes the accuracy of the model by introducing an adaptive learning mechanism, thereby improving the positioning accuracy of each motion axis.

[0006] The purpose of the present invention is to provide a lathe thermal error adaptive compensation system based on deep neural network.

[0007] The technical solution adopted by the present invention is a lathe thermal error adaptive compensation method based on a deep neural network, which is specifically implemented according to the following steps:

[0008] Step 1: Data collection and preprocessing: During the operation of the lathe, the ambient temperature T is collected in real time. env , screw temperature T ball , Nut temperature T nut , spindle speed S, feed speed F, process time t data and corresponding positioning errors of each motion axis ò z ; De-noise and normalize the collected data, and divide the data into training set and test set;

[0009] Step 2, build a deep neural network model;

[0010] Step 3, using the training set data to train the deep neural network model, and through an adaptive learning mechanism, updating the parameters of the deep neural network model in real time to obtain the deep neural network model with the best working condition;

[0011] Step 4: Use the deep neural network model with the best working conditions to predict the thermal error of each motion axis, and feed back the compensation value to the control system of each motion axis to achieve real-time compensation.

[0012] The present invention is also characterized in that:

[0013] In step 2, the deep neural network model adopts a multi-layer perceptron structure, which consists of an input layer, multiple hidden layers and an output layer; 3-5 hidden layers are used, each layer contains 50-100 neurons; the output of each hidden layer is transformed by a nonlinear activation function.

[0014] The input feature vector of the deep neural network model is shown in formula (2), and the output is the positioning error prediction value of each motion axis, as shown in formula (3):

[0015] X=[T env ,T ball ,T nut ,S,F,t] (2);

[0016]

[0017] Where f(g) represents the deep neural network model, W and b represent the weight matrix and bias vector of the model respectively;

[0018] The deep neural network model uses the mean square error (MSE) as the loss function. The calculation formula of the loss function is shown in formula (4):

[0019]

[0020] in, is the actual positioning error of each motion axis of the i-th sample, is the error of the model prediction and N is the number of samples.

[0021] In step 3, specifically:

[0022] Step 3.1: Obtain the actual positioning error based on the measured data of the processed workpiece and store;

[0023] Step 3.2: The actual positioning error Positioning error compared to model prediction Make a comparison and calculate the error difference;

[0024] Step 3.3, based on the error difference, the weights and biases of the deep neural network are updated through the Adam optimization algorithm to gradually adapt the model to the current working conditions; when the loss function value of the model no longer decreases significantly during the iteration, the model has converged and training is stopped.

[0025] The update formula of the Adam optimization algorithm is:

[0026] (1) Calculate the exponentially weighted moving average of the gradient, as shown in formula (5):

[0027] m t =β1m t-1 +(1-β1)g t (5);

[0028] Among them, m t is the first-order momentum estimate of the gradient, β1 is the exponential decay rate of the first-order momentum, g t is the current gradient;

[0029] (2) Calculate the exponentially weighted moving average of the square of the gradient, as shown in formula (6):

[0030]

[0031] Among them, v t is the second-order momentum estimate of the gradient, β2 is the exponential decay rate of the second-order momentum;

[0032] (3) Calculate the deviation correction, as shown in equation (7) and equation (8):

[0033]

[0034] (4) Calculate the update amount of the parameters, as shown in formula (9):

[0035]

[0036] in, is the updated model parameter, η is the learning rate, and ε is a constant.

[0037] Another technical solution adopted by the present invention is a lathe thermal error adaptive compensation system based on a deep neural network, comprising:

[0038] Data acquisition module, used to collect real-time ambient temperature, screw temperature, nut temperature, spindle speed, feed speed, and process time;

[0039] The deep neural network model training module predicts the positioning error of each motion axis based on the collected data, and updates it online according to the feedback data through an adaptive learning mechanism;

[0040] The compensation control module feeds back the error compensation value predicted by the deep neural network model to the CNC system for real-time adjustment of the positioning of each motion axis.

[0041] The beneficial effects of the present invention are as follows: the method of the present invention can dynamically respond to the changes in thermal errors of each motion axis in different seasons, time periods and processing conditions through the adaptive learning mechanism of the deep neural network model, significantly improving the processing accuracy of the lathe. Compared with the traditional model, this method can better adapt to complex and changeable processing environments, and can be continuously optimized over time, thereby improving the consistency and quality of the product. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 It is a training flow chart of the deep neural network model of the present invention;

[0043] Figure 2 This is a diagram of the implementation framework of the adaptive learning mechanism of the present invention;

[0044] Figure 3 It is a schematic diagram of the integration of the compensation system of the present invention in the numerical control system;

[0045] Figure 4 This is a comparison chart of the multi-point temperature test results of the lathe process cycle when processing workpieces and the prediction results of the deep neural network model;

[0046] Figure 5 It is a diagram of the iterative process when the deep neural network model makes predictions. DETAILED DESCRIPTION

[0047] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0048] Example 1

[0049] The lathe thermal error adaptive compensation method based on deep neural network of the present invention is implemented in the following steps:

[0050] Step 1, data collection and preprocessing;

[0051] During the operation of the lathe, the ambient temperature T is collected in real time. env , screw temperature T ball , Nut temperature T nut , spindle speed S, feed speed F, process time t data and corresponding positioning errors of each motion axis ò z ; Preprocess the collected data, including denoising and normalization, and divide the preprocessed data into training set and test set;

[0052] Step 2, build a deep neural network model;

[0053] The deep neural network model adopts the structure of multi-layer perceptron (MLP), which consists of an input layer, multiple hidden layers and an output layer; it uses 3-5 hidden layers, each containing 50-100 neurons; the output of each hidden layer is transformed by a nonlinear activation function (ReLU);

[0054] ReLU function, the specific calculation formula is shown in formula (1):

[0055] σ(x)=max(0,x) (1);

[0056] Where x is the input signal and σ(x) is the output signal.

[0057] Through multiple hidden layers and nonlinear activation functions, the complex mapping relationship between temperature change and positioning error of each motion axis can be learned.

[0058] Multilayer perceptrons can learn complex nonlinear relationships. In the lathe thermal error compensation problem, the relationship between thermal error and various factors is nonlinear. Multilayer perceptrons can model these complex nonlinear relationships through neurons in multiple hidden layers, thereby predicting thermal errors more accurately. Compared with linear models, multilayer perceptrons can better adapt to the complex data distribution in practical problems and improve the accuracy of thermal error models.

[0059] The input feature vector of the model is shown in formula (2), and the output is the positioning error prediction value of each motion axis, as shown in formula (3):

[0060] X=[T env ,T ball ,T nut ,S,F,t] (2);

[0061]

[0062] Where f(g) represents the deep neural network model, W and b represent the weight matrix and bias vector of the model respectively;

[0063] The model uses mean square error (MSE) as the loss function. The calculation formula of the loss function is shown in formula (4):

[0064]

[0065] in, is the actual positioning error of each motion axis of the i-th sample, is the error of model prediction, N is the number of samples;

[0066] Step 3: Use the training set data to train the deep neural network model, and update the parameters of the deep neural network model in real time through the adaptive learning mechanism to obtain the deep neural network model with the best working condition, such as Figure 1 and Figure 2 As shown;

[0067] Step 3.1: Obtain the actual positioning error based on the measured data of the processed workpiece and store;

[0068] Step 3.2: The actual positioning error Positioning error compared to model prediction Make a comparison and calculate the error difference;

[0069] Step 3.3: According to the error difference, the weights and biases of the deep neural network are updated through the Adam optimization algorithm to gradually adapt the model to the current working conditions. When the loss function value of the model no longer decreases significantly during the iteration, the model has converged and training is stopped.

[0070] The update formula of the Adam optimization algorithm is:

[0071] (1) Calculate the exponentially weighted moving average of the gradient, as shown in formula (5):

[0072] m t =β1m t-1 +(1-β1)g t (5);

[0073] Among them, m t is the first-order momentum estimate of the gradient, β1 is the exponential decay rate of the first-order momentum, g t is the current gradient;

[0074] (2) Calculate the exponentially weighted moving average of the square of the gradient, as shown in formula (6):

[0075]

[0076] Among them, v t is the second-order momentum estimate of the gradient, and β2 is the exponential decay rate of the second-order momentum.

[0077] (3) Calculate the deviation correction, as shown in equation (7) and equation (8):

[0078]

[0079]

[0080] (4) Calculate the update amount of the parameters, as shown in formula (9):

[0081]

[0082] in, are the updated model parameters, η is the learning rate, ε is a constant used to prevent division by zero;

[0083] The adaptive learning mechanism can update the model parameters in real time, so that the model can be continuously adjusted and optimized according to the comparison between the actual positioning error and the model prediction error. This adaptive learning mechanism can make the model better adapt to the current working conditions and improve the effect of thermal error compensation.

[0084] The deep neural network model of the present invention has long-term adaptability and can dynamically adjust the weight distribution of the model according to historical data to adapt to the changes in thermal errors of each motion axis in different seasons (spring, summer, autumn and winter), different time periods (day and night) and different processing conditions.

[0085] Step 4: Use the deep neural network model with the best working conditions to predict the thermal error of each motion axis, and feed back the compensation value to the control system of each motion axis to achieve real-time compensation.

[0086] During the machining process, data such as ambient temperature, screw temperature, nut temperature, spindle speed, etc. are input into the model in real time to calculate the current predicted positioning error values ​​of each motion axis and perform real-time compensation.

[0087] Example 2

[0088] The invention discloses a lathe thermal error adaptive compensation system based on a deep neural network, comprising:

[0089] Data acquisition module, used to collect real-time ambient temperature, screw temperature, nut temperature, spindle speed, feed speed, and process time;

[0090] The deep neural network model training module predicts the positioning error of each motion axis based on the collected data, and updates it online according to the feedback data through an adaptive learning mechanism;

[0091] The compensation control module feeds back the error compensation value predicted by the model to the CNC system for real-time adjustment of the positioning of each motion axis.

[0092] Example 3

[0093] The present invention provides a lathe thermal error adaptive compensation method based on a deep neural network, specifically:

[0094] 1. Data collection and preprocessing stage;

[0095] The ambient temperature, screw temperature, nut temperature, etc. are measured respectively. At the same time, by obtaining data such as spindle speed, feed speed and process time; the collected data is denoised and normalized to remove outliers and noise interference, and the data range is unified to [0,1]. Then, the pre-processed data is divided into training set and test set according to 7:3;

[0096] 2. Construction of deep neural network model stage;

[0097] Determine the structure of the deep neural network according to the actual situation, use 3-5 hidden layers, each layer contains 50-100 neurons. Select the appropriate nonlinear activation function (ReLU) and loss function (mean square error).

[0098] The input feature vectors of the model are determined to be the ambient temperature, screw temperature, nut temperature, spindle speed, feed speed and process time, and the output is the predicted value of the positioning error of each motion axis.

[0099] 3. Training and optimization stage;

[0100] The deep neural network model is trained using the training set data. During the training process, an adaptive learning mechanism is used to update the model parameters in real time through the Adam optimization algorithm based on the comparison between the actual positioning error and the model prediction error. When the loss function value of the model no longer decreases significantly during the iteration, the training is stopped. Then, the model is evaluated using the test set data to ensure that the model performance meets the requirements.

[0101] 4. Practical application stage:

[0102] like Figure 3 As shown in the figure, in the actual processing process, various data of the lathe are collected in real time and input into the trained deep neural network model to predict the thermal error of each motion axis. The predicted thermal error compensation value is fed back to the control system of each motion axis to achieve real-time compensation. At the same time, the performance of the model is continuously monitored and the model is adjusted and optimized according to the actual situation.

[0103] When processing a specific part, the ambient temperature of the lathe is 25°C, the screw temperature is 30°C, the nut temperature is 32°C, the spindle speed is 1000r / min, the feed speed is 0.5mm / min, and the process time is 30min. These data are input into the trained deep neural network model, and the model predicts that the positioning error of each motion axis is [0.01mm, -0.02mm, 0.03mm]. These compensation values ​​are fed back to the control system of each motion axis to achieve real-time compensation of thermal errors and improve processing accuracy.

[0104] Figure 4It is a comparison between the process cycle multi-point temperature test results and the prediction results of the deep neural network when the lathe processes the workpiece at 4000r / min; Figure 5 It is an iterative process when the deep neural network model makes predictions. The results show that the method of the present invention can accurately predict the temperature change and deformation of the lathe under complex working conditions. The error between the predicted value and the true value is small. The positioning error can be effectively reduced through compensation to ensure the processing quality of the lathe under different working conditions.

[0105] The updated deep neural network model of the present invention is integrated into the CNC system of the lathe, and the various parameter data during the processing are received in real time to predict and compensate the positioning error of each motion axis. During the processing, the system will dynamically adjust the position of each motion axis based on the real-time input parameters such as temperature, spindle speed, feed speed, etc., combined with the error value calculated by the deep neural network model.

Claims

1. The lathe thermal error adaptive compensation method based on deep neural network is characterized by: Follow the steps below to implement it: Step 1: Data collection and preprocessing: During the operation of the lathe, the ambient temperature T is collected in real time. env , screw temperature T ball , Nut temperature T nut , spindle speed S, feed speed F, process time t data and corresponding positioning errors of each motion axis ò z ; De-noise and normalize the collected data, and divide the data into training set and test set; Step 2, build a deep neural network model; Step 3, using the training set data to train the deep neural network model, and through an adaptive learning mechanism, updating the parameters of the deep neural network model in real time to obtain the deep neural network model with the best working condition; Step 4: Use the deep neural network model with the best working conditions to predict the thermal error of each motion axis, and feed back the compensation value to the control system of each motion axis to achieve real-time compensation.

2. The lathe thermal error adaptive compensation method based on deep neural network according to claim 1 is characterized in that: In step 2, the deep neural network model adopts a multi-layer perceptron structure, which consists of an input layer, multiple hidden layers and an output layer; 3-5 hidden layers are used, each layer contains 50-100 neurons; the output of each hidden layer is transformed by a nonlinear activation function.

3. The lathe thermal error adaptive compensation method based on deep neural network according to claim 2 is characterized in that: The input feature vector of the deep neural network model is shown in formula (2), and the output is the positioning error prediction value of each motion axis, as shown in formula (3): X=[T env ,T ball ,T nut ,S,F,t] (2); Where f(g) represents the deep neural network model, W and b represent the weight matrix and bias vector of the model respectively; The deep neural network model uses the mean square error (MSE) as the loss function. The calculation formula of the loss function is shown in formula (4): in, is the actual positioning error of each motion axis of the i-th sample, is the error of the model prediction and N is the number of samples.

4. The lathe thermal error adaptive compensation method based on deep neural network according to claim 1, characterized in that: In the step 3, specifically: Step 3.1: Obtain the actual positioning error based on the measured data of the processed workpiece and store; Step 3.2: The actual positioning error Positioning error compared to model prediction Make a comparison and calculate the error difference; Step 3.3: According to the error difference, the weights and biases of the deep neural network are updated through the Adam optimization algorithm to gradually adapt the model to the current working conditions. When the loss function value of the model no longer decreases significantly during the iteration, the model has converged and training is stopped.

5. The lathe thermal error adaptive compensation method based on deep neural network according to claim 4 is characterized in that: The update formula of the Adam optimization algorithm is: (1) Calculate the exponentially weighted moving average of the gradient, as shown in formula (5): m t =β1m t-1 +(1-β1)g t (5); Among them, m t is the first-order momentum estimate of the gradient, β1 is the exponential decay rate of the first-order momentum, g t is the current gradient; (2) Calculate the exponentially weighted moving average of the square of the gradient, as shown in formula (6): Among them, v t is the second-order momentum estimate of the gradient, β2 is the exponential decay rate of the second-order momentum; (3) Calculate the deviation correction, as shown in equation (7) and equation (8): (4) Calculate the update amount of the parameters, as shown in formula (9): in, is the updated model parameter, η is the learning rate, and ε is a constant.

6. A system for implementing the lathe thermal error adaptive compensation method based on deep neural network as described in any one of claims 1 to 5, characterized in that: include: Data acquisition module, used to collect real-time ambient temperature, screw temperature, nut temperature, spindle speed, feed speed, and process time; A deep neural network model training module predicts the positioning error of each motion axis based on the collected data, and performs online updates based on the feedback data through an adaptive learning mechanism; The compensation control module feeds back the error compensation value predicted by the deep neural network model to the CNC system for real-time adjustment of the positioning of each motion axis.

Citation Information

Patent Citations

  • Numerical control machine tool thermal error prediction and compensation method based on parallel deep learning network

    CN108803486A

  • A Method for Predicting and Compensating Thermal Errors in CNC Machine Tools Based on Parallel Deep Learning Networks

    CN108803486B

  • Numerically-controlled machine tool thermal error compensation method and system based on workpiece size data

    CN111596612A

Cited By

  • Intelligent reasoning method for machine tool machining precision driven by iterative physical embedded graph network

    CN119916742A

  • Precise positioning electrical control system for die of roll forging machine

    CN120382120A