Method and system for generating measurement and compensation machining program of numerical control machine tool

By automatically generating CNC machine tool measurement and compensation processing programs, the problem of difficult to ensure machining accuracy in the existing technology is solved, and the automation of CNC machine tool measurement and compensation processing is realized, and processing efficiency and accuracy are improved.

CN120010381APending Publication Date: 2025-05-16APLOS MASCH MFG (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510141194.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-08
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

During the processing of existing CNC machine tools, machining accuracy is difficult to ensure. It is mainly due to the cumbersome measurement and compensation process caused by tool wear and changes in machine tool accuracy, and it is impossible to achieve automated production, which seriously affects the processing efficiency.

Method used

It provides a method and system for generating a CNC machine tool measurement and compensation processing program. By receiving associated configuration data, it establishes the correspondence between color, measurement strategy and over-difference judgment program, loads a three-dimensional model, recognizes the face color, and automatically generates the main measurement and compensation program file, including measurement code, over-difference judgment code and compensation processing call code.

Benefits of technology

It realizes automation of the measurement and compensation processing process of CNC machine tools, improves processing efficiency and accuracy, reduces the waste of human resources, is suitable for various CNC systems and products, and realizes long-term repeated use of one development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120010381A_ABST
    Figure CN120010381A_ABST
Patent Text Reader

Abstract

The invention provides a numerical control machine tool measurement and compensation machining program generation method and system, and the method comprises the steps: receiving associated configuration data, and building a corresponding relation among a color, a measurement strategy and an out-of-tolerance judgment program based on the associated configuration data; loading the three-dimensional model of the to-be-processed product; identifying the color of each surface in the three-dimensional model of the to-be-processed product, and determining a measurement strategy and an out-of-tolerance judgment program corresponding to the to-be-processed surface in the to-be-processed product according to the corresponding relation; automatically generating a measurement compensation main program file based on the measurement strategy corresponding to the to-be-processed surface and an out-of-tolerance judgment program; and storing a pre-programmed compensation processing program file in a storage path of the measurement compensation main program, and establishing an association relationship between the compensation processing program file and a product. By adopting the method, the measurement and out-of-tolerance judgment program of the numerical control machine tool can be automatically generated only through simple configuration, so that the measurement and compensation machining process of the numerical control machine tool is more convenient and efficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of numerically controlled machine tools, and in particular to a method and system for generating a numerically controlled machine tool measurement and compensation processing program. Background Art

[0002] CNC machine tool processing requires programming software to generate the corresponding processing tool path, and then post-process the G code. The CNC system can cut according to the path of the G code and finally process the corresponding product. At the same time, the system also provides a measurement function, which can generate the measured G code through programming. After the CNC system measures, the operator can get the actual error based on the measurement results, adjust the tool compensation, and then process again to finally meet the processing accuracy requirements. The current processing accuracy requirements are getting higher and higher. In actual processing, the final processed product may be difficult to meet the requirements due to tool wear or changes in machine tool accuracy.

[0003] In order to ensure the accuracy of the final processed product, the commonly used method is online measurement. After measurement, tool radius compensation is performed according to the error before processing. The current mainstream method is to manually measure, manually find the program that needs to be reprocessed, and then process it again. In this way, automatic production cannot be achieved, which seriously affects the processing efficiency. If secondary development is performed on the programming software, independent secondary development is required for each product. If the CNC system is replaced, it is also necessary to develop again for the replaced CNC system, which wastes a lot of human resources.

[0004] In addition, the measurement program needs to be programmed on CAM (Computer Aided Manufacturing) software, the programming operation is complicated, and the generated measurement program needs to be combined with the processing program and judgment program of the CNC machine tool, which is prone to errors. Summary of the invention

[0005] In response to the problems in the prior art, the purpose of this application is to provide a method and system for generating CNC machine tool measurement and compensation processing programs. With simple configuration, CNC machine tool measurement and out-of-tolerance judgment programs can be automatically generated, making the CNC machine tool measurement and compensation processing process more convenient and efficient.

[0006] The present application provides a method for generating a CNC machine tool measurement and compensation processing program, comprising:

[0007] Receiving association configuration data, and establishing a corresponding relationship between color, measurement strategy, and out-of-tolerance judgment procedure based on the association configuration data;

[0008] Load the 3D model of the product to be processed;

[0009] Identify the colors of each surface in the three-dimensional model of the product to be processed, and determine the measurement strategy and out-of-tolerance judgment procedure corresponding to the surface to be processed in the product to be processed according to the corresponding relationship;

[0010] Automatically generate a measurement compensation main program file based on the measurement strategy and the deviation judgment program corresponding to the surface to be processed, wherein the measurement compensation main program file includes a measurement code for measuring the surface to be processed, a judgment code for determining deviations based on the measurement data of the surface to be processed, and a calling code for calling a corresponding compensation processing program file when the deviation meets a preset compensation condition;

[0011] The pre-compiled compensation processing program file is stored in the storage path of the measurement compensation main program, and an association relationship between the compensation processing program file and the product is established.

[0012] In some embodiments, the associated configuration data includes a set color number and a measurement strategy configuration file name and an out-of-tolerance judgment program file number corresponding to the color number;

[0013] Before receiving the associated configuration data, the following steps are also included:

[0014] receiving policy configuration data, and generating a measurement policy configuration file based on the policy configuration data, wherein the measurement policy configuration file includes instruction rules corresponding to the measurement policy;

[0015] Receive out-of-tolerance judgment configuration data, and generate an out-of-tolerance judgment program file based on the out-of-tolerance judgment configuration data. The out-of-tolerance judgment program file includes a judgment code for performing out-of-tolerance judgment based on specified measurement data and a calling code for calling a corresponding compensation processing program file when the out-of-tolerance meets a preset compensation condition.

[0016] In some embodiments, the measurement compensation main program file is automatically generated based on the measurement strategy and the tolerance judgment program corresponding to the surface to be processed, including the following steps:

[0017] Based on the measurement strategy name and the out-of-tolerance judgment program file number corresponding to the surface to be processed, the corresponding measurement strategy configuration file and the out-of-tolerance judgment program file are retrieved respectively;

[0018] Generate a measurement point list based on the measurement strategy configuration file corresponding to the surface to be processed;

[0019] A measurement compensation main program is generated based on a measurement compensation main program file template, information of the product to be processed, information of the surface to be processed, a corresponding measurement point list, a corresponding measurement strategy configuration file and a corresponding tolerance judgment program file.

[0020] In some embodiments, generating a measurement point list based on a measurement strategy configuration file corresponding to the surface to be processed includes the following steps:

[0021] Determine the measurement point position of each surface to be processed based on the measurement strategy configuration file corresponding to the surface to be processed;

[0022] Perform interference judgment according to the positions of the measuring points, and delete the measuring points where interference occurs;

[0023] A measuring point list is generated based on the measuring points.

[0024] In some embodiments, after generating a measurement point list based on the measurement strategy configuration file corresponding to the surface to be processed, the following steps are also included:

[0025] A program generation page is displayed, wherein the program generation page includes a measurement point display area, a measurement point editing area, and a program generation operation area, wherein the measurement point display area is configured to display a measurement point list, the measurement point editing area is configured to display a measurement point editing button, and the program generation operation area is configured to display a program path selection box and a program generation button.

[0026] In some embodiments, the receiving of policy configuration data and generating a measurement policy configuration file based on the policy configuration data comprises the following steps:

[0027] Determining strategy configuration data according to the size information of the three-dimensional model of the product to be processed, wherein the strategy configuration data includes variable information corresponding to the measurement strategy name;

[0028] A measurement strategy configuration file is generated based on the measurement strategy template corresponding to the measurement strategy name and the variable information.

[0029] In some embodiments, when the measurement compensation main program file is automatically generated, the default product name in the compensation processing program file name called in the calling code of the out-of-tolerance judgment program file is modified to the product name of the product to be processed;

[0030] The step of establishing the association relationship between the compensation processing program file and the product comprises the following steps:

[0031] The default product name in the file name of the retrieved compensation processing program file is changed to the product name of the product to be processed.

[0032] In some embodiments, storing the pre-compiled compensation processing program file in the storage path of the measurement compensation main program includes the following steps:

[0033] Based on the preset correspondence between the over-tolerance judgment program file number and the compensation processing program file, the compensation processing program file corresponding to the over-tolerance judgment program file number corresponding to the to-be-processed surface is retrieved;

[0034] The retrieved compensation processing program file is stored in the storage path of the measurement compensation main program.

[0035] In some embodiments, the out-of-tolerance judgment program file number is a tool number, and the file name of the compensation processing program file includes a product name and a tool number;

[0036] Based on the correspondence between the preset out-of-tolerance judgment program file number and the compensation processing program file, the compensation processing program file corresponding to the out-of-tolerance judgment program file number corresponding to the to-be-processed surface is retrieved, including: retrieving the compensation processing program file whose file name includes the out-of-tolerance judgment program file number.

[0037] In some embodiments, the step of storing the retrieved compensation processing program file in the storage path of the measurement compensation main program further includes the following steps:

[0038] Merging the retrieved compensation processing program files corresponding to the same tool to obtain compensation processing program files corresponding to each tool;

[0039] The compensation processing program files corresponding to the respective tools are stored in the storage path of the measurement compensation main program.

[0040] The embodiment of the present application also provides a CNC machine tool measurement and compensation processing program generation system, which is used to implement the CNC machine tool measurement and compensation processing program generation method, and the system includes:

[0041] A configuration module, used for receiving the associated configuration data, and establishing a corresponding relationship between the color, the measurement strategy and the out-of-tolerance judgment program based on the associated configuration data;

[0042] A program generation module, used to load a three-dimensional model of a product to be processed, identify the color of each surface in the three-dimensional model of the product to be processed, determine the measurement strategy and the deviation judgment program corresponding to the surface to be processed in the product to be processed according to the corresponding relationship, and automatically generate a measurement compensation main program file based on the measurement strategy and the deviation judgment program corresponding to the surface to be processed, wherein the measurement compensation main program file includes a measurement code for measuring the surface to be processed, a judgment code for determining deviation based on the measurement data of the surface to be processed, and a calling code for calling a corresponding compensation processing program file when the deviation meets a preset compensation condition;

[0043] The post-processing module is used to store the pre-compiled compensation processing program file in the storage path of the measurement compensation main program, and establish an association relationship between the compensation processing program file and the product.

[0044] In some embodiments, the configuration module is also used to receive strategy configuration data, generate a measurement strategy configuration file based on the strategy configuration data, and the measurement strategy configuration file includes instruction rules corresponding to the measurement strategy; and receive out-of-tolerance judgment configuration data, generate an out-of-tolerance judgment program file based on the out-of-tolerance judgment configuration data, and the out-of-tolerance judgment program file includes a judgment code for performing out-of-tolerance judgment based on specified measurement data and a calling code for calling a corresponding compensation processing program file when the out-of-tolerance meets a preset compensation condition.

[0045] The CNC machine tool measurement and compensation processing program generation method and system provided in this application have the following advantages:

[0046] By adopting this application, only simple configuration is required to automatically generate CNC machine tool measurement and out-of-tolerance judgment programs, forming a set of standard measurement, judgment, and compensation processing processes, which can be applied to various different systems and different programming software, without the need to redevelop the software each time. Programs for different systems and different products can be automatically generated after configuration, achieving long-term repeated use after one-time development, improving programming efficiency and reliability, meeting the needs of automatically generating measurement programs and automated processing, and making CNC machine tool measurement and compensation processing more convenient and efficient. Staff do not need to understand the differences between different systems, which reduces the requirements for software development staff, and provides users with sufficient flexibility through configurable settings. The same type of product can be configured only once, and the precision of different products can be specifically adjusted by modifying the judgment statement in the program code, which is suitable for various CNC machine tool processing application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings.

[0048] Figure 1 is a flow chart of a method for generating a CNC machine tool measurement and compensation processing program according to an embodiment of the present application;

[0049] Figure 2 It is a flow chart of a method for generating a CNC machine tool measurement and compensation processing program in a specific implementation mode of the present application;

[0050] Figure 3 is a schematic diagram of a measurement strategy file having been configured in accordance with an embodiment of the present application;

[0051] Figure 4 is a schematic diagram of instruction rules in a measurement strategy file of an embodiment of the present application;

[0052] Figure 5 It is a schematic diagram of the code in the out-of-tolerance judgment program of one embodiment of the present application;

[0053] Figure 6 It is a schematic diagram of establishing the corresponding relationship between the color, the measurement strategy and the out-of-tolerance judgment program in one embodiment of the present application;

[0054] Figure 7 is a schematic diagram of a program generation page of an embodiment of the present application;

[0055] Figure 8 is a schematic diagram of a measurement and compensation processing program file finally generated in one embodiment of the present application;

[0056] Fig. 9 It is a structural block diagram of a CNC machine tool measurement and compensation processing program generation system according to an embodiment of the present application. DETAILED DESCRIPTION

[0057] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0058] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0059] like Figure 1 As shown, the present application provides a method for generating a CNC machine tool measurement and compensation processing program, comprising:

