Numerical control program generation and simulation optimization system and method based on large model

By using a large-model-based CNC program generation and simulation optimization system, speech recognition and deep learning are utilized to achieve intelligent generation and automated simulation verification of CNC programs. This solves the problems of complexity in CNC programming and poor verification, improves programming efficiency and quality, and reduces the professional knowledge requirements.

CN122363047APending Publication Date: 2026-07-10SHANGHAI ELECTRICGROUP CORP +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI ELECTRICGROUP CORP
Filing Date
2026-04-08
Publication Date
2026-07-10

Smart Images

  • Figure CN122363047A_ABST
    Figure CN122363047A_ABST
Patent Text Reader

Abstract

The application discloses a numerical control program generation and simulation optimization system based on a large model, which comprises a voice recognition module for converting the voice instruction of a user into text information; a large model interaction module for automatically generating numerical control G codes compatible with target numerical control equipment through an algorithm model and / or a rule knowledge base; a simulation instruction recognition module for automatically generating corresponding simulation start instructions and operation instructions according to the numerical control G codes; a simulation environment execution module for automatically simulating, verifying and iteratively optimizing the numerical control G codes; and an optimization module for completing the iterative optimization. Through the integration of interactive voice recognition, deep learning driven large model text processing and precise automated simulation control, the application realizes the high automation of the whole numerical control programming process, improves the efficiency and accuracy of numerical control programming, and reduces the requirement for the professional knowledge of operators. The application also discloses a numerical control program generation and simulation optimization method based on the above system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of CNC programming, specifically relating to a CNC program generation and simulation optimization system and method based on a large model. Background Technology

[0002] Currently, CNC programming, especially G-code writing, demands high skill from operators, requiring specialized knowledge, and is a tedious and error-prone process. The accuracy of CNC machine tool operation directly impacts product processing quality and efficiency. While some auxiliary programming software exists, most rely on manual input and editing, lacking intelligent and automated support. Furthermore, post-programming verification requires specialized simulation software, making seamless integration with the programming process impossible. Therefore, designing an integrated solution encompassing intelligent voice command recognition, automatic CNC program generation using large models, automated operation simulation verification, and auxiliary process optimization is of significant practical importance. Summary of the Invention

[0003] The purpose of this invention is to overcome the shortcomings of the prior art and provide a CNC program generation and simulation optimization system based on a large model. It uses natural voice interaction to lower the threshold of use, relies on advanced AI large models to realize intelligent generation of CNC programs, and ensures program quality and efficiency through automated simulation and optimization closed loop. This significantly improves the automation, intelligence level and overall efficiency of CNC programming, reduces the dependence on professional personnel and the risk of errors, and assists in process optimization.

[0004] Another objective of this invention is to provide a CNC program generation and simulation optimization method based on a large model. By using the aforementioned CNC program generation and simulation optimization system based on a large model for CNC programming and simulation verification, the problems of complex operation, reliance on manual labor, error susceptibility, and poor connection between programming and simulation verification steps in current CNC programming can be solved, thereby improving programming efficiency and accuracy, enhancing product processing efficiency and quality, and assisting in process optimization.

[0005] One technical solution to achieve the above objectives is: a CNC program generation and simulation optimization system based on a large model, comprising: Voice recognition module: used to convert the user's voice commands into text information; Large model interaction module: Coupled with the speech recognition module, it is used to process the text information converted by the speech recognition module based on the large language model, and automatically generate CNC G-code compatible with the target CNC equipment through the large language model and / or rule knowledge base; Simulation instruction recognition module: Communicates with the large model interaction module, and is used to combine the multimodal large model to analyze the simulation software and its functional requirements for executing CNC G code, and automatically generate corresponding simulation start instructions and operation instructions; Simulation environment execution module: connected to the simulation instruction recognition module, used to receive simulation start instructions and operation instructions, start the specified simulation software and load CNC G code, and perform automatic simulation verification of CNC G code; The optimization module is connected to both the simulation environment execution module and the large model interaction module. It is used to analyze the causes of anomalies based on the simulation results of the simulation environment execution module and pass optimization suggestions to the rule knowledge base of the large model interaction module. The rule knowledge base generates corrected CNC G-code based on the optimization suggestions until iterative optimization is completed.

