Numerical control system workpiece machining path feature recognition method based on deep learning

By designing a deep learning model on the OPCUA client to feature recognition of the G code of the CNC system, the accuracy and efficiency problems caused by the complexity of the machining path in traditional CNC systems are solved, and a higher machining accuracy and automation level is achieved.

CN119668197APending Publication Date: 2025-03-21SHENYANG GOLDING NC & INTELLIGENCE TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311216344.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-20
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

The complexity of workpiece processing paths in traditional CNC systems makes it difficult for machining accuracy and efficiency to meet the high precision and high efficiency needs of modern manufacturing.

Method used

A feature recognition function module is designed on the OPCUA client, and the deep learning model is used to preprocess, feature extraction and classification of the G code generated by CNC machine tools to realize the feature recognition and visualization of the workpiece processing path.

Benefits of technology

It improves the perception of complex parts processing paths by CNC machine tools, improves processing accuracy and product quality, reduces production costs, and improves automation level and feature recognition efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119668197A_ABST
    Figure CN119668197A_ABST
Patent Text Reader

Abstract

The invention relates to a deep learning-based workpiece processing path feature identification method for a numerical control system. According to the method, a G code generated by a numerical control machine tool is analyzed and processed to obtain features of a tool path when a workpiece is machined. Particularly, the method not only performs basic data preprocessing and cleaning, but also performs deeper analysis by establishing cutter path characteristic indexes such as path length, angle, curvature and the like. The data classified through the feature indexes are used as input of a deep learning algorithm, and efficient recognition of the tool path features is further achieved. According to the numerical control machining tool path feature recognition method provided by the invention, the efficiency and the accuracy of feature recognition are improved, the perception capability of a complex machining path is further enhanced through application of a deep learning algorithm, and support is provided for intelligent recognition of the machining path of a numerical control system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of numerical control (NC) machining, and in particular to a method for identifying tool path features of NC machining. Background Art

[0002] As the manufacturing industry develops rapidly towards high integration and automation, modern manufacturing strategies are also changing. In this context, intelligent manufacturing (IM) has become an inevitable trend in the development of the manufacturing industry. Intelligent manufacturing not only integrates a variety of advanced manufacturing technologies, but also brings significant improvements to the manufacturing industry through digitalization, intelligence and full-process monitoring. Among them, the performance of the numerical control (NC) system, as a key component of the intelligent manufacturing system, directly affects the manufacturing quality and overall production efficiency.

[0003] However, the complexity of workpiece machining paths in CNC systems often becomes a key factor affecting machining accuracy and efficiency. These complexities often stem from a variety of manufacturing parameters, such as tool selection, workpiece geometry, and other factors. Therefore, traditional path optimization methods based on human operator experience or established rules are difficult to meet the urgent needs of modern manufacturing for high precision and high efficiency. Summary of the invention

[0004] In order to meet the needs of intelligent processing of CNC systems for path feature perception, the present invention experimentally designs a feature recognition function module on the OPC UA client to realize the CNC system processing path feature recognition function.

[0005] To achieve the above-mentioned purpose, the technical solution adopted by the present invention is: a method for identifying workpiece machining path features of a CNC system based on deep learning, comprising the following steps:

[0006] Step 1: Obtain the G code generated by the CNC machine tool and perform preprocessing;

[0007] Step 2: extracting the features of the workpiece processing path from the preprocessed G code;

[0008] Step 3: Classify and identify the extracted features through the deep learning model;

[0009] Step 4: Visualize the workpiece processing path based on the recognition results.

[0010] Step 1 is as follows:

[0011] Connect with the communication interface of the CNC machine tool and obtain G code in real time through the data acquisition protocol;

[0012] Remove redundant information in the G code and normalize the character string to complete the G code cleaning;

[0013] The cleaned G-code is converted into a set structured format for subsequent feature extraction.

[0014] In step 1, when a certain G code instruction does not exist in the CNC machine tool, it is replaced or not processed.

[0015] The step 1 is specifically as follows:

[0016] Identify the state instructions and positions describing the workpiece processing path in the structured format G code, obtain the curvature of every two adjacent path coordinate points in the path, and perform feature classification according to the curvature of the path coordinate points;