[0060] S100: receiving association configuration data, and establishing a correspondence between a color, a measurement strategy, and an out-of-tolerance judgment program based on the association configuration data; in this embodiment, the association configuration data includes a set color number and a measurement strategy configuration file name and an out-of-tolerance judgment program file number corresponding to the color number;

[0061] S200: loading a three-dimensional model of the product to be processed;

[0062] That is, loading the 3D model into the programming software environment, the 3D model includes the size information and color number information of each surface of the product;

[0063] S300: Identify the colors of each surface in the three-dimensional model of the product to be processed, and determine the measurement strategy and out-of-tolerance judgment procedure corresponding to the surface to be processed in the product to be processed according to the corresponding relationship;

[0064] S400: Automatically generate a measurement compensation main program file based on the measurement strategy and the deviation judgment program corresponding to the surface to be processed, wherein the measurement compensation main program file includes a measurement code for measuring the surface to be processed, a judgment code for determining deviations based on the measurement data of the surface to be processed, and a calling code for calling a corresponding compensation processing program file when the deviation meets a preset compensation condition;

[0065] Therefore, the present application can automatically match the corresponding measurement strategy according to the color, without manual point selection, and can automatically and quickly complete the selection of measurement points in each surface to be processed, and automatically generate the measurement code in the measurement compensation main program file according to the measurement strategy, without the need for the staff to manually operate each surface one by one; the out-of-tolerance judgment program can also be automatically matched by color, and after the measurement, it can be directly judged whether it is out of tolerance and whether it needs to be compensated again, and the corresponding compensation processing program file is automatically called when compensation processing is needed, without manual calling, thereby meeting the needs of the automated production line;

