On-machine measurement data edge-end interactive calculation method based on numerical control system macro variable

By implementing data edge-end interactive computing between the CNC system and the edge computing controller, the problems of weak computing power and small storage space in the CNC system in machine measurement technology are solved, and efficient and accurate on-machine measurement data processing and feedback are achieved.

CN119511946APending Publication Date: 2025-02-25SHAANXI WANGAO HANGYU INTELLIGENT MANUFACTURING TECHNOLOGY CO LTD

Patent Information

Application Number
CN202411581829.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

In the application of existing CNC systems in machine measurement technology, due to problems such as weak computing power, small storage space and few available macro variable addresses, it is difficult to deeply analyze the measurement results in the machine, which limits the development of the intelligent manufacturing industry.

Method used

The edge-end interactive calculation method of in-machine measurement data based on macro variables of CNC system is adopted, and multiple interactive protocols of the CNC system and the edge computing controller are interoperated to realize the acquisition, processing and storage of in-machine measurement data. The edge computing controller is used to perform complex calculations, reducing the burden on the CNC system.

Benefits of technology

It realizes accurate real-time calculation and feedback of on-machine measurement data, improves calculation efficiency and accuracy, saves the storage space of the CNC system, reduces the occupancy of user macro variables, and reduces the complexity of NC subroutine required for post-processing of on-machine measurement results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119511946A_ABST
    Figure CN119511946A_ABST
Patent Text Reader

Abstract

The invention discloses a numerical control system macro variable-based on-machine measurement data edge-end interactive calculation method, which comprises a numerical control system and an edge calculation controller, the numerical control system and the edge calculation controller carry out interoperation through a plurality of interactive protocols, and the interoperation comprises on-machine measurement data acquisition, processing and storage. The data interaction protocol of the numerical control system and the edge calculation controller comprises a heartbeat control bit, an input information storage bit, a calculation function flag bit, a circulation flag bit, a machine tool time recording bit, an operation time recording bit, a calculation result display bit and a return value flag bit. The flag bits of the interaction protocol respectively correspond to single numerical control system macro variable address numbers; on-machine measurement data edge-end accurate real-time interaction is achieved based on the numerical control system macro variables, the calculation efficiency is high, the occupied storage space and variable addresses of the numerical control system are small, and certain universality and flexibility are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of precision measurement technology, and in particular relates to an edge-to-end interactive calculation method for on-machine measurement data based on macro variables of a numerical control system. Background Art

[0002] As the core equipment of modern manufacturing industry, CNC machine tools are known as "industrial mother machines" and are an important symbol of the level of national manufacturing industry. With the rapid rise of intelligent manufacturing technology, in-machine measurement technology is used to detect the shape, position, size and tolerance of workpieces during processing. According to the in-machine measurement and detection results, the processing technology is improved in real time to improve the processing accuracy and production efficiency of parts. However, affected by the weak computing power, small storage space and few available macro variable addresses of CNC systems, most studies use in-machine measurement as a tool to obtain the coordinate value of a certain point. It is difficult to deeply analyze the in-machine measurement results to adjust the processing technology, resulting in less application of in-machine measurement technology in actual processing, which restricts the rapid development of the intelligent manufacturing industry. Edge computing technology based on digital twins can effectively solve the above problems, but the application of edge computing technology in CNC systems is mainly based on the collection of fixed information such as machine tool coordinate data, spindle speed, number of processed parts and spindle speed. Data edge-end interactive calculation methods based on macro variables have not yet been developed.

[0003] Chinese invention patent CN111804932A discloses a method for turning tensile specimens with different tool path profiles using macro programs. This solution quantifies the processing parameters of tensile specimens based on the macro variables of the CNC system, and proposes a method for processing tensile specimens of different sizes with a single macro program, which improves the processing efficiency and machine tool response speed, but is difficult to apply to the design of complex structural parts processing programs. Chinese invention patent CN111300144B discloses an automatic detection method for tool wear status based on image processing. This solution analyzes the tool wear status by arranging image acquisition equipment near the machine tool to obtain pictures of the tool after cutting, and transmits the prediction results to the macro variables of the CNC system through the TCP / IP protocol to realize self-detection of tool wear status. This method has not yet realized adaptive processing in the acquisition and detection of tool wear pictures. Chinese invention patent CN115034504B discloses a tool wear state prediction system and method based on cloud-edge collaborative training. This solution collects and pre-processes the sensor data of the tool through the edge platform, and the cloud platform completes the training of large-scale prediction models to predict the tool wear state in real time and stably. This method is mainly based on the construction of the tool wear prediction model, and does not involve the interactive calculation method between the CNC system and the edge computing controller.

