Numerical control machining tool checking method and system and medium
By combining fixed loop programs with parameterized subroutines, the tool inspection process for CNC machining is automated and standardized, solving the problems of low efficiency and high operator dependence in existing tool inspection programs, and improving tool inspection efficiency and machining accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHENGDU AIRCRAFT INDUSTRY GROUP
- Filing Date
- 2026-01-19
- Publication Date
- 2026-05-19
AI Technical Summary
Existing methods for developing CNC machining tool verification programs are inefficient, require repetitive work, and are highly dependent on operators, making it difficult to automate and standardize them.
By combining a fixed loop program with parameterized subroutines, the tool inspection process is automated by acquiring the structural dimensions of the tool inspection block and the tool parameters, reducing human input errors and achieving standardization and automation of the tool inspection operation.
Improve tool inspection efficiency, reduce operator workload, minimize the risk of human intervention, enhance machining automation, and ensure the accuracy and consistency of tool parameters.
Smart Images

Figure CN122064022A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of CNC machining technology, and in particular to a CNC machining tool inspection method, system and medium. Background Technology
[0002] With the development of modern industrial manufacturing, the design, manufacturing, and assembly of aerospace weaponry are increasingly trending towards integration, complexity, and automation. In CNC machine tool processing, the accuracy of CNC machining tools is crucial. Before CNC machining, the correct CNC machining tool must be installed on the appropriate tool holder to complete the machining process. Efficiently utilizing tool verification blocks as a method of error prevention can effectively prevent operational errors in CNC machining, such as incorrect tool setting, incorrect tool length settings, and incorrect tool usage, thereby improving product qualification rates. Currently, there are various methods for programming tool verification blocks, but they suffer from low tool feed efficiency and difficulties in widespread adoption.
[0003] To address this, Chinese Patent Application No. CN113126964A discloses a method for creating an efficient tool inspection program based on CATIA. While this method can guide process engineers in creating tool inspection block programs, it still requires creating a separate tool inspection program for each part, resulting in repetitive work and low tool inspection efficiency. Summary of the Invention
[0004] To address the aforementioned issues, reduce the workload of programmers, and improve tool inspection efficiency, this application provides a CNC machining tool inspection method, system, and medium.
[0005] On the one hand, the CNC machining tool inspection method provided in this application adopts the following technical solution: A method for verifying tools used in CNC machining includes the following steps: Obtain the structural dimensions of the inspection block and establish an inspection block model that matches the structural dimensions of the inspection block, wherein the inspection block is a conical inspection block; Obtain the main program for part machining, and convert the pre-processing file of the main program into G-code of the NC program through post-processing; Obtain the current tool parameters and pass them to the encapsulated fixed loop program, which is used to call the parameterized preset tool verification block subroutine. Execute the NC program containing the fixed cycle program. When the NC program reaches the selective pause instruction, pause the machining process and perform an integrity check on the tool block.
[0006] Optionally, before the step of obtaining the main machining program for the part and converting the pre-processing file of the main machining program into G-code of the NC program through post-processing, the following steps are included: The origin of the programming coordinate system is configured as the center of the tool inspection block cylinder, and point Z0 is configured as the machine tool worktable.
[0007] Optionally, in the step of obtaining the current tool parameters and passing them to the encapsulated fixed loop program, wherein the fixed loop program is used to call the parameterized preset tool verification block subroutine, the method for compiling the tool verification block subroutine includes: Establish a knife inspection block model with the same structural dimensions as the knife inspection block, wherein the knife inspection block is a conical knife inspection block; Based on the tool parameters to be verified, design the tool path on different feature surfaces of the verification block. The tool parameters include at least the tool working length L, tool diameter D, tool bottom corner radius R, forming angle A of the forming chamfering tool, and bottom cutting edge length B. A tool verification block subroutine is developed based on macro-variable parameterized programming, and the tool verification block subroutine is encapsulated into a fixed loop program, which can receive the input tool parameter variables.
[0008] Optionally, the step of designing the tool path on different feature surfaces of the verification block based on the tool parameters to be verified includes: When verifying the working length L of the tool, the tool path is configured as a straight line along the bottom edge of the tool along the center of the top surface of the verification block; When verifying the tool diameter D, the tool path is configured as a complete circle around the cylindrical surface of the verification block by the side edge of the tool, and the tool advance and retract is performed in an arc manner; When verifying the bottom corner radius R of the tool, the tool path is configured as a complete circle around the middle plane of the inclined cone surface of the tool bottom edge, and the tool advance and retraction are performed in an arc manner; To verify the forming angle A of the chamfering tool, configure the tool path to be a full circle around the edge of the selected test block.
[0009] Optionally, the forming angle A of the verification forming chamfering tool configures the tool path as a complete circle around the edge of the selected verification block, including: When A ≥ 90°, the shuttle edge is configured as the top shuttle edge of the truncated cone surface; When A < 90°, the bobbin edge is configured as a cylindrical top bobbin edge where the cylindrical surface intersects the top surface.
[0010] Optionally, the tool verification block subroutine is embedded within the CNC system and set to write-protected mode.
[0011] Optionally, the execution of the CNC program containing the fixed cycle program, when the program reaches a selective pause instruction, pauses machining to perform an integrity check of the tool verification block, including: If the test block is not milled, the tool parameters are considered correct. If the test block is milled, the correctness of the tool parameters is determined based on the damage characteristics of the test block.
[0012] Optionally, the execution of the CNC program containing the fixed cycle program, when the program reaches a selective pause instruction, pauses machining to perform an integrity check of the tool verification block, including: If milling marks are found on the cylindrical surface of the test block, check the tool diameter parameters; If milling marks are found on the inclined conical surface of the test block, check the tool bottom angle radius parameter; If milling marks are found on the top surface of the tool test block, check the tool working length parameters; If milling marks are found on the edge of the test block, check the parameters of the forming chamfering tool.
[0013] Secondly, the CNC machining tool inspection system provided in this application adopts the following technical solution: A CNC machining tool inspection system, used to implement the aforementioned CNC machining tool inspection method, includes: The model building module is configured to obtain the structural dimensions of the inspection block and build an inspection block model that is consistent with the structural dimensions of the inspection block, wherein the inspection block is a conical inspection block; The program conversion module is configured to acquire the main program for part machining and convert the pre-file of the main program for machining into G code of the NC program through post-processing. The parameter processing and calling module is configured to acquire the current tool parameters and pass them to the encapsulated fixed loop program; the fixed loop program is used to call the parameterized preset tool verification block subroutine. The execution control module is configured to execute an NC program containing the fixed loop program, and when the NC program reaches a selective pause instruction, control the machining to pause for an integrity check of the tool block.
[0014] Thirdly, this application provides a computer-readable storage medium that adopts the following technical solution: A computer-readable storage medium storing a computer program that can be loaded by a processor and execute the method.
[0015] In summary, this application includes at least one of the following beneficial technical effects: The encapsulation of fixed-cycle programs and parameterized subroutines enables the automatic invocation and execution of tool parameters, avoiding errors from manual input and improving the repetitive accuracy of tool inspection operations. Encapsulating fixed-cycle programs standardizes the tool inspection process, reduces reliance on operator experience, lowers the risk of human intervention, and increases the degree of automation in machining.
[0016] This application designs the tool path based on the cone-shaped tool verification block structure and tool verification function designed by the enterprise, and develops a parameterized program based on the macro variables of the CNC system to realize the generalization of the CNC tool verification program, reduce the workload of programmers, and improve the tool verification efficiency. Attached Figure Description
[0017] Figure 1 This is a flowchart of a knife inspection method according to Embodiment 1 of this application; Figure 2 This is a schematic diagram of the structure of the tool inspection block in this application; Figure 3 This is a schematic diagram of the tool path used to verify the working length L of the tool in an embodiment of this application; Figure 4 This is a schematic diagram of the tool path used in this application embodiment to verify the tool diameter D; Figure 5 This is a schematic diagram of the tool path used in this application embodiment to verify the tool bottom angle R; Figure 6 This is a schematic diagram of the tool path used in this application embodiment to verify the chamfering forming tool angle A; Figure 7 This is a schematic diagram illustrating the application example and coordinate system setting of the CNC machining tool inspection block in this application embodiment; Figure 8 This is a structural block diagram of a CNC machining tool inspection system according to Embodiment 2 of this application. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0019] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indication will also change accordingly.
[0020] In this invention, unless otherwise explicitly specified and limited, the terms "connection," "fixed," etc., should be interpreted broadly. For example, "fixed" can mean a fixed connection, a detachable connection, or an integral part; it can mean a mechanical connection or an electrical connection; it can mean a direct connection or an indirect connection through an intermediate medium; it can mean the internal communication of two components or the interaction between two components, unless otherwise explicitly limited. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0021] Furthermore, if the embodiments of this invention involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the meaning of "and / or" throughout the text includes three parallel solutions; for example, "A and / or B" includes solution A, solution B, or a solution where both A and B are satisfied simultaneously. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.
[0022] Example 1 This application discloses a method for verifying the cutting tool in CNC machining.
[0023] Reference Figure 1 A method for inspecting tools used in CNC machining includes the following steps: S10. Obtain the structural dimensions of the inspection block and establish an inspection block model that is consistent with the structural dimensions of the inspection block, wherein the inspection block is a conical inspection block. See Figure 2 A tool inspection block is a commonly used tool in CNC machining, used to check the accuracy and integrity of the cutting tool. In this embodiment, the tool inspection block is a conical tool inspection block, including a top plane, a cylindrical side surface, and an inclined conical surface.
[0024] S20. Obtain the main program for part machining, and convert the pre-file of the main program for machining into G code of the NC program through post-processing; The NC program includes the main program for machining the part. An NC program generally consists of a series of standard instructions (G-codes, M-codes, etc.), each instruction controlling a specific action of the machine tool. G-codes are used to instruct the machine tool to perform specific movements or operation types.
[0025] S30. Obtain the current tool parameters and pass the current tool parameters to the encapsulated fixed loop program. The fixed loop program is used to call the parameterized preset tool verification block subroutine. S40. Execute the NC program containing the fixed cycle program. When the NC program reaches the selective pause instruction, pause the machining and perform an integrity check on the tool block.
[0026] In the above implementation, firstly, the structural dimensions of the tool inspection block are obtained, and a tool inspection block model with the same structural dimensions is established. Then, the main machining program for the part is obtained, and the pre-processing file of the main machining program is converted into G-code for the NC program through post-processing. Next, the current tool parameters are obtained and passed to an encapsulated fixed-loop program, which calls a parameterized preset tool inspection block subroutine. Finally, the NC program containing the fixed-loop program is executed. When the NC program reaches a selective pause instruction, machining is paused to perform an integrity check of the tool inspection block. By using a "fixed-loop calling parameterized subroutine" model, the tool inspection process is automated. This reduces the operator's mental stress and workload, and also reduces reliance on operator skill. Traditional manual trial cutting or tool setting instrument measurements require multiple manual operations and machine tool idle runs. This method integrates the verification of multiple parameters into an automatically executed fixed-loop program. The operator only needs to call one line of G-code and input the parameters to complete the inspection of all items to be checked, greatly simplifying the operation steps.
[0027] The steps of the CNC machining tool inspection method will be explained in detail below: In step S10, in one embodiment, the dimensions of the tool inspection block structure can be obtained by inputting through a parameterized configuration interface or by calling the central tool library / database.
[0028] The parameterized configuration interface input method involves developing a parameter input form within the CAM software or a dedicated tool verification module. This form contains all the key dimensional fields required to define the conical tool verification block, such as: base diameter, top diameter, truncated cone height, and chamfer radius. Specifically, the operator enters values in the corresponding input boxes based on the drawings or measured data of the actual tool verification block. The system captures these input values through event listeners, such as when the "OK" or "Apply" button is clicked.
[0029] The central tool library / database is accessed through the following method: A unique identifier is created for each standard tool inspection block in the central tool management database. Under this identifier, all its structural dimensions are stored. Specifically, the operator in the CAM software simply selects or enters the identifier for the tool inspection block from a drop-down list, such as "Cone_Gauge_01". The system automatically queries and retrieves the corresponding dimensional data through internal interfaces such as APIs or database connections such as ODBC / JDBC.
[0030] In one embodiment, a tool inspection block model with the same structural dimensions as the tool inspection block is established. Specifically, using the acquired dimensional data as driving parameters, a preset, parameterized modeling script or program template is executed to automatically create a 3D model. The generated 3D model of the tool inspection block exists as a virtual workpiece in the current session of the CAM software. It is visible in the graphics window and added to the software's model tree.
[0031] The above method quickly and accurately converts the physical tool inspection block into a digital twin model, eliminating the errors and time consumption of manual modeling. Furthermore, it ensures that the digital model and the physical tool inspection block are completely identical in size, laying a reliable foundation for subsequent accurate tool inspection.
[0032] See Figure 3 Step S20: Obtain the main program for part machining, and convert the pre-processing file of the main program for machining into G code of the NC program through post-processing.
[0033] In one embodiment, before the step of converting the pre-processing file of the main machining program into G-code of the NC program through post-processing to obtain the main machining program for the part, the origin of the programming coordinate system is configured as the center of the tool inspection block cylinder, and the Z0 point is configured as the machine tool worktable.
[0034] By setting the origin of the programming coordinate system to the center of the tool verification block cylinder, the precise relative position of the tool and the tool verification block during machining is ensured. This allows the entire machining program to operate accurately around the tool verification block, avoiding positioning errors caused by asymmetry or improper configuration of the coordinate system origin. Setting point Z0 as the machine tool table surface ensures that all Z-axis movements during machining are based on the actual machine tool table surface. This avoids deviations caused by inconsistencies between the machine tool coordinate system and the program coordinate system, thereby improving machining accuracy.
[0035] In one implementation, the steps of obtaining the main program for part machining include: obtaining the pre-processing file of the main program for part machining; parsing the pre-processing file of the main program for machining; and identifying and mapping tool verification instructions.
[0036] The main machining program for a part refers to the "pre-processing file" generated by CAM (Computer-Aided Manufacturing) software. The pre-processing file contains geometric information describing the tool's motion trajectory, tool information such as tool number, diameter, and corner radius, process parameters such as feed rate F and spindle speed S, and auxiliary function instructions. In this embodiment, post-processing is the process of automatically executing a computer post-processor to "translate" the pre-processing file into the target NC program.
[0037] In this embodiment, the main program for part machining is shown in the table below:
[0038] Step S30: Obtain the current tool parameters and pass them to the encapsulated fixed loop program. The fixed loop program is used to call the parameterized preset tool verification block subroutine.
[0039] In one embodiment, the current tool parameters can be obtained by reading parameters from the tool management system or the tool compensation table. First, the tool compensation table within the machine tool control system is accessed. Then, the corresponding tool compensation information is read according to the current tool number (T number), and the read compensation value is converted into a tool parameter variable. The control system can be a FANUC CNC system, a Sinumerik CNC system, or a HEIDENHAIN CNC system. The parameter code for the FANUC CNC system is "#", the parameter code for the Sinumerik CNC system is "R", and the parameter code for the HEIDENHAIN CNC system is "Q". If the enterprise's CNC machine tool is a Sinumerik CNC system, "#" can be replaced with "R" to complete the tool verification block subroutine programming for the Sinumerik CNC system. Similarly, the HEIDENHAIN CNC system can be modified accordingly.
[0040] In another embodiment, the current tool parameters can be obtained and transmitted in real time during program execution. The tool parameter reading subroutine is called in the main program, and then the read parameters are passed to the fixed loop program.
[0041] The method for developing the tool verification block subroutine includes: Establish a knife inspection block model with the same structural dimensions as the knife inspection block, wherein the knife inspection block is a conical knife inspection block; See Figures 4-7 Based on the tool parameters to be verified, design the tool path on different feature surfaces of the test block. The tool parameters include at least the tool working length L, tool diameter D, tool bottom corner radius R, forming angle A of the forming chamfering tool, and bottom cutting edge length B. A tool verification block subroutine is developed based on macro-variable parameterized programming, and the tool verification block subroutine is encapsulated into a fixed loop program, which can receive the input tool parameter variables.
[0042] Furthermore, the tool verification block subroutine is embedded within the CNC system and set to write-protected mode.
[0043] In this embodiment, by calling a fixed subroutine, it is ensured that the tool verification trajectory is completely consistent on any machine tool, provided the same tool parameters are input, thus guaranteeing the reliability and comparability of the results. This transforms a complex and professional tool verification task into a simple, reliable, and repeatable standardized operating procedure. It achieves universalization of CNC tool verification, reducing the workload of programmers.
[0044] In this embodiment, the tool path designed according to the tool verification function sequentially verifies the correctness of the milling cutter's working length L, diameter D, bottom angle R, and the forming angle A of the chamfering tool. By first confirming the most basic safety parameter (length L), then performing side cutting (diameter D), followed by the more precise bottom forming surface cutting (bottom angle R), and finally the most complex forming contour cutting (angle A), each step serves as a safety prerequisite for the next, systematically eliminating risks and improving the convenience and efficiency of tool verification.
[0045] In this embodiment, to facilitate the efficient use of the CNC general program, i.e., the tool verification subroutine, a method based on CNC system parameterized calling is used to encapsulate the tool verification subroutine into a fixed loop program "G65 P998D**. R** A** B**". The tool verification subroutine is embedded in the CNC system and write-protected, preventing the operator from modifying it. In the fixed loop program, P998 is the subroutine with program number 998, D represents the tool diameter (corresponding to macro program #7), R represents the tool bottom angle (corresponding to macro program #18), A represents the cutting edge angle of the chamfering milling cutter (corresponding to macro program #1), and B represents the cutting bottom edge length of the chamfering milling cutter (corresponding to macro program #2). Specifically, if the tool is an end mill with a diameter of 20mm and a bottom angle of R3, the fixed program sequence is "G65 P998 D20. R3. A0. B0."; if the tool is a chamfering end mill with a diameter of 20mm, a cutting edge angle of 120 degrees, and a bottom cutting edge length of 2mm, the fixed program sequence is "G65P998 D20. R0 A120. B2.".
[0046] In this embodiment, the general procedure for verifying machining tools based on the FANUC CNC system is shown in the table below:
[0047] Optionally, the step of designing the tool path on different feature surfaces of the verification block based on the tool parameters to be verified includes: See Figure 4 When verifying the working length L of the cutting tool, the tool path is configured as a straight line along the center of the top surface of the test block. Errors in the working length L are directly reflected on the flattest and most visible top surface of the test block. If L is set too large (i.e., the tool is mounted too long), the tool tip will immediately leave a clear straight mark on the top surface, making the result immediately apparent without the need for any precision instruments. This eliminates interference from the tool's side edge and radius compensation on the verification results, ensuring that any damage is only related to the length parameter L; the path is centered, avoiding the risk of the tool colliding with the side wall of the test block.
[0048] See Figure 5 When verifying the tool diameter D, the tool path is configured such that the tool side edge circles a complete circle around the cylindrical surface of the verification block, and the tool approaches and retracts in an arc manner. Simulating real cutting conditions, by having the tool side edge cut a complete circle around the cylindrical surface, the cutting state of the tool on the entire 360° circumference can be checked, verifying the theoretical tool diameter D and comprehensively verifying the correctness of the tool radius compensation value input into the machine tool CNC system. In this implementation, the use of an arc-like approach for tool approach and retraction achieves a smooth transition of the path, ensuring that any cutting marks appearing on the cylindrical surface are uniquely attributed to an excessively large tool diameter or radius compensation setting. In contrast, related technologies use straight-line approach and retraction with direct entry / exit, leaving obvious tool marks at the entry and retraction points. These tool marks are difficult to distinguish from overcutting marks caused by diameter errors, easily leading to misjudgment.
[0049] See Figure 6 When verifying the tool's bottom corner radius R, the tool path is configured as a complete circle around the middle plane of the inclined cone surface of the verification block, with the tool's bottom edge moving in and out in an arc motion. If R is set too large, the arc of the tool's bottom edge will cut into the interior of the inclined cone surface, resulting in overcutting and leaving a complete circular groove on the inclined cone surface. If R is set too small, there will be a gap between the arc of the tool's bottom edge and the inclined cone surface, and no chips will be generated. Therefore, this method has extremely high sensitivity to errors caused by excessively large R values, and can effectively avoid quality defects such as "undercutting" or unclear corner clearing on the part due to an excessively large bottom corner radius.
[0050] See Figure 7 To verify the forming angle A of the chamfering tool, the tool path is configured as a complete circle around the edge of the selected test block.
[0051] Optionally, the forming angle A of the verification forming chamfering tool configures the tool path as a complete circle around the edge of the selected verification block, including: When A ≥ 90°, the shuttle edge is configured as the top shuttle edge of the truncated cone surface; When A < 90°, the bobbin edge is configured as a cylindrical top bobbin edge where the cylindrical surface intersects the top surface.
[0052] By selecting different edges, using the top of a truncated cone for A≥90° and the top of a cylinder for A<90°, this solution cleverly covers the two most common chamfering application scenarios of boss chamfering and countersunk hole chamfering with a single tool block, effectively improving versatility.
[0053] Step S40, executing the CNC program containing the fixed cycle program, pausing machining when the program reaches the selective pause instruction, and performing an integrity check of the tool check block, includes: If the test block is not milled, the tool parameters are considered correct. If the test block is milled, the correctness of the tool parameters is determined based on the damage characteristics of the test block.
[0054] In one embodiment, determining the correctness of tool parameters based on the damage characteristics of the tool inspection block includes: If milling marks are found on the cylindrical surface of the test block, check the tool diameter parameters; If milling marks are found on the inclined conical surface of the test block, check the tool bottom angle radius parameter; If milling marks are found on the top surface of the tool test block, check the tool working length parameters; If milling marks are found on the edge of the test block, check the parameters of the forming chamfering tool.
[0055] Specific pause commands (selective pause) are set in the CNC program so that when machining reaches a predetermined step, the program automatically pauses machining and performs subsequent tool parameter checks. After the pause, the tool inspection block is inspected using a vision or sensor system to determine if it is damaged.
[0056] In one specific embodiment, during the machining of the first part, the selective pause button M01 on the machine tool operation panel is activated. The machine tool pauses after the program executes the M01 instruction. The operator opens the machine door to check the integrity of the tool inspection block. If the tool inspection block is intact, the program continues machining the part. If the tool inspection block is milled, the tool diameter D, tool working length L, tool base angle R, and the use of the chamfering tool are checked based on the milled area. During batch machining, after the first part passes inspection, the selective pause button M01 on the machine tool operation panel is deactivated, and the parts are machined normally without further tool verification.
[0057] In one embodiment, a subroutine, such as P9000, is embedded in the CNC program to perform a tool inspection block check. The subroutine, while paused, inspects the tool inspection block using sensors or a vision system to determine if it is damaged. If the tool inspection block is damaged, the corresponding tool parameters are verified based on the damage characteristics. Then, high-precision sensors (such as touch sensors or laser rangefinders) or a vision system (such as an industrial camera) are used for real-time detection of the tool inspection block to determine the type and location of the damage. These sensors are connected to the CNC system to ensure accurate data transmission and real-time feedback. If a problem is detected with the tool, the CNC system will alert the operator via a display screen or alarm device to perform further inspection or adjustment. For example, the operator can view the specific damage location on the display and adjust or replace the tool based on the feedback.
[0058] This technical solution effectively addresses the problem of tool parameter verification by using selective pause commands in the CNC program and integrity checks with a tool verification block. By judging the correctness of tool parameters based on the damage characteristics of the tool verification block, potential tool problems can be identified in a timely manner, and corresponding adjustments can be made.
[0059] Example 2 This application also discloses a CNC machining tool inspection system.
[0060] See Figure 8 A CNC machining tool inspection system, used to implement the aforementioned CNC machining tool inspection method, comprising: The model building module is configured to obtain the structural dimensions of the inspection block and build an inspection block model that is consistent with the structural dimensions of the inspection block, wherein the inspection block is a conical inspection block; In this embodiment, the tool testing block is a conical tool testing block, meaning that the tool testing block has a conical geometry and multiple machining surfaces and angles, which can effectively test multiple parameters of the tool. The model building module can obtain the geometric dimensions of the tool testing block through computer-aided design (CAD) software or the built-in functions of the CNC system, and build a virtual model with the same dimensions.
[0061] The program conversion module is configured to acquire the main program for part machining and convert the pre-file of the main program for machining into G code of the NC program through post-processing. Specifically, this module is responsible for obtaining machining data from the main part machining program, converting the pre-processed files into standard NC programs (numerical control programs) through post-processing, and generating corresponding G-code. The program conversion module can use common post-processing tools (such as Post Processor) to automatically convert the cutting path information of the CAD model into G-code and insert selective pause instructions at key nodes.
[0062] The parameter processing and calling module is configured to acquire the current tool parameters and pass them to the encapsulated fixed loop program; the fixed loop program is used to call the parameterized preset tool verification block subroutine. Specifically, a fixed-cycle program is a pre-defined machining program that dynamically calls parameterized subroutines to perform tool check block inspections based on different tool parameters. By using the encapsulated fixed-cycle program, the system can select the appropriate tool check block subroutine according to the actual situation and automatically verify the tool parameters during machining.
[0063] The execution control module is configured to execute an NC program containing the fixed loop program, and when the NC program reaches a selective pause instruction, control the machining to pause for an integrity check of the tool block.
[0064] Specifically, when a selective pause command is invoked during machining, the execution control module pauses the machining process and transfers control to the subsequent tool inspection step. During the pause, the integrity of the tool inspection block is checked using a vision system, tactile sensors, and other means, and the working status of the tool is determined. After the inspection is completed, the execution control module decides whether to resume machining, or to adjust or replace the tool, based on the inspection results, to ensure that machining quality is not affected. The execution control module can achieve precise control of the machining process by integrating the servo system and main control unit in the CNC system. The pause command can be triggered by specific G-codes (such as M0 or M1), while the resume command can be implemented using codes such as M2 and M30.
[0065] Example 3 This application also discloses a computer-readable storage medium storing a computer program that can be loaded by a processor and execute the method.
[0066] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a device including one or any combination of the above-mentioned memories. The computer may be a variety of computing devices, including smart terminals and servers.
[0067] In the above embodiments of this disclosure, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0068] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0069] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0070] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0071] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable non-volatile storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a non-volatile storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned non-volatile storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0072] The above are all preferred embodiments of this application, and are not intended to limit the scope of protection of this application. Therefore, all equivalent changes made in accordance with the structure, shape and principle of this application should be covered within the scope of protection of this application.
Claims
1. A method for inspecting tools used in CNC machining, characterized in that, Includes the following steps: Obtain the structural dimensions of the inspection block and establish an inspection block model that matches the structural dimensions of the inspection block, wherein the inspection block is a conical inspection block; Obtain the main program for part machining, and convert the pre-processing file of the main program into G-code of the NC program through post-processing; Obtain the current tool parameters and pass them to the encapsulated fixed loop program, which is used to call the parameterized preset tool verification block subroutine. Execute the NC program containing the fixed cycle program. When the NC program reaches the selective pause instruction, pause the machining process and perform an integrity check on the tool block.
2. The CNC machining tool inspection method according to claim 1, characterized in that, Before the step of obtaining the main machining program for the part and converting the pre-processing file of the main machining program into G-code of the NC program through post-processing, the following steps are included: The origin of the programming coordinate system is configured as the center of the tool inspection block cylinder, and point Z0 is configured as the machine tool worktable.
3. The CNC machining tool inspection method according to claim 1, characterized in that, In the step of obtaining the current tool parameters and passing them to the encapsulated fixed loop program, where the fixed loop program is used to call the parameterized preset tool verification block subroutine, the method for compiling the tool verification block subroutine includes: Establish a knife inspection block model with the same structural dimensions as the knife inspection block, wherein the knife inspection block is a conical knife inspection block; Based on the tool parameters to be verified, design the tool path on different feature surfaces of the verification block. The tool parameters include at least the tool working length L, tool diameter D, tool bottom corner radius R, forming angle A of the forming chamfering tool, and bottom cutting edge length B. A tool verification block subroutine is developed based on macro-variable parameterized programming, and the tool verification block subroutine is encapsulated into a fixed loop program, which can receive the input tool parameter variables.
4. The CNC machining tool inspection method according to claim 3, characterized in that, The step of designing tool trajectories on different feature surfaces of the verification block based on the tool parameters to be verified includes: When verifying the working length L of the tool, the tool path is configured as a straight line along the bottom edge of the tool along the center of the top surface of the verification block; When verifying the tool diameter D, the tool path is configured as a complete circle around the cylindrical surface of the verification block by the side edge of the tool, and the tool advance and retract is performed in an arc manner; When verifying the bottom corner radius R of the tool, the tool path is configured as a complete circle around the middle plane of the inclined cone surface of the tool bottom edge, and the tool advance and retraction are performed in an arc manner; To verify the forming angle A of the chamfering tool, configure the tool path to be a full circle around the edge of the selected test block.
5. The CNC machining tool inspection method according to claim 4, characterized in that, The forming angle A of the verification forming chamfering tool configures the tool path as a complete circle around the edge of the selected verification block, including: When A ≥ 90°, the shuttle edge is configured as the top shuttle edge of the truncated cone surface; When A < 90°, the bobbin edge is configured as a cylindrical top bobbin edge where the cylindrical surface intersects the top surface.
6. The CNC machining tool inspection method according to claim 3, characterized in that, The tool verification block subroutine is embedded within the CNC system and set to write-protected mode.
7. The CNC machining tool inspection method according to claim 1, characterized in that, The execution of the CNC program containing the fixed cycle program pauses machining when the program reaches a selective pause instruction, and performs an integrity check of the tool verification block, including: If the test block is not milled, the tool parameters are considered correct. If the test block is milled, the correctness of the tool parameters is determined based on the damage characteristics of the test block.
8. The CNC machining tool inspection method according to claim 7, characterized in that, The execution of the CNC program containing the fixed cycle program pauses machining when the program reaches a selective pause instruction, and performs an integrity check of the tool verification block, including: If milling marks are found on the cylindrical surface of the test block, check the tool diameter parameters; If milling marks are found on the inclined conical surface of the test block, check the tool bottom angle radius parameter; If milling marks are found on the top surface of the test block, check the working length parameters of the tool. If milling marks are found on the edge of the test block, check the parameters of the chamfering tool.
9. A CNC machining tool inspection system, used to implement the CNC machining tool inspection method as described in claim 1, characterized in that, include: The model building module is configured to obtain the structural dimensions of the inspection block and build an inspection block model that is consistent with the structural dimensions of the inspection block, wherein the inspection block is a conical inspection block; The program conversion module is configured to acquire the main program for part machining and convert the pre-file of the main program for machining into G code of the NC program through post-processing. The parameter processing and calling module is configured to acquire the current tool parameters and pass them to the encapsulated fixed loop program; the fixed loop program is used to call the parameterized preset tool verification block subroutine. The execution control module is configured to execute an NC program containing the fixed loop program, and when the NC program reaches a selective pause instruction, control the machining to pause for an integrity check of the tool block.
10. A computer-readable storage medium, characterized in that, The computer program is stored that can be loaded by a processor and execute the method of any one of claims 1-8.