[0066] S500: storing the pre-compiled compensation processing program file in the storage path of the measurement compensation main program, and establishing an association relationship between the compensation processing program file and the product.

[0067] By adopting the CNC machine tool measurement and compensation processing program generation method of the present application, the CNC machine tool measurement and deviation judgment program can be automatically generated with simple configuration, forming a set of standard measurement, judgment, and re-compensation processing processes, which can be applicable to various different systems and different programming software. There is no need to re-develop the software every time. Programs for different systems and different products can be automatically generated after configuration, realizing one-time development and long-term repeated use, improving programming efficiency and reliability, meeting the needs of automatically generating measurement programs and automated processing, and making the CNC machine tool measurement and compensation processing process more convenient and efficient.

[0068] This application is explained by taking the implementation based on UG programming software environment as an example, but this application is not limited to this. In this application, the system refers to the control system of the CNC machine tool. There may be different types of systems, such as Heidenhain system, Kaiyu CNC system, etc., and there will be different programming rules for different systems. By adopting this method, the staff does not need to understand the difference between different systems, which reduces the requirements for software development staff, and provides users with sufficient flexibility through configurable settings. The same type of product can be configured only once, and the accuracy of different products can be specifically adjusted by modifying the judgment statement in the program code, which is suitable for various CNC machine tool processing application scenarios. This application standardizes the measurement and compensation processing program of CNC machine tools, which can greatly improve programming efficiency and reduce the possibility of errors in human operation. The generated measurement and compensation processing program can be merged with the processing program without manual splitting and merging. When running the measurement and compensation processing program, online detection is directly performed after the product is processed to avoid rework after going offline, and also avoid the situation where some high-precision requirements need to spend a lot of manpower and time to find the original origin after rework.