[0006] The above-mentioned CNC program generation and simulation optimization system based on a large model, wherein the large language model adopts a deep learning model based on the Transformer architecture.

[0007] This invention also provides a method for CNC program generation and simulation optimization based on a large model. The method employs the aforementioned CNC program generation and simulation optimization system based on a large model for CNC programming and simulation verification, and includes the following steps: S1: Voice input and recognition steps: The user inputs programming requirements or instructions via voice, and the voice recognition module converts the user's voice input programming requirements or instructions into text information; S2, Code generation steps: The large model interaction module performs intent recognition and element understanding on the text information output in step S1 based on the large language model, and generates the corresponding CNC G code; S3: Instruction parsing steps: The simulation instruction recognition module selects the corresponding simulation software based on the characteristics of the generated CNC G-code and constructs the simulation start command and operation instructions; S4, Automated Simulation Verification and Closed-Loop Optimization Steps: The simulation environment execution module automatically executes the start command and operation instructions, starts the simulation engine to load and run the CNC G code, and completes the simulation verification and iterative optimization.

[0008] In the above-mentioned method for generating and simulating CNC programs based on large models, in step S1, the user speaks the programming requirements or instructions into a microphone. The microphone collects the speech, and the audio stream is transmitted to the speech recognition module in real time. The speech recognition module converts the user's speech instructions into text information and displays the recognized text information on the interface for the user to confirm or correct.

[0009] The above-mentioned method for generating and simulating CNC programs based on large models includes the following steps in step S2: Intent and Element Understanding: Based on the large language model, the text information output by the recognition step S1 is parsed and identified to identify key structured processing elements and generate a structured object containing all identified processing elements and parameters; Intelligent CNC program generation: Based on the structured object, and according to the large language model and / or rule knowledge base, a finishing strategy is provided to generate CNC G-code.

[0010] The above-mentioned method for CNC program generation and simulation optimization based on a large model, wherein the large language model generates CNC G-code through an AI-assisted rule knowledge base or directly through AI, wherein: The process of generating CNC G-code using the AI-assisted rule knowledge base is as follows: the AI ​​transmits decisions to the rule knowledge base; the rule knowledge base, based on the strategy and avoidance constraints, and combined with precise geometric information, calls the geometric calculation engine to generate specific equipment trajectory points; the rule knowledge base selects specific parameters based on the recommended parameter range and internal safety rules; and the rule knowledge base generates a complete CNC G-code file according to the syntax. The AI-generated CNC G-code is achieved by a large language model that, after fine-tuning and training, receives the structured object as a prompt and directly generates CNC G-code files.

[0011] The above-mentioned method for generating and simulating CNC programs based on large models includes the following steps in step S4: The simulation environment execution module sequentially calls and executes operation instructions through the multimodal large language model, initiates automatic simulation calculations, analyzes simulation results, and performs error detection. If anomalies are found, the optimization module analyzes the causes of the anomalies based on the simulation results and transmits optimization suggestions to the rule knowledge base. The rule knowledge base generates corrected CNC G-code based on the optimization suggestions. The large language model automatically resubmits the corrected CNC G-code file to the simulation environment execution module, and the simulation engine runs again to evaluate whether the current simulation results meet the acceptance criteria. If no further optimization is needed, the closed-loop optimization is exited; if the criteria are not met, the rule knowledge base continues to correct the CNC G-code based on new optimization suggestions until the criteria are met or the iteration count is exceeded. All optimization processes are recorded in the database for subsequent large language model learning or historical tracing.

