Simulation control method and equipment for die-free turning and storage medium
By reading and classifying the CNC code for mold-free turning processing line by line, the motion instructions are extracted and the path data set is constructed, and the tool motion trajectory is simulated, the problem of risk identification in mold-free turning processing is solved, and efficient and accurate machining control and quality improvement are achieved.
Patent Information
- Application Number
- CN202510633117.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2025-08-15
AI Technical Summary
Before mold-free turning, it is difficult to effectively simulate and simulate possible risks during the processing process, resulting in low actual processing quality and low efficiency.
By obtaining the CNC code of the target workpiece, reading and classifying the G code line by line, extracting motion instructions, building tool motion path data set, calculating the set of movement vectors, and calling the tool path simulation engine to render the tool model, simulate the processing process.
High-precision and efficient tool circuit simulation are realized, risks and abnormalities in the processing process are discovered and avoided, processing quality and efficiency are improved, scrap rate and equipment damage are reduced, and costs are reduced.
Smart Images

Figure CN120491558A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of numerical control machining simulation, and in particular to a simulation control method, device and storage medium for moldless turning machining. Background Art
[0002] According to the structure and optional materials of the sealing products, the optional processing technologies include compression molding, injection molding and dieless turning.
[0003] Dieless turning seal processing technology has become a key component of today's sealing industry and represents an inevitable trend in its development. It plays a vital role in the maintenance and supporting industries and has gained widespread recognition. Specialized CNC turning seal processing equipment, which melts raw materials under heat and then extrudes them under high pressure to form a barrel blank, then programs the seal data using software, offers high-quality, efficient, and fast processing, resulting in shorter processing cycles and faster delivery times. Turned seals are not limited by size and can be manufactured in any specification, cross-section, quantity, and material. Compared to molded seals, this eliminates the high mold opening costs and waiting time.
[0004] The dieless turning process offers the following advantages: ① No molds are required, saving mold manufacturing costs and time; ② High efficiency for single-piece or small-batch production; ③ Easy to modify product dimensions without mold repair; ④ Good dimensional stability; ⑤ High surface quality; ⑥ Suitable for a wide range of product sizes, including large, medium, and small products. Before performing dieless turning on a sample, simulating the process to identify potential process risks and anomalies can help mitigate actual processing issues and improve quality, undoubtedly benefiting production. Summary of the Invention
[0005] In order to simulate the machining process before performing moldless turning on the sample and discover possible risk anomalies in the machining process, the present application provides a simulation control method, equipment and storage medium for moldless turning.
[0006] The present application provides a simulation control method, device, and storage medium for moldless turning processing, which adopt the following technical solutions: A simulation control method for die-less turning processing, comprising: Get the CNC code of the target workpiece; Read the G code in the CNC code line by line starting from the first line; Classifying each instruction of the G code based on a preset type library, wherein the preset type library includes a correspondence between instruction features and instruction types; Locating and extracting a target instruction whose instruction type is a motion instruction; Parameters of the target instruction are parsed, and a motion path dataset of the tool is constructed; the method includes: defining path segments, processing instruction dependencies based on a context state machine, each target instruction corresponds to a path segment, and the path segment includes a starting point and an ending point, the starting point being the position where the tool starts to move in the path segment, and the ending point being the target position where the tool moves to in the path segment; splitting the character string in the target instruction into a character string array by spaces; searching and locating the target character string in the character string array according to a preset logic, extracting the numeric part of the target character string, generating the starting point coordinates and the ending point coordinates corresponding to the target instruction, and obtaining the motion path dataset of the tool; Calculating a movement vector set of the tool in space based on a motion path data set of the tool; According to the movement vector set of the tool in space and based on the current tool type, a tool path simulation engine is called to render the tool model and simulate the motion trajectory of the current tool to form a current tool motion path model.
[0007] Optionally, the step of searching for a positioning target string in the string array according to a preset logic, extracting a numeric portion of the target string, generating starting point coordinates and ending point coordinates corresponding to the target instruction, and obtaining a motion path data set of the tool includes: Searching and locating the target string in the string array, where the target string is a string beginning with X, Y, or Z; When a string starting with X is located, the numeric portion after X is extracted and converted to a double value as the value of the X coordinate; When a string beginning with Y is located, the numeric portion after Y is extracted and converted into a double value as the value of the Y coordinate; When a character string starting with Z is located, the numeric portion after Z is extracted and converted into a double value as the value of the Z coordinate; Based on the extracted values of the X coordinate, the Y coordinate, and the Z coordinate, the starting point coordinates and the ending point coordinates corresponding to the target instruction are generated to obtain a motion path data set of the tool.
[0008] Optionally, the step of calculating the movement vector set of the tool in space based on the motion path data set of the tool includes: Based on the starting point coordinates and the ending point coordinates corresponding to each of the target instructions, according to the linear vector calculation method between the two points, the movement components corresponding to each of the target instructions on the X coordinate, Y coordinate, and Z coordinate are calculated to obtain the movement vector set of the tool in space.
[0009] Optionally, after forming the current tool motion path model, the following steps are also included: In response to a user operation of adjusting current tool parameters, the update code generates updated CNC code for the target workpiece; Using the updated CNC code of the target workpiece as the CNC code of the target workpiece, and repeatedly executing the code to obtain an updated current tool motion path model; or In response to a user's request to view the current tool cutting behavior, displaying the tool cutting behavior corresponding to the current tool motion path model; or In response to a user's request to view code, the code line corresponding to the current tool operation is displayed.
[0010] Optionally, after forming the current tool motion path model, the following steps are also included: In response to a user's request to detect the current tool motion path model, based on the characteristics of the target workpiece cutting part, the tool motion trajectory is simulated in segments to obtain multiple sub-tool motion path models; Use different colors to mark the sub-tool motion path model of different cutting parts; The tool abnormality verification algorithm is used to detect whether a preset abnormal event occurs in the current tool motion path model to obtain a detection result.
[0011] Optionally, the step of obtaining the CNC code of the target workpiece includes: Obtain the design drawings and processing parameters of the target workpiece; Based on the feature segmentation of the target workpiece cutting part, the corresponding tool is matched and a tool list is generated; updating the machining parameters based on the tool list; Based on the design drawing of the target workpiece and the updated processing parameters, a CNC code of the target workpiece is generated.
[0012] In a second aspect of the present application, a simulation control device for moldless turning is provided, comprising: An acquisition module is used to obtain the CNC code of the target workpiece; A reading module is used to read the G code in the CNC code line by line starting from the first line; a classification module, configured to classify each instruction of the G code based on a preset type library, wherein the preset type library includes a correspondence between instruction features and instruction types; An extraction module, used for locating and extracting a target instruction whose instruction type is a motion instruction; A construction module is used to perform parameter parsing on the target instruction and construct a motion path dataset of the tool; define path segments, process instruction dependencies based on a context state machine, each target instruction corresponds to a path segment, and the path segment includes a starting point and an ending point, the starting point is the position where the tool starts to move in the path segment, and the ending point is the target position where the tool moves to in the path segment; split the character string in the target instruction into a character string array by spaces; search and locate the target character string in the character string array according to a preset logic, extract the numeric part of the target character string, generate the starting point coordinates and the ending point coordinates corresponding to the target instruction, and obtain the motion path dataset of the tool; A calculation module, configured to calculate a movement vector set of the tool in space based on a motion path data set of the tool; The simulation module is used to call the tool path simulation engine based on the movement vector set of the tool in space and the current tool type, render the tool model and simulate the motion trajectory of the current tool to form the current tool motion path model.
[0013] In a third aspect of the present application, a computer storage medium is provided, wherein the computer storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the above method steps.
[0014] In a fourth aspect of the present application, an electronic device is provided, comprising: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the above-mentioned method steps.
[0015] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: By reading and classifying the CNC code of the target workpiece line by line, this application can accurately identify and extract motion instructions, perform parameter parsing on these motion instructions, and construct a tool motion path dataset, accurately describing the tool's motion trajectory during machining. Based on this dataset, a tool movement vector set is calculated, further clarifying the tool's motion direction and distance in space. The toolpath simulation engine is then invoked based on the current tool type to render the tool model and simulate its motion trajectory, forming a complete tool motion path model. This provides a high-precision, high-efficiency toolpath simulation engine capable of complete semantic parsing of G-code, dynamic path generation, physical-level collision detection, and real-time visualization. This allows for simulation of the machining process before performing dieless turning on a sample, pre-verifying the rationality of the machining path. This allows for efficient simulation and precise control of the dieless turning process, identifying potential risks or anomalies during the machining process, and helping to mitigate actual machining problems, reduce errors and scrap rates, improve machining quality, and lower machining risks and costs. The engine effectively detects potential collisions and interferences, avoids damage to the tool, workpiece, and machine tool, and reduces equipment repair and replacement costs, trial-and-error costs, and the need for repeated debugging.
[0016] Through simulation analysis, tool paths are optimized, cutting sequences are rationally arranged, cutting speeds and feed rates are increased, processing time is shortened, and production efficiency is improved. It facilitates operation by providing operators with a virtual processing environment, familiarizing them with processing procedures and operating methods, reducing training costs and risks, shortening training cycles, and improving operator skills. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 This is a flow chart of a simulation control method for moldless turning provided in an embodiment of the present application; Figure 2 This is a module schematic diagram of a simulation control device for moldless turning provided by an embodiment of the present application; Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0018] Description of reference numerals: 400, electronic device; 401, processor; 402, communication bus; 403, user interface; 404, network interface; 405, memory. DETAILED DESCRIPTION
[0019] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.
[0020] In the description of the embodiments of the present application, words such as "for example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "for example" or "for example" is intended to present related concepts in a concrete way. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0021] The following will provide a clear and complete description of the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments.
[0022] Please refer to Figure 1 , a flowchart of a simulation control method for die-less turning processing is proposed. The method can be implemented by a computer program, a single-chip microcomputer, or run on a simulation control device for die-less turning processing. The computer program can be integrated into a computer device or run as an independent tool application. Specifically, the method includes steps 1 to 7, which are as follows: Step S1: Obtain the CNC code for the target workpiece, which is the seal to be machined. The CNC code is a set of instructions used to control a CNC machine tool to process the seal from a barrel blank, which is melted and extruded from the raw material. This code, written in a programming language (typically G-code or M-code), details the machine's movements, tool paths, cutting parameters, and other information, enabling the machine tool to automatically complete the machining task according to a pre-set program.
[0023] Based on the above embodiment, as another optional embodiment, the step of obtaining the CNC code of the target workpiece may further include the following steps: Step S11: Obtain the design drawings and processing parameters of the target workpiece.
[0024] The user imports the design drawing (3D model of the target workpiece) into the computer-aided manufacturing (CAM) software. Supported file formats include DXF, DWG, STL, or STEP. Based on the characteristics of the target workpiece raw material (such as the material type and hardness of the blank barrel material) and processing requirements, set the following processing parameters: Cutting parameters: such as cutting speed, feed rate, cutting depth, etc.
[0025] Tool selection: Select the appropriate tool type, size, material, etc. according to processing requirements.
[0026] Processing strategies: such as roughing, finishing, grooving, contouring, etc.
[0027] Step S12: Match corresponding tools based on the feature segments of the target workpiece cutting part to generate a tool list.
[0028] By analyzing the design drawings of the target workpiece, the geometry, size, material, and processing requirements of each cutting area of the target workpiece are identified. Different materials and shapes may require different processing methods. Based on the characteristics of the cutting area, appropriate tool types such as external turning tools, internal turning tools, grooving tools, and threading tools are selected. For example, a carbide external turning tool is selected for machining the outer surface of a sealing ring, an internal turning tool is selected for machining the inner hole of the sealing ring, and a straight turning tool is selected for machining the chamfered area of the sealing ring. Based on the results of the segmented matching of the target workpiece, the type, size, and other relevant parameters of each tool are recorded to generate a complete tool list.
[0029] Step S13: The processing parameters include tool type, size, material and other data, and the processing parameters are updated based on the tool list; Step S14: Generate CNC code for the target workpiece based on the design drawing of the target workpiece and the updated processing parameters.
[0030] Using computer-aided manufacturing (CAM) software, the design drawings of the target workpiece are obtained, and the processing parameters are set according to the raw material data and processing requirements of the target workpiece. Based on the design drawings of the target workpiece and the set processing parameters, the motion path of the tool can be automatically generated and converted into CNC code, which can be directly transmitted to the CNC machine tool.
[0031] Based on the above embodiment, as another optional embodiment, after the step of obtaining the design drawings and processing parameters of the target workpiece, the following steps may be further included: Step S15: In response to the user's request to view the design drawings of the target workpiece, the design drawings of the target workpiece are displayed through a small window, so that the user can view the design drawings of the target workpiece at any time during the simulation process to ensure that the processing process meets the design requirements.
[0032] Based on the above embodiment, as another optional embodiment, before the step of updating the processing parameters based on the tool list, the following steps may be further included: Step S121: in response to a user's request to view a selected tool in a preset tool library, displaying an assembly drawing of the selected tool; Step S122: In response to the user selecting a replacement tool from the preset tool library, updating the tool list.
[0033] Users can view the assembly drawings of selected tools in the preset tool library, allowing them to intuitively understand the tool's structure, size, and assembly method, thereby better judging whether the tool is suitable for the current machining task. Users can select replacement tools in the preset tool library based on actual machining needs and flexibly adjust the tool list, effectively reducing machining errors caused by improper tool selection.
[0034] Based on the above embodiment, as another optional embodiment, after the step of obtaining the CNC code of the target workpiece, the following steps may be further included: Get the syntax model for checking CNC code; Based on the syntax model, the CNC code is analyzed and the analysis results are output.
[0035] Verify the syntax and logic of the code to ensure that the machine tool can accurately interpret and execute the code. For example, check whether the use of instructions such as G codes and M codes complies with the rules of the machine tool control system to avoid malfunctioning of the machine tool due to code errors.
[0036] Step S2: Read the G code in the CNC code line by line starting from the first line.
[0037] G-code is a geometric code, which is mainly used to describe the motion path, machining operations and related machine control instructions of the machine tool. G-code controls how the machine tool's tool moves through instructions. For example, G01 represents linear interpolation, G02 represents clockwise circular interpolation, and G03 represents counterclockwise circular interpolation. Set machining parameters: such as spindle speed (S instruction), feed rate (F instruction), etc. Define the coordinate system: set the workpiece coordinate system through instructions such as G54 and G55. The instructions in the G-code can control the movement of the machine tool by changing the values of these axes. Add comments after the semicolon ";". The X, Y, and Z axes are the three commonly used coordinate axes of machine tools, which are used to determine the position of the workpiece in space.
[0038] Example: Gcode G00 G40 X207 Z130; Quickly position to a safe position G21; Set the unit to millimeters Step S3: Classify each G-code instruction based on a preset type library. The preset type library includes a correspondence between instruction features and instruction types. Instruction types include motion instructions, setting instructions, and auxiliary function instructions. Each G-code instruction will be classified as a motion instruction, setting instruction, or auxiliary function instruction according to the instruction features, and semantic analysis will be performed.
[0039] Motion instructions in G-code are primarily used to control the motion path of machine tool components, such as cutting tools or nozzles. These instructions typically include a movement type (such as a straight line or circular arc) and a target position (coordinate parameters). Motion instruction characteristics include: coordinate parameters (X / Y / Z) and movement type (G00-G03). The following are two motion instructions in the code: Gcode G01 X10 Y20 F100; Linear interpolation (feature: G01+coordinate+speed) G02 X50 Y0 I25 J0; Clockwise arc (feature: G02+end point+center offset) G01: Linear interpolation, one of the most commonly used motion instructions, is used to control the machine tool to move along a straight line from the current position to the target position. X10 Y20: Indicates the coordinates of the target position. The machine tool will move 10 units in the X-axis direction and 20 units in the Y-axis direction. F100: Indicates the feed rate, usually in millimeters per minute (mm / min). The speed set here is 100 mm / min. The first motion instruction above causes the machine tool to move along a straight line from the current position to the position X=10, Y=20 at a speed of 100 mm / min.
[0040] G02: Indicates clockwise circular interpolation (Circular Interpolation, Clockwise), which is used to control the machine tool to draw an arc in the clockwise direction. X50 Y0: Indicates the coordinates of the end point of the arc. The machine tool will move to the position of X=50, Y=0. I25J0: Indicates the center offset of the arc. "Offset" is the relative position from the starting point of the arc to the center of the circle. I indicates that the offset in the X-axis direction is 25 units, and J indicates that the offset in the Y-axis direction is 0 units. The second motion instruction above is for the machine tool to start from the current position, draw an arc with a radius of 25 units in the clockwise direction, and finally reach the position of X=50, Y=0.
[0041] The setup instructions in the G code are used to change the state or configuration of the system, such as selecting a plane, setting the coordinate mode (G17-G19 selects a plane, G90 / G91 coordinate mode), etc. The following are the setup instructions in the code: Gcode G90; Set to absolute coordinate mode (feature: no coordinate parameters) G90: Indicates the absolute positioning mode. In this mode, all coordinate values are defined relative to the origin (0,0) of the workpiece coordinate system, rather than the current position. This command switches the machine tool's coordinate mode to absolute, and subsequent motion commands will use absolute coordinate values.
[0042] Extract the command type and parameters (regular expressions can be used), and process command dependencies through the context state machine (for example, G02 must be based on the end point coordinates of the previous G01). Example: csharp public InstructionType ClassifyInstruction(string line) { if (line.StartsWith("G0")&&(line.Contains("X") || line.Contains("Z"))) { return InstructionType.Motion; } else if (line.StartsWith("G1") || line.StartsWith("G2"))) { return InstructionType.Setting; } return InstructionType.Unknown; } Check whether the instruction starts with "G0" and whether the instruction contains "X" or "Z". If both conditions are met, the instruction is considered to be a motion instruction (InstructionType.Motion).
[0043] Checks whether the instruction begins with "G1" or "G2". If the conditions are met, the instruction is considered to be a setting instruction (InstructionType.Setting). If the input instruction does not meet any of the above conditions, it returns InstructionType.Unknown, indicating an unrecognized instruction type.
[0044] Step S4: Locate and extract the target instruction whose instruction type is motion instruction; Example: csharp public List <string>ExtractMotionCommands(List <string>lines) { returnlines.Where(line=>line.StartsWith("G00")|| line.StartsWith("G01"))).ToList(); } Each instruction line is checked. If the line starts with "G00" or "G01", it is considered to be a motion instruction and is retained.
[0045] Step S5: parse the target instruction parameters and construct the tool motion path data set.
[0046] Based on the above embodiment, as another optional embodiment, the step of performing parameter parsing on the target instruction and constructing the tool motion path data set may further include the following steps: Step S51: Define the path segment, process the instruction dependency based on the context state machine, each target instruction corresponds to a path segment, and the path segment includes a starting point and an end point. The starting point is the position where the tool starts to move in the path segment, which is usually the end point of the previous path segment. The end point is the target position to which the tool moves in the path segment, which is determined by the current instruction.
[0047] Step S52: Split the character string in the target instruction into a character string array according to spaces.
[0048] For example, the result of the segmentation of the instruction G01 X100 Z50 F200 is: ["G01", "X100", "Z50", "F200"]. Each motion instruction in the G code is a string containing multiple parameters (such as coordinate values, feed rate, etc.). The string is split into multiple parts by spaces so that they can be processed one by one.
[0049] Step S53: Search for the target character string in the character string array according to the preset logic, extract the numeric part in the target character string, generate the starting point coordinates and the ending point coordinates corresponding to the target instruction, and obtain the motion path data set of the tool.
[0050] Define path segments and process instruction dependencies based on the context state machine to ensure that each target instruction corresponds to a complete path segment and clearly define the positional relationship between the starting and ending points, thereby providing clear path guidance for the tool's movement. Split the string in the target instruction into an array by spaces, and use preset logic to find and locate the target string, extract the numerical portion, and further generate the coordinates of the starting and ending points. This process not only improves the accuracy and reliability of the path data, but also effectively handles complex instruction dependencies, ensuring the continuity and consistency of the tool motion path. Through these steps, the tool motion path dataset is obtained, which provides the basis for subsequent motion vector calculation and tool path simulation. By parsing the parameters of the target instruction and constructing the tool motion path dataset, the tool's motion trajectory during the machining process can be accurately described.
[0051] Based on the above embodiment, as another optional embodiment, the step of searching for a target string in a string array according to a preset logic, extracting the numeric portion of the target string, generating the starting point coordinates and the ending point coordinates corresponding to the target instruction, and obtaining a tool motion path data set may further include the following steps: Step S531: searching for a target character string in the character string array, where the target character string is a character string beginning with X, Y, or Z; Step S532: When a character string beginning with X is located, the numeric portion after X is extracted and converted into a double value as the value of the X coordinate; Step S533: When a character string beginning with Y is located, the numeric portion after Y is extracted and converted into a double value as the value of the Y coordinate; Step S534: When a character string beginning with Z is located, the numeric portion after Z is extracted and converted into a double value as the value of the Z coordinate; Step S535: Based on the extracted X-coordinate values, Y-coordinate values, and Z-coordinate values, the starting point coordinates and the ending point coordinates corresponding to the target instruction are generated to obtain a motion path data set of the tool.
[0052] Example: csharp public class PathSegment { public Point Start { get; set;} public Point End { get; set;} public double Feedrate { get; set;} } public PathSegment ParseLinearMove(string line) { var parts = line.Split(' '); / / Split the input string into multiple parts by spaces double x = double.Parse(parts.First(p =>p.StartsWith("X")).Substring(1)); / / Extract the X coordinate double z = double.Parse(parts.First(p =>p.StartsWith("Z")).Substring(1)); / / Extract the Z coordinate return new PathSegment { Start = CurrentPosition, / / The starting point is the current tool position End = new Point(x, z)}; / / The end point is the parsed X and Z coordinates } Extract the target string (e.g., coordinate values beginning with X, Y, or Z) from the segmented string array and convert it to a numeric type (e.g., double) to generate the start and end point coordinates for the path segment. Each target instruction has corresponding start and end point coordinates. The start point coordinates are typically the end point coordinates of the previous target instruction, while the end point is the target location of the current instruction. By progressively parsing each motion instruction in the G-code, a complete tool motion path dataset can be constructed, providing the foundation for subsequent simulation and machining.
[0053] Step S6: Based on the motion path data set of the tool, calculate the movement vector set of the tool in space.
[0054] Based on the above embodiment, as another optional embodiment, the step of calculating the movement vector set of the tool in space based on the motion path data set of the tool may further include the following steps: Based on the starting point coordinates and end point coordinates corresponding to each target instruction, according to the linear vector calculation method between the two points, the movement components corresponding to each target instruction in the X coordinate, Y coordinate, and Z coordinate are calculated to obtain the movement vector set of the tool in space.
[0055] Linear interpolation calculation: \[ \vec{V} = (X_{end} - X_{start},\ Y_{end} - Y_{start}) \] - C Example: csharp public Vector CalculateLinearVector(Point start, Point end) { return new Vector(end.X - start.X, end.Y - start.Y); } In CNC machining, a tool's motion path consists of multiple segments, each corresponding to a movement from a starting point to an end point. To simulate the tool's motion trajectory, it's necessary to calculate the motion vector for each segment (motion instruction). These vectors describe the direction and distance of the tool's movement in three-dimensional space. The motion vector is calculated by taking the difference between the starting and ending points of the segment. By calculating the motion vector, the tool's movement component along each coordinate axis can be determined.
[0056] Step S7: Based on the movement vector set of the tool in space and the current tool type, the tool path simulation engine is called to render the tool model and simulate the motion trajectory of the current tool to form the current tool motion path model.
[0057] This application can accurately identify and extract motion instructions by reading and classifying the CNC code of the target workpiece line by line, perform parameter analysis on the motion instructions, and construct a motion path data set for the tool, which can accurately describe the motion trajectory of the tool during the processing. Based on this data set, the tool movement vector set is calculated, and the movement direction and distance of the tool in space are further clarified. The tool path simulation engine is called in combination with the current tool type, and the tool model is rendered and its motion trajectory is simulated to form a complete tool motion path model. Before performing moldless turning on the sample, the processing process can be simulated to verify the rationality of the processing path in advance, and efficient simulation and precise control of the moldless turning process can be achieved. Possible risks or anomalies in the processing process can be discovered to help reduce problems in actual processing, reduce errors and scrap rates in actual processing, and improve processing quality, which is undoubtedly beneficial for actual production.
[0058] Based on the above embodiment, as another optional embodiment, after the step of forming the current tool motion path model, the following steps may be further included: Step S81: in response to a user's operation of adjusting current tool parameters, the current tool parameters including cutting parameters, geometric parameters, tool type, tool size, etc. of the current tool, an update code is generated to update CNC code of the target workpiece; Step S82: Using the updated CNC code of the target workpiece as the CNC code of the target workpiece, repeating the process to obtain an updated current tool motion path model.
[0059] By responding to the user's adjustment of tool parameters and updating the CNC code, the system can dynamically generate a new tool motion path model, thereby supporting the user to optimize the machining path in real time, improve machining accuracy and efficiency, and thus reduce machining time and tool wear.
[0060] Based on the above embodiment, as another optional embodiment, after the step of forming the current tool motion path model, the following steps may be further included: Step S91: In response to a user's request to view the current tool cutting behavior, the tool cutting behavior corresponding to the current tool motion path model is displayed. The tool cutting behavior includes cutting force, cutting heat, chip formation, tool wear, etc.
[0061] The tool path simulator displays the tool's motion on the workpiece, demonstrating the cutting path and simulating the tool's cutting behavior. Based on the magnitude and direction of the cutting force, it determines whether the workpiece will deform. Based on the distribution of cutting heat, it predicts tool wear and thermal deformation of the workpiece. Based on chip formation, it helps users optimize cutting parameters and reduce chip accumulation. A deep learning model predicts tool wear, enabling users to proactively change or adjust tools. This allows users to display tool cutting behavior upon request, allowing them to intuitively observe the tool's dynamic performance during machining, facilitating the early detection of potential problems and adjustments.
[0062] By observing tool motion, cutting forces, cutting heat, and tool wear, the feasibility and stability of the machining process can be assessed. Based on the simulation results, cutting parameters (such as cutting speed, feed rate, and depth of cut) and tool geometry (such as tool angle and cutting edge radius) can be adjusted. Furthermore, the need for adjustments or modifications to the machining equipment can be considered, and appropriate tools can be selected from the tool library to accommodate the machining requirements of the alternative material.
[0063] Based on the toolpath simulation engine's simulation results, if rapid tool wear, excessive cutting forces, or the expected machining accuracy cannot be achieved, tool replacement should be considered. The necessity of tool replacement should also be evaluated based on production plans and cost control objectives.
[0064] Based on the above embodiment, as another optional embodiment, after the step of forming the current tool motion path model, the following steps may be further included: Step S92: In response to the user's request to view the code, the code line corresponding to the current tool operation is displayed.
[0065] By displaying the code lines corresponding to the current tool movement, users can directly view the G-code or M-code associated with the tool's motion path during the simulation phase. Combined with virtual simulation software, users can analyze the code line by line, proactively identifying instructions that may cause risks or anomalies. Simulation results can then be used to optimize the tool path. For example, adjustments can be made to the tool's starting and ending points, or the cutting sequence, to avoid complex motion paths or unnecessary rotations, thereby minimizing interference between the tool and the target workpiece.
[0066] Based on the above embodiment, as another optional embodiment, after the step of forming the current tool motion path model, the following steps may be further included: Step S93: In response to the user's request to detect the current tool motion path model, the current tool motion path model is detected according to the tool abnormality verification algorithm to determine whether a preset abnormal event occurs, the preset abnormal event includes collision, overcutting, interference, etc., and the detection result is obtained.
[0067] Specifically, the following steps are included: Step S931: In response to a user's request to detect the current tool motion path model, based on the characteristics of the target workpiece cutting part, the tool motion trajectory is simulated in segments to obtain multiple sub-tool motion path models; Step S932: Marking the sub-tool motion path models of different cutting parts with different colors can help operators intuitively identify potential problems in each processing stage; Step S933: Detect whether a preset abnormal event occurs in the current tool motion path model according to the tool abnormality verification algorithm to obtain a detection result.
[0068] By responding to the user's request to detect the tool motion path model, the system can simulate the tool motion trajectory based on the characteristic segmentation of the target workpiece cutting part and generate multiple sub-tool motion path models. This segmented simulation method allows users to observe and analyze the behavior of the tool in different cutting parts more carefully, which helps to discover potential problems in advance. Secondly, using different colors to mark the sub-tool motion path models of different cutting parts can intuitively present the complexity of the tool movement, helping users to quickly identify the movement status of each part, observe the tool's motion trajectory, and detect whether there are problems such as collision, overcutting or interference. In addition, the current tool motion path model is detected in combination with the tool anomaly verification algorithm, which can effectively identify preset abnormal events. If a problem is found, the abnormal data can be filtered out, and the processing parameters can be adjusted or the tool path can be modified to reduce processing defects. After confirming that the tool path is correct, the CAM software converts the tool path into G code that can be recognized by the CNC machine tool.
[0069] After completing the simulation and commissioning, we conduct small-batch machining verification. We measure the dimensions of the machined workpieces and inspect their surface quality to evaluate the machining results after tool replacement. Based on the results of the actual machining verification, we further optimize and adjust the CNC program and machining parameters to ensure that the expected machining quality and production efficiency are achieved after tool replacement.
[0070] See Figure 2 , is a schematic diagram of a module of a simulation control device for moldless turning provided by an embodiment of the present application, the simulation control device for moldless turning includes: An acquisition module is used to obtain the CNC code of the target workpiece; The reading module is used to read the G code in the CNC code line by line starting from the first line; A classification module is used to classify each instruction of the G code based on a preset type library, the preset type library includes the correspondence between instruction features and instruction types, and the instruction types include motion instructions, setting instructions, and auxiliary function instructions; An extraction module, used for locating and extracting a target instruction whose instruction type is a motion instruction; A construction module is used to parse the parameters of the target instruction and construct the motion path data set of the tool; A calculation module, used for calculating a movement vector set of the tool in space based on a motion path data set of the tool; The simulation module is used to call the tool path simulation engine based on the current tool type according to the tool movement vector set in space, render the tool model and simulate the motion trajectory of the current tool to form the current tool motion path model.
[0071] Optionally, the construction module is further used to define path segments, and process instruction dependencies based on the context state machine. Each target instruction corresponds to a path segment, and the path segment includes a starting point and an end point. The starting point is the position where the tool starts to move in the path segment, and the end point is the target position to which the tool moves in the path segment. Split the string in the target instruction into a string array by spaces; According to the preset logic, the target string is searched in the string array, the numerical part of the target string is extracted, the starting point coordinates and the ending point coordinates corresponding to the target instruction are generated, and the motion path data set of the tool is obtained.
[0072] Optionally, the building module is also used to search for a target string in a string array, where the target string is a string starting with X, Y, or Z; When a string starting with X is found, the numeric portion after X is extracted and converted to a double value as the value of the X coordinate. When a string starting with Y is found, the numeric part after Y is extracted and converted to a double value as the Y coordinate value. When a string starting with Z is located, the numeric part after Z is extracted and converted into a double value as the value of the Z coordinate; Based on the extracted X-coordinate values, Y-coordinate values, and Z-coordinate values, the starting point coordinates and the ending point coordinates corresponding to the target instruction are generated to obtain a motion path data set of the tool.
[0073] Optionally, the construction module is also used to calculate the movement components corresponding to each target instruction in the X coordinate, Y coordinate, and Z coordinate based on the starting point coordinates and end point coordinates corresponding to each target instruction according to the linear vector calculation method between the two points, so as to obtain the movement vector set of the tool in space.
[0074] Optionally, the simulation control device for moldless turning processing also includes a display module, which is used to update the code to generate an updated CNC code for the target workpiece in response to the user's operation of adjusting the current tool parameters; the updated CNC code of the target workpiece is used as the CNC code of the target workpiece, and is repeatedly executed to obtain an updated current tool motion path model.
[0075] The optional display module is further configured to display the tool cutting behavior corresponding to the current tool motion path model in response to a user's request to view the current tool cutting behavior.
[0076] The optional display module is also used to display the code line corresponding to the current tool operation in response to the user's request to view the code.
[0077] Optionally, the simulation control device for die-less turning processing further includes a detection module, which is configured to respond to a user's request to detect a current tool motion path model, simulate the tool motion trajectory in segments based on characteristics of a target workpiece cutting portion, and obtain a plurality of sub-tool motion path models; Use different colors to mark the sub-tool motion path model of different cutting parts; According to the tool abnormality verification algorithm, whether the preset abnormal event occurs in the current tool motion path model is detected to obtain the detection result.
[0078] Optionally, the acquisition module is further used to obtain the design drawings and processing parameters of the target workpiece; Based on the feature segmentation of the target workpiece cutting part, the corresponding tool is matched and a tool list is generated; Update machining parameters based on tool list; Based on the design drawing of the target workpiece and the updated machining parameters, a CNC code for the target workpiece is generated.
[0079] It should be noted that the above embodiments provide systems that implement their functions using only the division of the above functional modules as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the system and method embodiments provided in the above embodiments are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0080] An embodiment of the present application also provides a computer storage medium, which can store multiple instructions. The instructions are suitable for being loaded by a processor and executing a simulation control method for moldless turning processing in the above embodiment. The specific execution process can be found in the specific description of the above embodiment and will not be repeated here.
[0081] Please refer to Figure 3 The present application also discloses an electronic device. Figure 3 The electronic device 400 may include: at least one processor 401 , at least one network interface 404 , a user interface 403 , a memory 405 , and at least one communication bus 402 .
[0082] The communication bus 402 is used to implement the connection and communication between these components.
[0083] The user interface 403 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 403 may also include a standard wired interface and a wireless interface.
[0084] The network interface 404 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0085] Processor 401 may include one or more processing cores. Using various interfaces and circuits, processor 401 connects to various components within the server. It executes instructions, programs, code sets, or instruction sets stored in memory 405, as well as accesses data stored in memory 405, to perform various server functions and process data. Optionally, processor 401 may be implemented using at least one of the following hardware forms: a digital signal processing (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). Processor 401 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing content displayed on the display screen; and the modem handles wireless communications. It is understood that the modem may also be implemented independently of the processor 401 and implemented as a separate chip.
[0086] Among them, the memory 405 may include a random access memory (RAM) or a read-only memory (Read-Only Memory). Optionally, the memory 405 includes a non-transitory computer-readable storage medium. The memory 405 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 405 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 405 may also optionally be at least one storage device located away from the aforementioned processor 401. Refer to Figure 3 The memory 405 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an application program for a simulation control method for moldless turning processing.
[0087] exist Figure 3 In the electronic device 400 shown, the user interface 403 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 401 can be used to call an application program stored in the memory 405 for a simulation control method for moldless turning processing. When executed by one or more processors 401, the electronic device 400 executes one or more methods such as those in the above-mentioned embodiments. It should be noted that for the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should know that this application is not limited to the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for this application.
[0088] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0089] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are merely schematic, such as the division of units, which is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interface, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0090] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0091] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0092] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of this application, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the method of this application. The aforementioned memory includes various media that can store program code, such as USB flash drives, mobile hard drives, magnetic disks, or optical disks.
[0093] The above are merely exemplary embodiments of the present disclosure and are not intended to limit the scope of the present disclosure. In other words, any equivalent variations and modifications made in accordance with the teachings of the present disclosure are still within the scope of the present disclosure. Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the disclosure and the practical implications thereof.
[0094] This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not described herein. The description and examples are to be considered as exemplary only, and the scope and spirit of the present disclosure are to be defined by the claims.< / string> < / string>
Claims
1. A simulation control method for die-less turning, characterized in that: include: Get the CNC code of the target workpiece; Read the G code in the CNC code line by line starting from the first line; Classifying each instruction of the G code based on a preset type library, wherein the preset type library includes a correspondence between instruction features and instruction types; Locating and extracting a target instruction whose instruction type is a motion instruction; Parameters of the target instruction are parsed, and a motion path dataset of the tool is constructed; the method includes: defining path segments, processing instruction dependencies based on a context state machine, each target instruction corresponds to a path segment, and the path segment includes a starting point and an ending point, the starting point being the position where the tool starts to move in the path segment, and the ending point being the target position where the tool moves to in the path segment; splitting the character string in the target instruction into a character string array by spaces; searching and locating the target character string in the character string array according to a preset logic, extracting the numeric part of the target character string, generating the starting point coordinates and the ending point coordinates corresponding to the target instruction, and obtaining the motion path dataset of the tool; Calculating a movement vector set of the tool in space based on a motion path data set of the tool; According to the movement vector set of the tool in space and based on the current tool type, a tool path simulation engine is called to render the tool model and simulate the motion trajectory of the current tool to form a current tool motion path model.
2. The simulation control method for moldless turning according to claim 1, characterized in that: The steps of searching for a target character string in the character string array according to a preset logic, extracting a numeric portion of the target character string, generating starting point coordinates and ending point coordinates corresponding to the target instruction, and obtaining a motion path data set of a tool include: Searching and locating the target string in the string array, where the target string is a string beginning with X, Y, or Z; When a string starting with X is located, the numeric portion after X is extracted and converted to a double value as the value of the X coordinate; When a string beginning with Y is located, the numeric portion after Y is extracted and converted into a double value as the value of the Y coordinate; When a character string starting with Z is located, the numeric portion after Z is extracted and converted into a double value as the value of the Z coordinate; Based on the extracted values of the X coordinate, the Y coordinate, and the Z coordinate, the starting point coordinates and the ending point coordinates corresponding to the target instruction are generated to obtain a motion path data set of the tool.
3. The simulation control method for moldless turning according to claim 2, characterized in that: The step of calculating the movement vector set of the tool in space based on the motion path data set of the tool comprises: Based on the starting point coordinates and the ending point coordinates corresponding to each of the target instructions, according to the linear vector calculation method between the two points, the movement components corresponding to each of the target instructions on the X coordinate, Y coordinate, and Z coordinate are calculated to obtain the movement vector set of the tool in space.
4. The simulation control method for moldless turning according to claim 1, characterized in that: After forming the current tool motion path model, it also includes: In response to a user operation of adjusting current tool parameters, the update code generates updated CNC code for the target workpiece; Using the updated CNC code of the target workpiece as the CNC code of the target workpiece, and repeatedly executing the code to obtain an updated current tool motion path model; or In response to a user's request to view the current tool cutting behavior, displaying the tool cutting behavior corresponding to the current tool motion path model; or In response to a user's request to view code, the code line corresponding to the current tool operation is displayed.
5. The simulation control method for die-less turning according to claim 1, characterized in that: After forming the current tool motion path model, it also includes: In response to a user's request to detect the current tool motion path model, based on the characteristics of the target workpiece cutting part, the tool motion trajectory is simulated in segments to obtain multiple sub-tool motion path models; Use different colors to mark the sub-tool motion path model of different cutting parts; The tool abnormality verification algorithm is used to detect whether a preset abnormal event occurs in the current tool motion path model to obtain a detection result.
6. The simulation control method for moldless turning according to claim 1, characterized in that: The steps to obtain the CNC code of the target workpiece include: Obtain the design drawings and processing parameters of the target workpiece; Based on the feature segmentation of the target workpiece cutting part, the corresponding tool is matched and a tool list is generated; updating the machining parameters based on the tool list; Based on the design drawing of the target workpiece and the updated processing parameters, a CNC code of the target workpiece is generated.
7. A simulation control device for die-less turning processing, characterized in that: include: An acquisition module is used to obtain the CNC code of the target workpiece; A reading module is used to read the G code in the CNC code line by line starting from the first line; a classification module, configured to classify each instruction of the G code based on a preset type library, wherein the preset type library includes a correspondence between instruction features and instruction types; An extraction module, used for locating and extracting a target instruction whose instruction type is a motion instruction; A construction module is used to perform parameter parsing on the target instruction and construct a motion path dataset of the tool; define path segments, process instruction dependencies based on a context state machine, each target instruction corresponds to a path segment, and the path segment includes a starting point and an ending point, the starting point is the position where the tool starts to move in the path segment, and the ending point is the target position where the tool moves to in the path segment; split the character string in the target instruction into a character string array by spaces; search and locate the target character string in the character string array according to a preset logic, extract the numeric part of the target character string, generate the starting point coordinates and the ending point coordinates corresponding to the target instruction, and obtain the motion path dataset of the tool; A calculation module, configured to calculate a movement vector set of the tool in space based on a motion path data set of the tool; The simulation module is used to call the tool path simulation engine based on the movement vector set of the tool in space and the current tool type, render the tool model and simulate the motion trajectory of the current tool to form the current tool motion path model.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executed by a method according to any one of claims 1 to 6.
9. An electronic device, characterized in that: It includes a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Machining file planning system and machining file generating method
CN104714477A
Three-axis numerical control milling machine virtual simulation machining method and device and readable storage medium
CN118011956A
Machining simulation verification method and device, computer equipment and storage medium
CN119717690A
Pyqt5-based G code hierarchical analysis and model visualization system
CN119806503A
Machine tool machining simulation system and method based on programming tool path file
CN119960387A
Cited By
Numerical control machining path cutting method, system and equipment and readable storage medium
CN121232710A