Complex curved surface machining numerical control program automatic generation method

Automatically generates CNC programs for complex surface processing through neural network technology, which solves the problem that traditional polishing methods are difficult to meet the needs of high precision and high efficiency, and realizes efficient and accurate CNC program generation of complex surface processing.

CN120215412AActive Publication Date: 2025-06-27CHANGCHUN INST OF OPTICS FINE MECHANICS & PHYSICS CHINESE ACAD OF SCI

Patent Information

Application Number
CN202510700127.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-28
Publication Date
2025-06-27
Estimated Expiration
2045-05-28

AI Technical Summary

Technical Problem

Traditional polishing methods are difficult to meet the high precision and high efficiency requirements of complex surface processing, and the CNC program generation process is cumbersome and complicated, resulting in high operational difficulty and low efficiency.

Method used

Using neural network technology, by collecting complex surface information, process parameters and CNC program data, a transfer learning network is built to automatically generate CNC machine tool code for complex surface processing.

Benefits of technology

It realizes efficient and precise CNC program generation for complex surface processing, reduces programming difficulty and cost, and improves polishing accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120215412A_ABST
    Figure CN120215412A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of optical machining, in particular to a method for automatically generating a complex curved surface machining numerical control program. Comprising the following steps: collecting related information of the complex curved surface, including information of the complex curved surface, process parameters when the complex curved surface is processed and program information of a numerical control machine tool when the complex curved surface is processed; collecting a plurality of groups of data in the above steps to obtain a complex curved surface information data set, taking the process information data set as an input data set, and obtaining a numerical control program data set as an output data set; constructing a transfer learning network; the input data set is input and trained, and a complex curved surface machining code prediction model is obtained; and according to the requirement of a complex curved surface machining task, information of the complex curved surface and technological parameters when the complex curved surface is machined are obtained and input into the complex curved surface machining code prediction model, a machine tool numerical control code can be obtained, and efficient machining of the complex curved surface is achieved. The method has the advantages of being short in calculation time, improving polishing precision and efficiency and enhancing model adaptability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of optical processing, and particularly to a method for automatically generating a numerical control program for machining complex curved surfaces. Background Art

[0002] With the development of industrial technologies such as optical instruments, aerospace, and national defense, the application of complex curved surfaces is becoming increasingly widespread. However, these complex curved surfaces usually have extremely stringent requirements for mirror surface machining. Traditional polishing methods, such as manual polishing, are difficult to meet the high-precision and high-efficiency requirements of modern industry for complex curved surface machining due to problems such as inconsistent precision and low efficiency. Machine tool polishing has relatively mature software for generating numerical control programs in general curved surface machining, but for the machining of complex curved surfaces and even free-form surfaces, the process of generating numerical control programs is extremely cumbersome and complex. It involves multiple links such as curved surface analysis, process planning, path planning, path and curved surface matching analysis, G-code conversion, and mechanical interference analysis. This not only requires extremely high professional knowledge and experience of operators, but also has certain knowledge barriers, resulting in many difficulties and challenges for engineering personnel in the process of use. Therefore, there is an urgent need to develop a method that can quickly and accurately generate numerically controlled machine tool codes for complex curved surface machining in a blind box manner. Summary of the Invention

[0003] The present invention provides a method for automatically generating a numerical control program for machining complex curved surfaces to solve the above problems.

[0004] The purpose of the present invention is to provide a method for automatically generating a numerical control program for machining complex curved surfaces, which specifically includes the following steps: S1. Collect information related to complex curved surfaces, including information on complex curved surfaces, process parameters during the machining of complex curved surfaces, and numerical control machine tool program information during the machining of complex curved surfaces; S2. Collect several groups of data in step S1 to obtain a complex curved surface information data set, a process information data set, and a numerical control program data set respectively; use the complex curved surface information data set and the process information data set as input data sets, and use the numerical control program data set as an output data set; S3. Construct a transfer learning network; input the input data set obtained in step S2 and perform training to obtain a prediction model for complex curved surface machining codes; S4. According to the requirements of complex curved surface machining tasks, obtain information on complex curved surfaces and process parameters during the machining of complex curved surfaces and input them into the prediction model for complex curved surface machining codes, and then numerically controlled machine tool codes can be obtained to achieve high-efficiency machining of complex curved surfaces.

