Workpiece machining program generation method, system and equipment
By automatically generating toolpath information and automatically calling error-proof subroutines, the problems of low efficiency and insufficient accuracy in workpiece program generation during CNC lathe machining are solved, achieving efficient and accurate workpiece machining and reducing production costs.
Patent Information
- Application Number
- CN202511294230.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-11
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2045-09-11
AI Technical Summary
In current CNC lathe machining, the efficiency and accuracy of workpiece machining program generation are low. This is mainly because tool compensation and error prevention judgment require manual comparison of part drawings and machine tool coordinate systems, which can easily lead to errors and affect machining accuracy.
By acquiring the 3D model and process information of the workpiece to be processed, toolpath information and area labels are automatically generated. Combined with the automatic identification of area labels to call the error prevention subroutine, the workpiece processing program is generated, reducing manual intervention and errors.
It improves the efficiency and accuracy of workpiece machining program generation, reduces the risk of material waste and equipment damage due to errors, and ensures the stability and consistency of the machining process.
Smart Images

Figure CN121348969A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of numerical control machining, in particular to a workpiece machining program generation method, system and device. BACKGROUND
[0002] In the field of numerical control lathe machining, process personnel generally use UG NX and the like to generate tool path information, and convert the tool path information into workpiece machining programs recognizable by machine tools through a postprocessor, and in order to further reduce the waste rate, usually also manually insert tool compensation error prevention statements in the workpiece machining programs to ensure that the tool compensation parameters are consistent with the actual machining area, which is a conventional link in the current numerical control programming process.
[0003] In related technologies, since the judgment of tool compensation error prevention needs to consider multiple factors such as machining position, tool relative position and coordinate direction, the process personnel must repeatedly compare part drawings and machine coordinate systems when programming, and then manually select and input corresponding error prevention subprogram numbers, which not only has a large workload and takes a long time, but also is prone to error prevention failure due to selection or statement input errors, ultimately affecting the machining accuracy of software post-processing. SUMMARY
[0004] The problem solved by the present application is how to improve the generation efficiency and accuracy of workpiece machining programs.
[0005] To solve the above problems, the present application provides a workpiece machining program generation method, system and device.
[0006] In a first aspect, the present application provides a workpiece machining program generation method, comprising: obtaining a three-dimensional model and process information of a workpiece to be machined; obtaining tool path information of a machining tool of the workpiece to be machined according to the three-dimensional model and the process information of the workpiece to be machined, the tool path information comprising tool path data and region labels of the workpiece to be machined; generating an initial machining program of the workpiece to be machined according to the tool path data and the region labels; selecting an error prevention subprogram corresponding to the region labels according to the region labels; generating a workpiece machining program of the workpiece to be machined according to the error prevention subprogram, in combination with the tool path data and the initial machining program.
[0007] Optionally, the obtaining of the tool path information of the machining tool of the workpiece to be machined according to the three-dimensional model and the process information of the workpiece to be machined comprises: generating a tool path corresponding to the machining tool according to the three-dimensional model; According to the process information, a tool parameter and a feed and rotation speed information corresponding to the machining tool are generated; According to the tool path, at least one machining position of the machining tool is determined; According to the machining position, the region label corresponding to the machining position is obtained; The tool path, the tool parameter, and the feed and rotation speed information are taken as the tool path data, and the tool path data and the region label are collectively encapsulated as the tool path information.
[0008] Optionally, the initial machining program of the workpiece to be machined is generated according to the tool path data and the region label: According to the tool path, the tool parameter, and the feed and rotation speed information of the tool path data, a plurality of program segments are generated; A segment identifier is written in the head of each program segment; According to the region label, a region comment is written in the segment identifier to generate the initial machining program.
[0009] Optionally, the error-proofing subprogram corresponding to the region label is selected according to the region label, including: The region label is parsed to obtain a region code of the workpiece to be machined; The region code is taken as a retrieval key to match in a preset region-subprogram mapping table to obtain a subprogram number corresponding to the region code; According to the subprogram number, the error-proofing subprogram corresponding to the region label is extracted from a preset error-proofing subprogram library.
[0010] Optionally, the workpiece machining program of the workpiece to be machined is generated according to the error-proofing subprogram, in combination with the tool path data and the initial machining program, including: According to the region label, the program segment corresponding to the region label is determined by positioning in the initial machining program; The error-proofing subprogram of the region label is inserted into the program segment corresponding to the region label; According to a preset format, the initial machining program after the error-proofing subprogram is inserted is format-converted to generate the workpiece machining program of the workpiece to be machined.
[0011] Optionally, the error-proofing subprogram of the region label is inserted into the program segment corresponding to the region label, including: The starting coordinate point of the program segment is obtained; According to the starting coordinate point in combination with the tool path data of the machining tool, the feed vector of the starting coordinate point is determined. generating a compensation safety point of the machining tool according to the starting coordinate point and the feed vector; splicing a positioning statement of the compensation safety point with the error-proofing subprogram to obtain a complete error-proofing subprogram, wherein the positioning statement of the compensation safety point is arranged before the error-proofing subprogram; inserting the complete error-proofing subprogram into a starting position of the program segment.
[0012] Optionally, before the selecting the error-proofing subprogram corresponding to the area label according to the area label, the method further comprises: determining a tool tip trajectory coordinate sequence of the machining tool according to the tool path, the tool parameter, and the feed and rotation speed information; determining a minimum distance between the machining tool and the workpiece to be machined according to the tool tip trajectory coordinate sequence; when the minimum distance is less than a preset distance threshold, updating a confidence value of the area label corresponding to the machining position according to a difference between the minimum distance and the preset distance threshold; when the confidence value of the area label is less than a preset threshold, performing secondary confirmation on the area label.
[0013] Optionally, after the generating the workpiece machining program of the workpiece to be machined according to the error-proofing subprogram, the tool path data, and the initial machining program, the method further comprises: obtaining a macro variable value in the workpiece machining program and a compensation register value of the machining tool corresponding to the macro variable value; judging whether the program segment corresponding to the macro variable value is deviated according to a comparison result of the macro variable value and the compensation register value; if yes, generating a compensation correction instruction according to the comparison result through an adaptive compensation correction function; updating the workpiece machining program by inserting the compensation correction instruction into an end of the program segment.
[0014] In a second aspect, the present application provides a workpiece machining program generation system, comprising: a model and process information acquisition module, configured to acquire a three-dimensional model and process information of a workpiece to be machined; a tool path information generation module, configured to obtain tool path information of a machining tool of the workpiece to be machined according to the three-dimensional model and the process information of the workpiece to be machined, wherein the tool path information comprises tool path data and area labels of the workpiece to be machined; an initial program generation module, configured to generate an initial machining program of the workpiece to be machined according to the tool path data and the area labels. An error-proofing subprogram selection module is configured to select an error-proofing subprogram corresponding to the area tag according to the area tag; A numerical control program generation module is configured to generate a workpiece machining program of the workpiece to be machined according to the error-proofing subprogram in combination with the tool path data and the initial machining program.
[0015] In a third aspect, the present application provides an electronic device comprising a memory and a processor; The memory is configured to store a computer program; The processor is configured to implement the workpiece machining program generation method as described above when executing the computer program.
[0016] The workpiece machining program generation method, system and device of the present application automatically identify the area tag and call the corresponding error-proofing subprogram in the post-processing stage of the workpiece machining program, thereby eliminating the steps of manual judgment and input and greatly shortening the program generation time. Through the automatic calling of the error-proofing subprogram, the efficiency and accuracy of the workpiece machining program generation are significantly improved. Specifically, the three-dimensional model and process information of the workpiece to be machined are first obtained, and the three-dimensional model and process information serve as the basis for generating the machining program. The three-dimensional model provides the geometry and size of the workpiece, and the process information includes key data such as machining strategy, tool selection and cutting parameters. Based on the above data, tool path information containing tool path data and area tags is automatically generated. The tool path data describes the tool motion trajectory and machining parameters in detail, and the area tag identifies the type of the machining area. Then, the initial machining program of the workpiece to be machined is generated. On the basis of the initial machining program, the post-processing stage of the workpiece machining program generation is entered. By analyzing the area tag, the preset error-proofing subprogram is automatically matched and called. Through the process of automatic matching and calling, the final workpiece machining program is obtained in combination with the initial machining program. Not only the tedious operation of manually searching and inputting the error-proofing subprogram is avoided, but also the errors caused by human errors are reduced, ensuring the accuracy and reliability of the machining program. Through the automatic calling of the error-proofing subprogram, the numerical control program can better adapt to the machining requirements of different workpieces and machine tools, ensuring the stability and consistency of the machining process. By analyzing the geometry and process requirements of the workpiece, the tool path and cutting parameters are automatically adjusted to better meet the actual machining conditions, which not only improves the machining efficiency, but also significantly reduces the risk of material waste and equipment damage caused by errors, avoids the generation of waste products caused by tool damage or machining errors, and reduces the production cost. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 A flowchart of the workpiece machining program generation method of the embodiment of the present application is shown in the figure; Figure 2A schematic diagram of a calling subprogram for an embodiment of the present application; Figure 3 A schematic diagram of a structure of a workpiece machining program generation system of an embodiment of the present application. DETAILED DESCRIPTION
[0018] In order to make the above objectives, characteristics and advantages of the present application more apparent, clear and easy to understand, specific embodiments of the present application will be described in detail below with reference to the accompanying drawings. Although some embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms, and should not be interpreted as being limited to the embodiments set forth herein, but rather, these embodiments are provided in order to more thoroughly and completely understand the present application. It should be understood that the drawings and embodiments of the present application are for exemplary purposes only, and are not intended to limit the scope of protection of the present application.
[0019] It should be understood that each of the steps recited in the method embodiments of the present application can be executed in different orders, and / or in parallel. In addition, the method embodiments can include additional steps and / or omit the execution of the steps shown. The scope of the present application is not limited in this respect.
[0020] As used herein, the term "comprises" and its variants are to be construed as open- ended, that is, "including, but not limited to," the term "based on" is "at least partially based on"; the term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments"; the term "optionally" means "optional embodiments." Related definitions will be given in the description below. It should be noted that the concepts of "first", "second", etc. mentioned in the present application are only used to distinguish different devices, modules or units, and are not intended to limit the order or interdependence of the functions performed by these devices, modules or units.
[0021] It should be noted that the modification of "one" or "multiple" mentioned in the present application is illustrative and not limiting, and those skilled in the art should understand that, unless otherwise explicitly indicated in the context, it should be understood as "one or more".
[0022] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data for analysis, stored data, displayed data, etc.) and signals involved in the present application are authorized by the user or fully authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation portal for user to choose authorization or refusal.
[0023] In combination Figure 1As shown, a workpiece machining program generation method of an embodiment of the application comprises: Obtaining a three-dimensional model and process information of a workpiece to be machined.
[0024] Specifically, first, the three-dimensional model of the workpiece needs to be imported from the design software. In the embodiment of the application, the three-dimensional model is usually in the format of STEP, IGES or Parasolid, etc. to obtain the accurate geometry and size of the workpiece. At the same time, the process information of the workpiece to be machined is collected, including machining strategy (rough machining, finishing, etc.), tool specification, cutting parameters (spindle speed, feed speed), etc. These information will be the important basis for subsequent generation of machining program, to ensure that the generated program meets the design requirements and machining specifications.
[0025] According to the three-dimensional model and the process information of the workpiece to be machined, the tool path information of the machining tool of the workpiece to be machined is obtained, and the tool path information includes tool path data and region label of the workpiece to be machined.
[0026] Specifically, based on the imported three-dimensional model and collected process information, tool path planning is carried out. First, the geometric features of the workpiece, such as plane, curved surface, hole, etc. are analyzed to determine the appropriate machining strategy. Then, according to the tool type and size, the motion trajectory of the tool in the machining area is calculated to generate tool path data. At the same time, the feed speed and spindle speed of the tool are set in combination with the process parameters. In addition, region labels are embedded in the tool path information to identify different machining areas and provide necessary information for subsequent error-proofing processing. In the embodiment of the application, the region label can be obtained by the staff by only inputting the machining position, such as "outer diameter" and "right end face" and other simple description keywords when compiling the workpiece machining program.
[0027] According to the tool path data and the region label, an initial machining program of the workpiece to be machined is generated.
[0028] Specifically, the tool path, tool parameters, and feed and speed information in the tool path data are converted into machine tool recognizable instructions, and the region label is combined to divide and annotate the program segments. The tool path provides the accurate motion trajectory of the tool in the machining process, and the tool parameters and feed and speed information ensure that the cutting conditions in the machining process meet the process requirements. The introduction of the region label enables the machining program to be processed specifically for different machining areas. By integrating these information, the generated initial machining program not only contains complete machining instructions, but also provides a basis for subsequent error-proofing processing and program optimization.
[0029] According to the region label, an error-proofing subprogram corresponding to the region label is selected.
[0030] Specifically, by parsing the region label in the tool path information, the current processing region type is identified, and according to a preset region-subprogram mapping table, the corresponding error-proof subprogram is automatically matched and called, wherein each region label corresponds to a specific error-proof logic, such as detecting whether the tool is correctly installed, checking whether the machining allowance is reasonable, etc. By automatically calling the error-proof subprogram, manual intervention is reduced, the accuracy and reliability of the machining program are improved, and machining errors caused by incorrect tool path data are avoided.
[0031] According to the error-proof subprogram, the tool path data and the initial machining program are combined to generate a workpiece machining program for the workpiece to be machined.
[0032] Specifically, the called error-proof subprogram code block is inserted into the position corresponding to the tool path data to generate a complete numerical control machining program. Combined with the process parameter setting, the initial machining program is optimized, such as adjusting the tool path to reduce idle travel, optimizing the cutting parameters to improve machining efficiency, etc. The final output machining program contains detailed tool path, cutting parameters and error-proof instructions, which can be directly used for machining operation of the numerical control machine tool, ensuring efficient and accurate machining process.
[0033] In the embodiment of the present application, by automatically identifying the region label and calling the corresponding error-proofing subprogram in the post-processing stage of the workpiece machining program, the manual judgment and input steps are eliminated, greatly shortening the program generation time. Through the automatic calling of the error-proofing subprogram, the efficiency and accuracy of the workpiece machining program generation are significantly improved. Specifically, first, the three-dimensional model and process information of the workpiece to be machined are obtained, which are the basis for generating the machining program. The three-dimensional model provides the geometry and size of the workpiece, while the process information includes key data such as machining strategy, tool selection, and cutting parameters. Based on the above data, the tool path information containing tool path data and region labels is automatically generated. The tool path data describes the tool motion trajectory and machining parameters in detail, while the region label identifies the type of the machining area. Then, based on the above data, the initial machining program of the workpiece to be machined is generated. On the basis of the initial machining program, the post-processing stage of the workpiece machining program generation is entered, and the preset error-proofing subprogram is automatically matched and called by analyzing the region label. Through the process of automatic matching and calling, combined with the initial machining program, the final workpiece machining program is obtained. Not only the tedious operation of manually searching and inputting the error-proofing subprogram is avoided, but also the errors caused by human error are reduced, ensuring the accuracy and reliability of the machining program. Through the automatic calling of the error-proofing subprogram, the numerical control program can better adapt to the machining requirements of different workpieces and machine tools, ensuring the stability and consistency of the machining process. By analyzing the geometry and process requirements of the workpiece, the tool path and cutting parameters are automatically adjusted to better meet the actual machining conditions, which not only improves the machining efficiency, but also significantly reduces the risk of material waste and equipment damage caused by errors, avoids the generation of waste products caused by tool damage or machining errors, and reduces production costs.
[0034] Optionally, the tool path information of the machining tool of the workpiece to be machined is obtained according to the three-dimensional model and the process information of the workpiece to be machined, comprising: generating a tool path corresponding to the machining tool according to the three-dimensional model; generating tool parameters and feed and speed information corresponding to the machining tool according to the process information; determining at least one machining position of the machining tool according to the tool path; obtaining the region label corresponding to the machining position according to the machining position; the tool path, the tool parameters, and the feed and speed information are taken as the tool path data, and the tool path data and the region label are jointly encapsulated as the tool path information.
[0035] Specifically, first, a tool path of a machining tool is generated according to a three-dimensional model, which accurately describes the movement trajectory of the tool during the machining process. The three-dimensional model provides the geometry and dimensions of the workpiece, which is the basis for generating an accurate tool path. Second, tool parameters and feed and speed information are generated according to process information, which includes machining strategies, tool selection, cutting parameters, etc. The above parameters directly affect the machining efficiency and quality. Then, at least one machining position is determined by analyzing the tool path, which is the actual machining point where the tool contacts the workpiece. According to the machining position, the corresponding region label is obtained, which is used to identify the type of machining region, such as "outer diameter", "inner diameter", "right end face", etc. Finally, the tool path, tool parameters, feed and speed information are taken as tool path data, and are packaged together with the region label as tool path information, providing comprehensive data support for subsequent post-processing.
[0036] In the embodiments of the present application, by generating a tool path based on a three-dimensional model, the accuracy of the tool movement trajectory is ensured, and the machining errors caused by improper path planning are reduced. Combined with the tool parameters and feed and speed information generated by the process information, the cutting conditions in the machining process are optimized, and the machining efficiency and surface quality are improved. By analyzing the tool path to determine the machining position and assigning the region label, the subsequent post-processing can automatically identify the machining region and call the corresponding error prevention subprogram, reducing manual intervention and reducing the error rate.
[0037] Optionally, the initial machining program of the workpiece to be machined is generated according to the tool path data and the region label: a plurality of program segments are generated according to the tool path, the tool parameters and the feed and speed information of the tool path data; a segment identifier is written in the header of each program segment; region annotations are written in the segment identifier according to the region label, and the initial machining program is generated.
[0038] Specifically, a plurality of program segments are generated according to the tool path, tool parameters and feed and speed information in the tool path data. Each program segment represents an independent operation or machining step in the machining process. Then, a segment identifier is written in the header of each program segment, which is used to mark and distinguish different program segments, facilitating subsequent positioning and modification. Then, region annotations are written in the segment identifier according to the region label, which provides additional information about the machining region, such as "outer diameter", "inner diameter" and "right end face", etc., making the program more readable and traceable. Through these steps, the initial machining program is finally generated, providing a basis for subsequent error prevention subprogram insertion and format conversion. This process ensures the structuring and standardization of the initial machining program, facilitating subsequent automated processing.
[0039] In the embodiments of the present application, the tool path data is divided into multiple program segments, and a segment identifier is written at the head of each program segment, so that the program structure is more clear, facilitating subsequent positioning and modification. Secondly, by writing area annotations in the segment identifier, the readability and traceability of the program are enhanced, which helps to quickly identify and locate specific processing areas. Not only the generation efficiency of the program is improved, but also the errors and debugging time caused by the chaotic program structure are reduced.
[0040] Optionally, the selecting the error-proof subprogram corresponding to the area tag according to the area tag comprises: parsing the area tag to obtain an area code of the workpiece to be processed; taking the area code as a retrieval key to match in a preset area-subprogram mapping table to obtain a subprogram number corresponding to the area code; extracting the error-proof subprogram corresponding to the area tag from a preset error-proof subprogram library according to the subprogram number.
[0041] Specifically, in numerical control machining, in order to reduce the loss of waste caused by human operation errors, process engineers need to add tool compensation error-proof content in the numerical control program, which is tedious and prone to errors. Therefore, the present application automatically matches and calls the error-proof subprogram by parsing the area tag, which significantly improves the generation efficiency and accuracy of the machining program. Specifically, first, the area tag is parsed to extract the area code representing the processing area type, such as "outer diameter", "end face", etc. Then, taking the area code as a retrieval key, the corresponding subprogram number is quickly found in the preset area-subprogram mapping table. Finally, the corresponding error-proof subprogram is extracted from the preset error-proof subprogram library according to the subprogram number. This process not only avoids the tedious operation of manually searching and inputting the error-proof subprogram, but also reduces errors caused by human errors, ensuring the accuracy and reliability of the machining program. Through automation, the program generation time is greatly shortened, and the machining efficiency and quality are improved.
[0042] In the preferred embodiments of the present application, the numerical control lathe realizes machining of parts through relative movement of the tool and the workpiece, taking the spindle axis as the Z-axis (axial direction), and the direction away from the workpiece as the positive direction of the Z-axis; the direction perpendicular to the Z-axis and pointing to the center of the workpiece is the X-axis (radial direction), and the direction away from the center of the workpiece is the positive direction of the X-axis, i.e. when machining the outer circle, the tool moves outward as the positive direction of the X-axis. Figure 2As shown, according to the coordinate direction of the numerical control lathe, the machining area is defined as four different areas. Different error-proof subprograms are selected for different machining areas. For the inner hole and inner end face of the machined part, O0003 can be selected. When machining a semi-closed surface or multiple areas, multiple error-proof subprograms O0001 and O0003 can be selected. When the tool moves away from the center of the workpiece in the radial direction and moves in the negative axial direction at the same time, it is determined that the current machining area is the outer circle right end face. At this time, the error-proof subprogram corresponding to the 00004 area is called and executed.
[0043] In the embodiment of the application, the region code is extracted by analyzing the region label, ensuring accurate identification of the machining area. The preset region-subprogram mapping table is used for fast matching, improving the search efficiency of the error-proof subprogram. The corresponding error-proof subprogram is extracted from the preset error-proof subprogram library, ensuring the accuracy and reliability of the error-proof subprogram. This process not only reduces manual intervention and reduces error rate, but also improves the generation speed of the machining program and ensures the stability and consistency of the machining process.
[0044] Optionally, the workpiece machining program of the workpiece to be machined is generated according to the error-proof subprogram in combination with the tool path data and the initial machining program, comprising: locating the region label in the initial machining program to determine the program segment corresponding to the region label; inserting the error-proof subprogram of the region label into the program segment corresponding to the region label; According to a preset format, the initial machining program after inserting the error-proof subprogram is format-converted to generate the workpiece machining program of the workpiece to be machined.
[0045] Specifically, the corresponding program segment is accurately located in the initial machining program according to the region label, ensuring that the error-proof subprogram can be accurately inserted into the specified position. Next, the error-proof subprogram corresponding to the region label is inserted into the positioned program segment, which is completed by automatic processing, avoiding errors caused by manual intervention. Finally, the system format-converts the initial machining program after inserting the error-proof subprogram according to the preset format to generate the final workpiece machining program, ensuring that it meets the execution standard of the numerical control machine tool. The entire process realizes efficient integration of the error-proof subprogram through automatic and accurate positioning technology, improving the accuracy and reliability of the machining program.
[0046] In the embodiment of the present application, the initial machining program is automatically generated and the program segment corresponding to the region label is accurately positioned, avoiding the tedious operation of manual searching and inputting, and saving a lot of time. The automatic insertion of the error-proof subroutine ensures the safety in the machining process, which can effectively avoid the generation of waste products caused by tool damage or machining errors. The machining program conforming to the machine tool execution standard is generated through format conversion, ensuring the smooth progress of the machining process.
[0047] Optionally, the inserting the error-proof subroutine of the region label into the program segment corresponding to the region label comprises: obtaining a starting coordinate point of the program segment; determining a feed vector of the starting coordinate point according to the starting coordinate point and the tool path data of the machining tool; generating a compensation safety point of the machining tool according to the starting coordinate point and the feed vector; splicing a positioning statement of the compensation safety point and the error-proof subroutine to obtain a complete error-proof subroutine, wherein the positioning statement of the compensation safety point is arranged before the error-proof subroutine; inserting the complete error-proof subroutine into a starting position of the program segment.
[0048] In the embodiment of the present application, first, a starting coordinate point of a program segment is obtained, which is the position of the tool when starting to execute the program segment in the machining process. Then, according to the starting coordinate point and the tool path data, a feed vector is determined, which is the direction and angle of the tool entering the workpiece. Next, according to the starting coordinate point and the feed vector, a compensation safety point of the machining tool is calculated, wherein the compensation safety point is used to ensure that the tool is in a safe position before calling the error-proof subroutine, avoiding collision between the tool and the workpiece or fixture. Then, a positioning statement of the compensation safety point and the error-proof subroutine are spliced to form a complete error-proof subroutine, wherein the positioning statement of the compensation safety point is arranged before the error-proof subroutine to ensure that the tool first moves to a safe position. Finally, the complete error-proof subroutine is inserted into the starting position of the program segment, ensuring that the error-proof check is performed first in the machining process, thereby improving the safety and reliability of machining.
[0049] In the embodiment of the present application, by accurately obtaining the starting coordinate point of the program segment and calculating the feed vector, the accuracy and safety of the tool when entering the machining area are ensured. Since the compensation safety point is introduced, collision that may occur when the tool calls the error-proof subroutine is effectively avoided, protecting the tool and the machine tool. Finally, the complete error-proof subroutine is inserted into the starting position of the program segment, ensuring that the error-proof check is performed first in the machining process, discovering and correcting potential errors in time, and avoiding machining errors caused by incorrect tool path data.
[0050] Optionally, before the selecting the error-proof subprogram corresponding to the area tag according to the area tag, the method further comprises: determining a tool tip trajectory coordinate sequence according to the tool path, the tool parameter, and the feed and rotation speed information; determining a minimum distance between the machining tool and the workpiece to be machined according to the tool tip trajectory coordinate sequence; when the minimum distance is less than a preset distance threshold, updating a confidence value of the area tag corresponding to the machining position according to a difference between the minimum distance and the preset distance threshold; when the confidence value of the area tag is less than a preset threshold, performing secondary confirmation on the area tag.
[0051] Specifically, first, a tool tip trajectory coordinate sequence is determined according to the tool path, the tool parameter, and the feed and rotation speed information, which is equivalent to simulating and confirming the actual motion trajectory of the tool. Then, the minimum distance between the tool and the workpiece to be machined is calculated according to the trajectory coordinate sequence, so as to determine whether the tool will be too close to the workpiece in the machining process, which may cause the risk of collision or machining error. If the minimum distance is less than a preset threshold, the confidence value of the area tag corresponding to the machining position is dynamically adjusted according to the difference between the two. The confidence value is a trust degree of the accuracy and reliability of the area tag, and is quantified by a numerical value. The confidence value reflects the possibility of the area tag correctly identifying the machining area, and is dynamically adjusted in combination with the minimum distance calculated according to the tool tip trajectory coordinate sequence. In normal machining, if the area tag is consistent with the actual machining area, the confidence value is high; when there is deviation, the confidence value is low. When the confidence value is lower than a preset threshold, the system starts secondary confirmation to ensure the accuracy of the tag. This mechanism improves the reliability of the machining program, reduces the machining errors caused by tag errors, and enhances the stability and safety of the machining process. The present application introduces an intelligent verification and feedback mechanism in the original automation process, so that the system can self-perceive potential errors and correct them in time, thereby improving the reliability and accuracy of the overall machining. In addition, after determining the minimum distance between the machining tool and the workpiece to be machined according to the tool tip trajectory coordinate sequence, if the minimum distance is greater than or equal to the preset distance threshold, it indicates that the safety distance between the tool and the workpiece is sufficient under the current machining setting, and there is no risk of collision, so there is no need to adjust the confidence value of the area tag, and the corresponding error-proof subprogram will be directly selected according to the area tag. After updating the confidence value of the area tag, if the confidence value of the area tag is greater than a preset threshold, it indicates that the accuracy of the area tag has a high trust degree, and it is believed that the area tag can correctly reflect the characteristics of the machining area, so the corresponding error-proof subprogram will be directly selected according to the area tag.
[0052] In a preferred embodiment of the present application, according to the tool path, tool parameters and feed and rotation speed information, the system calculates the trajectory coordinate sequence of the tool tip during machining. For example, the trajectory coordinate sequence of the tool tip is: ; The trajectory coordinate sequence of the tool tip is analyzed, and the minimum distance between the tool and the workpiece is calculated. The calculated minimum distance is , and the preset distance threshold , for example, mm.
[0053] If , the confidence of the area label corresponding to the machining position is updated according to the difference between and . The update formula is: ; Assuming mm, the confidence value is: ; The confidence value is compared with the preset threshold . If the confidence value , the system will perform secondary confirmation on the area label. For example, = 0.6, = 0.7, the area label is confirmed again.
[0054] In an embodiment of the present application, by introducing the analysis of the tool tip trajectory coordinate sequence, the potential collision risk between the tool and the workpiece can be predicted in advance, and the machining error caused by the tool excessively close to the workpiece is avoided. This dynamic adjustment mechanism based on data not only reduces the machining errors caused by label errors, but also reduces the frequency of manual intervention and saves labor costs. At the same time, the secondary confirmation step further ensures the correctness of the area label and enhances the stability of the machining process.
[0055] Optionally, after the error-proofing subprogram is generated according to the tool path data and the initial machining program, the system further comprises: obtaining the macro variable value in the workpiece machining program and the compensation register value of the machining tool corresponding to the macro variable value; According to the comparison result of the macro variable value and the compensation register value, it is judged whether the program segment corresponding to the macro variable value is deviated; If so, a compensation correction instruction is generated according to the comparison result through an adaptive compensation correction function; The compensation correction instruction is inserted into the end of the program segment to update the workpiece machining program.
[0056] Specifically, in the post-processing stage, first, the macro variable value in the workpiece machining program and the corresponding machining tool compensation register value are obtained. These values respectively represent the preset tool compensation amount in the machining program and the tool compensation amount actually used by the machine tool. By comparing the two sets of values, it can be judged whether the program segment corresponding to the macro variable value has deviation. Specifically, the comparison result is the deviation value of the macro variable value and the compensation register value, and by judging the relationship between the deviation value and the preset deviation value, it is judged whether the program segment has deviation. Wherein, when the deviation value is less than the preset deviation value, it is determined that the program segment has no deviation; when the deviation value is greater than or equal to the preset deviation value, it is determined that the program segment has deviation. If there is deviation, compensation correction instructions will be generated according to the comparison result through an adaptive compensation correction function. Finally, these correction instructions are inserted into the end of the corresponding program segment, realizing the update of the workpiece machining program. The adaptive compensation correction function is defined according to the actual machining requirement and the error model, aiming to comprehensively consider various error factors and dynamically adjust the tool path and machining parameters to improve the machining precision and surface quality.
[0057] In the preferred embodiment of the present application, in the post-processing stage, the value of the macro variable #1001 used for external circle machining in the workpiece machining program is 10.5, and the value of the corresponding tool compensation register D01 is 10.3. By comparing, it is found that the deviation between the two is 0.2, which exceeds the preset deviation value of ±0.05. Then the adaptive compensation correction function is called, the correction value of the macro variable value is determined according to the deviation value, and the compensation correction instruction is generated based on the correction value and inserted into the end of the corresponding program segment. Finally, the updated program is format-converted, and a new post-processing program is output, ensuring that the tool compensation value is consistent with the actual value of the machine tool. The compensation correction function is defined according to the actual machining requirement and the error model, and is used to dynamically adjust the tool path and machining parameters.
[0058] For example, the tool wear compensation model can be expressed as wherein, is the tool wear rate, is the machining time. The thermal deformation compensation model is based on temperature change and material thermal expansion coefficient, and is expressed as: ; The mechanical vibration compensation model is constructed by frequency domain analysis or time series prediction, and the comprehensive compensation correction function can be expressed as: ; wherein, and are the initial and actual tool length compensation values, and are the initial and actual tool radius compensation values, is the processing time, is the temperature change.
[0059] For example, in the processing, the initial tool length compensation value is mm, the actual value is mm, the tool length compensation correction amount is calculated mm. Considering the thermal expansion coefficient / °C and the temperature change °C, the thermal deformation compensation amount is mm. Comprehensive these factors, the corrected tool length compensation value is mm.
[0060] In the embodiment of the present application, by acquiring and comparing the macro variable value and the compensation register value, the system can timely discover and correct the compensation deviation caused by tool wear, manual adjustment or other factors. Secondly, the introduction of the adaptive compensation correction function can dynamically generate compensation correction instructions without manual intervention, greatly improving the processing efficiency. By inserting the correction instruction into the end of the program segment, the system realizes real-time updating of the processing program, ensuring the stability and consistency of the processing process.
[0061] As shown in Figure 3 , another embodiment of a workpiece processing program generation system of the present application comprises: a model and process information acquisition module for acquiring a three-dimensional model of a workpiece to be processed and process information; a tool path information generation module for obtaining tool path information of a processing tool of the workpiece to be processed according to the three-dimensional model of the workpiece to be processed and the process information, the tool path information comprising tool path data and region labels of the workpiece to be processed; an initial program generation module for generating an initial processing program of the workpiece to be processed according to the tool path data and the region labels; an error-proof subprogram selection module for selecting an error-proof subprogram corresponding to the region labels according to the region labels; a numerical control program generation module for generating a workpiece processing program of the workpiece to be processed according to the error-proof subprogram in combination with the tool path data and the initial processing program.
[0062] The workpiece processing program generation system of the present application has the same advantages as the workpiece processing program generation method of the present application compared with the prior art, which will not be repeated here.
[0063] An electronic device according to still another embodiment of the present application comprises a memory and a processor; The memory is used for storing a computer program; The processor is configured to implement the proxy registration and service invocation method when executing the computer program.
[0064] The electronic device of the present application has the same advantages as the workpiece processing program generation method of the prior art, which will not be repeated here.
[0065] Although the present application is disclosed as above, the protection scope of the present application is not limited to this. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present application, and these changes and modifications will fall within the protection scope of the present application.
Claims
1. A workpiece machining program generation method characterized by comprising: The method comprises the following steps: acquire a three-dimensional model of a workpiece to be processed and process information; obtain tool path information of a processing tool of the workpiece to be processed according to the three-dimensional model of the workpiece to be processed and the process information, wherein the tool path information comprises tool path data and region labels of the workpiece to be processed; generate an initial machining program of the workpiece to be processed according to the tool path data and the region labels; select an error-proofing subprogram corresponding to the region label according to the region label; generate a workpiece machining program of the workpiece to be processed according to the error-proofing subprogram, in combination with the tool path data and the initial machining program.
2. The workpiece process program generation method according to Claim 1, characterized by, The step of obtaining tool path information of a processing tool of the workpiece to be processed according to the three-dimensional model of the workpiece to be processed and the process information comprises the following steps: generate a tool path corresponding to the processing tool according to the three-dimensional model; generate tool parameters, feed and speed information corresponding to the processing tool according to the process information; determine at least one processing position of the processing tool according to the tool path; obtain the region label corresponding to the processing position according to the processing position; encapsulate the tool path, the tool parameters and the feed and speed information as the tool path data, and encapsulate the tool path data and the region label as the tool path information.
3. The workpiece process program generation method according to claim 2, characterized by, The step of generating an initial machining program of the workpiece to be processed according to the tool path data and the region labels comprises the following steps: generate a plurality of program segments according to the tool path, the tool parameters and the feed and speed information of the tool path data; write a segment identifier in the head of each program segment; write a region annotation in the segment identifier according to the region label to generate the initial machining program.
4. The workpiece process program generation method according to Claim 2, characterized by, The step of selecting an error-proofing subprogram corresponding to the region label according to the region label comprises the following steps: analyze the region label to obtain a region code of the workpiece to be processed; use the region code as a retrieval key to match in a preset region-subprogram mapping table to obtain a subprogram number corresponding to the region code; extract the error-proofing subprogram corresponding to the region label from a preset error-proofing subprogram library according to the subprogram number.
5. The workpiece process program generation method according to Claim 3, characterized by, The step of generating a workpiece machining program of the workpiece to be processed according to the error-proofing subprogram, in combination with the tool path data and the initial machining program comprises the following steps: position the initial machining program according to the region label to determine the program segment corresponding to the region label; insert the error-proofing subprogram of the region label into the program segment corresponding to the region label; convert the initial machining program after the error-proofing subprogram is inserted into the preset format to generate the workpiece machining program of the workpiece to be processed.
6. The workpiece process program generation method according to Claim 4, characterized by, The step of inserting the error-proofing subprogram of the region label into the program segment corresponding to the region label comprises the following steps: acquire a starting coordinate point of the program segment; determine a feed vector of the starting coordinate point according to the starting coordinate point and the tool path data of the processing tool; generate a compensation safety point of the processing tool according to the starting coordinate point and the feed vector; Splicing the positioning statement of the compensation safety point with the error-proofing subprogram to obtain a complete error-proofing subprogram, wherein the positioning statement of the compensation safety point is arranged before the error-proofing subprogram; Inserting the complete error-proofing subprogram into a starting position of the program segment.
7. The workpiece process program generation method according to Claim 2, characterized by, Before the selecting of the error-proofing subprogram corresponding to the area label according to the area label, the method further comprises: Determining a tool tip trajectory coordinate sequence of the machining tool according to the tool path, the tool parameter, and the feed and rotation speed information; Determining a minimum distance between the machining tool and the workpiece to be machined according to the tool tip trajectory coordinate sequence; When the minimum distance is less than a preset distance threshold, updating a confidence value of the area label corresponding to the machining position according to a difference between the minimum distance and the preset distance threshold; When the confidence value of the area label is less than a preset threshold, performing secondary confirmation on the area label.
8. The workpiece process program generation method according to Claim 3, characterized by, After the generating of the workpiece machining program according to the error-proofing subprogram in combination with the tool path data and the initial machining program, the method further comprises: Obtaining a macro variable value in the workpiece machining program and a compensation register value of the machining tool corresponding to the macro variable value; Determining whether the program segment corresponding to the macro variable value is deviated according to a comparison result of the macro variable value and the compensation register value; If yes, generating a compensation correction instruction according to the comparison result through an adaptive compensation correction function; Updating the workpiece machining program by inserting the compensation correction instruction into an end of the program segment.
9. A workpiece machining program generation system characterized by comprising: Comprise: A model and process information acquisition module for acquiring a three-dimensional model and process information of a workpiece to be machined; A tool path information generation module for obtaining tool path information of a machining tool of the workpiece to be machined according to the three-dimensional model and the process information of the workpiece to be machined, wherein the tool path information comprises tool path data and area labels of the workpiece to be machined; An initial program generation module for generating an initial machining program of the workpiece to be machined according to the tool path data and the area labels; An error-proofing subprogram selection module for selecting an error-proofing subprogram corresponding to the area labels according to the area labels; A numerical control program generation module for generating a workpiece machining program of the workpiece to be machined according to the error-proofing subprogram in combination with the tool path data and the initial machining program.
10. An electronic device, comprising: Comprise a memory and a processor; The memory is configured to store a computer program; The processor is configured to implement the workpiece machining program generation method according to any one of claims 1-8 when executing the computer program.
Citation Information
Patent Citations
Digital control machining operation error prevention technology
CN101169643A
Error-proofing method for tool utilization in process of numerical control machining
CN106610627A
Craft mistake proofing method and device and intelligent terminal
CN109407529A
Simulation device
CN110320861A
Numerical control method based on mistake-proofing and mistake-proofing functions
CN115793567A