[0012] The technical solution of the large-model-based CNC program generation and simulation optimization system and method of the present invention has the following significant advantages and positive effects compared with the prior art: Revolutionary human-computer interaction and reduced barriers to entry: Advantages: By introducing natural voice interaction as the primary input method, it completely changes the traditional mode of relying on keyboard and mouse to operate complex CAM software or manually writing code; Positive effects: It enables on-site operators and non-professional programmers to quickly and intuitively issue machining instructions, significantly reducing the professional threshold and operational complexity of CNC programming, expanding the scope of system users, and improving the flexibility and response speed of the production line. Operators do not need to have an in-depth understanding of G-code syntax or complex software menus.

[0013] A qualitative leap in the level of intelligence and automation: Advantages: Deep integration of large language models (LLM) and multimodal large models endows the system with powerful natural language understanding capabilities, multi-source information fusion capabilities, and intelligent reasoning capabilities; Positive effects: ① Automated program generation: It can intelligently understand the machining intention based on voice, text description and / or drawing model, and automatically generate preliminary CNC program code that meets the requirements and has correct syntax, which greatly reduces the workload and time cost of manual programming; ② Beyond the limitations of rule bases: Compared to traditional automated programming based on fixed rule bases or simple scripts, AI models can handle more complex and ambiguous natural language descriptions, adapt to the needs of non-standard and customized artifacts, and are more flexible and adaptable.

[0014] Significant improvement in efficiency: Advantages: It achieves a high degree of automation in both the core programming process (intent understanding, program generation) and the key later stages (simulation verification, optimization), forming a closed loop; Positive effects: ① Shortened programming cycle: The time required from inputting instructions to generating a usable program (especially for medium-complexity tasks) is drastically reduced from hours or even days to minutes; ②Accelerate debugging and iteration: The automated closed loop of “generation-simulation-optimization” eliminates the lengthy process of manually running simulations repeatedly, finding problems, and modifying code. The simulation debugging cycle is shortened by several times, which significantly speeds up the product flow from design to manufacturing.

[0015] Ensuring program quality and reliability: Advantages: Mandatory automated simulation verification and intelligent closed-loop optimization are the core guarantees.

[0016] Positive effects: ① Reduced human error rate: Automated generation and closed-loop verification optimization minimize the risk of syntax errors, logical errors, and parameter setting errors (such as incorrect rotation speed and feed) caused by human negligence.

[0017] ② Mitigating processing risks: Through precise simulation, potential risks can be effectively prevented. Attached Figure Description

[0018] Figure 1 This is an architecture diagram of the large-model-based CNC program generation and simulation optimization system of the present invention; Figure 2 This is a flowchart of the CNC program generation and simulation optimization method based on a large model according to the present invention. Detailed Implementation

[0019] To enable those skilled in the art to better understand the technical solution of the present invention, its specific embodiments are described in detail below with reference to the accompanying drawings: Please see Figure 1 According to an embodiment of the present invention, a numerical control program generation and simulation optimization system based on a large model includes: Voice recognition module 1: Used to convert the user's voice commands into text information; Large model interaction module 2: Coupled with speech recognition module 1, it is used to process the text information converted by the speech recognition module based on the large language model, and automatically generate CNC G code compatible with the target CNC equipment through the large language model and / or rule knowledge base; Simulation instruction recognition module 3: Communicates with large model interaction module 2, and is used to combine the multimodal large model to analyze the simulation software and its functional requirements for executing CNC G code, and automatically generate corresponding simulation start instructions and operation instructions; Simulation environment execution module 4: connected to simulation instruction recognition module 3, used to receive simulation start instructions and operation instructions, start the specified simulation software and load CNC G code, and perform automatic simulation verification of CNC G code; Optimization Module 5: Connected to Simulation Environment Execution Module 4 and Large Model Interaction Module 2 respectively, it is used to analyze the causes of anomalies based on the simulation results of Simulation Environment Execution Module 4 and pass optimization suggestions to the rule knowledge base of Large Model Interaction Module 2. The rule knowledge base generates corrected CNC G-code based on the optimization suggestions until iterative optimization is completed.