[0017] Standardize features with classification labels for input into deep learning models.

[0018] The step of obtaining the curvature of every two adjacent coordinate points in the path and performing feature classification comprises the following steps:

[0019] Calculate the curvature of every two adjacent path coordinate points, and classify points with the same range of curvature into the same type of machining surface by setting the curvature threshold:

[0020] For two adjacent path coordinate points, if the curvature of a path coordinate point is greater than a threshold, the current path coordinate point is considered to be classified as a curved surface; otherwise, it is classified as a plane.

[0021] The training of the deep learning model includes the following steps:

[0022] Obtain the historical G code generated by the CNC machine tool and perform preprocessing;

[0023] Extract the features of the workpiece machining path from the preprocessed G code and divide it into training data and test data;

[0024] A convolutional neural network is used to train the model through training data. During the training process, the optimization algorithm Adam and the loss function are used to optimize the model to obtain a trained deep learning model.

[0025] Evaluate the performance of deep learning models on test data.

[0026] A CNC system workpiece machining path feature recognition system based on deep learning, comprising:

[0027] Data preprocessing module, used to collect and preprocess the G codes generated by CNC machine tools;

[0028] A feature extraction module is used to extract the features of the workpiece processing path from the preprocessed G code;

[0029] Deep learning models are used to classify and identify the extracted features.

[0030] The data preprocessing module comprises:

[0031] The data collection submodule is used to connect with the communication interface of the CNC machine tool and obtain the G code in real time through the data acquisition protocol;

[0032] The data cleaning submodule is used to remove redundant information in the G code and normalize the character string to complete the G code cleaning;

[0033] The data formatting submodule is used to convert the cleaned G code into a set structured format for subsequent feature extraction.

[0034] The feature extraction module comprises:

[0035] The path feature calculation submodule is used to identify the state instructions and positions describing the workpiece processing path in the structured format G code, obtain the length and angle of each path segment in the path, and for each path segment, perform feature classification according to the angles of the path segments adjacent to it;

[0036] The feature normalization submodule is used to standardize the classified features and divide them into training data and test data for input into the deep learning model.

[0037] The deep learning model comprises:

[0038] The model training submodule is used to use convolutional neural networks to train models through training data. During the training process, the optimization algorithm Adam and the loss function are used to optimize the model to obtain a trained deep learning model.

[0039] The model evaluation submodule is used to evaluate the performance of the deep learning model through test data.

[0040] The present invention has the following significant beneficial effects and advantages:

[0041] 1. Improve product quality and machining accuracy. This method can effectively improve the perception of CNC machine tools on complex parts machining paths through advanced data analysis and feature recognition technology. This means that the machine tool can more accurately identify and track tool paths, thereby ensuring that the machining process meets the preset accuracy requirements. Ultimately, this will help improve the product quality and machining accuracy of the entire production line and reduce product scrap rates caused by machining errors.

[0042] 2. Reduce production costs and improve automation. Traditional processing methods usually require a lot of manual intervention and adjustment, which not only increases production costs, but may also cause processing errors due to human factors. This method greatly reduces production costs by reducing manual intervention and using algorithms to automatically identify features. At the same time, this also helps to improve the automation level of the entire production process, enabling the production line to operate more efficiently with less human monitoring.

[0043] 3. Improve the efficiency and accuracy of feature recognition. This method uses advanced deep learning algorithms and multi-dimensional data analysis technology to quickly and accurately identify features of a large amount of processing data in a short period of time. This not only improves the efficiency of feature recognition, but also helps to promptly identify problems that may occur during the processing through accurate data analysis. Through this feedback information, engineers can quickly adjust processing parameters to optimize processing quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 A logic diagram for running the method of the present invention;

[0045] Figure 2 It is the processing trajectory information model diagram;

[0046] Figure 3 It is a structural diagram of the method of the present invention;

[0047] Figure 4 This is a visualization diagram of the results of the present invention. DETAILED DESCRIPTION

[0048] The method of the present invention is further described in detail below in conjunction with the accompanying drawings.