[0005] Preferably, step S1 specifically includes the following steps: S11. Complex surface information collection: Collecting the information of a complex surface includes the surface shape, size, material, surface equation and surface error distribution map of the complex surface; S12. Machining process parameter collection: Collect the process parameters when the complex surface described in step S11 is machined, including but not limited to the tool type, tool size, abrasive particle size, removal rate distribution, and machining path used in the machining process; S13. Numerical control machine tool program information collection: The numerical control machine tool program information when the complex surface described in step S1 is machined, including the actual running time of the numerical control machine tool, the running speed gradient, the numerical control program file, and the rationality information of the axis system configuration.

[0006] Preferably, in step S2, no less than 200 groups of data in step S1 are collected.

[0007] Preferably, step S3 specifically includes the following sub-steps: S31. Normalize the non-normalized initial numerical data in the input dataset; convert the non-numerical data in the input dataset into vector features through one-hot encoding; S32. Use a convolutional neural network model to establish the mapping relationship between the input data and the output data; use the difference between the predicted G-code numerical matrix and the actual G-code numerical matrix as the loss function for pre-training; S33. Use the trained network weight matrix PT for transfer learning of complex surface machining tasks; S34. Randomly initialize the output layer weights in the pre-trained convolutional neural network model; S35. Use a small batch of complex surface machining data to fine-tune and train the pre-trained network weight matrix PT.

[0008] Preferably, the non-normalized initial numerical data in step S31 includes tool size, abrasive particle size, removal rate distribution, and machining path; the non-numerical data includes the tool type used in the machining process.

[0009] Preferably, the convolutional neural network model in step S32 includes a convolutional layer, a pooling layer, a fully connected layer, and an output layer; The formula of the loss function is as follows: ; In the formula, N represents the total number of rows of the predicted G-code, represents the i-th row code value obtained by prediction, represents the actual i-th row code value; Use the adam algorithm as the optimization algorithm, and set the initial learning rate to 0.001.

[0010] Preferably, step S33 further includes: retaining the weights of the convolutional layer, pooling layer, and fully connected layer in the pre-trained convolutional neural network model, where the weights of the convolutional layer, pooling layer, and fully connected layer are obtained from the weight matrix obtained by pre-training.

[0011] Preferably, in step S35, the training step size is set to 1 / 100 of that during pre-training.

[0012] Compared with the prior art, the present invention can achieve the following beneficial effects: The present invention proposes a method for automatically generating a numerical control program for complex surface machining. By using the previously machined complex surface, process parameters, and numerical control program as a data set and applying a neural network, through training with a large amount of diverse data, it has a powerful generalization ability, can handle unknown complex surface types, and transfer learning further enhances the rapid adaptability to new tasks. When a new complex surface machining task arrives, only the complex surface information and process parameter information need to be input into the network to quickly obtain the numerical control program. Although the amount of data set collection in the early stage of the method of the present invention is large, once the neural network calculation model is built, obtaining the machine tool numerical control code is very fast. Therefore, the method for automatically generating a numerical control program for complex surface machining proposed by the present invention has obvious advantages in terms of calculation time consumption and comprehensibility, and improves the polishing accuracy and efficiency, enhances the model adaptability, and reduces the programming difficulty and cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 is a flowchart of a method for automatically generating a numerical control program for complex surface machining according to an embodiment of the present invention.

[0014] Figure 2 is a schematic diagram of transfer learning training according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0015] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the following description, the same modules are denoted by the same reference numerals. In the case of the same reference numerals, their names and functions are also the same. Therefore, their detailed descriptions will not be repeated.

[0016] In order to make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and do not constitute a limitation to the present invention.

[0017] Refer to Figure 1 , the present invention provides a method for automatically generating a numerical control program for complex surface machining, specifically including the following steps: S1. Collect information related to complex surfaces, including information about complex surfaces, process parameters during the machining of complex surfaces, and numerical control machine tool program information during the machining of complex surfaces; S11. Collection of complex surface information: Collect information about a complex surface; Specifically, the information includes but is not limited to the surface shape, dimensions, material, surface equation, and surface error distribution map of the complex surface; the above information precisely defines the complex surface from geometric and physical properties, providing a detailed basis for formulating subsequent machining strategies; S12. Collection of machining process parameters: Collect the process parameters during the machining of the complex surface described in step S11; Specifically, the process parameters include but are not limited to the tool type, tool size, abrasive particle size, removal rate distribution, machining path, etc. used in the machining process.

[0018] S13. Collection of numerical control machine tool program information: The numerical control machine tool program information during the machining of the complex surface described in step S1; Specifically, the numerical control machine tool program information includes but is not limited to the actual running time of the numerical control machine tool, running speed gradient, numerical control program file, and shaft system configuration rationality information.