[0020] The core of this invention lies in realizing a closed loop for the automatic generation and simulation optimization of CNC G-code from voice commands based on a speech recognition model, and incorporating a mechanism for real-time simulation verification of programming code, greatly enhancing the system's practicality. A deep learning model based on the Transformer architecture is preferred as the large language model, as it demonstrates superiority in understanding and generating programming code. For simulation software, open-source simulation platforms with high integration and strong scalability are given priority.

[0021] Please see Figure 2 An embodiment of the present invention provides a method for CNC program generation and simulation optimization based on a large model. This method employs the aforementioned CNC program generation and simulation optimization system based on a large model for CNC programming and simulation verification, and includes the following steps: S1: Voice Input and Recognition (Reception and Transcription) Steps: The user inputs programming requirements or instructions via voice, and the voice recognition module converts the user's voice input programming requirements or instructions into text information; S2, Code generation steps: The large model interaction module performs intent recognition and element understanding on the text information output in step S1 based on the large language model, and generates the corresponding CNC G code; S3: Instruction parsing steps: The simulation instruction recognition module selects the corresponding simulation software based on the characteristics of the generated CNC G-code and constructs the simulation start command and operation instructions; S4, Automated Simulation Verification and Closed-Loop Optimization Steps: The simulation environment execution module automatically executes the start command and operation instructions, starts the simulation engine to load and run the CNC G code, and completes the simulation verification and iterative optimization.

[0022] In step S1, voice input and recognition: (1) The user clearly speaks the machining instructions into the microphone. Example: "Use a 10mm diameter four-flute carbide end mill to finish the top surface of the aluminum alloy block. The surface roughness is required to be Ra1.6. Leave a 0.05mm allowance on each side. Be careful to avoid the locating pin hole in the upper left corner." The microphone captures speech, and the audio stream is transmitted to the speech recognition module 1 in real time. Speech Recognition Module 1: Select a speech recognition model and invoke the service; Output the recognized text: "Use a 10mm diameter four-flute carbide end mill to finish the top surface of an aluminum alloy block. The surface roughness requirement is Ra1.6, with a 0.05mm allowance on each side. Be careful to avoid the locating pin hole in the upper left corner." The interface displays the identified text for user confirmation / correction.

[0023] Step S2 specifically includes the following process: (1) Intent and element understanding: Based on the large language model, the text information output in step S1 is subjected to intent recognition and understanding to identify key structured processing elements: Cutting tool: {Type: End mill, Diameter: 10mm, Number of cutting edges: 4, Material: Carbide} Workpiece: {Material: 7075 aluminum alloy, Shape: Square} Machining features: {Type: Plane, Location: Top surface} Quality requirements: {Surface roughness: Ra1.6, allowance: 0.05mm (one side)} Constraints: {Avoidance Feature: Locating Pin Hole (Top Left Corner)} Generate a structured object containing all identified processing elements and parameters.

[0024] (2) Intelligent generation of CNC program: Based on the above structured objects, and according to the large language model and / or rule knowledge base, a finishing strategy is provided to generate CNC G code.

[0025] Decision-making based on factors: The large language model provides finishing strategies by using an AI-assisted rule knowledge base or by directly generating CNC G-code through AI. For example, when selecting a parallel finishing strategy, it recommends core parameters (spindle speed, feed rate, depth of cut, etc.) based on the material and tool.

[0026] Method 1: AI-assisted rule knowledge base: AI transmits decisions to the rule knowledge base. The rule knowledge base, based on strategies and avoidance constraints, and combined with precise geometric information, calls the geometry calculation engine to generate specific toolpath trajectory points. Based on recommended parameter ranges and internal safety rules (such as maximum depth of cut limits), the rule knowledge base selects specific parameters. Following the syntax, the rule knowledge base generates a complete CNC G-code file containing tool definitions, setting instructions, tool compensation, cutting motions, cycle termination, etc.