[0049] With the rapid development of artificial intelligence and machine learning technology, especially the breakthroughs made by deep learning in the fields of image and speech recognition, new possibilities have been provided for automatic path recognition in numerical control systems. Based on this progress, the present invention proposes a method for identifying the features of workpiece processing paths in numerical control systems based on deep learning. Specifically, the present invention further extracts the key geometric information of the workpiece processing path by analyzing the G code generated by the CNC machine tool. Then, a deep learning algorithm, especially a pre-trained convolutional neural network (CNN), is applied to efficiently identify and classify these features. This not only significantly improves the recognition speed and accuracy of the processing path features, but also helps to optimize the processing quality and production efficiency of the workpiece.

[0050] A method for identifying workpiece machining path features of a CNC system based on deep learning, comprising:

[0051] Data preprocessing module, used to collect G codes generated by CNC machine tools and perform preliminary cleaning and formatting on them;

[0052] Feature extraction module, used to extract key features of workpiece processing path from preprocessed G code;

[0053] Deep learning models are used to classify and identify the extracted features.

[0054] The data preprocessing module comprises:

[0055] The data collection submodule is connected to the communication interface of the CNC machine tool and uses a specific data acquisition protocol (OPC UA) to obtain G code in real time.

[0056] Data cleaning submodule,Data cleaning mainly includes removing redundant information in G-code, such as comments and blank lines.,In addition, string normalization is performed, which uses regular expressions for pattern matching and string replacement.

[0057] The data formatting submodule converts the cleaned G-code into a format that is easier for machines to process, making the data more structured and convenient for subsequent feature extraction.

[0058] The feature extraction module comprises:

[0059] The path feature calculation submodule first identifies the key instructions (such as G00, G01, G02, G03, etc.) and parameters (such as X, Y, Z coordinates) that describe the workpiece processing path in the G code. Then, based on this information, the length, angle, etc. of the path are calculated to perform feature classification;

[0060] The feature normalization submodule is used to normalize the calculated features.

[0061] The deep learning model includes:

[0062] The model training submodule selects a suitable deep learning model structure, such as a convolutional neural network (CNN), and then uses the extracted feature vectors to train the model. During the training process, the optimization algorithm Adam and loss functions such as cross entropy are used to optimize the model;

[0063] The model evaluation submodule uses a set of independent test data to evaluate the performance of the model after training is completed, and fine-tunes and optimizes the model based on these evaluation indicators.

[0064] like Figure 1 As shown, a method for identifying workpiece machining path features of a CNC system based on deep learning comprises the following steps:

[0065] Step 1: Collect the G code generated by the CNC machine tool and perform data preprocessing;

[0066] Step 2: Extract key features of the workpiece machining path from the preprocessed G code;

[0067] Step 3: Use deep learning models to classify and identify the extracted features;

[0068] Step 4: Visualize the workpiece processing path based on the recognition results.

[0069] In step 1, when some G-code instructions do not exist in the CNC machine tool, they are specially processed, such as ignored or replaced;

[0070] According to the input requirements of the deep learning model, the G-code data is preprocessed, including methods such as data standardization, so that it can be effectively processed by the deep learning model.

[0071] In step 3, the pre-trained deep learning model ResNet is used for feature classification and recognition. The ResNet model performs well in processing image and sequence data due to its residual structure, so it is also suitable for processing complex features of workpiece processing paths.

[0072] The offline feature recognition mode is adopted. Specifically, in the offline mode, a large amount of G-code data is first processed in batches and feature extracted, and distributed computing resources are used to accelerate the processing speed. Then, the pre-processed and feature-extracted data is input into the deep learning model for classification and recognition.

[0073] In this study, an advanced feature recognition module is designed specifically for OPC UA clients. This module is based on Figure 2The intelligent numerical control (NC) machining trajectory information model shown in the figure is constructed. This information model integrates data related to the machining trajectory, such as tool type, material hardness, machining speed, etc., and provides support for real-time monitoring and analysis of data. The core conversion process is to parse the G code generated by the CNC machine tool during the machining process and convert it into specific three-dimensional space coordinate points, that is, the trajectory coordinate points of the x, y and z axes. This conversion process uses a highly optimized algorithm, which not only ensures the conversion speed, but also ensures the high accuracy of the data. Therefore, a large amount of basic data is provided for subsequent feature recognition work. This functional module also includes a variety of preprocessing technologies, such as data cleaning and data normalization, to eliminate the interference of noise data and outliers. At the same time, in order to meet the needs of real-time machining monitoring, the module also has the ability to process data streams, which can instantly parse and convert the G code data generated in real time. In addition to data conversion, the module further implements feature extraction algorithms. The module classifies data based on useful features in the converted three-axis coordinate points, such as trajectory length, curvature, angle change, etc. Finally, deep learning technology is applied to perform feature recognition on the machining path.