[0069] like Figure 2 As shown, before the step S100: receiving the associated configuration data, the following steps are also included:

[0070] S010: receiving policy configuration data, and generating a measurement policy configuration file based on the policy configuration data, wherein the measurement policy configuration file includes instruction rules corresponding to the measurement policy;

[0071] S020: receiving out-of-tolerance judgment configuration data, and generating an out-of-tolerance judgment program file based on the out-of-tolerance judgment configuration data, wherein the out-of-tolerance judgment program file includes a judgment code for performing out-of-tolerance judgment based on specified measurement data and a calling code for calling a corresponding compensation processing program file when the out-of-tolerance meets a preset compensation condition.

[0072] In this embodiment, the step S010: receiving policy configuration data, and generating a measurement policy configuration file based on the policy configuration data, includes the following steps:

[0073] Determining strategy configuration data according to the size information of the three-dimensional model of the product to be processed, wherein the strategy configuration data includes variable information corresponding to the measurement strategy name;

[0074] A measurement strategy configuration file is generated based on the measurement strategy template corresponding to the measurement strategy name and the variable information.

[0075] Figure 3The table shows several configured measurement strategy configuration files. The file name of each measurement strategy configuration file is the name of the corresponding measurement strategy, such as 2-point distance measurement, 2-point parallel plane distance measurement, 3-point inner circle measurement, 3-point outer circle measurement, 4-point inner circle measurement, 4-point outer circle measurement, 6-point outer circle measurement, etc. Take the measurement strategy configuration file of 3-point outer circle measurement as an example, in which the variable information available for configuration includes the coordinates of the center of the circle and the diameter of the circle. This information can be determined from the size information of the surface to be processed in the 3D model of the product to be processed. The specific content is as follows:

[0076] XCen = XCPos; / / x-axis coordinate of the center of the circle

[0077] YCen = YCPos; / / Y-axis coordinate of the center of the circle

[0078] Zcen=ZCPos; / / Z-axis coordinate of the center of the circle

[0079] DIA = CD; / / diameter of the circle

[0080] The specific command rules in the measurement strategy configuration file can be pre-configured by the staff, and different command rules will be used for different systems. For example, the command rules corresponding to the Heidenhain system are as follows:

[0081] TCH PROBE 1401CIRCLE PROBING~