[0004] Therefore, it is urgent to develop an edge-to-end interactive calculation method for on-machine measurement data based on CNC system macro variables, and migrate the post-processing of on-machine measurement results from the CNC system to the edge computing controller to solve the problems of weak computing power, small storage space and few available macro variable addresses of the CNC system, so as to realize accurate real-time calculation and feedback of on-machine measurement data edge-to-end interaction. Summary of the invention

[0005] In response to the problems raised by the above background technology, the purpose of the present invention is to provide an edge-to-end interactive calculation method of on-machine measurement data based on CNC system macro variables, so as to realize real-time and accurate interoperation of CNC system and edge computing controller data.

[0006] In order to achieve the above technical objectives, the technical solution adopted by the present invention is as follows:

[0007] A method for edge-to-end interactive calculation of on-machine measurement data based on numerical control system macro variables, comprising a numerical control system and an edge computing controller, wherein the numerical control system and the edge computing controller interoperate through a plurality of interactive protocols, wherein the interoperation includes on-machine measurement data acquisition, processing and storage, wherein the interactive protocol of the numerical control system and the edge computing controller data comprises a heartbeat control bit, an input information storage bit, a calculation function flag bit, a cycle flag bit, a machine tool time recording bit, a calculation time recording bit, a calculation result display bit and a return value flag bit, wherein the flag bits of the interactive protocol respectively correspond to a single numerical control system macro variable address number; the data processing module embedded in the edge computing controller comprises a coordinate system management module, a feature information storage module and a geometric tolerance calculation module;

[0008] The following steps are also included:

[0009] Step 1: Establish communication between the edge computing controller and the CNC system according to the communication protocol;

[0010] Step 2: Set the feature information of the model to be measured and design the corresponding on-machine measurement NC program. The single measurement results are saved to a specific macro variable address number as the variable required for the edge computing controller operation. The feature information is the shape, position, size and tolerance information of the model.

[0011] Step 3: Design an NC subroutine based on the data interaction protocol to transfer the single on-machine measurement information to the calculation function flag bit and input information storage bit:

[0012] Step 4: The edge computing controller sends an instruction to the numerical control system to read the computing function flag information, selects the corresponding data processing module according to the computing function flag, obtains the macro variable address information corresponding to the input information storage bit for calculation;

[0013] Step 5: After the calculation is completed, the result is written back to the CNC system. The calculation result is displayed at the macro variable address corresponding to the bit and stored in the edge computing controller.

[0014] It is further limited to also include hardware equipment and soft data, the hardware equipment is a numerical control system, an edge computing controller and a twisted pair cable, and the soft data is the communication protocol of the numerical control system, the macro variable address, the data processing module in the edge computing controller, the data parsing method, and the interaction protocol between the numerical control system and the edge computing controller.

[0015] It is further defined that the heartbeat control bit is a check bit used to ensure normal communication between the numerical control system and the edge computing controller, and the edge computing controller cyclically sends a "0" or "1" keep-alive signal to the heartbeat flag bit of the numerical control system at a frequency of 1s / time;

[0016] The input information storage bit is a storage bit for on-machine measurement result data and detection information. When the NC subroutine is run, the variable on-machine measurement results and detection information are transferred to the input information storage bit according to the specified order and are called by the edge computing controller.

[0017] It is further defined that the computing function flag is a flag for the edge computing controller to select a computing module, and the edge control calculator selects a corresponding computing module according to specific information of the computing function flag.

[0018] It is further defined that the loop flag is the core of controlling the interoperability between the numerical control system and the edge computing controller, and the operation time record is the difference between the current time of the machine tool and the machine tool time record.

[0019] It is further defined that the calculation result display bit is a macro variable address of the calculation result of the visualized edge computing controller, and the return value flag bit is a flag bit for determining whether the edge computing result is returned successfully.

