Intelligent numerical control machine tool contour error prediction compensation system and control method thereof
Through the intelligent platform of modular design and software and hardware collaboration, integrating all aspects of CNC machining, the shortcomings of traditional CNC machine tool control systems in terms of functional scalability, resource utilization, development threshold and cumbersome processes are solved, and the system is intelligent, efficient and flexible.
Patent Information
- Application Number
- CN202510122975.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-26
- Publication Date
- 2025-05-16
AI Technical Summary
Traditional CNC machine tool control systems have shortcomings in terms of poor functional scalability, low resource utilization, high development threshold and cumbersome processes, which limit their application in the field of modern high-precision processing and complex algorithm research.
It adopts a modular design and efficient data transmission method of software and hardware collaboration, and integrates all links of CNC processing into a unified intelligent platform, including parameter setting, online planning, core control, data monitoring, neural network prediction and error intelligent control modules.
It has achieved improved functional scalability, improved resource utilization, reduced development threshold and simplified process, and promoted the development of CNC machine tool control system toward intelligence, efficiency and flexibility.
Smart Images

Figure CN120010393A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of industrial control and intelligent technology, and specifically relates to an intelligent numerical control machine tool contour error prediction and compensation system and a control method thereof. Background Art
[0002] With the continuous upgrading of the global manufacturing industry and the accelerated advancement of intelligent transformation, CNC machine tools, as the core equipment in the intelligent manufacturing system, play a vital role in improving production efficiency, ensuring processing accuracy and promoting technological innovation. The control system of CNC machine tools, as a bridge connecting user needs and machine tool execution actions, its performance and flexibility are directly related to the efficient operation and intelligence level of the entire manufacturing process. However, traditional CNC machine tool control systems face many challenges in design concepts, functional scalability and intelligent algorithm application, which limits their in-depth application in the field of modern high-precision processing and complex algorithm research. Traditionally, CNC machine tool control systems mostly adopt embedded architecture design and are deeply integrated into the control panel on the machine tool side. Although this tightly coupled hardware and software integration mode performs well in ensuring real-time control response, it brings the following significant problems:
[0003] (1) Poor functional scalability: Due to the high degree of integration of traditional CNC machine tool systems, there are complex interdependencies between the functional modules, resulting in system upgrades and maintenance being highly dependent on the original equipment manufacturer. It is difficult for users to flexibly add or adjust functions according to their own processing needs, which limits the adaptability and flexibility of the system.
[0004] (2) Low resource utilization: As the complexity of the control system increases, the utilization efficiency of hardware resources is low, and some redundant functions cannot function effectively.
[0005] (3) High development threshold: The development of traditional CNC machine tool systems requires developers to not only be proficient in the operating skills of CNC machine tools, but also be proficient in a variety of professional tools and platforms such as CAD / CAM software, CNC program generation, and data analysis. This undoubtedly increases the difficulty of intelligent algorithm development and verification, greatly increases the complexity of developing and verifying intelligent algorithms, and prolongs the product development cycle.
[0006] (4) Complicated process: From program writing to data collection and analysis, and then to verification of the final results, the entire process of CNC machine tool control systems requires frequent switching between multiple platforms. This is not only time-consuming and labor-intensive, but also prone to verification failures due to operational errors, which seriously affects R&D efficiency and quality.
[0007] In recent years, with the rapid development of information technology, networking, virtualization and intelligent technologies have provided new ideas for the innovation of CNC machine tool control systems. Although network-based CNC systems have realized the functions of remote monitoring and data acquisition, their control core is still limited to physical machine tools and cannot perform virtual processing simulation and algorithm verification that are separated from physical equipment, which limits their application potential in algorithm research and optimization. At the same time, although some emerging systems have tried to introduce modular design concepts to improve the flexibility and scalability of the system, the collaborative efficiency between modules is not high, the user interface is complex, and they have failed to fundamentally solve the problems existing in traditional systems.
[0008] To sum up, the existing CNC machine tool control systems have shortcomings in function expansion, resource utilization, development threshold and verification process. There is an urgent need for an intelligent CNC machine tool contour error prediction and compensation system and its control method to break the traditional constraints and promote the CNC machine tool control system to develop in a more intelligent, efficient and flexible direction. Summary of the invention
[0009] In response to the problems in the related technology, the present invention proposes an intelligent CNC machine tool contour error prediction and compensation system and a control method thereof. Through modular design, software and hardware collaboration and efficient data transmission, various links of CNC machining are integrated into a unified intelligent platform to solve the technical problems of traditional CNC machine tools' control system functional scalability, low resource utilization, high development threshold and cumbersome processes.
[0010] The technical solution of the present invention is implemented as follows: an intelligent CNC machine tool contour error prediction and compensation system includes a host computer, the host computer is connected to a motion control card, and the motion control card controls the action of the CNC machine tool; the CNC machine tool includes an actuator, and the actuator includes multiple processing single axes; the host computer is configured with multiple functional modules, including:
[0011] A parameter setting module, used to set the system parameters and processing parameters of the CNC machine tool, and to import external planning data and configuration files;
[0012] An online planning module, which acquires planning data online by programming the motion control card;
[0013] A core control module, used to control the actuator to realize multiple motion modes;
[0014] The data monitoring module is used to dynamically collect real-time monitoring data during the processing of the actuator; a circular buffer structure is used to collect and save the monitoring data without restriction;
[0015] The neural network prediction module predicts the tracking error of multiple processing axes based on the neural network model to achieve offline prediction error;
[0016] The error intelligent control module combines online planning, error prediction, error compensation, speed / acceleration over-limit interpolation processing, and PC mode verification to iteratively optimize the machining trajectory.
[0017] The present invention integrates various aspects of CNC machining into a unified intelligent platform through modular design, software and hardware collaboration and efficient data transmission, so as to solve the technical problems of traditional CNC machine tools such as poor control system functional scalability, low resource utilization, high development threshold and complicated process.
[0018] As a further improvement of the above solution, the motion mode at least includes an interpolation motion mode, a PT motion mode, a point motion mode and a JOG motion mode;
[0019] The core control module implements the common control logic in multiple motion modes through the abstractly designed base class MotionBase; the interpolation motion mode, PT motion mode, point motion mode and JOG motion mode are based on the base class MotionBase, and are implemented through the corresponding subclasses InterMotion, PTMotion, PointMotion and JogMotion, respectively.
[0020] As a further improvement of the above solution, the data monitoring module includes a monitor, which is set in a circulation mode and configured to complete the reading of all previous data before detecting data and overwriting the previous data.
[0021] As a further improvement of the above solution, the circular ring buffer includes a restriction condition, and the restriction condition is configured such that the tail pointer address cannot exceed the head pointer address.
[0022] As a further improvement of the above solution, the neural network prediction module includes:
[0023] A data preprocessing module is used to collect raw data and preprocess the raw data to convert it into processed data; the processed data includes a training set, a validation set and a test set; wherein the data volume of the training set is larger than that of the validation set and the test set;
[0024] The neural network model module is used to define the model structure and perform error prediction; the model structure adopts an LSTM neural network model built based on the Python environment; the input of the LSTM neural network model includes speed, acceleration and motion state, and its output is the tracking error at the corresponding moment;
[0025] A training module, using the training set to train the LSTM neural network model and update the model parameters; evaluating the performance of the model on the validation set and selecting the best model as the trained model;
[0026] The prediction and optimization module uses the trained model to predict the tracking error and performs real-time optimization based on the prediction results to form an optimized model; the real-time optimization includes: compensating according to the predicted tracking error, adjusting the control signal of the CNC machine tool accordingly, updating the input of the trained model in real time, performing continuous prediction, and correspondingly continuously compensating the motion control of the CNC machine tool;
[0027] A model evaluation module is used to evaluate the prediction effect of the optimized model on the test set, and to improve the model according to the prediction effect to form a trained model;
[0028] The system integration module integrates the trained model into the actual control system of the CNC machine tool to perform real-time error prediction and compensation.
[0029] As a further improvement of the above solution, the original data includes a machine tool control signal and a machine tool feedback signal; wherein the machine tool control signal includes a motor pulse signal; the machine tool feedback signal includes position data, speed data and acceleration data;
[0030] The preprocessing includes denoising, standardization or normalization of the original data; if there is missing data in the preprocessing process, interpolation method is used to fill it.
[0031] As a further improvement of the above scheme, when training the LSTM neural network model, the mean square error is used as the loss function; the model is trained using the gradient descent method or the Adam optimization algorithm; and the training process is optimized by adjusting the learning rate or batch size hyperparameters.
[0032] As a further improvement of the above scheme, the prediction effect of the model is evaluated by calculating the error of the optimized model on the test set; the calculation indicators of the error include mean square error, mean absolute error and determination coefficient; if the error is greater than the preset threshold, the model is improved by adjusting the model structure, increasing the amount of data in the training set or changing the optimization algorithm.
[0033] As a further improvement of the above solution, the error intelligent control module iteratively optimizes the machining trajectory, including the following process:
[0034] Acquire planning data online: directly acquire planning data of the processing trajectory through external input; or, calculate and generate planning data of the processing trajectory in real time through the online planning module;
[0035] Data standardization: pre-process planning data and unify data formats and scales;
[0036] Neural network error prediction: Tracking error prediction is performed on multiple processing axes through the neural network prediction module;
[0037] Time domain error compensation: Compensate the processing trajectory in combination with the prediction results;
[0038] Speed / acceleration over-limit interpolation processing: smooth and optimize the machining trajectory after compensation;
[0039] PT mode verification: The optimized processing trajectory is verified by actual processing, and further iterative compensation is performed by collecting result data.
[0040] An intelligent CNC machine tool contour error prediction and compensation control method is applied to an intelligent CNC machine tool contour error prediction and compensation system as described above, comprising the following steps:
[0041] T1. Input trajectory file to obtain the planning data of the motion control card for the processing trajectory. The planning data has the dimension of n rows and m columns, which represents the execution data of each processing axis in different time series. At this time, no processing is performed; n and m are positive integers;
[0042] T2. Standardize the planning data obtained from T1, standardize the format of the data collected by the monitor, and optimize it to the standard format required by the neural network error prediction input without changing the data dimension;
[0043] T3. The standardized data obtained in T2 is predicted by the modeled neural network to obtain the tracking error data of the m-axis, with the data dimension of n rows and 2m columns, which are the expected positions and predicted positions of the m processing axes respectively;
[0044] T4. The planning data obtained in T1 is regarded as the expected standard trajectory, and the obtained prediction error and the expected trajectory are calculated and the error compensation is completed to obtain the new planning data after compensation. The data dimension is n rows and m columns, which are the execution data of m processing single axes;
[0045] T5. Before executing the new planning data obtained in T4, check whether its position, speed and acceleration are reasonable, perform over-limit speed / acceleration interpolation processing, increase or keep the number of data rows unchanged, keep the column dimension unchanged, and keep the data format unchanged;
[0046] T6. The planning data after interpolation processing in T5 is executed by the actual CNC machine tool through the PT control mode, and the processing data is collected by the monitor;
[0047] T7. Iterative compensation: after T6 is completed, the collected data and the expected data obtained from T1 are used to compensate the error of T4 again. After that, T4-T5-T6 are repeated to realize iterative error compensation.
[0048] The core innovations of the present invention are embodied in the following aspects:
[0049] (1) Modular architecture design: The acquisition of machining trajectory planning data, collection of monitoring data, neural network prediction, error compensation and other functions are abstracted into independent modules. Each module interacts through a unified data flow method, which facilitates functional expansion and reduces the coupling between modules.
[0050] (2) Unified operation mode: Users only need to upload processing task files through a single operation interface, and the system can automatically complete the entire process from data processing to processing verification, greatly reducing the complexity of operation.
[0051] (3) Combination of virtual and actual processing: It supports offline prediction and online verification. It can simulate the algorithm performance under different working conditions through virtual processing, and verify the reliability of the results through actual CNC machine tool processing.
[0052] (4) Intelligent algorithm verification platform: The system has built-in functional modules that support the verification of multiple intelligent algorithms. Users can easily complete the entire process from algorithm design to experimental verification on the same platform, which helps promote the rapid implementation of algorithms.
[0053] (5) Through the design and implementation of this system, researchers can get rid of the cumbersome operation process and multi-platform switching limitations of traditional CNC systems and efficiently complete processing experiments and intelligent algorithm verification in an integrated environment. This not only improves research efficiency, but also provides solid technical support for the development of intelligent manufacturing technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 It is the overall architecture diagram of each functional module of the present invention;
[0055] Figure 2 is a flow chart of the interpolation motion mode of the present invention;
[0056] Figure 3 It is a structural schematic diagram of the circular buffer of the present invention;
[0057] Figure 4 A flow chart of dynamic data monitoring of the present invention;
[0058] Figure 5 This is a working flow chart of the error intelligent control module of the present invention. DETAILED DESCRIPTION
[0059] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0060] Example
[0061] like Figure 1 As shown, this embodiment provides an intelligent CNC machine tool contour error prediction and compensation system, including a host computer, the host computer is connected to a motion control card, the motion control card is connected to the CNC machine tool through a terminal board module, and controls the movement of the CNC machine tool; the CNC machine tool includes an actuator, and the actuator includes multiple processing single axes;
[0062] Specifically, the host computer can be a computer with an Intel i5-12400 CPU; the motion control card can be a Googol GSN-024-G-00 motion control block; the terminal board module can be a GNM-601-00 six-axis terminal board; in this embodiment, the CNC machine tool is a five-axis machine tool; the host computer is configured with multiple functional modules, including:
[0063] A parameter setting module, used to set the system parameters and processing parameters of the CNC machine tool, and to import external planning data and configuration files;
[0064] An online planning module, which acquires planning data online by programming the motion control card; directly collects planning data without performing actual processing for subsequent analysis and processing;
[0065] The core control module controls the actuator to realize multiple motion modes through secondary development of the motion control card; the motion modes at least include interpolation motion mode, PT motion mode, point motion mode and JOG motion mode, ensuring the normal realization of the underlying control function of the system and ensuring the safety of the equipment during the motion process.
[0066] Specifically, in this embodiment, the core control module implements the common control logic in multiple motion modes through the abstractly designed base class MotionBase; the interpolation motion mode, PT motion mode, point motion mode and JOG motion mode are based on the base class MotionBase, and the corresponding subclasses InterMotion, PTMotion, PointMotion and JogMotion implement interpolation motion, PT motion, point motion and JOG motion respectively.
[0067] like Figure 2As shown, taking interpolation motion as an example, the basic steps to achieve interpolation motion are as follows:
[0068] (1) Establish an interpolation coordinate system;
[0069] (2) Setting the look-ahead parameters to achieve high-speed and smooth continuous trajectory motion;
[0070] (3) Pressing interpolation motion instructions such as straight lines and arcs into the interpolation buffer area;
[0071] (4) Call the interpolation buffer data end instruction;
[0072] (5) Start the motion, and the motion control card executes the interpolation data in the buffer area in sequence until all the interpolation data have been moved.
[0073] By calling the control card dynamic library function interface and combining the custom function design, the control process of interpolation motion is comprehensively completed, and the data monitoring and safety protection of the motion process are carried out at the same time, so as to complete the control of the interpolation motion mode. Similarly, PT motion mode, point motion mode and JOG motion mode can be realized. After configuring the machine tool parameters, the host computer system can realize direct motion control of the five-axis machine tool.
[0074] The data monitoring module is used to dynamically collect real-time monitoring data during the machining process of the actuator; a circular buffer structure is used to collect and save the monitoring data without restriction; it should be noted that the data collection of traditional CNC machine tools is limited by the cache capacity, and the amount of data collected is limited by the hardware. In response to the above problems, this system has designed a dynamic data collection algorithm that can dynamically and real-time collect various information data during the machining process, and is not limited by hardware. It can realize unlimited storage of monitoring data and provide a data basis for other functional modules.
[0075] like Figure 3 , Figure 4 As shown, the data monitoring module includes a monitor. In order to realize dynamic monitoring, it is not limited by the memory size, monitors the data in real time and outputs it to a file. The monitor needs to be set in a loop mode and configured to complete the reading of all previous data before monitoring the data and overwriting the previous data.
[0076] The circular ring buffer includes a restriction condition, and the restriction condition is configured such that the tail pointer address cannot exceed the head pointer address, which has the following benefits:
[0077] (1) There is no need to consider the size of the buffer area; (2) There is no need to consider whether reading data too quickly will lead to repeated reading of data. Reasonably call the GTN_ReadWatch() function to read the buffer area data and write it to the file in time, so as to obtain the collected data in real time. Specifically, the data monitoring module dynamically collects and monitors data, including the following process:
[0078] First, watch is initialized, the monitor is started, and a thread is created; second, the GTN_ReadWatch() function is called to read the monitoring data in the circular ring buffer; finally, it is determined whether there is monitoring data; if so, the data is processed and the GTN_ReadWatch() function is called again; if not, the thread is closed.
[0079] The neural network prediction module predicts the tracking errors of multiple processing axes based on the neural network model to achieve offline prediction errors. The model structure adopts the LSTM neural network model (i.e., long short-term memory network) built based on the Python environment.
[0080] The establishment of the LSTM neural network model relies on python's torch, numpy, scipy and other expansion packages. By collecting and analyzing the actual processing data of the actual machine tool, many features related to the error in the machine tool movement process are established as neural network features. The feature-rich trajectory is used as the training trajectory, the real expected data is used as the input parameter, and the actual data is used as the output parameter for neural network training to obtain the single-axis neural network model of the machine tool. The five axes are trained collaboratively to obtain five single-axis models, that is, five processing single-axis models. Using the obtained processing single-axis model, given the input data, the tracking error in the machine tool processing process can be simulated, that is, given the input, no processing is required, and the predicted output result can be directly obtained.
[0081] In this embodiment, the neural network prediction module includes:
[0082] A data preprocessing module is used to collect raw data, preprocess the raw data, and convert it into processed data; in this embodiment, the raw data includes a machine tool control signal and a machine tool feedback signal; wherein the machine tool control signal includes a motor pulse signal; the machine tool feedback signal includes position data, speed data, and acceleration data;
[0083] The preprocessing includes denoising, standardization or normalization of the original data to ensure the stability and effectiveness of the data during training; a common normalization method is to scale the data to the range of [0,1]. If there is missing data during the preprocessing process, interpolation method is used to fill it.
[0084] The processed data includes a training set, a validation set and a test set; wherein the data volume of the training set is larger than the data volume of the validation set and the test set; in this embodiment, the processed data is divided into 70% training set, 15% validation set and 15% test set.
[0085] The neural network model module is used to define the model structure and perform error prediction. This embodiment selects the LSTM neural network model, which can effectively capture the long-term dependencies in time series data. The input of the LSTM neural network model includes speed, acceleration, and motion state, and its output is the tracking error at the corresponding moment.
[0086] A training module, using the training set to train the LSTM neural network model and update the model parameters; evaluating the performance of the model on the validation set, and selecting the optimal model as the trained model; in this embodiment, when training the LSTM neural network model, using the mean square error as the loss function; using the gradient descent method or the Adam optimization algorithm for model training; optimizing the training process by adjusting the learning rate or batch size hyperparameters.
[0087] The prediction and optimization module uses the trained neural network to perform real-time error prediction and combines the control strategy to perform error compensation.
[0088] Specifically, the trained model is used to predict the tracking error, and real-time optimization is performed according to the prediction result to form an optimized model; the real-time optimization includes: compensating according to the predicted tracking error, adjusting the control signal of the CNC machine tool accordingly, updating the input of the trained model in real time, performing continuous prediction, and correspondingly continuously compensating the motion control of the CNC machine tool;
[0089] The model evaluation module evaluates the prediction effect of the optimized model on the test set, and improves it according to the prediction effect to form a trained model. In this embodiment, the prediction effect of the model is evaluated by calculating the error of the optimized model on the test set. The calculation indicators of the error include mean square error, mean absolute error and determination coefficient. If the error is greater than a preset threshold, the model is improved by adjusting the model structure, increasing the amount of data in the training set or changing the optimization algorithm.
[0090] The system integration module integrates the trained model into the actual control system of the CNC machine tool to perform real-time error prediction and compensation. Specifically, the neural network prediction model is embedded in the control system of the CNC machine tool to obtain the operating status of the machine tool in real time and make predictions. The error prediction results are fed back to the motion control card to adjust the control signal to reduce the tracking error and ensure its stable operation.
[0091] like Figure 5As shown, the error intelligent control module combines online planning, error prediction, error compensation, speed / acceleration over-limit interpolation processing, and PC mode verification to iteratively optimize the processing trajectory. The error intelligent control module implements functions such as neural network prediction and error compensation through encapsulated interfaces, and interacts with other modules based on file streams. Using a cross-language calling method, complex neural network algorithms are implemented through Python, and the results are passed to other modules for further processing. The error intelligent control module is the core of the system to achieve intelligent control, covering multiple key links and functions. In this embodiment, the error intelligent control module iteratively optimizes the processing trajectory, including the following processes:
[0092] Acquire planning data online: directly acquire planning data of the processing trajectory through external input; or, calculate and generate planning data of the processing trajectory in real time through the online planning module;
[0093] Data standardization: pre-process planning data and unify data formats and scales;
[0094] Neural network error prediction: Tracking error prediction is performed on multiple processing axes through the neural network prediction module;
[0095] Time domain error compensation: Compensate the processing trajectory in combination with the prediction results; specifically, the time domain error compensation includes the following process:
[0096] S1. Initialize the processing trajectory and collect the position data of the planned points and actual points based on the sampling period;
[0097] S2. According to the position data collected in step S1, the reference trajectory speed and the actual trajectory speed of each processing axis are estimated by the method of center difference;
[0098] S3. Calculate the delay time of each processing axis according to the position data collected in step S1 and the speed data estimated in step S2;
[0099] S4. Estimate the synchronization delay time according to the speed data estimated in step S2 and the delay time data calculated in step S3;
[0100] S5. Calculate the synchronization error under the synchronization delay time, compensate the initial planning trajectory based on the synchronization error, and obtain the ideal planning trajectory;
[0101] S6. Run the new reference trajectory and repeat the operation in step S1 until the accuracy requirement is met.
[0102] Speed / acceleration over-limit interpolation processing: smooth and optimize the machining trajectory after compensation;
[0103] PT mode verification: The optimized processing trajectory is verified by actual processing, and further iterative compensation is performed by collecting result data.
[0104] Through the above scheme of the present invention, in a specific application: an intelligent CNC machine tool contour error prediction compensation control method comprises the following steps:
[0105] T1. Input the random NURBS trajectory file RandNurbs.ltxt, and use the Googol system to obtain the planning data of the motion control card for the processing trajectory. The planning data has the dimensions of n rows and 5 columns, representing the execution data of each processing single axis in different time series. No processing is performed at this time.
[0106] T2. Standardize the planning data obtained from T1, standardize the format of the data collected by the monitor, and optimize it to the standard format required by the neural network error prediction input without changing the data dimension;
[0107] T3. The standardized data obtained in T2 is predicted by the modeled neural network to obtain the tracking error data of the five axes. The data dimension is n rows and 10 columns, which are the expected positions and predicted positions of the five processing axes respectively;
[0108] T4. The planning data obtained in T1 is regarded as the expected standard trajectory, and the obtained prediction error and the expected trajectory are calculated and the error compensation is completed to obtain the new planning data after compensation. The data dimension is n rows and 5 columns, which are the execution data of the five processing single axes;
[0109] T5. Before executing the new planning data obtained in T4, for safety reasons, it is necessary to check whether its position, speed and acceleration are reasonable, and perform over-limit speed / acceleration interpolation processing. The number of data rows may increase, but the column dimension and data format remain unchanged;
[0110] T6. The planning data after T5 interpolation processing is executed by the actual five-axis CNC machine tool through the PT control mode, and the processing data is collected by the monitor; thus, the full process experiment of the intelligent error control algorithm of prediction compensation is completed;
[0111] T7. Iterative compensation: after T6 is completed, the collected data and the expected data obtained from T1 are used to compensate the error of T4 again. After that, T4-T5-T6 are repeated to realize iterative error compensation.
[0112] According to the disclosure and teaching of the above description, those skilled in the art to which the present invention belongs may also make changes and modifications to the above embodiments. Therefore, the present invention is not limited to the specific embodiments disclosed and described above, and some modifications and changes to the invention should also fall within the scope of protection of the claims of the present invention. In addition, although some specific terms are used in this specification, these terms are only for the convenience of description and do not constitute any limitation to the present invention.
Claims
1. An intelligent CNC machine tool contour error prediction and compensation system, comprising a host computer, the host computer is connected to a motion control card, the motion control card controls the movement of the CNC machine tool; the CNC machine tool comprises an actuator, the actuator comprises a plurality of processing single axes; characterized in that, The host computer is configured with multiple functional modules, including: A parameter setting module, used to set the system parameters and processing parameters of the CNC machine tool, and to import external planning data and configuration files; An online planning module, which acquires planning data online by programming the motion control card; A core control module, used to control the actuator to realize multiple motion modes; The data monitoring module is used to dynamically collect real-time monitoring data during the processing of the actuator; a circular buffer structure is used to collect and save the monitoring data without restriction; The neural network prediction module predicts the tracking error of multiple processing axes based on the neural network model to achieve offline prediction error; The intelligent error control module combines online planning, error prediction, error compensation, speed / acceleration over-limit interpolation processing, and PC mode verification to iteratively optimize the machining trajectory.
2. The intelligent CNC machine tool contour error prediction and compensation system according to claim 1 is characterized in that: The motion modes at least include interpolation motion mode, PT motion mode, point motion mode and JOG motion mode; The core control module implements the common control logic in multiple motion modes through the abstractly designed base class MotionBase; the interpolation motion mode, PT motion mode, point motion mode and JOG motion mode are based on the base class MotionBase, and are implemented through the corresponding subclasses InterMotion, PTMotion, PointMotion and JogMotion, respectively.
3. The intelligent CNC machine tool contour error prediction and compensation system according to claim 1 is characterized in that: The data monitoring module includes a monitor, which is set in a circulation mode and configured to complete the reading of all previous data before monitoring data and overwriting the previous data.
4. The intelligent CNC machine tool contour error prediction and compensation system according to claim 3 is characterized in that: The circular ring buffer includes a restriction condition, and the restriction condition is configured such that the tail pointer address cannot exceed the head pointer address.
5. The intelligent CNC machine tool contour error prediction and compensation system according to claim 1 is characterized in that: The neural network prediction module includes: A data preprocessing module is used to collect raw data and preprocess the raw data to convert it into processed data; the processed data includes a training set, a validation set and a test set; wherein the data volume of the training set is larger than that of the validation set and the test set; The neural network model module is used to define the model structure and perform error prediction; the model structure adopts an LSTM neural network model built based on the Python environment; the input of the LSTM neural network model includes speed, acceleration and motion state, and its output is the tracking error at the corresponding moment; A training module, using the training set to train the LSTM neural network model and update the model parameters; evaluating the performance of the model on the validation set and selecting the best model as the trained model; The prediction and optimization module uses the trained model to predict the tracking error and performs real-time optimization based on the prediction results to form an optimized model; the real-time optimization includes: compensating according to the predicted tracking error, adjusting the control signal of the CNC machine tool accordingly, updating the input of the trained model in real time, performing continuous prediction, and correspondingly continuously compensating the motion control of the CNC machine tool; A model evaluation module is used to evaluate the prediction effect of the optimized model on the test set, and to improve the model according to the prediction effect to form a trained model; The system integration module integrates the trained model into the actual control system of the CNC machine tool to perform real-time error prediction and compensation.
6. The intelligent CNC machine tool contour error prediction and compensation system according to claim 5, characterized in that: The original data includes a machine tool control signal and a machine tool feedback signal; wherein the machine tool control signal includes a motor pulse signal; the machine tool feedback signal includes position data, speed data and acceleration data; The preprocessing includes denoising, standardization or normalization of the original data; if there is missing data in the preprocessing process, interpolation method is used to fill it.
7. The intelligent CNC machine tool contour error prediction and compensation system according to claim 6, characterized in that: When training the LSTM neural network model, the mean square error is used as the loss function; the model is trained using the gradient descent method or the Adam optimization algorithm; the training process is optimized by adjusting the learning rate or batch size hyperparameters.
8. The intelligent CNC machine tool contour error prediction and compensation system according to claim 7, characterized in that: The prediction effect of the model is evaluated by calculating the error of the optimized model on the test set; the calculation indicators of the error include mean square error, mean absolute error and determination coefficient; if the error is greater than the preset threshold, the model is improved by adjusting the model structure, increasing the amount of data in the training set or changing the optimization algorithm.
9. The intelligent CNC machine tool contour error prediction and compensation system according to claim 8, characterized in that: The error intelligent control module iteratively optimizes the machining trajectory. The process includes: Acquire planning data online: directly acquire planning data of the processing trajectory through external input; or, calculate and generate planning data of the processing trajectory in real time through the online planning module; Data standardization: pre-process planning data and unify data formats and scales; Neural network error prediction: Tracking error prediction is performed on multiple processing axes through the neural network prediction module; Time domain error compensation: Compensate the processing trajectory in combination with the prediction results; Speed / acceleration over-limit interpolation processing: smooth and optimize the machining trajectory after compensation; PT mode verification: The optimized processing trajectory is verified by actual processing, and further iterative compensation is performed by collecting result data.
10. An intelligent CNC machine tool contour error prediction and compensation control method, applied to an intelligent CNC machine tool contour error prediction and compensation system as described in any one of claims 1 to 9, characterized in that: The following steps are involved: T1. Input trajectory file, obtain the planning data of the motion control card for the processing trajectory. The dimension of the planning data is n rows and m columns, representing the execution data of each processing single axis in different time series. At this time, no processing is performed; n and m are positive integers; T2. Standardize the planning data obtained from T1, standardize the format of the data collected by the monitor, and optimize it to the standard format required by the neural network error prediction input without changing the data dimension; T3. The standardized data obtained in T2 is predicted by the modeled neural network to obtain the tracking error data of the m-axis, with the data dimension of n rows and 2m columns, which are the expected positions and predicted positions of the m processing axes respectively; T4. The planning data obtained in T1 is regarded as the expected standard trajectory, and the obtained prediction error and the expected trajectory are calculated and the error compensation is completed to obtain the new planning data after compensation. The data dimension is n rows and m columns, which are the execution data of m processing single axes; T5. Before executing the new planning data obtained in T4, check whether its position, speed and acceleration are reasonable, perform over-limit speed / acceleration interpolation processing, increase or keep the number of data rows unchanged, keep the column dimension unchanged, and keep the data format unchanged; T6. The planning data after interpolation processing in T5 is executed by the actual CNC machine tool through the PT control mode, and the processing data is collected by the monitor; T7. Iterative compensation: after T6 is completed, the collected data and the expected data obtained from T1 are used to compensate the error of T4 again. After that, T4-T5-T6 are repeated to realize iterative error compensation.
Citation Information
Cited By
Precise compensation method of composite numerical control machine tool
CN120972769A
Process-in-loop numerical control device and method
CN121635070A
A process-in-the-loop CNC device and method
CN121635070B