[0082] Q1100=[XCen]

[0083] Q1101=[YCen]

[0084] Q1102=[ZCen]

[0085] Q51116=[DIA]

[0086] Q1115=+0

[0087] Q423 = +3

[0088] Q325=+0

[0089] Q1119 = +360

[0090] Q320=+0

[0091] Q260 = +50

[0092] Q1125=+1

[0093] Q309=+0

[0094] Q1120=+0

[0095] For another example, the instruction rules corresponding to the Kaiyu CNC system are as follows:

[0096] G901 X[XCen]Y[YCen]Z[ZCen]D[DIA]K3 S0 E360 H0 S50

[0097] Therefore, the staff does not need to know what system to use. They only need to load the corresponding configuration and set the corresponding XCen, YCen, ZCen, and DIA parts using the drawing information of the 3D model. Finally, the corresponding normal instructions can be generated to obtain a measurement strategy configuration file that can be used normally. For example, the content of the measurement strategy configuration file for 3-point outer circle measurement is as follows: Figure 4 shown.

[0098] Figure 5 The following is an example of the code format in an out-of-tolerance judgment program file, in which the Heidenhain system is used as an example. For other systems, the staff can pre-write the code in the out-of-tolerance judgment program file according to the programming rules of the system. Figure 5 As shown, the program is set to execute the program after LBL1 when the deviation is greater than 0.8. Here, the alarm is taken as an example (corresponding to the first line of code). When the deviation is greater than 0.1, the program after LBL2 is executed. Here, half of the error is written into the system as the tool radius compensation value, and then the compensation processing program corresponding to T10 is called (corresponding to the eleventh line of code). That is, the preset compensation condition set here is that the deviation is greater than 0.1, and the corresponding compensation processing program is the program with the file name ProgName_T10.H. In this embodiment, when the measurement compensation main program file is automatically generated, the default product name in the compensation processing program file name called in the calling code of the deviation judgment program file is modified to the product name of the product to be processed. Corresponding to Figure 5 For example, when generating the measurement compensation main program file, modify the ProgName in line 11 of the code to the product name of the product to be processed.

[0099] The step S500: establishing the association relationship between the compensation processing program file and the product includes: modifying the default product name in the file name of the retrieved compensation processing program file to the product name of the product to be processed. Thus, when the out-of-tolerance judgment program is run and it is determined that the compensation processing program file needs to be called, the file name in the calling code is consistent with the file name of the actual compensation processing program file, and the call can be successful.

[0100] Figure 6 It is a schematic diagram of the corresponding relationship between the color, the measurement strategy and the out-of-tolerance judgment procedure in this embodiment. The description information is used for notes and explanations and has no practical significance. Figure 6Only a schematic diagram of part of the color configuration is shown exemplarily, and the present application is not limited thereto. Wherein the color number (ID) corresponds to the color number in the corresponding programming software, which is used to automatically identify the to-be-processed surface of the three-dimensional model to be measured, so that there is no need to manually select the surface to be measured. The corresponding subroutine is the number of the over-difference judgment program. In this embodiment, the over-difference judgment program file is named after the tool number, and the internal code corresponds to calling the compensation processing program corresponding to the tool number when the preset calling condition is met, that is, the compensation processing program with the file name ProgName_Tx, wherein Tx is the tool number, and ProgName will be replaced by the product name of the to-be-processed product. That is, in this embodiment, the over-difference judgment program file number is the tool number, and the file name of the compensation processing program file includes the product name and the tool number. In the step S500, based on the correspondence between the preset over-difference judgment program file number and the compensation processing program file, the compensation processing program file corresponding to the over-difference judgment program file number corresponding to the to-be-processed surface is retrieved, including: retrieving the compensation processing program file whose file name includes the over-difference judgment program file number.

[0101] In this embodiment, the step S400: automatically generating a measurement compensation main program file based on the measurement strategy and the tolerance judgment program corresponding to the surface to be processed, includes the following steps:

[0102] Based on the measurement strategy name and the out-of-tolerance judgment program file number corresponding to the surface to be processed, the corresponding measurement strategy configuration file and the out-of-tolerance judgment program file are retrieved respectively;

[0103] Generate a measurement point list based on the measurement strategy configuration file corresponding to the surface to be processed;

[0104] A measurement compensation main program is generated based on a measurement compensation main program file template, information of the product to be processed, information of the surface to be processed, a corresponding measurement point list, a corresponding measurement strategy configuration file and a corresponding tolerance judgment program file.

[0105] In this embodiment, generating a measurement point list based on the measurement strategy configuration file corresponding to the surface to be processed includes the following steps:

[0106] Determine the measurement point position of each surface to be processed based on the measurement strategy configuration file corresponding to the surface to be processed;