[0019] S2. Construct a data set: Repeat step S1, collect at least N groups (N≥200) of data, and obtain a complex surface information data set, a process information data set, and a numerical control program data set; use the complex surface information data set and the process information data set as the input data set, and use the numerical control program data set as the output data set.

[0020] S3. Construct a transfer learning network; input the input data set obtained in step S2 and train it to obtain a complex surface machining code prediction model; specifically, it includes the following sub-steps: S31. Normalize the non-normalized initial numerical data in the input data set; convert the non-numerical data in the input data set into vector features through one-hot encoding; The non-normalized initial numerical data includes process parameters such as tool size, abrasive particle size, removal rate distribution, machining path, etc.; the non-numerical data includes the tool type used in the machining process, etc.; Specifically, the normalization method is: Adopt the min-max normalization method to scale the data to the range of [0,1]; the formula is as follows: ; In the formula, x is the original data point, x min is the minimum value in this feature column, and x max is the maximum value in this feature column.

[0021] S32. Establish the mapping relationship between the input data (complex surface information data, process information data) and the output data (CNC program data) using a convolutional neural network model (CNN); use the difference between the predicted G-code numerical matrix and the actual G-code numerical matrix as the loss function for pre-training; The convolutional neural network model includes a convolutional layer, a pooling layer, a fully connected layer, and an output layer; The formula for the loss function is as follows: ; In the formula, N represents the total number of lines of the predicted G-code, represents the numerical value of the i-th line of the predicted code, represents the numerical value of the i-th line of the actual code; Use the adam algorithm as the optimization algorithm, and set the initial learning rate to 0.001; if the loss of the validation set has not improved for 5 consecutive rounds, multiply the learning rate by the decay factor 0.5, and set the minimum learning rate threshold to 10 -6 . In addition, add an L2 regularization term (λ = 1e -4 ) to the weights to prevent overfitting. Set the batch size to 32 and the number of training iterations to 100,000 times.

[0022] G-code is a programming language used to control CNC machine tools, specifying parameters such as the movement path, speed, and feed rate of the machine tool; each line of code contains multiple instructions for controlling different axes of the machine tool (such as the X, Y, and Z axes) and the position and operation of the tool.

[0023] Through this step, the CNN network can fit the mapping relationship between the process parameters, surface shape information, and processing program during conventional surface machining.

[0024] S33. Model weight transfer: Use the trained network weight matrix PT for transfer learning of complex surface machining tasks; retain the weights of other layers except the output layer in the pre-trained CNN model, and these weights are consistent with the weights obtained from conventional surface training (obtained from the pre-trained weight matrix, without re-initializing or adjusting these weights).

[0025] S34. Output layer weight initialization: Randomly initialize the weights of the output layer in the pre-trained convolutional neural network model so that the model can adapt to the characteristics of complex surface machining tasks; specifically, use the He initialization method for initialization.

[0026] S35. Fine-tuning training: Use a small batch of complex surface machining data to fine-tune the trained network weight matrix PT; set the training step size to 1 / 100 of the pre-training step size to ensure that the model has a high fitting accuracy while maintaining a certain generalization ability; The model is trained using fine-tuning data to update the weights of the model, especially the weights of the output layer, and the training of the network model applicable to the output of complex surface machining codes is completed. For details, see Figure 2 as shown.

[0027] S4. According to the requirements of the complex surface machining task, obtain the information of the complex surface and the process parameters when the complex surface is machined and input them into the complex surface machining code prediction model, and the numerical control code of the machine tool can be obtained to achieve the efficient machining of the complex surface.

[0028] The key technical points and advantages of the present invention are as follows: By proposing an automatic generation method for numerical control programs for complex surface machining, the present invention uses the previously machined complex surface, process parameters, and numerical control programs as a data set, and uses a neural network to mine the internal relationships among the three. Through training with a large amount of diverse data, the neural network has strong generalization ability, can handle unknown complex surface types, and transfer learning further enhances the rapid adaptability to new tasks. When a new complex surface machining task arrives, only the complex surface information and process parameter information need to be input into the network, and the numerical control program can be quickly obtained. Compared with the traditional complex analysis and generation method, the method proposed by the present invention has obvious advantages in terms of calculation time consumption and understandability, and improves the polishing accuracy and efficiency, enhances the model adaptability, and reduces the programming difficulty and cost.