[0020] It is further defined that the calculation result analysis and storage method includes the functions of data classification, correspondence between data and feature names, and storage file output. After the execution of a single NC main program of the numerical control system is completed, the edge computing controller creates a new data storage file in XML format in the "C:\Measure Data" path, and the file is named with "date-hour-minute-second" when the calculation is completed.

[0021] It is further defined that after executing the NC subroutine described in step three, the loop flag is set to "1", the edge computing controller executes the calculation function, and the NC subroutine loop executes the "G04" program delay 10ms instruction and the edge computing controller calculation time monitoring instruction; if the edge computing controller calculates successfully, the loop flag is set to "0", the loop instruction is actively ended, the NC subroutine is jumped out, and the NC main program continues to execute; if the edge computing controller fails to calculate due to a data format error, the loop flag is set to "2", the loop instruction is forcibly ended, and an alarm or prompt instruction is executed, and the specific information is "Element not cleared or definition failed"; if the operation time record is greater than 120s, it means that the edge computing controller connection is interrupted or abnormal, the loop instruction is forcibly ended, and an alarm or prompt instruction is executed, and the specific information is "Edge Server connection interrupted".

[0022] It is further defined that if the calculation result is returned successfully, the edge computing controller sets the return value flag to "0" and continues to execute the NC main program; if the calculation result is returned unsuccessfully, the edge computing controller sets the return value flag to "1", forces the program to be paused, and executes an alarm or prompt instruction, with the message "Feature CalculateFailed".

[0023] It is further defined that the edge computing controller in step four sends an instruction to the numerical control system to read the computing function flag information at a frequency of 3 ms / time, and the calculation result in step five is stored in the xml file of the edge computing controller.

[0024] Beneficial effects of the present invention:

[0025] The present invention describes an edge-to-end interactive calculation method for on-machine measurement data based on CNC system macro variables. By designing a data interaction protocol in which the user macro variable address of the CNC system is an edge-to-end interactive calculation flag, the on-machine measurement results are assigned to the corresponding calculation flags, and the CNC system calculation flag information is read and written by the edge computing controller. Based on the interaction protocol and interoperability logic, accurate real-time calculation and feedback of on-machine measurement data edge-to-end interaction are achieved.

[0026] Furthermore, the present invention comprehensively considers the computing power, storage space and number of user macro variables of the CNC system, and designs variable on-machine measurement NC instructions that comply with the interactive protocol and ensure real-time and precise edge-to-end interaction. The geometric element fitting and shape and position dimension calculation based on the on-machine measurement results are migrated from the CNC system to the edge computing controller, thereby realizing the collection, processing and storage of on-machine measurement data, improving the calculation efficiency and accuracy of on-machine measurement data, saving the storage space of the CNC system, reducing the occupancy rate of user macro variables, and reducing the complexity of the NC subroutines required for post-processing of on-machine measurement results. The on-machine measurement data edge-to-end interactive calculation method based on macro variables has certain versatility and flexibility. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The present invention can be further illustrated by the non-limiting examples given in the accompanying drawings;

[0028] Figure 1 It is a basic principle diagram of an embodiment of an edge-end interactive calculation method for on-machine measurement data based on macro variables of a numerical control system of the present invention;

[0029] Figure 2 It is an execution flow chart of an embodiment of an edge-end interactive calculation method for on-machine measurement data based on macro variables of a numerical control system of the present invention;

[0030] Figure 3 A detailed logic diagram of the interaction between the numerical control system and the edge computing controller of an embodiment of an on-machine measurement data edge-end interactive computing method based on a numerical control system macro variable of the present invention;

[0031] Figure 4 A Fanuc numerical control system NC program diagram of an embodiment of an edge-end interactive calculation method for on-machine measurement data based on numerical control system macro variables of the present invention;

[0032] Figure 5 It is a diagram showing the operation of an edge-end computing controller according to an embodiment of an edge-end interactive computing method for on-machine measurement data based on macro variables of a numerical control system of the present invention;

[0033] Figure 6 A diagram showing calculation results of a Fanuc numerical control system operation according to an embodiment of an edge-end interactive calculation method for on-machine measurement data based on a numerical control system macro variable of the present invention;

[0034] Figure 7 This is an edge computing controller result storage diagram of an embodiment of an edge-to-end interactive computing method for on-machine measurement data based on macro variables of a numerical control system in the present invention. DETAILED DESCRIPTION