[0107] Perform interference judgment according to the positions of the measuring points, and delete the measuring points where interference occurs;

[0108] Specifically, a CNC machine tool model and a model of a product to be processed are loaded, wherein the CNC machine tool model includes a CNC machine tool probe model. Interference judgment for each measuring point includes: judging whether there is an overlapping area between the CNC machine tool probe and the product to be processed when the CNC machine tool probe measures a measuring point based on the model of the product to be processed and the CNC machine tool probe model (adjusting the displacement of the CNC machine tool probe in three directions of xyz according to the position of the measuring point, so that the CNC machine tool probe moves to the position for measuring the measuring point). If there is an overlapping area, it means that the CNC machine tool probe will interfere with the product to be processed when measuring the measuring point, so the measurement of the measuring point cannot be completed, and the measuring point needs to be deleted;

[0109] A measuring point list is generated based on the measuring points.

[0110] like Figure 7 As shown, in this embodiment, after the measurement point list is generated based on the measurement strategy configuration file corresponding to the surface to be processed, the following steps are also included:

[0111] A program generation page is displayed, wherein the program generation page includes a measurement point display area, a measurement point editing area, and a program generation operation area, wherein the measurement point display area is configured to display a measurement point list, the measurement point editing area is configured to display a measurement point editing button, and the program generation operation area is configured to display a program path selection box and a program generation button.

[0112] Therefore, in this embodiment, in the program generation page, the staff can further edit the measurement points, add or delete measurement points, so that the measurement can better meet the actual needs and the measurement method can be more flexible. After the staff configures the program path in the program path selection box, click the program generation button "Start generating program" to directly generate the measurement compensation main program with one click. Figure 8 As shown, the file name of the generated measurement compensation main program includes the product name, such as Figure 8 The product1_overall processing.h file in is the measurement compensation main program corresponding to the product name of product 1.

[0113] In this embodiment, in step S500, the pre-compiled compensation processing program file is stored in the storage path of the measurement compensation main program, including the following steps:

[0114] Based on the preset correspondence between the over-tolerance judgment program file number and the compensation processing program file, the compensation processing program file corresponding to the over-tolerance judgment program file number corresponding to the to-be-processed surface is retrieved;

[0115] The retrieved compensation processing program file is stored in the storage path of the measurement compensation main program.

[0116] like Figure 8 As shown, after the product name in the file name of the compensation processing program file is changed to the form of product1_Tx.h, the compensation processing program file is stored in the same path as the measurement and compensation main program. Tx represents the tool number, and product1 corresponds to the product name of the product to be processed. For example, in this embodiment, compensation of T2 tool, T3 tool, and T5 tool is required, then the measurement and compensation main program files: product1_T2.h, product1_T3.h, product1_T5.h are stored in the storage path of the measurement and compensation main program. The various program files under this storage path are collectively referred to as the measurement and compensation processing program file.

[0117] In this embodiment, the step of storing the retrieved compensation processing program file in the storage path of the measurement compensation main program further includes the following steps:

[0118] Merging the retrieved compensation processing program files corresponding to the same tool to obtain compensation processing program files corresponding to each tool;

[0119] The compensation processing program files corresponding to the respective tools are stored in the storage path of the measurement compensation main program.

[0120] After the measurement and compensation processing program is generated, when the actual processing is carried out, all processing programs will be run first, and then the measurement code in the measurement and compensation main program will be executed to measure the error of the processing surface of the product to be processed. After the measurement code is completed, the judgment code in the tolerance judgment program will be run to judge the tolerance. If the preset compensation conditions are met, the call code will be run. First, the tool radius compensation value is set, and then the compensation processing program corresponding to the tool is executed. For example, if the corresponding tool is T10, the program of product name_T10.h is executed. Therefore, by adopting this method, different CNC systems only need to modify the instructions in the measurement strategy configuration file and the tolerance judgment program file, and other parts can be used without adjustment. If it is for the same type of product, it can be executed directly from step S400.

[0121] like Fig. 9 As shown, the embodiment of the present application also provides a CNC machine tool measurement and compensation processing program generation system, which is used to implement the CNC machine tool measurement and compensation processing program generation method, and the system includes:

[0122] Configuration module M100, used to receive associated configuration data, and establish a corresponding relationship between color, measurement strategy and out-of-tolerance judgment program based on the associated configuration data;

[0123] The program generation module M200 is used to load the three-dimensional model of the product to be processed, identify the color of each surface in the three-dimensional model of the product to be processed, determine the measurement strategy and the deviation judgment program corresponding to the surface to be processed in the product to be processed according to the corresponding relationship, and automatically generate a measurement compensation main program file based on the measurement strategy and the deviation judgment program corresponding to the surface to be processed, wherein the measurement compensation main program file includes a measurement code for measuring the surface to be processed, a judgment code for determining the deviation based on the measurement data of the surface to be processed, and a calling code for calling the corresponding compensation processing program file when the deviation meets the preset compensation condition;