[0027] Method 2: Direct AI generation: Fine-tuning and training a large language model (LLM) to directly output G-code.

[0028] LLM receives a structured object as a prompt and directly generates a CNC G-code file containing all the above instructions. This generates a preliminary program file.

[0029] The simulation instruction recognition module 3 selects the corresponding simulation software based on the characteristics of the generated CNC G-code and constructs the simulation start command and operation instructions. This includes the selected machine tool model (including stroke, spindle, and tool changer), tool magazine, fixture model, and blank model.

[0030] In step S4, the simulation environment execution module 4 executes instructions sequentially through the multimodal large model: loading program, loading tool / fixture / stock model, setting initial position, and starting automatic simulation calculation.

[0031] Analyze simulation results, perform error detection (e.g., detect collisions and mark their locations), perform geometric verification to confirm no overcutting or undercutting, and conduct performance analysis to calculate total machining time and analyze tool load curves.

[0032] Optimization Module: In case of anomalies, analyze the cause based on simulation results. Examples include program errors, collisions, and excessively high loads. Rule-based optimization decisions: For collisions: "Increase the safe height of non-cutting movement to above xx" or "In the coordinate region (X1, Y1) to (X2, Y2), force tool lifting to a safe height before horizontal movement," etc. For excessively high loads: "For aluminum alloy finishing, the feed rate F can be appropriately increased within acceptable load ranges," etc.

[0033] Program Correction: The optimization module passes the modification instructions to the rule knowledge base. For example, it parses the instructions, modifies the safety height, locates the relevant height settings and movement instructions in the original program, modifies the cutting feed rate F value based on optimization suggestions, and generates the corrected program file.

[0034] Closed-loop iteration: The system automatically resubmits the revised program file to the simulation verification module. The simulation engine runs again, loading the revised program and other models. It confirms that collision errors have been eliminated, that there are no new overcuts / undercuts, and confirms the processing time, etc. It evaluates that the current results meet the acceptance criteria. When no further optimization is needed, it exits the closed loop. If the criteria are not met, it will continue to be revised based on new optimization suggestions until the criteria are met or the number of iterations is exceeded.

[0035] Results Recording: Record the optimization process (initial problem, modifications, and results) to the database for subsequent model learning or historical tracking.

[0036] In summary, the large-model-based CNC program generation and simulation optimization system and method of this invention, by integrating interactive speech recognition, deep learning-driven large-model text processing, and precise automated simulation control, achieves a high degree of automation throughout the entire CNC programming process, improving the efficiency and accuracy of CNC programming while reducing the professional knowledge requirements of operators. It not only simplifies the CNC programming process, significantly reducing the programming threshold and workload, but also enhances the system's adaptability and verification accuracy, demonstrating significant innovative and practical value.

[0037] Those skilled in the art should recognize that the above embodiments are merely illustrative of the present invention and are not intended to limit the present invention. Any variations or modifications to the above embodiments that are within the spirit and essence of the present invention will fall within the scope of the claims of the present invention.

Claims

1. A CNC program generation and simulation optimization system based on a large model, characterized in that, include: Voice recognition module: used to convert the user's voice commands into text information; Large-scale model interaction module: Coupled with the speech recognition module, it is used to process the text information converted by the speech recognition module based on the large language model, and automatically generate CNC G-code compatible with the target CNC equipment by combining contextual understanding and through the large language model and / or rule knowledge base; Simulation instruction recognition module: Communicates with the large model interaction module, and is used to combine the multimodal large model to analyze the simulation software and its functional requirements for executing CNC G code, and automatically generate corresponding simulation start instructions and operation instructions; Simulation environment execution module: connected to the simulation instruction recognition module, used to receive simulation start instructions and operation instructions, start the specified simulation software and load CNC G code, and perform automatic simulation verification of CNC G code; The optimization module is connected to both the simulation environment execution module and the large model interaction module. It is used to analyze the causes of anomalies based on the simulation results of the simulation environment execution module and pass optimization suggestions to the rule knowledge base of the large model interaction module. The rule knowledge base generates corrected CNC G-code based on the optimization suggestions until iterative optimization is completed.