[0035] In order to enable those skilled in the art to better understand the present invention, the technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments. The technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present invention.

[0036] In addition, the descriptions of "first", "second", etc. in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on the ability of ordinary technicians in the field to implement. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0037] like Figure 1-Figure 3 As shown, an edge-to-end interactive calculation method for on-machine measurement data based on numerical control system macro variables of the present invention includes a numerical control system and an edge computing controller, the numerical control system and the edge computing controller interoperate through multiple interactive protocols, the interoperation includes on-machine measurement data acquisition, processing and storage, the interactive protocol of the numerical control system and the edge computing controller data includes a heartbeat control bit, an input information storage bit, a calculation function flag bit, a cycle flag bit, a machine tool time recording bit, an operation time recording bit, a calculation result display bit and a return value flag bit, and the flag bits of the interactive protocol respectively correspond to a single numerical control system macro variable address number; the data processing module embedded in the edge computing controller includes a coordinate system management module, a feature information storage module and a form and position tolerance calculation module;

[0038] The following steps are also included:

[0039] Step 1: Establish communication between the edge computing controller and the CNC system according to the communication protocol;

[0040] Step 2: Set the feature information of the model to be measured and design the corresponding on-machine measurement NC program (numerical control program). The single measurement results are saved to a specific macro variable address number as the variable required for the edge computing controller operation. The feature information is the shape, position, size and tolerance information of the model.

[0041] Step 3: Design an NC subroutine based on the data interaction protocol to transfer the single on-machine measurement information to the calculation function flag bit and input information storage bit:

[0042] Step 4: The edge computing controller sends an instruction to the numerical control system to read the computing function flag information at a frequency of 3 ms / time, selects the corresponding data processing module according to the computing function flag, obtains the macro variable address information corresponding to the input information storage bit for calculation;

[0043] Step 5: After the calculation is completed, the result is written back to the CNC system. The calculation result is displayed at the corresponding macro variable address and stored in the XML file of the edge computing controller.

[0044] Preferably, it also includes hardware equipment and software data, the hardware equipment is a numerical control system, an edge computing controller and a twisted pair (IP network cable), and the soft data is the communication protocol of the numerical control system, the macro variable address, the data processing module in the edge computing controller, the data parsing method, and the interaction protocol between the numerical control system and the edge computing controller. It aims to use the edge control calculator to solve the problems of poor computing power of the numerical control system, high complexity of the NC subroutines and large number of occupied macro variable addresses, so as to achieve real-time, accurate and efficient processing of on-machine measurement data, and feed back the calculation results to the numerical control system, laying the foundation for the planning and implementation of intelligent processes.

[0045] The specific functional information of the interaction protocol between the CNC system and the edge computing controller is as follows:

[0046] (1) The heartbeat control bit is a check bit used to ensure normal communication between the CNC system and the edge computing controller. The edge computing controller cyclically sends a "0" or "1" keep-alive signal to the heartbeat flag bit of the CNC system at a frequency of 1s / time; by observing the variable address information, it can be ensured that the CNC system and the edge computing controller communicate normally.

[0047] (2) The input information storage bit is the storage bit for the on-machine measurement result data and detection information. When the NC subroutine is running, the variable on-machine measurement results and detection information are transferred to the input information storage bit according to the specified order and are called by the edge computing controller.

[0048] (3) The computing function flag is a flag used by the edge computing controller to select a computing module. The edge computing controller selects a corresponding computing module based on the specific information of the computing function flag.

[0049] (4) The loop flag is the core of controlling the interoperability between the CNC system and the edge computing controller. By judging the specific information of the loop flag, the state of the CNC system / edge computing controller (the executed program) is changed to complete the accurate data transmission in the shortest time.

[0050] The specific processing logic of the loop flag is as follows: ① After executing the NC subroutine, the loop flag is set to "1", the edge computing controller performs the calculation function, and the NC subroutine loop executes the "G04" delay 10ms instruction and the edge computing controller calculation time monitoring instruction. ② If the edge computing controller calculates successfully, the loop flag is set to "0", the loop instruction is actively ended, the NC subroutine is jumped out, and the NC main program is continued. ③ If the edge computing controller fails to calculate due to a data format error, the loop flag is set to "2", the loop instruction is forced to end, and the alarm or prompt instruction is executed, and the information is "Element not cleared or definition failed".