[0124] The post-processing module M300 is used to store the pre-compiled compensation processing program file in the storage path of the measurement compensation main program, and establish an association relationship between the compensation processing program file and the product.

[0125] In this embodiment, the configuration module M100 is also used to receive strategy configuration data, generate a measurement strategy configuration file based on the strategy configuration data, and the measurement strategy configuration file includes instruction rules corresponding to the measurement strategy; and receive out-of-tolerance judgment configuration data, generate an out-of-tolerance judgment program file based on the out-of-tolerance judgment configuration data, and the out-of-tolerance judgment program file includes a judgment code for performing out-of-tolerance judgment based on specified measurement data and a calling code for calling a corresponding compensation processing program file when the out-of-tolerance meets a preset compensation condition.

[0126] By adopting the CNC machine tool measurement and compensation processing program generation system of the present application, the CNC machine tool measurement and out-of-tolerance judgment program can be automatically generated with simple configuration, forming a set of standard measurement, judgment, and re-compensation processing processes, which can be applied to various different systems and different programming software, without the need to redevelop the software each time. Programs for different systems and different products can be automatically generated after configuration, achieving long-term repeated use after one-time development, improving programming efficiency and reliability, meeting the needs of automatically generating measurement programs and automated processing, and making the CNC machine tool measurement and compensation processing process more convenient and efficient. In this embodiment, the functions of each module in the CNC machine tool measurement and compensation processing program generation system can be implemented by the specific implementation methods of each step of the above-mentioned CNC machine tool measurement and compensation processing program generation method, which will not be repeated here.

[0127] The above content is a further detailed description of the present application in combination with specific preferred implementation methods, and it cannot be determined that the specific implementation of the present application is limited to these descriptions. For ordinary technicians in the technical field to which the present application belongs, several simple deductions or substitutions can be made without departing from the concept of the present application, which should be deemed to fall within the scope of protection of the present application.

Claims

1. A method for generating a CNC machine tool measurement and compensation processing program, characterized in that: include: Receiving association configuration data, and establishing a corresponding relationship between color, measurement strategy, and out-of-tolerance judgment procedure based on the association configuration data; Load the 3D model of the product to be processed; Identify the colors of each surface in the three-dimensional model of the product to be processed, and determine the measurement strategy and out-of-tolerance judgment procedure corresponding to the surface to be processed in the product to be processed according to the corresponding relationship; Automatically generate a measurement compensation main program file based on the measurement strategy and the deviation judgment program corresponding to the surface to be processed, wherein the measurement compensation main program file includes a measurement code for measuring the surface to be processed, a judgment code for determining deviations based on the measurement data of the surface to be processed, and a calling code for calling a corresponding compensation processing program file when the deviation meets a preset compensation condition; The pre-compiled compensation processing program file is stored in the storage path of the measurement compensation main program, and an association relationship between the compensation processing program file and the product is established.

2. The method for generating a CNC machine tool measurement and compensation processing program according to claim 1, characterized in that: The associated configuration data includes a set color number and a measurement strategy configuration file name and an out-of-tolerance judgment program file number corresponding to the color number; Before receiving the associated configuration data, the following steps are also included: receiving policy configuration data, and generating a measurement policy configuration file based on the policy configuration data, wherein the measurement policy configuration file includes instruction rules corresponding to the measurement policy; Receive out-of-tolerance judgment configuration data, and generate an out-of-tolerance judgment program file based on the out-of-tolerance judgment configuration data. The out-of-tolerance judgment program file includes a judgment code for performing out-of-tolerance judgment based on specified measurement data and a calling code for calling a corresponding compensation processing program file when the out-of-tolerance meets a preset compensation condition.

3. The method for generating a CNC machine tool measurement and compensation processing program according to claim 2, characterized in that: Automatically generate a measurement compensation main program file based on the measurement strategy and the tolerance judgment program corresponding to the surface to be processed, including the following steps: Based on the measurement strategy name and the out-of-tolerance judgment program file number corresponding to the surface to be processed, the corresponding measurement strategy configuration file and the out-of-tolerance judgment program file are retrieved respectively; Generate a measurement point list based on the measurement strategy configuration file corresponding to the surface to be processed; A measurement compensation main program is generated based on a measurement compensation main program file template, information of the product to be processed, information of the surface to be processed, a corresponding measurement point list, a corresponding measurement strategy configuration file and a corresponding tolerance judgment program file.