[0074] like Figure 3 As shown in the figure, on the OPCUA client, a feature recognition function module is designed based on the CNC system processing flow. Figure 2 The machining trajectory information model in the CNC machine tool is used to convert the G code into x, y, and z three-axis trajectory coordinate points to provide basic data for subsequent feature recognition. Then, the trajectory coordinate point set is preprocessed. The preprocessed coordinate data information is sent to the feature recognition module to identify the key features in the data. In the model training phase, the model is trained using a deep learning algorithm, and the model is adjusted and optimized to improve its prediction accuracy and stability. Finally, the digital twin model is used to complete the interaction between the feature recognition module and the CNC system, and the performance of the model is evaluated. The results are fed back to the model training phase to further optimize and adjust the model, and update the model and instructions in real time. The model trained using feature data can be used to identify the path coordinates of CNC machine tools, which helps to dynamically adjust the model and control strategy according to actual conditions, thereby achieving more efficient and precise control.

[0075] A method for identifying workpiece machining path features of a CNC system based on deep learning, comprising the following steps:

[0076] Step 1: Collect the G code generated by the CNC machine tool and perform data preprocessing;

[0077] Step 2: Extract key features of the workpiece machining path from the preprocessed G code;

[0078] Step 3: Use deep learning models to classify and identify the extracted features;

[0079] Step 4: Visualize the workpiece processing path based on the recognition results.

[0080] The step 1 comprises:

[0081] Step 1.1: Connect the designed data collection submodule to the communication interface of the CNC machine tool to ensure the real-time and integrity of the data. The OPC UA protocol is used to achieve cross-platform and cross-device data communication, which can ensure the security and integrity of the data during transmission.

[0082] Step 1.2: Remove redundant and non-essential information, such as comments and blank lines, through data cleaning algorithms. In order to further standardize the format of G-code, regular expressions are used to normalize the string.

[0083] Step 1.3: In order to make the data more suitable for machine processing, data formatting is required to convert the cleaned G code into a standard data format that is easy for machine processing. After that, any subsequent operations can directly use this formatted data without additional conversion or processing.

[0084] The step 2 comprises:

[0085] Step 2.1: Identify the key instructions (such as G00, G01, G02, G03, etc.) and parameters (such as X, Y, Z coordinates) in the G code that describe the workpiece processing path. Then, based on this information, calculate the length, angle, curvature and other information of the path, and classify the processing features based on this information to provide input features for subsequent data analysis and machine learning.

[0086] Step 2.2: Using statistical methods to transform features into a standard form with uniform dimensions and ranges can help improve the efficiency and accuracy of model training.

[0087] The step 3 comprises:

[0088] Step 3.1: In view of the highly complex and nonlinear characteristics of CNC machining data, the present invention selects a convolutional neural network (CNN) as the basic model structure, and uses the optimization algorithm Adam and the cross entropy loss function to train the model.

[0089] Step 3.2: Evaluate the model using an independent set of test data, and fine-tune and optimize the model based on the evaluation results to achieve the best performance.

[0090] The step 4 comprises:

[0091] Use visualization tools to visualize data and display a three-dimensional graph of the workpiece processing path. This helps to better understand the processing path characteristics of the workpiece, so as to subsequently identify areas that need improvement or optimization, thereby improving overall production efficiency and quality. Figure 4 As shown, the coordinate axes in the visualization result diagram are x, y, and z axes, respectively, in centimeters. The figure shows that the method for identifying workpiece machining path features of a CNC system based on deep learning proposed by the present invention can effectively identify the curved and planar features of the workpiece machining path.

[0092] Combining the above characteristics, this feature recognition function module not only provides an efficient and accurate data conversion and feature recognition method, but also has high practicality and application potential because it is based on the OPC UA architecture with strong openness and good compatibility.

