A security semantic analysis method for NC code in CNC turning
By extracting and segmenting the instruction information and function word information of the NC code for CNC turning processing, and calculating the tool usage time and stress, the NC code semantic problem that is difficult to detect in the existing technology is solved, and CNC turning processing is realized. Safety semantic analysis of processing avoids safety accidents of tools and machine tools.
Patent Information
- Application Number
- CN202411051029.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-08-01
AI Technical Summary
The existing NC code in CNC turning processing has semantic ambiguity, which makes it difficult to detect the impact of small-scale parameter changes on processing safety, which may lead to safety accidents such as tool damage and machine tool damage. Existing protective measures cannot effectively block illegal tampering. security risks.
By extracting the instruction information and function word information in the NC code, we divide the main program segment and the subprogram segment, calculate the tool usage time and stress, detect whether it exceeds the limit, and calculate the feed force, main cutting force, and radial force based on the cutting conditions. , determine whether the transmission power of the machine tool and the maximum allowable resistance of the feed mechanism are exceeded, and conduct safety semantic analysis.
It effectively detects and avoids safety accidents such as tool damage and machine tool inability to support processing due to semantic issues, ensuring the safety of NC code during execution and improving the safety and reliability of CNC turning processing.
Smart Images

Figure CN118584898B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of numerical control machining, and more specifically, relates to a method for analyzing the safety semantics of NC codes used in numerical control turning machining. Background Art
[0002] CNC system is one of the components of industrial control system, a key part of my country's industrial production and widely used in mechanical processing. At present, CNC system is developing towards intelligence and openness, and the networking operation of CNC system has become a trend. Therefore, various security threats such as hacker attacks and malicious codes of traditional information networks are accelerating into CNC network; and the software code contained in complex CNC system is huge, which may contain system design loopholes and reserved backdoors and other security risks, providing opportunities for attackers to steal information resources; at the same time, CNC protocol also has security issues. Most CNC machine tool control systems use plain text to transmit and manage NC code, which can easily lead to illegal acquisition of unencrypted NC code, and restore the processing code through special software, resulting in manufacturing data leakage and other consequences.
[0003] There are currently three ways to program NC codes, including manual programming, conversational programming, and CAD / CAM software programming. Manual programming can provide the highest possible CNC machine intimacy value and output that exceeds the results of the CAM system, but it is too dependent on CNC programmers and prone to human errors, and its efficiency is low; conversational programming can achieve faster setup, programming, and execution time, and is more cost-effective than CAM systems, but lacks support for complex tool paths, cannot process complex parts, and has limited flexibility; CAD / CAM software programming maximizes processing efficiency and processing quality, and reduces programming errors through virtual simulation, but the output effect is sometimes not as good as manual programming, and small errors still occur in the program. Therefore, each type of programming method has its own advantages and disadvantages, and semantic errors may occur. At the same time, because the CNC system faces various information security risks, it may be illegally tampered before being sent to the CNC machine tool for processing, causing the originally secure NC code to have unsafe semantic problems, and the existing protection measures cannot effectively block such risks. Therefore, it is still necessary to perform security semantic analysis on the NC code before processing to prevent more serious safety accidents due to semantic problems when executing the NC code.
[0004] The existing NC code semantic analysis includes two parts: syntax detection and semantic detection. Most technical methods can detect syntax errors. However, due to the ambiguity of semantics in NC code itself, there are still defects in semantic detection. Semantic rules always have drawbacks. Most of them can only detect the rationality of instruction connection and whether the parameter range exceeds the machine tool limit, and do not consider the impact of small-range parameter changes on processing safety. Although the existing simulation software can simulate and check the running effect before the NC code is issued, it takes a long time and requires manual experience to judge its rationality. In addition, due to possible illegal acquisition, NC code instructions or parameters are tampered with, so that when the originally safe NC code is issued to the CNC machine tool, there will be interference collision, tool usage time exceeds the limit, tool force exceeds the quota, and the machine tool transmission power is insufficient, and the feed force and radial force exceed the maximum resistance allowed by the feed mechanism. Safety semantic problems such as scrapped parts, damaged tools, and damaged machines occur.
[0005] In summary, it is necessary to detect NC codes before processing, conduct NC code security semantic analysis, and automatically detect semantic problems in NC codes to avoid the above-mentioned serious safety accidents. Summary of the invention
[0006] In view of the defects of the prior art and the need for improvement, the present invention provides a method for NC code security semantic analysis for CNC turning processing, which aims to detect abnormal semantics in the NC code that will cause tool damage and the inability of the machine tool to support processing before CNC turning processing.
[0007] To achieve the above object, according to one aspect of the present invention, a method for NC code security semantic analysis for NC turning processing is provided, comprising:
[0008] Extracting instruction information and function word information of each instruction statement in the NC code to be analyzed; determining the load state instruction statement according to the instruction information of each instruction statement; and determining the tool processing mode of each instruction statement according to the function word information of the instruction statement;
[0009] The NC code is divided into multiple main program segments according to different tool function words, and each main program segment is divided into multiple sub-program segments according to different tool processing methods;
[0010] According to the function word information of each load state instruction statement in each main program segment, the tool usage time of the main program segment is calculated, and the abnormal main program segment that will cause the usage time to exceed the limit is detected;
[0011] According to the function word information of each load state instruction statement in each subprogram segment, the cutting condition of the instruction statement is determined, and the main cutting force used to calculate the instruction statement is determined in combination with the cutting condition, the tool processing method and the processed material. , Feed force and radial force According to the function word information of each load state instruction statement in each subprogram segment, combined with the coefficients and exponents corresponding to the instruction statement, the instruction statement is calculated. , and ; Based on each load status instruction statement , and , detect abnormal subprogram segments that will cause the tool force to exceed the limit, abnormal subprogram segments where the machine tool transmits insufficient power, and abnormal subprogram segments where the feed force and radial force exceed the maximum allowable resistance of the feed mechanism, and complete the NC code safety semantic analysis.
[0012] Furthermore, based on each load status instruction statement , and , detect abnormal subprogram segments that will cause the tool force to exceed the limit, abnormal subprogram segments where the machine tool transmits insufficient power, and abnormal subprogram segments where the feed force and radial force exceed the maximum allowable resistance of the feed mechanism, specifically:
[0013] The load state instruction statements in each subprogram segment , and The largest resultant force among the resultant forces is used as the tool force of this subprogram segment, and the abnormal subprogram segment that causes the tool force to exceed the quota is detected;
[0014] According to the function word information of each load state instruction statement in each subprogram segment and , calculate the cutting power of the corresponding load state instruction statement to determine the maximum cutting power of the subroutine segment, so as to detect the abnormal subroutine segment where the machine tool transfers insufficient power; according to the maximum and maximum , detect the abnormal subroutine segment where the feed force and radial force exceed the maximum resistance allowed by the feed mechanism.
[0015] Furthermore, the detection of the abnormal program segment that will cause the tool usage time to exceed the limit is implemented in the following manner:
[0016] Calculate the tool path length based on the tool motion mode controlled by each load state instruction statement in each program segment and the coordinate function word start and end point information under the load state instruction statement ;
[0017] The spindle speed according to the load status instruction statement and feed rate , calculate the feed speed of the load state instruction statement or According to the trajectory length and the feed speed , calculate the tool processing time under this load state instruction statement ;
[0018] The processing time corresponding to each load state instruction statement in the current program segment is accumulated, and the accumulated result is used as the tool usage time of the current program segment to determine whether the tool usage time exceeds the limit, and finally the abnormal program segment that will cause the tool usage time to exceed the limit is detected from the multiple program segments.
[0019] Furthermore, the feed force , Main cutting force and radial force The calculation method is:
[0020] According to the known diameter of the blank and the spindle speed for each load state instruction statement , calculate the cutting speed of the tool under this load state instruction statement ;
[0021] According to the load state instruction statement and its adjacent previous instruction statement in the NC code Axis value changes , calculate the cutting depth of the tool under this load state instruction statement ;
[0022] According to the cutting speed corresponding to each load state instruction statement , the cutting depth And function word feed , combined with the coefficients and exponents corresponding to the load state instruction statement, calculate the feed force of the load state instruction statement , Main cutting force and radial force .
[0023] Furthermore, the detection method of the abnormal subroutine segment where the feed force and radial force exceed the maximum resistance allowed by the feed mechanism is:
[0024] Set the maximum feed force of the current subroutine segment and maximum radial force Compare the axial force and radial force with the maximum resistance allowed by the machine tool feed mechanism. If the maximum feed force and maximum radial force If at least one of the subroutine segments exceeds the maximum resistance, the current subroutine segment is defined as an abnormal subroutine segment.
[0025] Furthermore, each main program segment is divided into multiple subprogram segments according to different tool processing methods as follows:
[0026] Determine the tool type according to the tool function word corresponding to the main program segment;
[0027] If the tool type is an external general tool or an internal general tool, the instruction statements in the main program segment are analyzed one by one to determine whether the processing direction of the current instruction statement has changed compared with the previous instruction statement in terms of the perpendicular relationship with the z-axis. If it has changed, the cutting mode has changed, that is, it is determined that the tool processing method has changed, and the current instruction statement and its previous instruction statement are divided into two subprogram segments; if there is no change and the processing direction is perpendicular to the z-axis, then according to the change in the x-axis coordinate of the current instruction statement compared with the previous instruction statement, it is determined whether the current instruction statement has changed in terms of cutting or not compared with the previous instruction statement. If it has changed, the cutting mode has changed, that is, it is determined that the tool processing method has changed, and the current instruction statement and its previous instruction statement are divided into two subprogram segments. If there is no change, it is determined whether the spindle speed or feed rate has changed. If so, it is determined that the tool processing method has changed, and the current instruction statement and its previous instruction statement are divided into two subprogram segments. If not, it is determined that the tool processing method has not changed; wherein, the cutting mode includes external cylindrical longitudinal turning and cutting processing under longitudinal cutting and external cylindrical transverse turning processing under transverse cutting.
[0028] Furthermore, each main program segment is divided into multiple subprogram segments according to different tool processing methods as follows:
[0029] Determine the tool type according to the tool function word corresponding to the main program segment;
[0030] If the tool type is a slotting tool, the instruction statements in the main program segment are analyzed one by one, and according to the change in the x-axis coordinate of the current instruction statement compared with the previous instruction statement, it is judged whether the current instruction statement has changed in cutting or not compared with the previous instruction statement. If it has changed, the cutting mode has changed, that is, it is judged that the tool processing method has changed, and the current instruction statement and the previous instruction statement are divided into two subprogram segments. If there is no change, it is judged whether the spindle speed or feed rate has changed. If so, it is judged that the tool processing method has changed, and the current instruction statement and the previous instruction statement are divided into two subprogram segments. If the spindle speed and feed rate have not changed, it is judged that the tool processing method has not changed; wherein, the cutting mode includes slotting processing and cutting processing.
[0031] Furthermore, each main program segment is divided into multiple subprogram segments according to different tool processing methods as follows:
[0032] Determine the tool type according to the tool function word corresponding to the main program segment;
[0033] If the tool type is a drilling tool, analyze the instruction statements in the main program segment one by one. If the processing direction of the current instruction statement is not parallel to the z-axis, the instruction statement is determined to be an abnormal statement and marked. If the processing direction of the current instruction statement is parallel to the z-axis, determine whether the spindle speed or feed rate of the current instruction statement is different from that of the previous instruction statement. If the spindle speed or feed rate is different, it is determined that the tool processing method has changed, and the current instruction statement and the previous instruction statement are divided into two subprogram segments. If the spindle speed and feed rate are the same, it is determined that the tool processing method has not changed.
[0034] Furthermore, the method further includes: judging the instruction statements in the NC code one by one to detect the instruction statements that may cause interference and collision, specifically:
[0035] According to the coordinate conversion relationship, the machine tool coordinate limit in the machine tool manufacturing resource information is converted into the coordinate limit in the workpiece coordinate system. If the trajectory function of the current instruction statement exceeds the coordinate limit in the workpiece coordinate system, it is judged that the current instruction statement is an instruction statement for interference and collision between the tool and the machine tool;
[0036] According to the coordinate conversion relationship, the fixture coordinate range in the machine tool coordinate system is converted into the fixture coordinate range in the workpiece coordinate system. If the trajectory function of the current instruction statement passes through the fixture coordinate range in the workpiece coordinate system, it is determined that the current instruction statement is an instruction statement for interference and collision between the tool and the fixture.
[0037] When the instruction in the instruction statement is G00 or the instruction statement is the previous or next instruction statement indicating tool movement of the tool change instruction statement, if the trajectory function of the instruction statement passes through the workpiece coordinate range, it is judged that the current instruction statement is an instruction statement for interference and collision between the tool and the workpiece;
[0038] The trajectory function of each instruction statement is calculated based on the tool motion mode controlled by the instruction statement and the starting point and end point information of the coordinate function word under the instruction statement.
[0039] The present invention also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is executed by a processor, the device where the storage medium is located is controlled to execute the NC code security semantic analysis method for CNC turning processing as described above.
[0040] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects:
[0041] (1) The present invention proposes a method for NC code safety semantic analysis for CNC turning processing. Specifically, data extraction is performed on the NC code to extract instruction information and function word information, and the main program segment is divided according to the tool. The subprogram segment is divided according to the tool processing method in the main program segment. The tool processing time is calculated in the main program segment according to the data extraction content; the various coefficients of the tool force are determined in the subprogram segment according to the data extraction content and the auxiliary information to calculate the tool feed force, main cutting force, radial force, and cutting power. Tool damage safety issues include tool force exceeding its maximum force limit and tool usage time exceeding the usage time limit; machine tool inability to support processing safety issues include insufficient machine tool transmission power and feed force or radial force during processing exceeding the maximum resistance allowed by the feed mechanism. To solve the above safety issues, it is necessary to judge the tool force and processing time for the tool; it is necessary to compare the cutting power with the maximum power limit of the machine tool, and compare the feed force or radial force with the maximum resistance allowed by the feed mechanism. Therefore, the data extraction and segmentation processing of the NC code is aimed at determining the coefficients in the empirical force formula and calculating the processing time and cutting power. The present invention can solve the problem that the existing technology fails to detect the abnormal semantics in the NC code that will cause tool damage and the machine tool cannot support processing. At the same time, it can also solve the problem that the NC code can still ensure the security of the NC code execution process through this detection method after the NC code is illegally tampered.
[0042] (2) The present invention can also detect abnormal semantics of interference collision in NC code. Function words include feed amount function words, spindle speed function words, and coordinate function words; three types of interference collision semantics include tool and machine tool interference collision semantics, tool and fixture interference collision semantics, and tool and workpiece interference collision semantics; the three types of interference collision semantics are detected by combining tool trajectory function with blank information and machine tool manufacturing resource information. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A flowchart of a method for NC code security semantic analysis for CNC turning provided in an embodiment of the present invention.
[0044] Figure 2 A flowchart for extracting NC code related data provided by an embodiment of the present invention.
[0045] Figure 3 This is an example diagram of the database format provided in an embodiment of the present invention.
[0046] Figure 4 A flow chart for detecting whether a function word exceeds a machine tool limit is provided in an embodiment of the present invention.
[0047] Figure 5 A flowchart for determining the usage time of a tool provided by an embodiment of the present invention.
[0048] Figure 6 A flowchart for determining whether a tool is damaged and a machine tool cannot support processing is provided in an embodiment of the present invention. Figure 7 A flowchart of dividing a main program segment into various sub-program segments according to different tool processing methods is provided in an embodiment of the present invention.
[0049] Figure 8 An example diagram of NC code program segmentation provided in an embodiment of the present invention.
[0050] Fig. 9 This is an example diagram of the verification database format provided in an embodiment of the present invention.
[0051] Fig.10 A flowchart of detecting interference collision semantics provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0053] Embodiment 1
[0054] A security semantic analysis method for NC code used in CNC turning processing, such as Figure 1 As shown, including:
[0055] Extracting instruction information and function word information of each instruction statement in the NC code to be analyzed; determining the load state instruction statement according to the instruction information of each instruction statement; and determining the tool processing mode of each instruction statement according to the function word information of the instruction statement;
[0056] The NC code is divided into multiple main program segments according to different tool function words, and each main program segment is divided into multiple sub-program segments according to different tool processing methods;
[0057] According to the function word information of each load state instruction statement in each main program segment, the tool usage time of the main program segment is calculated, and the abnormal main program segment that will cause the usage time to exceed the limit is detected;
[0058] According to the function word information of each load state instruction statement in each subprogram segment, the cutting condition of the instruction statement is determined, and the main cutting force used to calculate the instruction statement is determined in combination with the cutting condition, tool processing method and processed material. , Feed force and radial force According to the function word information of each load state instruction statement in each subprogram segment, combined with the coefficients and exponents corresponding to the instruction statement, the instruction statement is calculated. , and ; Based on each load status instruction statement , and , detect abnormal subprogram segments that will cause the tool force to exceed the limit, abnormal subprogram segments where the machine tool transmits insufficient power, and abnormal subprogram segments where the feed force and radial force exceed the maximum allowable resistance of the feed mechanism, and complete the NC code safety semantic analysis.
[0059] In the method, the instruction information and function word information of each instruction statement in the NC code to be analyzed are extracted. In the actual implementation, for example, the NC code to be processed is input, the NC code is analyzed one by one, the current instruction statement is moved to, and the instruction type is analyzed, wherein the G instruction analyzes the G instruction value, motion mode and load state, the motion mode is linear motion, circular motion, etc., the load state is whether it is in the processing state under the instruction statement, and the coordinate function word under the current instruction statement state is recorded; the M instruction analyzes the M instruction value and function, and the M instruction function includes the spindle motion state, the coolant opening and closing state, etc.; at the same time, the tool function word, the spindle speed function word, and the feed amount function word under the current instruction statement state are recorded and stored in the database corresponding to the current instruction statement; the instruction statements are analyzed one by one, and the information of each instruction statement is stored in the database until the NC code analysis is completed.
[0060] Figure 2 An example of a flowchart for extracting NC code related data is shown below. Figure 2 As shown, first obtain the NC code to be processed, and detect the instruction type from the first instruction statement:
[0061] G instruction detection: Identify modal and non-modal instructions based on the code corpus to determine whether it is a motion control instruction. For example, N0020 G54 G00 X69.85 Z4.06 S1100 M3, G54 and G00 are modal instructions. The instruction will become invalid only if there is a modal instruction that can offset it. In this instruction statement state, identify G54 and G00 instructions. Since G00 is a motion control instruction, identify the corresponding coordinate function word to record the end point position (69.85, 4.06);
[0062] M instruction detection: Similarly, in the above instruction statement state, modal and non-modal instructions are identified according to the code corpus. M3 is a modal instruction. This instruction will become invalid only if there is a subsequent offsetting modal instruction. In this instruction statement state, the M3 instruction is identified. Since M3 is a spindle start instruction, if the spindle speed is not specified subsequently, the instruction statement has a semantic anomaly.
[0063] Tool function word T detection: For example, N0010 T0101, the tool number is 01, the tool compensation is 01, and if there is no tool change in the subsequent instructions, the program segment will always be processed by this tool;
[0064] Spindle speed function word S detection: After the spindle is started, the spindle speed is specified, and each subsequent instruction statement uses the same spindle speed, for example, N0020 G54 G00 X69.85 Z4.06 S1100 M3, spindle speed is 1100. When it changes, the subsequent instruction statements will change accordingly, and at the same time, check whether the spindle speed exceeds the machine tool limit;
[0065] Feed rate function word F detection: specify the feed rate, and the subsequent command statements use the same feed rate, for example, N0040 G01 G99 X54.86 F0.23, feed rate It is 0.23. When it changes, the subsequent instruction statements follow the change and detect whether the feed amount exceeds the machine tool limit.
[0066] Store the data analyzed by the above NC codes one by one in the format as follows Figure 3 As shown, the feed starting point in the workpiece coordinate system , feed end point , Indicates the x-coordinate of the starting point, represents the z-direction coordinate of the starting point, Indicates the x-coordinate of the end point, Indicates the z-coordinate of the end point, It indicates the serial number of the instruction statement, where the feed starting point in the current instruction statement state is the coordinate of the feed end point in the previous instruction statement state, the feed end point is the target coordinate in the current instruction statement state, and the feed radius R exists only when the motion state is G02 or G03; data extraction of NC code is convenient for subsequent detection and positioning of abnormal semantics, and it can also identify the lack of necessary instructions and whether the range of each function word is reasonable, so as to prevent safety accidents during the execution of NC code.
[0067] Figure 4 A flow chart for detecting the range of a function word is shown as follows: Figure 4 As shown, the database information is read one by one according to the sequence number, the coordinate function word, the feed amount function word, and the spindle speed function word are detected, and the error function word information and the sequence number are recorded. In view of some existing NC code abnormality detection methods, this embodiment starts from the semantics of the NC code and detects abnormal semantics by analyzing the NC code content. It can not only detect the abnormality of the NC code, but also detect the specific code or program segment with the abnormality, thereby improving the detection accuracy of the NC code abnormal semantics and ensuring the safety of the NC code execution process.
[0068] The above-mentioned load state instruction statement is an instruction statement for controlling the tool to be in a load state. The above-mentioned tool function word represents the type of tool. The above-mentioned tool processing mode can be determined according to the tool function word, coordinate function word, spindle speed and feed speed in the function word information.
[0069] As a preferred implementation, based on each load status instruction statement , and , detect abnormal subprogram segments that will cause the tool force to exceed the limit, abnormal subprogram segments where the machine tool transmits insufficient power, and abnormal subprogram segments where the feed force and radial force exceed the maximum allowable resistance of the feed mechanism, specifically:
[0070] The load state instruction statements in each subprogram segment , and The largest resultant force among the resultant forces is used as the tool force of this subprogram segment, and the abnormal subprogram segment that causes the tool force to exceed the quota is detected;
[0071] According to the function word information and , calculate the cutting power of the corresponding load state instruction statement to determine the maximum cutting power of the subroutine segment, so as to detect the abnormal subroutine segment where the machine tool will have insufficient power transmission; according to the maximum and maximum , detect the abnormal subroutine segment where the feed force and radial force exceed the maximum resistance allowed by the feed mechanism.
[0072] Based on different program segments, combined with tool information, blank information, and machine tool manufacturing resource information, the abnormal program segment semantics of tool usage time exceeding the limit and force exceeding the quota, as well as abnormal program segment semantics of insufficient machine tool transmission power, feed force and radial force exceeding the maximum resistance allowed by the feed mechanism are detected according to empirical formulas.
[0073] As a preferred implementation, the above detection of abnormal program segments that may cause the tool usage time to exceed the limit is implemented as follows:
[0074] Calculate the tool path length based on the tool motion mode controlled by each load state instruction statement in each program segment and the coordinate function word start and end point information under the load state instruction statement ;
[0075] The spindle speed according to the load status instruction statement and feed rate , calculate the feed speed of the load state instruction statement or According to the trajectory length and the feed speed , calculate the tool processing time under this load state instruction statement ;
[0076] The processing time corresponding to each load state instruction statement in the current program segment is accumulated, and the accumulated result is used as the tool usage time of the current program segment to determine whether the tool usage time exceeds the limit, and finally the abnormal program segment that will cause the tool usage time to exceed the limit is detected from the above multiple program segments. Figure 5 An example flowchart of determining whether a program segment is an abnormal program segment whose usage time exceeds the tool limit semantics is provided.
[0077] About track length When the instruction statement is linear motion, the calculation of the trajectory length is:
[0078]
[0079] When the instruction statement is arc motion, the calculation of the trajectory length is:
[0080] ;
[0081] Alternatively, the trajectory length is calculated as:
[0082] ;
[0083] in, Indicates the track length in mm; is the radius of circular motion, the unit can be mm; Indicates the x-coordinate of the starting point in the current instruction statement state. Indicates the z-direction coordinate of the starting point in the current instruction statement state. Indicates the x-coordinate of the end point in the current instruction statement state. Indicates the z-direction coordinate of the end point in the current instruction statement state.
[0084] In addition, the above It is the feed speed of the instruction statement, the unit can be mm / min; It is the processing time of the instruction statement, and the unit can be min.
[0085] In an embodiment, for example:
[0086] From N0010 T0101 to N0110 G00 X101.6 Z12.7 M5, calculate the machining time under this tool state, analyze the command statements one by one until N0040 is the load state, the current command is G01, so the path length is , the processing time of this instruction statement is ,in , the unit is min; continue to calculate the processing time of subsequent instruction statements in this way until N0090 G02 X39.62 Z-9.7 R5.84, the current instruction is G02, so the track length is , the processing time of this instruction statement is , in min; until N0100 G01 Z4.06, the machining time calculation under this tool state is completed, and the above machining time results are accumulated to obtain the total machining time under this tool state, and determine whether the usage time exceeds the tool limit.
[0087] As a preferred implementation, the following calculation method is used to calculate each force for the NC code security semantic analysis method for CNC turning machining proposed in this embodiment. Specifically, the feed force , Main cutting force and radial force The calculation method is:
[0088] According to the known diameter of the blank and the spindle speed for each load state instruction statement , calculate the cutting speed of the tool under this load state instruction statement ;
[0089] According to the load state instruction statement and its adjacent previous instruction statement in the NC code Axis value changes , calculate the cutting depth of the tool under this load state instruction statement ;
[0090] According to the cutting speed corresponding to each load state instruction statement , cutting depth And function word feed , combined with the above coefficients and exponents corresponding to the load state instruction statement, calculate the feed force of the load state instruction statement , Main cutting force and radial force .
[0091] In the above, The cutting speed of the instruction statement, the unit can be m / min, The diameter of the workpiece processing part, the unit can be mm, The cutting depth of the instruction statement, the unit can be mm, It is the change amount in the x-axis direction of the instruction statement.
[0092] According to the empirical formula, the feed force , main cutting force , radial force . is the feed force of the instruction statement, in N. The main cutting force of the instruction statement, in N, is the radial force of the instruction statement, in N. is the resultant force of feed force, main cutting force and radial force, in N. is the cutting power of the instruction statement, in KW, where They are the coefficients in the formulas for the main cutting force, feed force, and radial force, respectively, and they depend on the material being machined, the tool material, and the tool processing method; , , , The cutting depth in the three force formulas is , Feed rate and cutting speed The index also depends on the processing material, tool material and tool processing method; They are the correction coefficients of the main cutting force, feed force and radial force, which depend on the tool material, processing material and tool geometric parameters.
[0093] The feed force under the current command state can be calculated separately , Main cutting force , radial force , and calculate the resultant force , .
[0094] On this basis, the maximum cutting power of the subroutine segment can be determined as follows:
[0095] The main cutting force based on each load state instruction statement in the current subroutine segment and cutting speed , calculate the cutting power of this load state instruction statement ;
[0096] Set the maximum cutting power of each load state instruction statement in the current subroutine segment As the maximum cutting power of the current subroutine segment.
[0097] As a preferred implementation, the detection method of the abnormal subroutine segment in which the feed force and radial force exceed the maximum resistance allowed by the feed mechanism is:
[0098] Set the maximum feed force of the current subroutine segment and maximum radial force Compare the axial force and radial force with the maximum resistance allowed by the machine tool feed mechanism. If the maximum feed force and maximum radial force If at least one of the subroutine segments exceeds the maximum resistance, the current subroutine segment is defined as an abnormal subroutine segment.
[0099] It should be noted that before executing the method of this embodiment, it is necessary to obtain tool information, blank information and machine tool manufacturing resource information as auxiliary information for related calculations; among them, tool information includes tool type, tool number, tool material characteristics, tool force rating and tool life; blank information includes blank diameter, blank length and blank material characteristics; machine tool manufacturing resource information includes the transmission efficiency of machine tool manufacturing resources, fixture coordinates and various machine tool parameter limitations.
[0100] A collection of additional information can be defined , , , , , , ,in represents a tool collection, Represents a collection of blank information, Represents a collection of machine tool manufacturing resource information. Represents a collection of information about n tools.
[0101] Figure 6 An example of a flow chart for detecting whether the force on the tool exceeds the force limit and whether the machine tool can support the processing is shown in the figure. Figure 6 As shown, it can be detected that the program segment is an abnormal program segment semantics in which the tool force exceeds the tool force quota, the machine tool transmission power is insufficient, and the feed force and radial force exceed the maximum resistance allowed by the feed mechanism.
[0102] In an embodiment, for example:
[0103] The machine tool is set as C620-Ⅰ horizontal lathe, the maximum radial force allowed by its feed mechanism is 3530N, the feed force is 5100N, the main motor power is 7.9KW, and the transmission efficiency is 0.75; the NC code is divided into program segments in the above manner, N0010 to N0040 is a subprogram segment, T0101 is an external universal tool, the tool material is high-speed steel, the cutting mode of this subprogram segment is external cylindrical longitudinal turning, the spindle speed is 1100r / min, so the cutting speed is , feed rate is 0.23mm / r, It is 4.07mm, and the processing material is carbon structural steel. It can be determined according to the experience manual , , , can be determined based on tool information and blank information Therefore, in this subroutine segment, the forces in three directions and the resultant forces can be calculated according to the verification formula. At the same time, the cutting power can be calculated according to the main cutting force and cutting speed, and it can be judged whether the feed force and radial force exceed the maximum resistance allowed by the feed mechanism; N0050 to N0060 is a subroutine segment. The cutting mode of this subroutine segment is external cylindrical horizontal turning, the spindle speed is 1100r / min, and the cutting speed is , feed rate is 0.23mm / r, It is 4.64mm. In this program segment, the forces in three directions and the resultant forces are calculated according to the verification formula, the cutting power is calculated, and it is determined whether the feed force and radial force exceed the maximum resistance allowed by the feed mechanism; in each subsequent subprogram segment, the force and cutting power are calculated and it is determined whether they exceed the maximum resistance allowed by the feed mechanism, and it is determined whether the subprogram segment is abnormal.
[0104] As a preferred implementation, each main program segment is divided into multiple sub-program segments according to different tool processing methods as follows:
[0105] Determine the tool type according to the tool function word corresponding to the main program segment;
[0106] If the tool type is an external general tool or an internal general tool, the instruction statements in the main program segment are analyzed one by one to determine whether the processing direction of the current instruction statement has changed compared with the previous instruction statement in terms of the perpendicular relationship with the z-axis. If it has changed, the cutting mode has changed, that is, it is determined that the tool processing method has changed, and the current instruction statement and its previous instruction statement are divided into two subprogram segments; if there is no change and the processing direction is perpendicular to the z-axis, then according to the change in the x-axis coordinate of the current instruction statement compared with the previous instruction statement, it is determined whether the current instruction statement has changed in terms of cutting or not compared with the previous instruction statement. If it has changed, the cutting mode has changed, that is, it is determined that the tool processing method has changed, and the current instruction statement and its previous instruction statement are divided into two subprogram segments. If there is no change, it is determined whether the spindle speed or feed rate has changed. If so, it is determined that the tool processing method has changed, and the current instruction statement and its previous instruction statement are divided into two subprogram segments. If not, it is determined that the tool processing method has not changed; wherein, the cutting mode under the general tool includes external cylindrical longitudinal turning and cutting under longitudinal cutting and external cylindrical transverse turning under transverse cutting.
[0107] Further preferably, if the tool type is a slotting tool, the instruction statements in the main program segment are analyzed one by one, and according to the change in the x-axis coordinate of the current instruction statement compared with the previous instruction statement, it is determined whether the current instruction statement has changed in cutting or not compared with the previous instruction statement. If it has changed, the cutting mode has changed, that is, it is determined that the tool processing method has changed, and the current instruction statement and the previous instruction statement are divided into two subprogram segments. If there is no change, it is determined whether the spindle speed or feed rate has changed. If so, it is determined that the tool processing method has changed, and the current instruction statement and the previous instruction statement are divided into two subprogram segments. If the spindle speed and feed rate have not changed, it is determined that the tool processing method has not changed; wherein, the cutting mode under the slotting tool includes slotting processing and cutting processing.
[0108] Further preferably, if the tool type is a drilling tool, the instruction statements in the main program segment are analyzed one by one. If the processing direction of the current instruction statement is not parallel to the z-axis, the instruction statement is determined to be an abnormal statement and marked. If the processing direction of the current instruction statement is parallel to the z-axis, it is determined whether the spindle speed or feed rate of the current instruction statement is different from that of the previous instruction statement. If the spindle speed or feed rate is different, it is determined that the tool processing mode has changed, and the current instruction statement and the previous instruction statement are divided into two subprogram segments. If the spindle speed and feed rate are the same, it is determined that the tool processing mode has not changed.
[0109] The NC code shown in the embodiment should be segmented as follows:
[0110] According to the tool positioning instruction number N0010, it is an external general tool. Analyze it line by line until the instruction statement N0040 is vertical to the z direction for machining, but If the change is less than the diameter of the cutting part, it is judged as external cylindrical longitudinal turning, divided into a subprogram segment and recorded; the subsequent N0050 instruction statement changes the machining direction, and the machining direction is not perpendicular to the z direction, so it is judged as external cylindrical transverse turning, divided into a subprogram segment and recorded; continue to analyze the subsequent instruction statements, the N0070 instruction statement changes the machining direction, judged as external cylindrical longitudinal turning, divided into a subprogram segment and recorded; and so on, until the program segment division is completed.
[0111] Figure 7 The following is a flowchart that illustrates how to divide NC code into subprogram segments according to different tool processing methods. Figure 7 As shown, it can be divided into subprogram segments for different tool processing methods, which is convenient for subsequent force analysis and power calculation. Get the program segments divided by tool, locate the instruction number where the tool function word is located, and the tools in some CNC lathes that process complex parts can be divided into: external general tools, slotting tools, internal general tools, and drilling tools according to tool type. Analyze the NC code one by one according to the program steps.
[0112] The cutting modes of external general-purpose tools and internal general-purpose tools include external cylindrical longitudinal turning, external cylindrical transverse turning, and cutting off (under external general-purpose tools, external cylindrical longitudinal turning and external cylindrical transverse turning can be collectively referred to as external contour processing; under the action of internal general-purpose tools, external cylindrical longitudinal turning and external cylindrical transverse turning can be collectively referred to as internal contour processing). The cutting modes of grooving tools include grooving and cutting off; the cutting modes of drilling tools include boring; the cutting modes generally include external cylindrical longitudinal turning, external cylindrical transverse turning, grooving, cutting off, and boring.
[0113] Figure 8 This example shows how to divide the NC code into main program segments according to the tool and divide the main program segment into sub-program segments according to different tool processing methods. Figure 8 As shown in the figure, the NC code in the leftmost column is divided into 4 subprogram segments under the tool function word T0101, and is divided into 5 subprogram segments under the tool function word T0202; the middle column indicates that each subprogram segment is an external contour machining when the tool is an external general tool; the rightmost column specifies the cutting mode, spindle speed n, feed rate f, and cutting depth of the instruction statement under load for each subprogram segment. The value of .
[0114] As a preferred implementation scheme, the method of this embodiment can further include semantic detection of interference collision on the basis of the above scheme, that is, it also includes: judging the instruction statements in the NC code one by one to detect the instruction statements that will cause interference collision, specifically:
[0115] According to the coordinate conversion relationship, the machine tool coordinate limit in the machine tool manufacturing resource information is converted into the coordinate limit in the workpiece coordinate system. If the trajectory function of the current instruction statement exceeds the coordinate limit in the workpiece coordinate system, it is judged that the current instruction statement is an instruction statement for interference and collision between the tool and the machine tool;
[0116] According to the coordinate conversion relationship, the fixture coordinate range in the machine tool coordinate system is converted into the fixture coordinate range in the workpiece coordinate system. If the trajectory function of the current instruction statement passes through the fixture coordinate range in the workpiece coordinate system, it is determined that the current instruction statement is an instruction statement for interference and collision between the tool and the fixture.
[0117] When the instruction in the current instruction statement is G00 or the instruction statement is the previous or next instruction statement for controlling tool movement of the tool change instruction statement, if the trajectory function of the instruction statement passes through the workpiece coordinate range, it is judged that the current instruction statement is an instruction statement for interference and collision between the tool and the workpiece;
[0118] The trajectory function of each instruction statement is calculated based on the tool motion mode controlled by the instruction statement and the starting point and end point information of the coordinate function word under the instruction statement.
[0119] In general, based on the machine tool coordinate restrictions and trajectory functions in the machine tool manufacturing resource information (located in the auxiliary information), the instruction statements that cause interference and collision between the tool and the machine tool are detected; based on the fixture coordinates and trajectory functions in the machine tool manufacturing resource information, the interference and collision semantics between the tool and the fixture are detected; based on the blank diameter, blank length and other information in the blank information, the workpiece coordinate range is judged, and according to the load state (should be in a non-machining state) and the trajectory function, the interference and collision semantics between the tool and the workpiece are detected.
[0120] When actually implementing this embodiment, a verification database may be created. Fig. 9 The format of the verification data in this embodiment is illustrated as follows: Fig. 9 As shown, including the following information:
[0121] NC code instruction number (10, 20, 40, 90 in the figure are the abbreviations of the last digits of N0010, N0020, N0040, N0090), trajectory function (in Represents the set of trajectory functions corresponding to each instruction statement, Represents the trajectory function under the current instruction statement state, ), track length , Starting point of the machine tool coordinate system and the end point coordinates , processing time t, change in x direction , Feed force , Main cutting force , radial force , together , cutting power and other information;
[0122] Safety semantic analysis of NC codes includes semantic detection of interference collision, semantic detection of tool usage time exceeding the limit, semantic detection of tool force exceeding the limit, and semantic detection of insufficient machine power, feed force and radial force exceeding the maximum resistance allowed by the feed mechanism, resulting in the machine tool being unable to support processing;
[0123] The interference collision semantics of the NC code is detected to obtain the abnormal semantics of the NC code instruction statement, which includes the interference collision semantics between the tool and the machine tool, the interference collision semantics between the tool and the fixture, and the interference collision semantics between the tool and the workpiece.
[0124] Fig.10 The following is an example of a flowchart for detecting interference collision semantics. When detecting interference collision semantics, for example:
[0125] The interference collision semantics between the tool and the machine tool mainly detects the interference collision between the tool and the machine tool during the machining process. For example, according to the machine tool coordinate restriction information, after the coordinate transformation between the machine tool coordinate system and the workpiece coordinate system, if the machine tool coordinate restriction in the workpiece coordinate system is limited to not exceed 500 in both the x and z directions, then when the trajectory function of the instruction statement exceeds this range, such as the instruction statement N0030 G00 X58.93 Z-45.97 is tampered with to N0030 G00 X588.93 Z-45.97, it will interfere with the machine tool when it is executed, and the instruction statement is detected to have interference collision semantics;
[0126] The interference collision semantics between the tool and the fixture mainly detects the interference collision between the tool and the fixture during the machining process. For example, according to the fixture coordinates, after the coordinate transformation between the machine tool coordinate system and the workpiece coordinate system, if the x-direction range of the fixture coordinates in the workpiece coordinate system is limited to -60 to 60, and the z-direction range is not more than 46, if the instruction statement N0030 G00 X58.93 Z-45.97 is tampered with to N0030 G00 X58.93 Z-47 and is executed, it will cause interference collision with the fixture, and the instruction statement is detected to have interference collision semantics;
[0127] The interference collision semantics between the tool and the workpiece is detected when the instruction in the instruction statement is G00 or the instruction statement is the previous or next instruction statement that controls the tool movement of the tool change instruction statement, and the tool and the workpiece are interfered and collided. For example, if X0 Z0 is limited to the end face of the workpiece, the instruction statement indicating the tool movement before the tool change instruction, such as N0110 G00 X101.6Z12.7 M5, is tampered with to N0110 G00 X10.16 Z-12.7 M5, and a load state occurs, then the tool retraction point is abnormal, and the instruction statement is detected to have interference collision semantics; the instruction statement indicating the tool movement after the tool change instruction, such as N0020 G54 G00X69.85 Z4.06 S1000 M3, is tampered with to N0020 G54 G00X6.85 Z-4.06 S1000 M3, and a load state occurs, then the tool change point is abnormal, and the instruction statement is detected to have interference collision semantics;
[0128] In the embodiment, several interference collision semantics existing in the NC code are detected through the trajectory function, the specific existing code semantic anomalies can be detected, and the specific abnormal instruction statements can be located, thereby improving the security of the NC code execution process.
[0129] Embodiment 2
[0130] A computer-readable storage medium includes a stored computer program, wherein when the computer program is executed by a processor, the device where the storage medium is located is controlled to execute a method for NC code security semantic analysis for CNC turning processing as described above.
[0131] The relevant technical solution is the same as that in Embodiment 1 and will not be described in detail here.
[0132] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for NC code security semantic analysis for CNC turning processing, It is characterized in that include: Extract the instruction information and function word information of each instruction statement in the NC code to be analyzed; Determine the load state instruction statement according to the instruction information of each instruction statement; and determine the tool processing mode of each instruction statement according to the function word information of the instruction statement; The NC code is divided into multiple main program segments according to different tool function words, and each main program segment is divided into multiple sub-program segments according to different tool processing methods; According to the function word information of each load state instruction statement in each main program segment, the tool usage time of the main program segment is calculated, and the abnormal main program segment that will cause the usage time to exceed the limit is detected; According to the function word information of each load state instruction statement in each subprogram segment, the cutting condition of the instruction statement is determined, and the main cutting force used to calculate the instruction statement is determined in combination with the cutting condition, the tool processing method and the processed material. , Feed force and radial force According to the function word information of each load state instruction statement in each subprogram segment, combined with the coefficients and exponents corresponding to the instruction statement, the instruction statement is calculated. , and ; Based on each load status instruction statement , and , detect abnormal subprogram segments that will cause the tool force to exceed the quota, abnormal subprogram segments where the machine tool transmits insufficient power, and abnormal subprogram segments where the feed force and radial force exceed the maximum allowable resistance of the feed mechanism. Specifically: , and The largest resultant force is used as the tool force of the subprogram segment, and the abnormal subprogram segment that will cause the tool force to exceed the quota is detected; according to the function word information and , calculate the cutting power of the corresponding load state instruction statement to determine the maximum cutting power of the subroutine segment, so as to detect the abnormal subroutine segment where the machine tool transfers insufficient power; according to the maximum and maximum , detect the abnormal subroutine segments where the feed force and radial force exceed the maximum resistance allowed by the feed mechanism, and complete the safety semantic analysis of the NC code.
2. The NC code security semantic analysis method according to claim 1, It is characterized in that The detection of abnormal program segments that will cause the tool usage time to exceed the limit is implemented as follows: Calculate the tool path length based on the tool motion mode controlled by each load state instruction statement in each program segment and the coordinate function word start and end point information under the load state instruction statement ; The spindle speed according to the load status instruction statement and feed rate , calculate the feed speed of the load state instruction statement or According to the trajectory length and the feed speed , calculate the tool processing time under this load state instruction statement ; The processing time corresponding to each load state instruction statement in the current program segment is accumulated, and the accumulated result is used as the tool usage time of the current program segment to determine whether the tool usage time exceeds the limit, and finally the abnormal program segment that will cause the tool usage time to exceed the limit is detected from multiple program segments.
3. The NC code security semantic analysis method according to claim 1, It is characterized in that The feed force , Main cutting force and radial force The calculation method is: According to the known diameter of the blank and the spindle speed for each load state instruction statement , calculate the cutting speed of the tool under this load state instruction statement ; According to the change of the x-axis value of each load state instruction statement and its adjacent previous instruction statement in the NC code , calculate the cutting depth of the tool under this load state instruction statement ; According to the cutting speed corresponding to each load state instruction statement , the cutting depth And function word feed , combined with the coefficients and exponents corresponding to the load state instruction statement, calculate the feed force of the load state instruction statement , Main cutting force and radial force .
4. The NC code security semantic analysis method according to claim 3, It is characterized in that The detection method of the abnormal subroutine segment where the feed force and radial force exceed the maximum allowable resistance of the feed mechanism is: Set the maximum feed force of the current subroutine segment and maximum radial force Compare the axial force and radial force with the maximum resistance allowed by the machine tool feed mechanism. If the maximum feed force and maximum radial force If at least one of the subroutine segments exceeds the maximum resistance, the current subroutine segment is defined as an abnormal subroutine segment.
5. The NC code security semantic analysis method according to claim 1, It is characterized in that The implementation method of dividing each main program segment into multiple subprogram segments according to different tool processing methods is as follows: Determine the tool type according to the tool function word corresponding to the main program segment; If the tool type is an external general tool or an internal general tool, the instruction statements in the main program segment are analyzed one by one to determine whether the processing direction of the current instruction statement has changed compared with the previous instruction statement in terms of the perpendicular relationship with the z-axis. If it has changed, the cutting mode has changed, that is, it is determined that the tool processing method has changed, and the current instruction statement and its previous instruction statement are divided into two subprogram segments; if there is no change and the processing direction is perpendicular to the z-axis, then according to the change in the x-axis coordinate of the current instruction statement compared with the previous instruction statement, it is determined whether the current instruction statement has changed in terms of cutting or not compared with the previous instruction statement. If it has changed, the cutting mode has changed, that is, it is determined that the tool processing method has changed, and the current instruction statement and its previous instruction statement are divided into two subprogram segments. If there is no change, it is determined whether the spindle speed or feed rate has changed. If so, it is determined that the tool processing method has changed, and the current instruction statement and its previous instruction statement are divided into two subprogram segments. If not, it is determined that the tool processing method has not changed; wherein, the cutting mode includes external cylindrical longitudinal turning and cutting processing under longitudinal cutting and external cylindrical transverse turning processing under transverse cutting.
6. The NC code security semantic analysis method according to claim 1, It is characterized in that The implementation method of dividing each main program segment into multiple subprogram segments according to different tool processing methods is as follows: Determine the tool type according to the tool function word corresponding to the main program segment; If the tool type is a slotting tool, the instruction statements in the main program segment are analyzed one by one, and according to the change in the x-axis coordinate of the current instruction statement compared with the previous instruction statement, it is judged whether the current instruction statement has changed in cutting or not compared with the previous instruction statement. If it has changed, the cutting mode has changed, that is, it is judged that the tool processing method has changed, and the current instruction statement and the previous instruction statement are divided into two subprogram segments. If there is no change, it is judged whether the spindle speed or feed rate has changed. If so, it is judged that the tool processing method has changed, and the current instruction statement and the previous instruction statement are divided into two subprogram segments. If the spindle speed and feed rate have not changed, it is judged that the tool processing method has not changed; wherein, the cutting mode includes slotting processing and cutting processing.
7. The NC code security semantic analysis method according to claim 1, It is characterized in that The implementation method of dividing each main program segment into multiple subprogram segments according to different tool processing methods is as follows: Determine the tool type according to the tool function word corresponding to the main program segment; If the tool type is a drilling tool, analyze the instruction statements in the main program segment one by one. If the processing direction of the current instruction statement is not parallel to the z-axis, the instruction statement is determined to be an abnormal statement and marked. If the processing direction of the current instruction statement is parallel to the z-axis, determine whether the spindle speed or feed rate of the current instruction statement is different from that of the previous instruction statement. If the spindle speed or feed rate is different, it is determined that the tool processing method has changed, and the current instruction statement and the previous instruction statement are divided into two subprogram segments. If the spindle speed and feed rate are the same, it is determined that the tool processing method has not changed.
8. The NC code security semantic analysis method according to claim 1, It is characterized in that Also includes: Judge the instruction statements in the NC code one by one to detect the instruction statements that will cause interference and collision, specifically: According to the coordinate conversion relationship, the machine tool coordinate limit in the machine tool manufacturing resource information is converted into the coordinate limit in the workpiece coordinate system. If the trajectory function of the current instruction statement exceeds the coordinate limit in the workpiece coordinate system, it is judged that the current instruction statement is an instruction statement for interference and collision between the tool and the machine tool; According to the coordinate conversion relationship, the fixture coordinate range in the machine tool coordinate system is converted into the fixture coordinate range in the workpiece coordinate system. If the trajectory function of the current instruction statement passes through the fixture coordinate range in the workpiece coordinate system, it is determined that the current instruction statement is an instruction statement for interference and collision between the tool and the fixture. When the instruction in the instruction statement is G00 or the instruction statement is the previous or next instruction statement indicating tool movement of the tool change instruction statement, if the trajectory function of the instruction statement passes through the workpiece coordinate range, it is judged that the current instruction statement is an instruction statement for interference and collision between the tool and the workpiece; The trajectory function of each instruction statement is calculated based on the tool motion mode controlled by the instruction statement and the starting point and end point information of the coordinate function word under the instruction statement.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed by a processor, the device where the storage medium is located is controlled to execute a method for NC code security semantic analysis for CNC turning processing as described in any one of claims 1 to 8.