[0051] (5) The operation time record bit is the difference between the current time of the machine tool and the machine tool time record bit. The edge computing controller status is judged based on the operation time record bit. If the operation time record bit is greater than 120s, it means that the edge computing controller connection is interrupted or abnormal, and the loop instruction is forced to end, and the alarm or prompt instruction is executed. The specific information is "EdgeServerconnection interrupted" to improve data processing efficiency.

[0052] (6) The calculation result display position is the macro variable address of the calculation result of the visualized edge computing controller.

[0053] (7) The return value flag is a flag to determine whether the edge computing result is returned successfully. If the calculation result is returned successfully, the edge computing controller sets the return value flag to "0" and continues to execute the NC instruction. If the calculation result is returned unsuccessfully, the edge computing controller sets the return value flag to "1", forces the program to be paused, and executes an alarm or prompt instruction with the message "FeatureCalculateFailed".

[0054] Based on the specific functional information of the interaction protocol between the above-mentioned CNC system and the edge computing controller, NC instructions are designed to realize edge-to-end interactive computing of on-machine measurement data.

[0055] In order to more intuitively illustrate the edge-to-end interactive calculation method of on-machine measurement data based on CNC system macro variables provided by the present invention, the calculation process and application of the method are introduced in detail by taking the Fanuc CNC system as an example. The correspondence between the function bits used in the data interaction protocol between the CNC system and the edge computing controller and the Fanuc system macro variable address is shown in Table 1.

[0056] Table 1 Correspondence between the function information of the Fanuc system interaction protocol and the macro variable address

[0057]

[0058]

[0059] Taking the three-point method for fitting a circle as an example, according to the on-machine measurement process and data interaction protocol, the NC macro program is designed as follows Figure 4 As shown; the specific steps of the edge-end interactive calculation method of on-machine measurement data based on the macro variables of the numerical control system of the present invention are as follows:

[0060] Step 1: According to the FOCAS data acquisition protocol launched by Fanuc CNC system and the data interaction protocol described in an edge-to-end interactive calculation method of on-machine measurement data based on CNC system macro variables, design the edge computing controller communication module, computing module and storage module, and use the Fanuc CNC system simulator and the actual machine tool to verify the feasibility of the communication in turn.

[0061] Step 2: Analyze the information to be tested in the model, and design the following based on the programming rules of the Fanuc CNC system and the functional requirements of the edge computing controller: Figure 4 At the same time, the design of the measurement subroutine will transfer the machine measurement results to the specified variable address, that is, #101~#103, and write the model feature measurement main program. Since the Fanuc CNC system simulator does not have the actual measurement function, Figure 4 In the test program, #101 to #103 are directly assigned values ​​to verify the rationality of the edge computing controller function disclosed in the present invention and the feasibility of the edge-end interactive computing method of on-machine measurement data with the help of the Fanuc CNC system simulator.