Claims

1. A method for identifying workpiece machining path features in a CNC system based on deep learning, characterized in that: The following steps are involved: Step 1: Obtain the G code generated by the CNC machine tool and perform preprocessing; Step 2: extracting the features of the workpiece processing path from the preprocessed G code; Step 3: Classify and identify the extracted features through the deep learning model; Step 4: Visualize the workpiece processing path based on the recognition results.

2. According to the method for identifying workpiece machining path features of a CNC system based on deep learning in claim 1, it is characterized in that: Step 1 is as follows: Connect with the communication interface of the CNC machine tool and obtain G code in real time through the data acquisition protocol; Remove redundant information in the G code and normalize the character string to complete the G code cleaning; The cleaned G-code is converted into a set structured format for subsequent feature extraction.

3. The method for identifying workpiece machining path features of a CNC system based on deep learning according to claim 1, characterized in that: In step 1, when a certain G code instruction does not exist in the CNC machine tool, it is replaced or not processed.

4. The method for identifying workpiece machining path features of a CNC system based on deep learning according to claim 1, characterized in that: The step 1 is specifically as follows: Identify the state instructions and positions describing the workpiece processing path in the structured format G code, obtain the curvature of every two adjacent path coordinate points in the path, and perform feature classification according to the curvature of the path coordinate points; Standardize features with classification labels for input into deep learning models.

5. The method for identifying workpiece machining path features of a CNC system based on deep learning according to claim 4, characterized in that: The step of obtaining the curvature of every two adjacent coordinate points in the path and performing feature classification comprises the following steps: Calculate the curvature of every two adjacent path coordinate points, and classify points with the same range of curvature into the same type of machining surface by setting the curvature threshold: For two adjacent path coordinate points, if the curvature of a path coordinate point is greater than a threshold, the current path coordinate point is considered to be classified as a curved surface; otherwise, it is classified as a plane.

6. The method for identifying workpiece machining path features of a CNC system based on deep learning according to claim 1, characterized in that: The training of the deep learning model includes the following steps: Obtain the historical G code generated by the CNC machine tool and perform preprocessing; Extract the features of the workpiece machining path from the preprocessed G code and divide it into training data and test data; A convolutional neural network is used to train the model through training data. During the training process, the optimization algorithm Adam and the loss function are used to optimize the model to obtain a trained deep learning model. Evaluate the performance of deep learning models on test data.

7. A CNC system workpiece machining path feature recognition system based on deep learning, characterized in that: include: Data preprocessing module, used to collect and preprocess the G codes generated by CNC machine tools; A feature extraction module is used to extract the features of the workpiece processing path from the preprocessed G code; Deep learning models are used to classify and identify the extracted features.

8. The deep learning-based CNC system workpiece processing path feature recognition system according to claim 7, characterized in that: The data preprocessing module comprises: The data collection submodule is used to connect with the communication interface of the CNC machine tool and obtain the G code in real time through the data acquisition protocol; The data cleaning submodule is used to remove redundant information in the G code and normalize the character string to complete the G code cleaning; The data formatting submodule is used to convert the cleaned G code into a set structured format for subsequent feature extraction.

9. The deep learning-based CNC system workpiece processing path feature recognition system according to claim 7, characterized in that: The feature extraction module comprises: The path feature calculation submodule is used to identify the state instructions and positions describing the workpiece processing path in the structured format G code, obtain the length and angle of each path segment in the path, and for each path segment, perform feature classification according to the angles of the path segments adjacent to it; The feature normalization submodule is used to standardize the classified features and divide them into training data and test data for input into the deep learning model.

10. The deep learning-based CNC system workpiece processing path feature recognition system according to claim 7, characterized in that: The deep learning model comprises: The model training submodule is used to use convolutional neural networks to train models through training data. During the training process, the optimization algorithm Adam and the loss function are used to optimize the model to obtain a trained deep learning model. The model evaluation submodule is used to evaluate the performance of the deep learning model through test data.

Citation Information

Cited By

  • Five-axis numerical control machining small line segment grouping method based on track fairing strategy

    CN121069900A

  • STEP-NC processing feature identification method based on deep learning

    CN121350556A