Training method and device of machine tool translational axis error compensation model, machine tool and medium
By pre-training and transfer training the initial translational axis error compensation model, and utilizing the dataset and error database generated by topology and multibody theory, the problem of insufficient accuracy in translational axis error compensation for five-axis CNC machine tools was solved, and high-precision error compensation for different machine tool types and life stages was achieved.
Patent Information
- Application Number
- CN202410648620.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-23
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2044-05-23
AI Technical Summary
The existing translational axis error compensation methods for five-axis CNC machine tools cannot adopt different compensation strategies according to different machine tool types and life stages, resulting in low error compensation accuracy.
By pre-training and transfer training the pre-built initial translational axis error compensation model, a second translational axis error compensation model suitable for the machine tool model and life stage to be tested is generated. The pre-training dataset is generated using topological structure and many-body theory, and transfer training is performed in combination with the actual error database.
The error compensation accuracy of the translation axis has been improved, making the error compensation model applicable to machine tools of different types and life stages, thereby improving machining accuracy.
Smart Images

Figure CN118567293B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of numerical control machining, in particular to a training method and device of a machine tool translational axis error compensation model, a machine tool and a medium. BACKGROUND
[0002] Five-axis numerical control machine tools are commonly used for machining complex curved surfaces and have a significant influence on the aerospace, precision instrument and high-precision medical equipment industries. With the development of the aerospace industry, the technical requirements for its products are continuously improving, and therefore the machining precision requirements for five-axis numerical control machine tools are increasingly stringent.
[0003] The main factor affecting the machining precision of a five-axis numerical control machine tool is the translational axis of the five-axis numerical control machine tool. At present, the error recognition and compensation method for the translational axis of the five-axis numerical control machine tool does not have the ability to adopt different compensation strategies according to different machine tool types and different life stages, resulting in low error compensation precision of the translational axis of the five-axis numerical control machine tool.
[0004] The above content is only used to assist in understanding the technical solutions of the present application and does not represent the acknowledgement of the above content as prior art. SUMMARY
[0005] The main purpose of the present application is to provide a training method and device of a machine tool translational axis error compensation model, a machine tool and a medium, which aims to pre-train and migrate the initial translational axis error compensation model to obtain a second translational axis error compensation model, so that the second translational axis error compensation model can be applicable to the machine type and the current life stage of the machine tool to be detected, thereby improving the error compensation precision of the translational axis.
[0006] To achieve the above purpose, the present application provides a training method of a machine tool translational axis error compensation model, which comprises the following: generating a pre-training data set and an error database respectively, wherein the pre-training data set is generated according to the topological structure of the machine tool and the theory of multiple bodies, the error database is an actual error database generated by error detection of the machine tool according to a first preset trajectory line, and the error database includes target error data corresponding to the machine type of the machine tool to be detected; based on the pre-training data set, pre-training an initially constructed initial translational axis error compensation model to obtain a trained first translational axis error compensation model; based on the target error data, migrating the first translational axis error compensation model to obtain a second translational axis error compensation model after completing the migration training.
[0007] Optionally, the pre-training, based on the pre-training data set, of a pre-constructed initial parallel axis error compensation model to obtain a trained first parallel axis error compensation model comprises: obtaining the pre-training data set and inputting the pre-training data set into the initial parallel axis error compensation model to obtain training error data values; performing loss calculation on the training error data values based on a preset loss function and a preset actual error data value to obtain a loss value; and adjusting parameters of each node in the initial parallel axis error compensation model by gradient descent method based on the loss value until the loss value is lower than a preset threshold or the loss value does not change after a plurality of iterations, so as to obtain the first parallel axis error compensation model.
[0008] Optionally, the method further comprises: setting parameters of a preset number of hidden layers of the first parallel axis error compensation model as fixed parameters; and the migration training, based on the target error data, of the first parallel axis error compensation model to obtain a second parallel axis error compensation model after completion of migration training comprises: performing migration training on other parameters of the first parallel axis error compensation model except the fixed parameters based on the target error data.
[0009] Optionally, the migration training, based on the target error data, of the first parallel axis error compensation model on other parameters except the fixed parameters comprises: selecting data corresponding to a second preset trajectory line in the target error data; inputting the data corresponding to the second preset trajectory line in the target error data into the first parallel axis error compensation model to obtain migration error data with the same number of items as the target error data; and performing migration training on other parameters of the first parallel axis error compensation model except the fixed parameters based on the migration error data and the target error data to obtain a second parallel axis error compensation model.
[0010] Optionally, the initial parallel axis error compensation model comprises an input layer, a hidden layer and an output layer, and a construction method of the initial parallel axis error compensation model comprises the following: constructing an input layer of the initial parallel axis error compensation model based on a machine tool service life value and a detection value obtained according to the second preset trajectory line; constructing a hidden layer of the initial parallel axis error compensation model; and constructing an output layer of the initial parallel axis error compensation model.
[0011] Optionally, an activation function of a preset level of a hidden layer of the initial parallel axis error compensation model is a linear rectifier function, and an activation function of the hidden layer of the initial parallel axis error compensation model except the preset level is a normalized exponential function.
[0012] Optionally, after the migration training of the first translational axis error compensation model based on the target error data is completed, the method further comprises: detecting the to-be-detected machine tool based on the second preset trajectory line to obtain detection parameters of the to-be-detected machine tool; and inputting the detection parameters of the to-be-detected machine tool into the second translational axis error compensation model to obtain error compensation data of the translational axis of the to-be-detected machine tool.
[0013] To achieve the above-mentioned purpose, the present application provides a machine tool translational axis error compensation prediction method, which comprises the following steps: detecting the to-be-detected machine tool based on a second preset trajectory line to obtain detection parameters of the to-be-detected machine tool; and inputting the detection parameters of the to-be-detected machine tool into a second translational axis error compensation model to obtain error compensation data of the translational axis of the to-be-detected machine tool; wherein the second translational axis error compensation model is obtained by migration training of a first translational axis error compensation model based on target error data, the first translational axis error compensation model is obtained by pre-training of a pre-constructed initial translational axis error compensation model based on a pre-training data set, the pre-training data set is generated according to the topological structure of the machine tool and the multibody theory, and the target error database is an actual error database generated by error detection of the machine tool based on a first preset trajectory line.
[0014] Optionally, the training method of the second translational axis error compensation model comprises: generating a pre-training data set and an error database respectively, wherein the pre-training data set is generated according to the topological structure of the machine tool and the multibody theory, the error database is an actual error database generated by error detection of the machine tool based on a first preset trajectory line, and the error database comprises target error data corresponding to the machine type of the to-be-detected machine tool; pre-training a pre-constructed initial translational axis error compensation model based on the pre-training data set to obtain a trained first translational axis error compensation model; and migration training of the first translational axis error compensation model based on the target error data to obtain the second translational axis error compensation model.
[0015] In addition, to achieve the above object, the application further provides a training device of a machine tool translational axis error compensation model, comprising: a generation module, configured to generate a pre-training data set and an error database respectively, wherein the pre-training data set is generated according to a topological structure of a machine tool and a multibody theory, the error database is an actual error database generated by error detection of the machine tool according to a first preset trajectory line, and the error database comprises target error data corresponding to a machine type of the machine tool to be detected; a pre-training module, configured to pre-train an initially constructed initial translational axis error compensation model based on the pre-training data set, to obtain a first trained translational axis error compensation model; and a transfer training module, configured to perform transfer training on the first translational axis error compensation model based on the target error data, to obtain a second translational axis error compensation model after completion of the transfer training.
[0016] In addition, to achieve the above object, the application further provides a machine tool translational axis error compensation prediction device, comprising: a detection parameter acquisition module, configured to detect the machine tool to be detected based on a second preset trajectory line, to acquire detection parameters of the machine tool to be detected; and an error compensation determination module, configured to input the detection parameters of the machine tool to be detected into the second translational axis error compensation model, to obtain error compensation data of a translational axis of the machine tool to be detected; wherein the second translational axis error compensation model is obtained by performing transfer training on a first translational axis error compensation model based on target error data, the first translational axis error compensation model is obtained by pre-training an initially constructed initial translational axis error compensation model based on a pre-training data set, the pre-training data set is generated according to a topological structure of a machine tool and a multibody theory, and the target error database is an actual error database generated by error detection of the machine tool according to a first preset trajectory line.
[0017] In addition, to achieve the above object, the application further provides a five-axis numerical control machine tool, comprising a translational axis, a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the training method of the machine tool translational axis error compensation model according to any one of the above and implements the error compensation prediction method of the machine tool translational axis according to any one of the above.
[0018] In addition, to achieve the above object, the application further provides a computer readable storage medium, having a computer program stored thereon, wherein the computer program is executed by a processor to implement the training method of the machine tool translational axis error compensation model according to any one of the above and implement the error compensation prediction method of the machine tool translational axis according to any one of the above.
[0019] The training method, device, machine tool and medium of the machine tool translational axis error compensation model have the following technical effects:
[0020] The initial translational axis error compensation model is pre-trained through a pre-training data set, and a first trained translational axis error compensation model is obtained, wherein the pre-training data set is generated according to the topological structure of the machine tool and the multibody theory. Since the topological structure and the multibody theory can detect the error of each node in the motion trajectory of the translational axis, the error data of different types of machine tools in different environments can be simulated, so that the initial translational axis error compensation model can learn the error change rule of different types of machine tools and machine tools in different life stages, and the error compensation accuracy of the translational axis is improved. The first pre-trained translational axis error compensation model is migrated and trained through target error data, and a second translational axis error compensation model is obtained. Since the error database is an actual error database generated by detecting the error of the machine tool according to the first preset trajectory line, the error database includes target error data corresponding to the machine type of the machine tool to be detected, and the migration training is completed according to the target error data, so that the second translational axis error compensation model can be applied to the machine type of the machine tool to be detected and the current life stage, and the error compensation accuracy of the translational axis is further improved. BRIEF DESCRIPTION OF DRAWINGS
[0021] Figure 1 The flowchart of an embodiment of the training method of the machine tool translational axis error compensation model of the present application is shown.
[0022] Figure 2 The flowchart of another embodiment of the training method of the machine tool translational axis error compensation model of the present application is shown.
[0023] Figure 3 The flowchart of an embodiment of the error compensation prediction method of the machine tool translational axis of the present application is shown.
[0024] Figure 4 The structure diagram of the translational axis error compensation model of the present application is shown.
[0025] Figure 5 The schematic diagram of the second preset trajectory line of the present application is shown.
[0026] Figure 6 The structure diagram of the hidden layer of the translational axis error compensation model of the present application is shown.
[0027] Figure 7 The function module diagram of an embodiment of the training device of the machine tool translational axis error compensation model of the present application is shown.
[0028] Figure 8A functional module schematic diagram of an embodiment of the error compensation prediction device of the machine tool translational axis of the present application;
[0029] Figure 9 A structural schematic diagram of a five-axis numerical control machine tool in an embodiment of the present application.
[0030] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0031] It should be understood that the specific embodiments described herein are only used to explain the present application and not to limit the present application.
[0032] In the prior art, five-axis numerical control machine tools are often used for machining complex curved surfaces and have a significant influence on the aerospace, precision instrument and high-precision medical equipment industries. With the development of the aerospace industry, the technical requirements for its products are continuously improving, and therefore the machining precision requirements for five-axis numerical control machine tools are increasingly stringent.
[0033] The main factor affecting the machining precision of the five-axis numerical control machine tool is the translational axis of the five-axis numerical control machine tool, and therefore measuring, analyzing and compensating for the error of the translational axis is an important content. The existing five-axis numerical control machine tool translational axis error identification and compensation methods include the thirteen-line detection method and the four-line detection method using the particle swarm algorithm, but different types of machine tools have different error change trends as the service life of the machine tool changes. Therefore, the above prior art does not have the ability to adopt different compensation strategies according to different machine tool types and different service life stages, resulting in low error compensation precision of the translational axis of the five-axis numerical control machine tool.
[0034] The present application provides a solution, which aims to obtain a second translational axis error compensation model by pre-training and migration training of a pre-constructed initial translational axis error compensation model, so that the second translational axis error compensation model can be applicable to the machine type and the current service life stage of the machine tool to be detected, thereby improving the error compensation precision of the translational axis.
[0035] Reference Figure 1 A flowchart of an embodiment of the training method of the machine tool translational axis error compensation model of the present application. Refer to Figure 1 The training method of the machine tool translational axis error compensation model can be executed by a computing device with computing function, which can be a desktop computer, a notebook computer or a five-axis numerical control machine tool, etc. The training method of the machine tool translational axis error compensation model includes S100 to S120, which are as follows:
[0036] S100, respectively generate pre-training data set and error database.
[0037] In the example embodiment, the pre-training data set is generated according to the topological structure of the machine tool and the multi-body theory, wherein the pre-training data set can include the following data:
[0038] .
[0039] The topological structure refers to the connection relationship between each mechanical element in the five-axis data NC machine tool, which can determine the function, performance and reliability of the five-axis data NC machine tool. In the embodiment of the application, a spatial positioning error model of the five-axis data NC machine tool is established based on the topological structure, as shown in Figure 5 , which includes 6 items of geometric error of X, Y and Z total 3 translation axes, i.e. 1 item of positioning error, 2 items of straightness error, 1 item of roll error, 1 item of pitch error, and 1 item of yaw error. In the embodiment, the 18 items of geometric error of the X, Y and Z three translation axes in the above spatial positioning error model include: 、 、 、 、 、 ; Y-axis error: 、 、 、 、 、 ; Z-axis error: 、 , , , 、 .
[0040] Multi-body theory, also known as multi-body physics, provides a framework for understanding the collective behavior of a large number of interacting particles. In the example embodiment, because the five-axis data NC machine tool cooperates with each mechanical element during the machining process, it is affected by complex multi-factor dynamic action, and the error identification process is more complex, so the particle weight optimization algorithm in the multi-body theory is introduced to analyze the motion trajectory of the translation axis of the five-axis data NC machine tool in the spatial positioning error model.
[0041] The error database is an actual error database generated by detecting the error of the machine tool according to the first preset trajectory line, and the error database includes target error data corresponding to the machine type of the machine tool to be detected, wherein the first preset trajectory line is 13 dynamic trajectory lines selected in the spatial positioning error model according to the particle weight optimization algorithm and the error detection requirement, and the error database can include the following 18 error data:
[0042] .
[0043] In some embodiments, in the present embodiment, the data in the above pre-training data set can be generated according to the following method through the topological structure and the many-body theory:
[0044] In the spatial positioning error model, according to the particle weight optimization algorithm, the motion trajectory of the tool associated with the prismatic axis in the ideal state can be expressed as:
[0045] , wherein:
[0046] , , , , ,
[0047] It should be noted that the above ideal state refers to the case where the motion trajectory of the tool does not change due to mechanical friction, tool wear and other factors in the ideal mechanical case.
[0048] In actual work, only considering the static error of the prismatic axis, the actual motion trajectory of the machine tool can be expressed as:
[0049] , wherein: , u=x, y, z represents the error generated by the prismatic axis motion, and L is the length of the tool.
[0050] For example can be obtained according to , , , , , :
[0051]
[0052] Therefore, in the case of given , , 18 error terms, the point position Figure 5 of each point in the actual motion of four lines (for example, the four lines , , , ) shown in can be generated. After calculating , we can get:
[0053] ,
[0054] The above 15 data obtained by calculation are used as the input layer of the pre-created prismatic axis error compensation model the 18 errors as actual errors, taking the 18 errors as target values for training, and constantly adjusting the input values, and the data generated in this process is the pre-training data set. That is, according to the topological structure and the many-body theory, the point positions of each node in the motion trajectory of the translational axis can be error-detected, so that error data of different types of machine tools in different environments can be simulated.
[0055] In some embodiments, in the present embodiment, the 18 error data included in the error database is generated according to the following method:
[0056] First, based on the established spatial positioning error model, the laser interferometer is used to detect the specific 13 trajectory lines of the machine tool, and the 18 geometric errors of the machine tool are identified to form the following error vector:
[0057] .
[0058] Secondly, in the actual error detection and identification process, the 13 trajectory lines will be divided into parts for detection and identification, and the current service life of the machine tool during error detection is recorded, and the current detection number is recorded, so that the error vector is added with a subscript, and the set of all errors forms an error database, that is, the 18 error data is as follows:
[0059]
[0060] It should be noted that in the present example embodiment, the generation order of the pre-training data set and the error database is not limited, and the user can determine the generation order of the pre-training data set and the error database according to actual needs.
[0061] S110, based on the pre-training data set, pre-training the initially constructed initial translational axis error compensation model to obtain a trained first translational axis error compensation model.
[0062] In the present example embodiment, the
[0063]
[0064] in the pre-training data set is input into the initially constructed initial translational axis error compensation model for training to obtain the trained first translational axis error compensation model.
[0065] It should be noted that the pre-training data set generated by the above embodiment can simulate the transformation of the performance of the machine tool to be detected under different conditions as much as possible, and therefore the pre-training of the initial translational axis error compensation model by the pre-training data set enables the initial translational axis error compensation model to learn the error variation law generated by different types of machine tools and machine tools at different life stages, thereby effectively improving the error detection accuracy.
[0066] In S120, the first translational axis error compensation model is trained based on the target error data to obtain a second translational axis error compensation model after the training.
[0067] In combination with the above example embodiment, in the present example embodiment, the target error data is actual error data obtained by error detection of the machine tool to be detected according to 13 trajectory lines. The first translational axis error compensation model is trained based on the target error data, and the error value output by the translational axis error compensation model is infinitely close to the target error data in the training process.
[0068] It should be noted that when the first translational axis error compensation model is trained, data of the same type of machine tool can be used for training, which can enable the first translational axis error compensation model to have specific learning ability for the same type of machine tool, and thus the second translational axis error compensation model after the training can improve the error detection accuracy of the machine tool to be detected.
[0069] In Figure 1 In the above description embodiment shown in the above description embodiment, the training method of the machine tool translational axis error compensation model is provided, the initial translational axis error compensation model is pre-trained by the pre-training data set, and the first translational axis error compensation model after the training is obtained, wherein the pre-training data set is generated according to the topological structure of the machine tool and the multibody theory. Since the topological structure and the multibody theory can detect the error of each node in the translational axis trajectory, the error data of different types of machine tools under different environments can be simulated, so that the initial translational axis error compensation model can learn the error variation law generated by different types of machine tools and machine tools at different life stages, and the error compensation accuracy of the translational axis is improved. The first translational axis error compensation model after the pre-training is trained by the target error data to obtain a second translational axis error compensation model, wherein the error database is an actual error database generated by error detection of the machine tool according to the first preset trajectory line, and the error database includes the target error data corresponding to the machine type of the machine tool to be detected. The target error data is used for training, so that the second translational axis error compensation model can be suitable for the machine type and the current life stage of the machine tool to be detected, and the error compensation accuracy of the translational axis is further improved.
[0070] Figure 2 FIG. 2 is a flowchart illustrating another embodiment of a method for training a machine tool translational axis error compensation model according to the present disclosure. Referring to FIG. 2, the method for training the machine tool translational axis error compensation model includes S200-S270, and details are as follows. Figure 2
[0071] S200, a pre-training data set and an error database are respectively generated.
[0072] The pre-training data set and the error database in the example embodiment are consistent with the training data set generation process in the above embodiment, and details are referred to the above embodiment. The example embodiment will not be described again.
[0073] S210, the pre-training data set is obtained, and the pre-training data set is input into an initial translational axis error compensation model for pre-training to obtain a training error data value.
[0074] In one possible embodiment, referring to FIG. 2, the initial translational axis error compensation model includes an input layer, a hidden layer, and an output layer. The construction method of the initial translational axis error compensation model includes S2101-S2103, and details are as follows. Figure 4
[0075] S2101: based on the machine tool service life value and the detection value obtained according to the second preset trajectory line, the input layer of the initial translational axis error compensation model is constructed.
[0076] In the example embodiment, referring to FIG. 2, the second preset trajectory line is four trajectory lines selected according to the translational axis spatial positioning error model, that is, the face diagonal lines of the X-Y, X-Z, and Y-Z planes are respectively denoted as Figure 5 , , , , the body diagonal line of the XYZ three-axis linkage is denoted as , the trajectory is divided into parts during measurement, each part is denoted as , , , , the length of each small section is denoted as , , , , the deviation value from the theoretical length is denoted as , , , , and the projection length of the deviation on the X, Y, and Z axes is denoted as , , , , , 、 、 、 ; the current life of the machine tool is recorded as . In this way, the input layer can be constructed as a 15-dimensional vector according to the length, deviation and life:
[0077]
[0078] S2102: Construct the hidden layer of the initial translational axis error compensation model.
[0079] In the example embodiment, referring to Figure 5 and Figure 6 , the initial translational axis error compensation model has 16 hidden layers, wherein layers 1-4 are convolution layers, the input channel number is 1, the output channel number is 64, and the four layers are established as a residual block; layers 5-8 are convolution layers, the input channel number is 64, the output channel number is 128, and the four layers are established as a residual block; layers 9-12 are convolution layers, the input channel number is 128, the output channel number is 256, and the four layers are established as a residual block; layers 13-16 are convolution layers, the input channel number is 256, the output channel number is 512, and the four layers are established as a residual block.
[0080] It should be noted that, in order to improve the learning ability of the initial translational axis error compensation model, the linear rectifier function is used as the activation function for the hidden layers of the initial translational axis error compensation model except for the last layer, that is, function as the activation function, and the normalized exponential function, that is, function, is used as the activation function for the last layer of the hidden layer of the initial translational axis error compensation model.
[0081] S2103: Construct the output layer of the initial translational axis error compensation model.
[0082] In the example embodiment, because the last output channel of the hidden layer is 512 and the dimension of the input vector is 15, the input of the fully connected layer is dimension, the output of the fully connected layer is the prediction value of the 18 geometric errors of the three translational axes, recorded as , and the loss function is constructed as:
[0083] , wherein , .
[0084] It should be noted that in the embodiment, the current life of the machine tool is included in the construction of the initial linear axis error compensation model and the pre-training of the initial linear axis error compensation model, so that the initial linear axis error compensation model has the ability to learn the error change rule generated by different types of machine tools at different life stages, and the compensation quality of the linear axis is improved.
[0085] In S220, loss calculation is performed on the training error data value based on the preset loss function and the preset actual error data value, and a loss value is obtained.
[0086] In the example embodiment, the preset loss function is:
[0087] , wherein, , ;
[0088] The preset actual error data value is obtained by detecting the machine tool using the 13-trace line detection method, and is set according to the machine tool type, the current life stage of the machine tool, and the effect to be achieved by training. In the embodiment, the preset actual error data value is the 18 actual error data values in the given 、 、 .
[0089] In S230, the parameters of each node in the initial linear axis error compensation model are adjusted by gradient descent method based on the loss value, until the loss value is lower than the preset threshold value or the number of iterations does not change, and the first linear axis error compensation model is obtained.
[0090] As can be understood in combination with the above embodiment, in the example embodiment, the pre-training data includes:
[0091]
[0092] The above pre-training data is input into the initial linear axis error compensation model, and the initial linear axis error compensation model outputs training error data values, which are 18 error data. Then, the loss value is calculated by the preset loss function and the given 、 、 18 actual error data values, and the loss value is obtained. Then, the initial linear axis error compensation model is updated by gradient descent method for backward propagation to train the model. When the loss value is reduced to a certain threshold value or the number of iterations does not change, the training of the initial linear axis error compensation model is stopped, and the first linear axis error compensation model is obtained.
[0093] S240, set the parameters of the preset number of layers of the hidden layer of the first translational axis error compensation model as fixed parameters.
[0094] Specifically, in combination with the above embodiment, the first translational axis error compensation model is trained for migration to improve the compensation accuracy of the first translational axis error compensation model. The parameters of the hidden layers 1-12 of the first translational axis error compensation model are fixed and unchanged, i.e. the parameters of the hidden layers 1-12 do not change during the migration training process, and only the parameters of the hidden layers 13-16 of the first translational axis error compensation model change.
[0095] S250, based on the target error data, the other parameters of the first translational axis error compensation model except the fixed parameters are trained for migration to obtain a second translational axis error compensation model.
[0096] In an example embodiment, 13 trajectory line detection methods are used to identify 18 errors of XYZ translational axes, and four of them 、 、 、 are taken as input of the input layer. The identified 18 errors are target values, and the first translational axis error compensation model with non-fixed parameters is trained for migration. During training, historical error identification data of the same type of five-axis CNC machine tool can be used for training. The second translational axis error compensation model after training is denoted as , which can be used for error compensation when the machine tool to be detected is detected.
[0097] Specifically, the process of migration training is as follows: when migrating, 13 trajectory line detection methods are used to detect the errors of the machine tool to be detected to obtain actual error data. Then, the detection results of four of the 13 trajectory lines, i.e. 、 、 、 are calculated.
[0098] ;
[0099] Then, the above 15 parameters are taken as target error data, and the target error data is input into the input layer of the first translational axis error compensation model. Then, the output layer of the first translational axis error compensation model outputs 18 errors ; and is taken as a predicted value, and the 18 errors identified by the 13 trajectory line detection method are taken as target values, i.e.
[0100]
[0101] Through the loss function Calculate the difference between the predicted value and the target value, and perform model migration training on the pre-trained model of the fixed part parameters through back propagation.
[0102] S260, detecting the machine tool to be detected based on the second preset trajectory line to obtain detection parameters of the machine tool to be detected.
[0103] In an example embodiment, the second preset trajectory line is Figure 5 four trajectory lines shown in FIG. 4, i.e. , , , The second preset trajectory line is detected by a laser interferometer to obtain detection parameters of the machine tool to be detected, and the detection parameters of the machine tool to be detected include 15 error parameters.
[0104] S270, inputting the detection parameters of the machine tool to be detected into the second translational axis error compensation model to obtain error compensation data of the translational axis of the machine tool to be detected.
[0105] In an example embodiment, the 15 error parameters of the machine tool to be detected are input into the second translational axis error compensation model to obtain error compensation data of the translational axis of the machine tool to be detected. In this embodiment, the error compensation data of the translational axis of the machine tool to be detected includes 18 error parameters. The number of error parameters is the same as the number of error parameters obtained by the first preset trajectory line.
[0106] In Figure 2 the above-described embodiment shown in FIG. 4, the training method of the machine tool translational axis error compensation model is provided. On the one hand, the loss value is calculated by the preset loss function and the preset actual error data value, and the parameters of each node of the initial translational axis error compensation model are adjusted by the loss value, so that the initial translational axis error compensation model can better fit the pre-training data and improve the compensation quality. On the other hand, the preset number of layers of the hidden layer of the first translational axis error compensation model is fixedly set, which not only reduces the workload of migration training, but also better fits the machine type and the current life stage of the machine tool to be detected.
[0107] The above embodiment is a specific embodiment of the training method of the machine tool translational axis error compensation model. For error compensation prediction of the second machine tool translational axis error compensation model in the above embodiment, the present application provides a machine tool translational axis error compensation prediction method.
[0108] Figure 3 FIG. 1 is a flowchart of an embodiment of the machine tool translational axis error compensation prediction method of the present application. Referring to Figure 3 , the machine tool translational axis error compensation prediction method includes S300 to S310, which are specifically as follows:
[0109] S300, detecting the machine tool to be detected based on the second preset trajectory line to obtain a detection parameter of the machine tool to be detected.
[0110] In the example embodiment, the second preset trajectory line is four trajectory lines selected according to a spatial positioning error model of the translational axis, i.e., a face diagonal of the X-Y, X-Z and Y-Z planes, and a body diagonal of the XYZ three-axis linkage; and the detection parameter includes:
[0111] .
[0112] S310, inputting the detection parameter of the machine tool to be detected into the second translational axis error compensation model to obtain error compensation data of the translational axis of the machine tool to be detected.
[0113] In combination with the above embodiment, the second translational axis error compensation model is obtained by migrating training the first translational axis error compensation model based on target error data, the first translational axis error compensation model is obtained by pre-training a pre-constructed initial translational axis error compensation model based on a pre-training data set, the pre-training data set is generated according to the topological structure of the machine tool and the multi-body theory, and the target error database is an actual error database generated by error detection of the machine tool according to the first preset trajectory line.
[0114] Specifically, when performing error compensation calculation on the machine tool to be detected, the laser interferometer is used to calculate each point in the four lines of the machine tool to be detected to obtain the detection parameter.
[0115] ,
[0116] The detection parameter is input into the second translational axis error compensation model to obtain 18 errors.
[0117]
[0118] It should be noted that in some embodiments, after the error compensation data of the translational axis of the machine tool to be detected is calculated, the error compensation data needs to be added to the error compensation table of the numerical control system.
[0119] Specifically, in combination with the above example embodiment, the above obtained 18 errors are denoted as ,
[0120] Among them: , Then, the is set to the error compensation table of the Siemens numerical control system, and the error compensation implementation is completed.
[0121] Optionally, the error compensation table setting method is as follows:
[0122]
[0123] Wherein, a represents a reference coordinate axis, i.e. an input axis, b represents a coordinate axis to be compensated, i.e. an output axis, i represents an i-th compensation table, and N represents that the motion position on the reference coordinate axis is divided into N equal parts.
[0124] In a specific embodiment, the second translational axis error compensation model is obtained by training the machine tool translational axis error compensation model through the training method described above, and the specific method comprises: generating a pre-training data set and an error database respectively, wherein the pre-training data set is generated according to the topological structure of the machine tool and the multibody theory, and the error database is an actual error database generated by error detection of the machine tool according to the first preset trajectory line, and the error database comprises target error data corresponding to the machine type of the machine tool to be detected; pre-training the initially constructed initial translational axis error compensation model based on the pre-training data set to obtain the first trained translational axis error compensation model; and performing transfer training on the first translational axis error compensation model based on the target error data to obtain the second translational axis error compensation model.
[0125] It should be noted that the training method of the machine tool translational axis error compensation model has been described in detail in the above embodiments, and specific reference is made to the above embodiments, which will not be described herein.
[0126] In Figure 3 In the above description embodiment shown in the above description embodiment, the machine tool translational axis error compensation prediction method provided by the present application comprises the following steps: detecting the machine tool to be detected based on the second preset trajectory line to obtain detection parameters of the machine tool to be detected; inputting the detection parameters of the machine tool to be detected into the second translational axis error compensation model to obtain error compensation data of the translational axis of the machine tool to be detected; on the one hand, compared with the error calculation of the machine tool by using the first preset trajectory line, the error compensation calculation of the machine tool to be detected is performed by combining the detection parameters of the second preset trajectory line and the second translational axis error compensation model in the present application, which not only effectively reduces the detection frequency of the machine tool and improves the detection efficiency on the basis of ensuring the error compensation accuracy, but also effectively reduces the workload of the workers; on the other hand, by adding the error to the error compensation table of the numerical control system, the rapid optimization of the geometric error compensation data of the translational axis of the machine tool can be realized, and the compensation of the numerical control system to the machine tool is more accurate.
[0127] The following is a device embodiment of the present description, which can be used to execute the method embodiments of the present description. For details not disclosed in the device embodiments of the present description, please refer to the method embodiments of the present description.
[0128] Referring to Figure 7FIG. 1 is a schematic diagram of a function module of an embodiment of the training device of the machine tool translational axis error compensation model of the present application.
[0129] The training device 700 of the machine tool translational axis error compensation model in the embodiments of the present specification comprises:
[0130] The generating module 710 is configured to generate a pre-training data set and an error database, respectively, wherein the pre-training data set is generated according to the topological structure of the machine tool and the multibody theory, the error database is an actual error database generated by error detection of the machine tool according to the first preset trajectory line, and the error database comprises target error data corresponding to the machine type of the machine tool to be detected.
[0131] The pre-training module 720 is configured to pre-train a pre-constructed initial translational axis error compensation model based on the pre-training data set to obtain a first trained translational axis error compensation model.
[0132] The transfer training module 730 is configured to perform transfer training on the first translational axis error compensation model based on the target error data to obtain a second translational axis error compensation model after the transfer training.
[0133] In an optional implementation, the pre-training module 720 is further configured to obtain the pre-training data set, input the pre-training data set into the initial translational axis error compensation model to obtain training error data values, perform loss calculation on the training error data values based on a preset loss function and a preset actual error data value to obtain a loss value, and adjust parameters of each node in the initial translational axis error compensation model by back propagation through the gradient descent method based on the loss value until the loss value is lower than a preset threshold or the loss value does not change after a plurality of iterations, thereby obtaining the first translational axis error compensation model.
[0134] In an optional implementation, the training device 700 of the machine tool translational axis error compensation model is further configured to set parameters of a preset number of layers of a hidden layer of the first translational axis error compensation model as fixed parameters, and the transfer training module 730 is further configured to perform transfer training on parameters other than the fixed parameters of the first translational axis error compensation model based on the target error data.
[0135] In an optional implementation, the transfer training module 730 is further configured to select data corresponding to the second preset trajectory line from the target error data, input the data corresponding to the second preset trajectory line from the target error data into the first translational axis error compensation model to obtain transfer error data with the same number of items as the target error data, and perform transfer training on parameters other than the fixed parameters of the first translational axis error compensation model based on the transfer error data and the target error data, thereby obtaining the second translational axis error compensation model.
[0136] In an optional implementation, the initial translational axis error compensation model comprises an input layer, a hidden layer and an output layer, and the training device 700 of the translational axis error compensation model is further configured to: construct the input layer of the initial translational axis error compensation model based on the machine tool service life value and the detection value obtained according to the second preset trajectory line; construct the hidden layer of the initial translational axis error compensation model; and construct the output layer of the initial translational axis error compensation model.
[0137] In an optional implementation, the activation function of the preset level of the hidden layer of the initial translational axis error compensation model is a linear rectifier function, and the activation function of the hidden layer of the initial translational axis error compensation model except the preset level is a normalized exponential function.
[0138] In an optional implementation, the training device 700 of the translational axis error compensation model is further configured to: detect the machine tool to be detected based on the second preset trajectory line to obtain detection parameters of the machine tool to be detected; and input the detection parameters of the machine tool to be detected into the second translational axis error compensation model to obtain error compensation data of the translational axis of the machine tool to be detected.
[0139] Reference Figure 8 FIG. 1 is a functional module schematic diagram of an embodiment of a machine tool translational axis error compensation prediction device according to the present application.
[0140] The machine tool translational axis error compensation prediction device 800 in the embodiments of the present application comprises:
[0141] The detection parameter acquisition module 810 is configured to detect the machine tool to be detected based on the second preset trajectory line to obtain detection parameters of the machine tool to be detected.
[0142] The error compensation determination module 820 is configured to input the detection parameters of the machine tool to be detected into the second translational axis error compensation model to obtain error compensation data of the translational axis of the machine tool to be detected; wherein the second translational axis error compensation model is obtained by performing migration training on the first translational axis error compensation model based on target error data, the first translational axis error compensation model is obtained by performing pre-training on the initially constructed initial translational axis error compensation model based on a pre-training data set, the pre-training data set is generated according to the topological structure of the machine tool and the multibody theory, and the target error database is an actual error database generated by performing error detection on the machine tool according to the first preset trajectory line.
[0143] It should be noted that the training device of the translational axis error compensation model provided in the above embodiment is only used to illustrate the training method of the translational axis error compensation model, and in actual application, the above functions can be completed by different functional modules according to the needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the training device of the translational axis error compensation model and the training method of the translational axis error compensation model provided in the above embodiment belong to the same concept. Therefore, for the details not disclosed in the device embodiments of the present specification, please refer to the above-mentioned training method of the translational axis error compensation model of the present specification, which will not be repeated here.
[0144] The above-mentioned serial numbers of the embodiments of the present specification are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0145] The embodiments of the present specification also provide a computer readable storage medium having a computer program stored thereon, which is executed by a processor to implement the method of any of the above-mentioned embodiments. The computer readable storage medium can include but is not limited to any type of disk, including floppy disks, optical disks, DVDs, CD-ROMs, micro-drives, and magneto-optical disks, ROM, RAM, EPROM, EEPROM, DRAM, VRAM, flash memory device, magnetic or optical card, nanosystem (including molecular memory IC), or any type of medium or device suitable for storing instructions and / or data.
[0146] The embodiments of the present specification also provide a five-axis numerical control machine tool, which includes a translational axis, a memory, a processor and a computer program stored on the memory and executable on the processor, and the processor executes the program to implement the method of any of the above-mentioned embodiments.
[0147] Figure 9 The above-mentioned serial numbers of the embodiments of the present specification are only for description, and do not represent the advantages and disadvantages of the embodiments. Figure 9 As shown in the figure, the five-axis numerical control machine tool 900 includes a processor 901 and a memory 902.
[0148] In the embodiments of the present specification, the processor 901 is the control center of the computer system, which can be a processor of a physical machine or a processor of a virtual machine. The processor 901 can include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 901 can be implemented in at least one of a hardware form of a digital signal processing (DSP), a field-programmable gate array (FPGA), a programmable logic array (PLA). The processor 901 can also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in a standby state.
[0149] In the embodiments of the present specification, in the process of executing the training method of the detection model, the processor 901 is specifically configured to:
[0150] The memory 902 can include one or more computer-readable storage media that can be non-transitory. The memory 902 can also include a high-speed random access memory, and a nonvolatile memory such as one or more disk storage terminals, flash memory terminals. In some embodiments of the present specification, the non-transitory computer-readable storage medium in the memory 902 is used to store at least one instruction for being executed by the processor 901 to implement the method in the embodiments of the present specification.
[0151] In some embodiments, the terminal 900 further includes a peripheral terminal interface 903 and at least one peripheral terminal. The processor 901, the memory 902 and the peripheral terminal interface 903 can be connected through a bus or a signal line. Each peripheral terminal can be connected to the peripheral terminal interface 903 through a bus, a signal line or a circuit board.
[0152] The peripheral terminal interface 903 can be used to connect at least one input / output (I / O) related peripheral terminal to the processor 901 and the memory 902. In some embodiments of the present specification, the processor 901, the memory 902 and the peripheral terminal interface 903 are integrated on the same chip or circuit board; in some other embodiments of the present specification, any one or two of the processor 901, the memory 902 and the peripheral terminal interface 903 can be implemented on a separate chip or circuit board. The embodiments of the present specification do not make specific limitations in this regard.
[0153] The terminal structure block diagram shown in the embodiments of the present specification does not constitute a limitation on the terminal 900, and the terminal 900 can include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0154] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent process transformation using the content of the present specification and the drawings, or direct or indirect application in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method of training a machine tool translational axis error compensation model, characterized by, The method comprises: respectively generating a pre-training data set and an error database, wherein the pre-training data set is generated according to the topological structure of the machine tool and the multibody theory, the error database is an actual error database generated by error detection of the machine tool according to a first preset trajectory line, and the error database comprises target error data corresponding to the machine type of the machine tool to be detected; based on the pre-training data set, pre-training an initially constructed translational axis error compensation model to obtain a first trained translational axis error compensation model; based on the target error data, performing transfer training on the first translational axis error compensation model to obtain a second translational axis error compensation model after completion of the transfer training; the initial translational axis error compensation model comprises an input layer, a hidden layer and an output layer, and the construction method of the initial translational axis error compensation model comprises the following steps: based on the machine tool life value and the detection value obtained according to the second preset trajectory line, constructing the input layer of the initial translational axis error compensation model; constructing the hidden layer of the initial translational axis error compensation model; the hidden layer has 16 layers, wherein layers 1-4 are convolution layers, the input channel number is 1, the output channel number is 64, and the four layers are established as a residual block; layers 5-8 are convolution layers, the input channel number is 64, the output channel number is 128, and the four layers are established as a residual block; layers 9-12 are convolution layers, the input channel number is 128, the output channel number is 256, and the four layers are established as a residual block; layers 13-16 are convolution layers, the input channel number is 256, the output channel number is 512, and the four layers are established as a residual block; constructing the output layer of the initial translational axis error compensation model, the output layer comprising a fully connected layer and a loss function, and the fully connected layer outputting prediction values of 18 geometric errors of three translational axes.
2. The method of claim 1, wherein, The method further comprises: setting the parameters of a preset number of layers of the hidden layer of the first translational axis error compensation model as fixed parameters; based on the target error data, performing transfer training on the first translational axis error compensation model to obtain a second translational axis error compensation model after completion of the transfer training; based on the target error data, performing transfer training on the first translational axis error compensation model to obtain a second translational axis error compensation model after completion of the transfer training.
3. The method of claim 1, wherein, 4. The method of claim 3, wherein, The method further comprises: selecting data corresponding to a second preset trajectory line from the target error data; inputting the data corresponding to the second preset trajectory line from the target error data into the first translational axis error compensation model to obtain migration error data with the same number of items as the target error data; based on the migration error data and the target error data, performing migration training on the other parameters of the first translational axis error compensation model except the fixed parameters to obtain a second translational axis error compensation model.
5. The method of claim 1, wherein, The activation function of a preset level of the hidden layer of the initial translational axis error compensation model is a linear rectifier function, and the activation function of the hidden layer of the initial translational axis error compensation model except the preset level is a normalized exponential function.
6. The method of claim 4, wherein, After the migration training of the first translational axis error compensation model based on the target error data to obtain the second translational axis error compensation model after the migration training, the method further comprises: detecting a to-be-detected machine tool based on the second preset trajectory line to obtain detection parameters of the to-be-detected machine tool; inputting the detection parameters of the to-be-detected machine tool into the second translational axis error compensation model to obtain error compensation data of the translational axis of the to-be-detected machine tool.
7. A method of error compensation prediction for a machine tool translational axis, characterized in that, The error compensation prediction method of the machine tool translational axis comprises the following steps: detecting a to-be-detected machine tool based on a second preset trajectory line to obtain detection parameters of the to-be-detected machine tool; inputting the detection parameters of the to-be-detected machine tool into a second translational axis error compensation model to obtain error compensation data of the translational axis of the to-be-detected machine tool; wherein the second translational axis error compensation model is obtained by performing migration training on a first translational axis error compensation model based on target error data, the first translational axis error compensation model is obtained by pre-training a pre-constructed initial translational axis error compensation model based on a pre-training data set, the pre-training data set is generated according to the topological structure of the machine tool and the multibody theory, and the target error database is an actual error database generated by detecting the error of the machine tool according to a first preset trajectory line; The initial translational axis error compensation model comprises an input layer, a hidden layer, and an output layer, and the construction method of the initial translational axis error compensation model comprises the following: constructing an input layer of the initial translational axis error compensation model based on the service life value of the machine tool and the detection value obtained according to the second preset trajectory line; The hidden layer of the initial translational axis error compensation model is constructed; the hidden layer has 16 layers, wherein layers 1-4 are convolution layers, the input channel number is 1, the output channel number is 64, and the four layers are established as a residual block; layers 5-8 are convolution layers, the input channel number is 64, the output channel number is 128, and the four layers are established as a residual block; layers 9-12 are convolution layers, the input channel number is 128, the output channel number is 256, and the four layers are established as a residual block; and layers 13-16 are convolution layers, the input channel number is 256, the output channel number is 512, and the four layers are established as a residual block; The output layer of the initial translational axis error compensation model is constructed, and the output layer includes a full connection layer and a loss function, and the full connection layer outputs prediction values of 18 geometric errors of three translational axes.
8. The method of claim 7, wherein, The training method of the second translational axis error compensation model includes: Respectively generating a pre-training data set and an error database, wherein the pre-training data set is generated according to the topological structure of the machine tool and the multibody theory, the error database is an actual error database generated by detecting the error of the machine tool according to the first preset trajectory line, and the error database includes target error data corresponding to the machine type of the machine tool to be detected; Based on the pre-training data set, the pre-trained initial translational axis error compensation model is pre-trained to obtain the first trained translational axis error compensation model; Based on the target error data, the first translational axis error compensation model is trained to obtain the second translational axis error compensation model.
9. A device for training a machine tool translational axis error compensation model, characterized in that, The training device of the machine tool translational axis error compensation model includes: A generation module is configured to generate a pre-training data set and an error database, wherein the pre-training data set is generated according to the topological structure of the machine tool and the multibody theory, the error database is an actual error database generated by detecting the error of the machine tool according to the first preset trajectory line, and the error database includes target error data corresponding to the machine type of the machine tool to be detected; A pre-training module is configured to pre-train the pre-constructed initial translational axis error compensation model based on the pre-training data set to obtain the first trained translational axis error compensation model; A migration training module is configured to train the first translational axis error compensation model based on the target error data to obtain the second translational axis error compensation model after migration training is completed; The initial translational axis error compensation model includes an input layer, a hidden layer and an output layer, and the construction method of the initial translational axis error compensation model includes the following: Based on the machine tool life value and the detection value obtained according to the second preset trajectory line, the input layer of the initial translational axis error compensation model is constructed; The hidden layer of the initial translational axis error compensation model is constructed, and the hidden layer has 16 layers, wherein layers 1-4 are convolution layers, the input channel number is 1, the output channel number is 64, and the four layers are established as a residual block; layers 5-8 are convolution layers, the input channel number is 64, the output channel number is 128, and the four layers are established as a residual block; layers 9-12 are convolution layers, the input channel number is 128, the output channel number is 256, and the four layers are established as a residual block; and layers 13-16 are convolution layers, the input channel number is 256, the output channel number is 512, and the four layers are established as a residual block. The output layer of the initial translational axis error compensation model is constructed, and the output layer includes a full connection layer and a loss function, and the full connection layer outputs prediction values of 18 geometric errors of three translational axes.
10. An error compensation prediction device for a machine tool translational axis, characterized in that The error compensation prediction device of the machine tool translational axis comprises: The detection parameter acquisition module is configured to detect the to-be-detected machine tool based on the second preset trajectory line to obtain detection parameters of the to-be-detected machine tool. The error compensation determination module is configured to input the detection parameters of the to-be-detected machine tool into a second translational axis error compensation model to obtain error compensation data of the translational axis of the to-be-detected machine tool; wherein the second translational axis error compensation model is obtained by performing migration training on a first translational axis error compensation model based on target error data, the first translational axis error compensation model is obtained by pre-training an initially constructed initial translational axis error compensation model based on a pre-training data set, the pre-training data set is generated according to the topological structure of the machine tool and the multibody theory, and the target error database is an actual error database generated by performing error detection on the machine tool based on the first preset trajectory line. The initial translational axis error compensation model comprises an input layer, a hidden layer, and an output layer, and the construction method of the initial translational axis error compensation model comprises the following steps: An input layer of the initial translational axis error compensation model is constructed based on the machine tool service life value and detection values obtained according to the second preset trajectory line; The hidden layer of the initial translational axis error compensation model is constructed, and the hidden layer has 16 layers, wherein layers 1-4 are convolution layers, the input channel number is 1, the output channel number is 64, and the four layers are established as a residual block; layers 5-8 are convolution layers, the input channel number is 64, the output channel number is 128, and the four layers are established as a residual block; layers 9-12 are convolution layers, the input channel number is 128, the output channel number is 256, and the four layers are established as a residual block; and layers 13-16 are convolution layers, the input channel number is 256, the output channel number is 512, and the four layers are established as a residual block; The output layer of the initial translational axis error compensation model is constructed, and the output layer includes a full connection layer and a loss function, and the full connection layer outputs prediction values of 18 geometric errors of three translational axes.
11. A five-axis NC machine tool comprising a translational axis, a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the training method of the machine tool translational axis error compensation model according to any one of claims 1 to 6, and implement the error compensation prediction method of the machine tool translational axis according to any one of claims 7 to 8.
12. A computer readable storage medium having stored thereon a computer program, characterized in that The computer program, when executed by a processor, implements the training method of the error compensation model of the machine tool translational axis as claimed in any one of claims 1 to 6, and implements the error compensation prediction method of the machine tool translational axis as claimed in any one of claims 7 to 8.
Citation Information
Patent Citations
Method for quickly optimizing geometric error compensation data of translational axis of five-axis numerical control machine tool
CN112558547A
Cutting force neural network prediction model training method based on transfer learning
CN112699550A
UWB ranging error compensation algorithm and device based on attention mechanism and transfer learning
CN115329675A
Numerical control machine tool thermal error compensation method and device based on thermal image
CN117055474A