[0062] Step 3: Start the edge computing controller and the CNC system. If the heartbeat flag (#173) changes from "0, 1" to "1", import the NC program and start on-machine measurement and calculation. Otherwise, check the status and connection of the edge computing controller until the heartbeat flag (#173) changes from "0, 1" to "1".

[0063] Taking the program segment "G65P****M3030A1Q1X#101Y#102Z#103I0.0J0.0K1.0U0.0V25.00W-481.4437" as an example, the data interaction process between the CNC system and the edge computing controller is introduced in detail:

[0064] (1) Run the NC subroutine, transfer the on-machine measurement results and feature information to the input information storage bits (A~F, H~K, M, Q~Z), set the loop flag bit (#172) to "1", and loop the program delay and calculation time judgment instructions to ensure the uniqueness of the input information storage bits (A~F, H~K, M, Q~Z) when the edge computing controller performs reading, calculation, feedback and storage. This solves the problem of inconsistency between the CNC system program running speed and the edge computing controller calculation speed, while maximizing the computing efficiency of the edge computing controller.

[0065] (2) When the NC subroutine enters the loop instruction, the edge computing controller reads the information of the macro variable address of the computing function flag bit (M / #13), selects the corresponding computing module, reads the information of the macro variable address of the corresponding input information storage bit (A~F, H~K, M, Q~Z) according to the module requirements, and performs calculations. The following three situations may occur during the calculation process:

[0066] ① If the calculation is successful, the loop flag (#172) is set to "0". At the same time, the judgment of whether the return value is successful can be divided into the following two cases: a. If the return value is successful, the calculation result is returned to the calculation result display bit (#180~#194) of the Fanuc CNC system and stored in a new XML format file named "Date-Hour-Minute-Second" under the path "C:\Measure Data" of the edge computing controller; b. If the return value fails, the return value flag (#170) is set to "1" to execute the "#3000=1" instruction, triggering the CNC system alarm function, and the alarm information is "Feature Calculate Failed". Check the feature value input.

[0067] ② If the calculation fails, set the loop flag (#172) to "2" to execute the "#3000=3" instruction, triggering the CNC system alarm function. The alarm message is "Element not cleared or definition failed". Check whether the element definition is repeated.

[0068] ③ If the calculation times out, that is, the calculation time record bit (#174) is greater than 120s, execute the "#3000=2" instruction to trigger the CNC system alarm. The alarm information is "Edge Server connection interrupted". Check the running status of the edge computing controller.

[0069] (3) After the single-line program is completed, continue to execute the measurement operation, define the measurement point results in the edge computing controller in turn, until the entire program segment is completed, and record the calculation result display bit (#180~#194) data.

[0070] Step 4: By comparing the calculation result display bits (#180~#194) with the results of the XML file in the "C:\MeasureData" path of the edge computing controller, the feasibility of the on-machine measurement data interactive calculation method based on the CNC system macro variables is verified.

[0071] Step 5: Improve the workpiece processing technology based on the edge-end calculation results of the on-machine measurement data.

[0072] See also Figure 5 , using the console window to feedback the edge computing controller operation information, including software operation, communication establishment, computing function information acquisition and return value identification statements, which helps to view the edge computing controller operation status.

[0073] See also Figure 6 , to display some macro variable information of the Fanuc system after the operation is completed. The figure includes the loop flag bit (#172), heartbeat control bit (#173), machine tool time recording bit (#174) and calculation result display bit (#180~#194).

[0074] See also Figure 7 The edge computing controller's calculation result parsing and storage methods include data classification, data and feature name correspondence, and storage file output functions; after the execution of a single NC main program of the CNC system is completed, the edge computing controller creates a data storage file in XML format in the "C:\Measure Data" path. The file is named with the "date-hour-minute-second" when the calculation is completed, which is helpful to trace and query the edge-end interactive calculation results of the on-machine measurement data.

[0075] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present invention. Therefore, all equivalent modifications or changes made by those with ordinary knowledge in the technical field without departing from the spirit and technical ideas disclosed by the present invention should still be covered by the claims of the present invention.

Claims

1. A method for edge-end interactive calculation of on-machine measurement data based on macro variables of a numerical control system, characterized in that: It includes a numerical control system and an edge computing controller, the numerical control system and the edge computing controller interoperate through multiple interactive protocols, the interoperation includes on-machine measurement data acquisition, processing and storage, the interactive protocol of the numerical control system and the edge computing controller data includes a heartbeat control bit, an input information storage bit, a calculation function flag bit, a cycle flag bit, a machine tool time recording bit, an operation time recording bit, a calculation result display bit and a return value flag bit, and the flag bits of the interactive protocol respectively correspond to a single numerical control system macro variable address number; the data processing module embedded in the edge computing controller includes a coordinate system management module, a feature information storage module and a geometric tolerance calculation module; The following steps are also included: Step 1: Establish communication between the edge computing controller and the CNC system according to the communication protocol; Step 2: Set the feature information of the model to be measured and design the corresponding on-machine measurement NC program. The single measurement results are saved to a specific macro variable address number as the variable required for the edge computing controller operation. The feature information is the shape, position, size and tolerance information of the model. Step 3: Design an NC subroutine based on the data interaction protocol to transfer the single on-machine measurement information to the calculation function flag bit and input information storage bit: Step 4: The edge computing controller sends an instruction to the numerical control system to read the computing function flag information, selects the corresponding data processing module according to the computing function flag, obtains the macro variable address information corresponding to the input information storage bit for calculation; Step 5: After the calculation is completed, the result is written back to the macro variable address corresponding to the calculation result display position of the CNC system and stored in the edge computing controller.

2. The edge-end interactive calculation method of on-machine measurement data based on CNC system macro variables according to claim 1 is characterized in that: The numerical control system and edge computing controller are composed of hardware equipment and soft data. The hardware equipment is the numerical control system, the edge computing controller and the twisted pair cable. The soft data is the communication protocol of the numerical control system, the macro variable address, the data processing module in the edge computing controller, the data parsing method, and the interaction protocol between the numerical control system and the edge computing controller.

3. The edge-end interactive calculation method of on-machine measurement data based on CNC system macro variables according to claim 1 is characterized in that: The heartbeat control bit is a check bit to ensure normal communication between the numerical control system and the edge computing controller. The edge computing controller sends a "0" or "1" keep-alive signal to the heartbeat flag bit of the numerical control system at a frequency of 1s / time; The input information storage bit is a storage bit for on-machine measurement result data and detection information. When the NC subroutine is run, the variable on-machine measurement results and detection information are transferred to the input information storage bit according to the specified order and are called by the edge computing controller.

4. The edge-end interactive calculation method of on-machine measurement data based on CNC system macro variables according to claim 1 is characterized in that: The computing function flag is a flag for the edge computing controller to select a computing module, and the edge control calculator selects a corresponding computing module according to specific information of the computing function flag.

5. The edge-end interactive calculation method of on-machine measurement data based on CNC system macro variables according to claim 1 is characterized in that: The cycle flag is the core of controlling the interoperability between the numerical control system and the edge computing controller, and the operation time record is the difference between the current time of the machine tool and the machine tool time record.

6. The edge-end interactive calculation method of on-machine measurement data based on CNC system macro variables according to claim 1 is characterized in that: The calculation result display bit is a macro variable address of the calculation result of the visualized edge computing controller, and the return value flag bit is a flag bit for judging whether the edge computing result is returned successfully.

7. The edge-end interactive calculation method of on-machine measurement data based on CNC system macro variables according to claim 1 is characterized in that: The calculation result analysis and storage method includes the functions of data classification, correspondence between data and feature names, and storage file output. After the execution of a single NC main program of the numerical control system is completed, the edge computing controller creates a data storage file in XML format in the "C:\MeasureData" path, and the file is named with "date-hour-minute-second" when the calculation is completed.

8. The edge-end interactive calculation method of on-machine measurement data based on CNC system macro variables according to claim 1 is characterized in that: After executing the NC subroutine described in step 3, the loop flag is set to "1", the edge computing controller performs the calculation function, and the NC subroutine loop executes the "G04" program delay 10ms instruction and the edge computing controller calculation time monitoring instruction; If the edge computing controller succeeds in the calculation, it sets the loop flag to "0", actively ends the loop instruction, exits the NC subroutine, and continues to execute the NC main program; If the edge computing controller fails to calculate due to a data format error, the loop flag is set to "2", the loop instruction is forced to end, and an alarm or prompt instruction is executed. The specific information is "Element not cleared or definition failed"; if the operation time record is greater than 120s, it means that the edge computing controller connection is interrupted or abnormal, the loop instruction is forced to end, and an alarm or prompt instruction is executed. The specific information is "Edge Server connection interrupted".

9. The edge-end interactive calculation method of on-machine measurement data based on CNC system macro variables according to claim 6 is characterized in that: If the calculation result is returned successfully, the edge computing controller sets the return value flag to "0" and continues to execute the NC main program; If the calculation result fails to be returned, the edge computing controller sets the return value flag to "1", forces the program to be paused, and executes an alarm or prompt instruction with the message "Feature Calculate Failed".

10. The edge-end interactive calculation method of on-machine measurement data based on CNC system macro variables according to claim 1, characterized in that: The edge computing controller in step four sends an instruction to the numerical control system to read the computing function flag information at a frequency of 3 ms / time, and the calculation result in step five is stored in the xml file of the edge computing controller.

Citation Information

Patent Citations

  • Automatic Detection Method for Tool Wear Based on Image Processing

    CN111300144B

  • Method for turning tensile samples of different feeding profiles by using macro program=

    CN111804932A

  • Tool wear state prediction system and method based on cloud-edge collaborative training

    CN115034504B

Cited By

  • Cutting deviation self-adaptive compensation method for edge end digital twinning drive

    CN121523221A