4. The method for generating a CNC machine tool measurement and compensation processing program according to claim 3, characterized in that: Generating a measurement point list based on the measurement strategy configuration file corresponding to the surface to be processed includes the following steps: Determine the measurement point position of each surface to be processed based on the measurement strategy configuration file corresponding to the surface to be processed; Perform interference judgment according to the positions of the measuring points, and delete the measuring points where interference occurs; A measuring point list is generated based on the measuring points.

5. The method for generating a CNC machine tool measurement and compensation processing program according to claim 3, characterized in that: After generating a measurement point list based on the measurement strategy configuration file corresponding to the surface to be processed, the following steps are also included: A program generation page is displayed, wherein the program generation page includes a measurement point display area, a measurement point editing area, and a program generation operation area, wherein the measurement point display area is configured to display a measurement point list, the measurement point editing area is configured to display a measurement point editing button, and the program generation operation area is configured to display a program path selection box and a program generation button.

6. The method for generating a CNC machine tool measurement and compensation processing program according to claim 2, characterized in that: The receiving of policy configuration data and generating a measurement policy configuration file based on the policy configuration data comprises the following steps: Determining strategy configuration data according to the size information of the three-dimensional model of the product to be processed, wherein the strategy configuration data includes variable information corresponding to the measurement strategy name; A measurement strategy configuration file is generated based on the measurement strategy template corresponding to the measurement strategy name and the variable information.

7. The method for generating a CNC machine tool measurement and compensation processing program according to claim 2, characterized in that: When the measurement compensation main program file is automatically generated, the default product name in the compensation processing program file name called in the calling code of the over-tolerance judgment program file is modified to the product name of the product to be processed; The step of establishing the association relationship between the compensation processing program file and the product comprises the following steps: The default product name in the file name of the retrieved compensation processing program file is changed to the product name of the product to be processed.

8. The method for generating a CNC machine tool measurement and compensation processing program according to claim 1, characterized in that: The step of storing the pre-compiled compensation processing program file in the storage path of the measurement compensation main program includes the following steps: Based on the preset correspondence between the over-tolerance judgment program file number and the compensation processing program file, the compensation processing program file corresponding to the over-tolerance judgment program file number corresponding to the to-be-processed surface is retrieved; The retrieved compensation processing program file is stored in the storage path of the measurement compensation main program.

9. The method for generating a CNC machine tool measurement and compensation processing program according to claim 8, characterized in that: The deviation judgment program file number is the tool number, and the file name of the compensation processing program file includes the product name and the tool number; Based on the correspondence between the preset out-of-tolerance judgment program file number and the compensation processing program file, the compensation processing program file corresponding to the out-of-tolerance judgment program file number corresponding to the to-be-processed surface is retrieved, including: retrieving the compensation processing program file whose file name includes the out-of-tolerance judgment program file number.

10. The method for generating a CNC machine tool measurement and compensation processing program according to claim 1, characterized in that: The step of storing the retrieved compensation processing program file in the storage path of the measurement compensation main program also includes the following steps: Merging the retrieved compensation processing program files corresponding to the same tool to obtain compensation processing program files corresponding to each tool; The compensation processing program files corresponding to the respective tools are stored in the storage path of the measurement compensation main program.

11. A CNC machine tool measurement and compensation processing program generation system, characterized in that: The system is used to implement the method for generating a CNC machine tool measurement and compensation processing program according to any one of claims 1 to 10, and comprises: A configuration module, used for receiving the associated configuration data, and establishing a corresponding relationship between the color, the measurement strategy and the out-of-tolerance judgment program based on the associated configuration data; A program generation module, used to load a three-dimensional model of a product to be processed, identify the color of each surface in the three-dimensional model of the product to be processed, determine the measurement strategy and the deviation judgment program corresponding to the surface to be processed in the product to be processed according to the corresponding relationship, and automatically generate a measurement compensation main program file based on the measurement strategy and the deviation judgment program corresponding to the surface to be processed, wherein the measurement compensation main program file includes a measurement code for measuring the surface to be processed, a judgment code for determining deviation based on the measurement data of the surface to be processed, and a calling code for calling a corresponding compensation processing program file when the deviation meets a preset compensation condition; The post-processing module is used to store the pre-compiled compensation processing program file in the storage path of the measurement compensation main program, and establish an association relationship between the compensation processing program file and the product.

12. The CNC machine tool measurement and compensation processing program generation system according to claim 11, characterized in that: The configuration module is also used to receive strategy configuration data, generate a measurement strategy configuration file based on the strategy configuration data, and the measurement strategy configuration file includes instruction rules corresponding to the measurement strategy; and receive out-of-tolerance judgment configuration data, generate an out-of-tolerance judgment program file based on the out-of-tolerance judgment configuration data, and the out-of-tolerance judgment program file includes a judgment code for out-of-tolerance judgment based on specified measurement data and a calling code for calling a corresponding compensation processing program file when the out-of-tolerance meets a preset compensation condition.