2. The CNC program generation and simulation optimization system based on a large model as described in claim 1, characterized in that, The large language model adopts a deep learning model based on the Transformer architecture.

3. A method for CNC program generation and simulation optimization based on a large model, characterized in that, The CNC programming and simulation verification using the large-model-based CNC program generation and simulation optimization system as described in claim 1 includes the following steps: S1: Voice input and recognition steps: The user inputs programming requirements or instructions via voice, and the voice recognition module converts the user's voice input programming requirements or instructions into text information; S2, Code generation steps: The large model interaction module performs intent recognition and element understanding on the text information output in step S1 based on the large language model, and generates the corresponding CNC G code; S3: Instruction parsing steps: The simulation instruction recognition module selects the corresponding simulation software based on the characteristics of the generated CNC G-code and constructs the simulation start command and operation instructions; S4, Automated Simulation Verification and Closed-Loop Optimization Steps: The simulation environment execution module automatically executes the start command and operation instructions, starts the simulation engine to load and run the CNC G code, and completes the simulation verification and iterative optimization.

4. The method for generating and simulating CNC programs based on a large model as described in claim 3, characterized in that, In step S1, the user speaks the programming requirements or instructions into the microphone. The microphone picks up the voice, and the audio stream is transmitted to the voice recognition module in real time. The voice recognition module converts the user's voice instructions into text information and displays the recognized text information on the interface for the user to confirm or correct.

5. The method for generating and simulating CNC programs based on a large model as described in claim 3, characterized in that, Step S2 specifically includes the following process: Intent and Element Understanding: Based on the large language model, the text information output by the recognition step S1 is parsed and identified to identify key structured processing elements and generate a structured object containing all identified processing elements and parameters; Intelligent CNC program generation: Based on the structured object, and according to the large language model and / or rule knowledge base, a finishing strategy is provided to generate CNC G-code.

6. The method for generating and simulating CNC programs based on a large model as described in claim 5, characterized in that, Large language models generate CNC G-code either through AI-assisted rule knowledge bases or directly through AI, where: The process of generating CNC G-code using the AI-assisted rule knowledge base is as follows: the AI ​​transmits decisions to the rule knowledge base; the rule knowledge base, based on the strategy and avoidance constraints, and combined with precise geometric information, calls the geometric calculation engine to generate specific equipment trajectory points; the rule knowledge base selects specific parameters based on the recommended parameter range and internal safety rules; and the rule knowledge base generates a complete CNC G-code file according to the syntax. The AI-generated CNC G-code is achieved by a large language model that, after fine-tuning and training, receives the structured object as a prompt and directly generates CNC G-code files.

7. The method for generating and simulating CNC programs based on a large model as described in claim 6, characterized in that, Step S4 specifically includes the following process: The simulation environment execution module sequentially calls and executes operation instructions through the multimodal large language model, initiates automatic simulation calculations, analyzes simulation results, and performs error detection. If anomalies are found, the optimization module analyzes the causes of the anomalies based on the simulation results and transmits optimization suggestions to the rule knowledge base. The rule knowledge base generates corrected CNC G-code based on the optimization suggestions. The large language model automatically resubmits the corrected CNC G-code file to the simulation environment execution module, and the simulation engine runs again to evaluate whether the current simulation results meet the acceptance criteria. If no further optimization is needed, the closed-loop optimization is exited; if the criteria are not met, the rule knowledge base continues to correct the CNC G-code based on new optimization suggestions until the criteria are met or the iteration count is exceeded. All optimization processes are recorded in the database for subsequent large language model learning or historical tracing.