[0029] It should be understood that various forms of the processes shown above can be used, and steps can be reordered, added, or deleted. For example, the steps described in the disclosure of the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution disclosed in the present invention can be achieved, and no limitation is made herein.

[0030] The above specific implementation manners do not constitute a limitation to the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for automatically generating a numerical control program for complex surface machining, characterized in that: Specifically, it includes the following steps: S1. Collect information related to complex surfaces, including information about complex surfaces, process parameters during the machining of complex surfaces, and numerical control machine tool program information during the machining of complex surfaces; S2. Collect several groups of data in step S1 to obtain a complex surface information dataset, a process information dataset, and a numerical control program dataset respectively; use the complex surface information dataset and the process information dataset as the input dataset, and use the numerical control program dataset as the output dataset; S3. Construct a transfer learning network; Input the input dataset obtained in step S2 and conduct training to obtain a complex surface machining code prediction model; S4. According to the requirements of the complex surface machining task, obtain the information of the complex surface and the process parameters during the machining of the complex surface and input them into the complex surface machining code prediction model, then the machine tool numerical control code can be obtained to achieve the efficient machining of complex surfaces.

2. The automatic generation method of a numerical control program for complex surface machining according to claim 1, wherein: The specific steps of step S1 are as follows: S11. Collection of complex surface information: Collect the information of a complex surface, including the surface shape, size, material, surface equation, and surface error distribution map of the complex surface; S12. Collection of machining process parameters: Collect the process parameters during the machining of the complex surface described in step S11, including but not limited to the tool type used in the machining process, tool size, abrasive particle size, removal rate distribution, machining path; S13. Collection of numerical control machine tool program information: The numerical control machine tool program information during the machining of the complex surface described in step S1, including the actual running time of the numerical control machine tool, running speed gradient, numerical control program file, and axis system configuration rationality information.

3. The automatic generation method of a numerical control program for complex surface machining according to claim 1, characterized in that: In step S2, no less than 200 groups of data in step S1 are collected.

4. A method for automatically generating a numerical control program for machining complex curved surfaces according to claim 1, characterized in that: The specific steps of step S3 are as follows: S31. Normalize the non-normalized initial numerical data in the input dataset; convert the non-numerical data in the input dataset into vector features through one-hot encoding; S32. Use a convolutional neural network model to establish the mapping relationship between the input data and the output data; use the difference between the predicted G-code numerical matrix and the actual G-code numerical matrix as the loss function for pre-training; S33. Use the trained network weight matrix PT for transfer learning of complex surface machining tasks; S34. Randomly initialize the weights of the output layer in the pre-trained convolutional neural network model; S35. Use a small batch of complex surface machining data to fine-tune and train the network weight matrix PT obtained from pre-training.

5. A method for automatically generating a numerical control program for machining complex curved surfaces according to claim 4, characterized in that: The non-normalized initial numerical data in step S31 includes tool size, abrasive particle size, removal rate distribution, machining path; the non-numerical data includes the tool type used in the machining process.

6. The automatic generation method of a numerical control program for complex surface machining according to claim 4, wherein: The convolutional neural network model in step S32 includes a convolutional layer, a pooling layer, a fully connected layer, and an output layer; The formula of the loss function is as follows: ; Where N represents the total number of predicted G-code lines, represents the value of the i-th line of code obtained by prediction, represents the value of the actual i-th line of code; Use the adam algorithm as the optimization algorithm, and set the initial learning rate to 0.

001.

7. A method for automatically generating a numerical control program for complex surface machining according to claim 4, characterized in that: Step S33 also includes: retain the weights of the convolutional layer, pooling layer, and fully connected layer in the pre-trained convolutional neural network model, and the weights of the convolutional layer, pooling layer, and fully connected layer are obtained from the weight matrix obtained from pre-training.

8. A method for automatically generating a numerical control program for machining complex curved surfaces according to claim 4, characterized in that: In the step S35, the training step size is set to 1 / 100 of that during pre-training.

Citation Information

Patent Citations

  • Intelligent numerical control programming system for special-shaped helical curved surface machining

    CN102385347A

  • Machine learning device, numerical control machining program generation device, and machine learning method

    CN112384867A

  • Numerical control machine tool code generation method based on multi-modal information and related equipment

    CN116149258A

  • Complex curved surface numerical control machining process planning automatic generation method

    CN116679617A

  • Machine tool machining strategy planning method and device, equipment and storage medium

    CN118643966A

Cited By

  • Method for automatically programming complex curved surface features of cylinder

    CN121009773A