A tool turret control method, device, equipment and medium

By introducing a content pre-reading program into the turret control program, the preparatory actions required before tool change are analyzed and executed in advance, which solves the problem of wasted time due to waiting in the existing technology and improves the working efficiency of the machine tool.

CN117348529BActive Publication Date: 2026-05-29QUANZHOU JINGHE PRECISION EQUIP CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
QUANZHOU JINGHE PRECISION EQUIP CO LTD
Filing Date
2023-10-27
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In the existing servo-powered turret operating mode, the spindle orientation, turret release, and turret locking are all in a waiting state where the equipment is stopped, resulting in wasted time and low work efficiency.

Method used

By introducing a content prefetching program into the turret control program, the preparatory actions required before tool changing are parsed and executed in advance, reducing the waiting time during tool changing.

Benefits of technology

It effectively reduces the waiting time during tool changing in the turret and improves the working efficiency of the machine tool.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117348529B_ABST
    Figure CN117348529B_ABST
Patent Text Reader

Abstract

The application provides a tool turret control method, device, equipment and medium, the method comprises the following steps: writing a tool turret control program according to actual control requirements of the tool turret, and writing a content pre-reading program according to actual pre-reading requirements; running the tool turret control program and the content pre-reading program; when executing any program code instruction of the tool turret control program, the content pre-reading program obtains a plurality of continuous program code instructions after the currently executed program code instruction from the tool turret control program; the content pre-reading program analyzes the plurality of continuous program code instructions, and if the plurality of continuous program code instructions contain a tool changing instruction, the tool turret is controlled to perform the preparatory action required before tool changing in advance before the tool changing instruction is executed. The application has the following advantages: compared with the existing working mode, the waiting time in the tool changing process of the tool turret can be effectively reduced, so that the working efficiency of the machine tool is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of turret technology, and in particular to a turret control method, device, equipment and medium. Background Technology

[0002] The turret is a core functional component of a CNC machining center, primarily used to mount various cutting tools, including turning tools, milling cutters, drills, and taps, to achieve turning and milling functions. For example, Chinese utility model patent application CN202122301404.2 discloses a simplified dual-motor servo turret, and Chinese invention patent application CN202310637652.5 discloses a single-servo power turret; both can perform tool changing operations as needed.

[0003] The normal tool changing mode of existing servo-powered turrets is as follows: receiving the tool changing signal -- spindle orientation -- turret release -- confirmation of turret release signal -- tool changing servo rotation -- turret locking -- tool changing complete. In this mode, because spindle orientation, turret release, and turret locking are all in a stopped waiting state, it results in a significant waste of time and reduced work efficiency. In view of the above problems, the inventors of this invention conducted in-depth research on this issue, leading to this invention. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a turret control method, device, equipment and medium to solve the problem that in the existing working mode of servo power turrets, the spindle orientation, turret release and turret locking are all in a waiting state where the equipment is stopped, which causes a great waste of time and reduces work efficiency.

[0005] In a first aspect, the present invention provides a turret control method, the method comprising:

[0006] Step S1: Write the turret control program according to the actual turret control requirements, and write the content pre-reading program according to the actual pre-reading requirements;

[0007] Step S2: Run the turret control program and the content prefetching program. When any segment of program code instruction in the turret control program is executed, the content prefetching program obtains several consecutive segments of program code instructions following the currently executed program code instruction from the turret control program.

[0008] Step S3: The content pre-reading program parses and obtains several consecutive program code instructions. If the parsed consecutive program code instructions contain a tool change instruction, the turret is controlled to perform the preparatory actions required before the tool change instruction is executed.

[0009] Furthermore, the content pre-reading program is configured with a number of segments of pre-read program code instructions, and the number of pre-read program code instructions is between 2 and 8 segments.

[0010] Furthermore, in step S3, if several consecutive program code instructions contain a tool change instruction, then controlling the turret to perform the preparatory actions required before executing the tool change instruction specifically includes:

[0011] When the currently executed program code instruction is not a tool change instruction, if several consecutive program code instructions contain a tool change instruction, it is determined whether the currently executed program code instruction is an interpolation cutting instruction. If so, the turret is not controlled to perform the preparatory actions required before the tool change.

[0012] If not, then continue to determine whether there is an interpolation cutting instruction between the currently executed program code instruction and the tool change instruction contained in several consecutive program code instructions. If there is, then do not control the turret to perform the preparatory actions required before the tool change. If not, then control the turret to perform the preparatory actions required before the tool change synchronously.

[0013] If the parsed code does not contain a tool change instruction, the turret will not be controlled to perform the preparatory actions required before the tool change.

[0014] Furthermore, step S3 also includes:

[0015] When the currently executed program code instruction is a tool change instruction, if several consecutive program code instructions contain tool change instructions, it is determined whether the next program code instruction corresponding to the currently executed program code instruction is an interpolation cutting instruction. If so, it waits for the tool turret to complete the entire tool change process before continuing to execute the next program code instruction; otherwise, after completing the tool change action, it directly continues to execute the next program code instruction, and in the process of executing the next program code instruction, other auxiliary actions after the completion of the tool change action are executed simultaneously.

[0016] If the parsed program code instructions do not contain a tool change instruction, it is determined whether the next program code instruction corresponding to the currently executed program code instruction is an interpolation cutting instruction. If so, it waits for the turret to complete the entire tool change process before continuing to execute the next program code instruction. If not, it directly continues to execute the next program code instruction after the tool change action is completed, and other auxiliary actions after the tool change action is completed are executed simultaneously during the execution of the next program code instruction.

[0017] Secondly, the present invention provides a turret control device, the device comprising a programming module, a program execution module, and a parsing control module;

[0018] The programming module is used to write turret control programs according to the actual turret control requirements and content pre-read programs according to the actual pre-read requirements.

[0019] The program execution module is used to run the turret control program and the content prefetching program. When any segment of program code instruction of the turret control program is executed, the content prefetching program obtains several consecutive segments of program code instructions after the currently executed program code instruction from the turret control program.

[0020] The parsing control module is used to parse and obtain several consecutive program code instructions from the content pre-reading program. If the parsed consecutive program code instructions contain a tool change instruction, the module controls the turret to perform the preparatory actions required before the tool change instruction is executed.

[0021] Furthermore, the content pre-reading program is configured with a number of segments of pre-read program code instructions, and the number of pre-read program code instructions is between 2 and 8 segments.

[0022] Furthermore, in the parsing control module, if several consecutive program code instructions contain a tool change instruction, then controlling the turret to perform the preparatory actions required before executing the tool change instruction specifically includes:

[0023] When the currently executed program code instruction is not a tool change instruction, if several consecutive program code instructions contain a tool change instruction, it is determined whether the currently executed program code instruction is an interpolation cutting instruction. If so, the turret is not controlled to perform the preparatory actions required before the tool change.

[0024] If not, then continue to determine whether there is an interpolation cutting instruction between the currently executed program code instruction and the tool change instruction contained in several consecutive program code instructions. If there is, then do not control the turret to perform the preparatory actions required before the tool change. If not, then control the turret to perform the preparatory actions required before the tool change synchronously.

[0025] If the parsed code does not contain a tool change instruction, the turret will not be controlled to perform the preparatory actions required before the tool change.

[0026] Furthermore, the parsing control module is also used to determine whether the next program code instruction corresponding to the currently executed program code instruction is an interpolation cutting instruction when the currently executed program code instruction is a tool change instruction, if it is found that several consecutive program code instructions also contain tool change instructions. If so, it waits for the tool turret to complete the entire tool change process before continuing to execute the next program code instruction; if not, it directly continues to execute the next program code instruction after the tool change action is completed, and simultaneously executes other auxiliary actions after the tool change action is completed during the execution of the next program code instruction.

[0027] If the parsed program code instructions do not contain a tool change instruction, it is determined whether the next program code instruction corresponding to the currently executed program code instruction is an interpolation cutting instruction. If so, it waits for the turret to complete the entire tool change process before continuing to execute the next program code instruction. If not, it directly continues to execute the next program code instruction after the tool change action is completed, and other auxiliary actions after the tool change action is completed are executed simultaneously during the execution of the next program code instruction.

[0028] Thirdly, the present invention provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in the first aspect.

[0029] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.

[0030] One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages:

[0031] 1. A content pre-reading program is simultaneously run during the operation of the turret control program. This program retrieves and parses several consecutive program code instructions following the currently executed program code instruction from the turret control program. This allows for the pre-observation of subsequent actions. When a tool change instruction is found within these consecutive program code instructions, the turret is controlled to perform the necessary preparatory actions before the tool change instruction is executed. This enables the tool change to proceed directly without waiting when the subsequent tool change instruction is executed, thus reducing the waiting time during the tool change process and improving the machine tool's working efficiency.

[0032] 2. When the currently executed program code instruction is a tool change instruction, if the next program code instruction corresponding to the currently executed program code instruction is not an interpolation cutting instruction, then after the tool change action is completed, the next program code instruction will be executed directly. During the execution of the next program code instruction, other auxiliary actions after the tool change action is completed will be executed simultaneously. This can further reduce the waiting time during the tool change process of the turret, thereby further improving the working efficiency of the machine tool.

[0033] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0034] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0035] Figure 1 This is an execution flowchart of a turret control method according to Embodiment 1 of the present invention;

[0036] Figure 2 This is a schematic diagram of a turret control device according to Embodiment 2 of the present invention;

[0037] Figure 3 This is a schematic diagram of the electronic device in Embodiment 3 of the present invention;

[0038] Figure 4 This is a schematic diagram of the structure of the medium in Embodiment 4 of the present invention. Detailed Implementation

[0039] This application provides a turret control method, device, equipment, and medium to solve the problem that in the working mode of a servo-powered turret, the spindle orientation, turret release, and turret locking are all in a waiting state where the equipment is stopped, resulting in a great waste of time and reduced work efficiency. Compared with the existing working mode, it can effectively reduce the waiting time during the turret tool changing process, thereby improving the working efficiency of the machine tool.

[0040] The overall concept of the technical solution in this application embodiment is as follows: When running the turret control program, a content pre-reading program is run simultaneously. The content pre-reading program obtains several consecutive program code instructions following the currently executed program code instruction from the turret control program. When the turret is found to contain a tool change instruction, the turret is controlled to perform the preparatory actions required before the tool change instruction is executed. At the same time, when the currently executed program code instruction is a tool change instruction, if the next program code instruction corresponding to the currently executed program code instruction is not an interpolation cutting instruction, the next program code instruction is executed directly after the tool change action is completed. During the execution of the next program code instruction, other auxiliary actions after the tool change action is completed are executed simultaneously.

[0041] Example 1

[0042] This embodiment provides a preferred embodiment of a turret control method, such as... Figure 1 As shown, the method includes:

[0043] Step S1: Write a turret control program according to the actual control requirements of the turret. This turret control program is used to control the turret to perform the required actions. Write a content pre-reading program according to the actual pre-reading requirements. This content pre-reading program is used to obtain the content of the turret control program. In actual use, the turret control program can be written, modified, etc., according to the actual control requirements of the turret.

[0044] Step S2: Run the turret control program and the content pre-reading program. When any segment of program code instruction of the turret control program is executed, the content pre-reading program obtains several consecutive segments of program code instructions after the currently executed program code instruction from the turret control program, so as to obtain the subsequent action content in advance through several consecutive segments of program code instructions.

[0045] Step S3: The content pre-reading program parses and obtains several consecutive program code instructions. If the parsed consecutive program code instructions contain a tool change instruction, the turret is controlled to perform the preparatory actions required before the tool change is executed, so as to reduce the waiting time when the tool change is executed. The preparatory actions include, but are not limited to, spindle orientation, turret release and other preparatory actions before the tool change.

[0046] This invention employs a content pre-reading program that runs concurrently with the turret control program. The content pre-reading program retrieves and parses several consecutive program code instructions following the currently executed program code instruction from the turret control program, thereby pre-obtaining the subsequent action content. When a tool change instruction is found within these consecutive program code instructions, the turret is controlled to perform the necessary preparatory actions before executing the tool change instruction. This allows the tool change to proceed directly without waiting when the subsequent tool change instruction is executed, thus reducing the waiting time during the tool change process and improving the machine tool's working efficiency.

[0047] In some embodiments of the present invention, the content pre-reading program is configured with a number of pre-read program code instruction segments, and the number of pre-read program code instruction segments is between 2 and 8 segments, so as to better realize the preparatory actions required before tool change before executing the tool change instruction. In step S2, the content pre-reading program obtains the corresponding program code instruction from the turret control program according to the set number of segments.

[0048] In practical implementation, this invention aims to reduce waiting time during tool changes by pre-executing necessary preparatory actions before executing tool change instructions when a series of consecutive pre-fetched program code instructions contain such instructions. Since the execution of these preparatory actions does not require much time, the number of pre-fetched program code instruction segments does not need to be too large or too small. Therefore, in a preferred embodiment, the number of pre-fetched program code instruction segments is set between 4 and 6. Of course, this invention is not limited to this; the number of pre-fetched program code instruction segments can be adjusted according to actual needs during implementation.

[0049] In some embodiments of the present invention, step S3, if several consecutive program code instructions contain a tool change instruction, specifically includes controlling the turret to perform preparatory actions required before the tool change instruction is executed:

[0050] When the currently executed program code instruction is not a tool change instruction, if several consecutive program code instructions contain a tool change instruction, it is determined whether the currently executed program code instruction is an interpolation cutting instruction. If so, the tool turret is not controlled to perform the preparatory actions required before the tool change. This is because when there is an interpolation cutting instruction, the tool on the tool turret needs to be used to cut the workpiece, etc., so the tool turret cannot be controlled to perform the preparatory actions required before the tool change.

[0051] If not, then continue to determine whether there is an interpolation cutting instruction between the currently executed program code instruction and the tool change instruction contained in several consecutive program code instructions. If there is, it means that the tool on the turret needs to be used to cut the workpiece, etc. At this time, the turret is not controlled to perform the preparatory actions required before the tool change. If not, it means that the tool on the turret does not need to be used to cut the workpiece, etc. At this time, the turret is controlled to perform the preparatory actions required before the tool change synchronously. That is, during the execution of the current program code instruction, the turret is controlled to perform the preparatory actions required before the tool change synchronously. The preparatory actions required before the tool change include receiving the tool change signal, spindle orientation, turret release or confirmation of turret release signal.

[0052] If the parsed code does not contain a tool change instruction, the turret will not be controlled to perform the preparatory actions required before the tool change.

[0053] In some embodiments of the present invention, step S3 further includes:

[0054] When the currently executed program code instruction is a tool change instruction, if several consecutive program code instructions also contain tool change instructions, it is determined whether the next program code instruction corresponding to the currently executed program code instruction is an interpolation cutting instruction. If so, the process waits for the turret to complete the entire tool change process before continuing to execute the next program code instruction. During this waiting period, if the set timeout limit is exceeded, an abnormality may occur, and an alarm can be generated. If not, after completing the tool change action, the next program code instruction is executed directly. During the execution of the next program code instruction, other auxiliary actions following the completion of the tool change action are executed simultaneously. These auxiliary actions include, but are not limited to, actions such as turret locking. It should be noted that in the technical solution of this invention, when several consecutive program code instructions contain tool change instructions, the turret is controlled to pre-execute the tool change instruction before execution. The preparatory actions required before tool changing are performed. Therefore, when the tool change command is executed, if the tool change signal, spindle orientation, turret release, and turret release confirmation signal have all been pre-executed, the tool change servo of the turret can be directly controlled to rotate directly to perform the tool change. Meanwhile, under normal circumstances, the next action can only be executed after the turret is locked. However, to reduce unnecessary waiting time, this invention, after actual analysis, found that the turret is a precision-indexed four-axis structure that can withstand a certain load even without locking. While rigidity and accuracy are affected without locking, rapid axis movement and spindle opening are allowed without damage. Therefore, this invention adopts a method where, when the content pre-reading program determines that the next program code instruction corresponding to the currently executed program code instruction is not an interpolation cutting instruction, it directly continues to execute the next program code instruction and simultaneously executes other auxiliary actions such as turret locking. This delays the detection of the turret locking signal, thereby improving efficiency.

[0055] If several consecutive program code instructions are parsed and do not contain a tool change instruction, it is determined whether the next program code instruction corresponding to the currently executed program code instruction is an interpolation cutting instruction. If so, the process waits for the turret to complete the entire tool change process before continuing to execute the next program code instruction. If not, the process continues to execute the next program code instruction directly after the tool change action is completed. During the execution of the next program code instruction, other auxiliary actions after the tool change action is completed are executed simultaneously. These other auxiliary actions include, but are not limited to, actions such as turret locking.

[0056] In practice, if the next program code instruction is an interpolation cutting instruction, it means that the tool on the turret needs to be used immediately to cut the workpiece. Therefore, it is necessary to wait for the turret to complete the entire tool change process before continuing to execute the next program code instruction to ensure that the tool on the turret can be used to cut the workpiece. Conversely, if the next program code instruction is not an interpolation cutting instruction, it means that the tool on the turret does not need to be used immediately to cut the workpiece. Therefore, other auxiliary actions after the tool change can be executed later without waiting. Furthermore, since an interpolation cutting instruction will inevitably follow when the currently executed program code instruction is a tool change instruction (otherwise, there would be no need to execute the tool change instruction), regardless of whether the pre-fetched consecutive program code instructions contain a tool change instruction, it is possible to directly determine whether the next program code instruction corresponding to the currently executed program code instruction is an interpolation cutting instruction.

[0057] This invention, when the currently executed program code instruction is a tool change instruction, if the next program code instruction corresponding to the currently executed program code instruction is not an interpolation cutting instruction, will directly continue to execute the next program code instruction after the tool change action is completed. During the execution of the next program code instruction, other auxiliary actions after the tool change action is completed will be executed simultaneously. This can further reduce the waiting time during the tool change process of the turret, thereby further improving the working efficiency of the machine tool.

[0058] The following specific example further illustrates the technical solution of the present invention. In this specific example, the execution sequence of the turret control program is as follows:

[0059] I. G0 G17 G40 G49 G80 G90

[0060] II. T2 M6

[0061] III. G0 G54 G90 X123.Y100.M3 S1000

[0062] IV. G43 H2 Z100.

[0063] V. G83 Z-10.R2.

[0064] VI. X100.Y50.

[0065] 7. X90.

[0066] 8. X70.

[0067] 9. G0 G80 Z100.

[0068] 10. G0 Z200.

[0069] XI. T1 M6

[0070] 12. G0 G54 G90 X121.Y100.M3 S1000

[0071] 13. G0 G43 H1 Z10.

[0072] XIV. Z-10.

[0073] 15. G1 X50.

[0074] Let's take 6 segments of pre-fetched program code instructions as an example:

[0075] When the turret control program executes to the 5th segment, the content pre-reading program has already pre-read the content of the 11th segment. Since the 11th segment is a tool change command, which requires tool changing, but the 6th, 7th and 8th segments are interpolation cutting commands, which require cutting operations on the workpiece, no preparatory actions can be executed in advance.

[0076] Furthermore, when the turret control program executes to the 9th segment, since there is no workpiece machining required between the 9th and 11th segments (i.e., no interpolation cutting instructions), the turret can perform preparatory actions in advance. In other words, when executing the program code instructions of the 9th and 10th segments, the preparatory actions required before tool change can be executed simultaneously.

[0077] Furthermore, when the turret control program is executed to the 11th segment, since the preparatory actions required before tool changing have already been performed when executing the program code instructions in the 9th and 10th segments, the tool changing only requires the tool changing servo to rotate directly to change the tool, without having to perform any more preparatory actions.

[0078] Furthermore, when the turret control program executes to segment 11, the content pre-reading program has already pre-read the content up to segment 17. Since segments 12 and 13 do not involve machining the workpiece, after the tool changer servo completes the rotary tool change, subsequent program code instructions can be executed directly. During the execution of these instructions, other auxiliary actions following the tool change are executed simultaneously. In other words, while executing segments 12 and 13, other auxiliary actions following the tool change can be executed simultaneously. Of course, if segment 12 involves machining the workpiece, the program must wait for the turret to complete the entire tool change process before continuing with segment 12.

[0079] Based on the same inventive concept, this application also provides an apparatus corresponding to the method in Embodiment 1, as detailed in Embodiment 2.

[0080] Example 2

[0081] This embodiment provides a turret control device, such as Figure 2 As shown, the device includes a programming module, a program execution module, and a parsing control module;

[0082] The programming module is used to write a turret control program according to the actual control requirements of the turret. The turret control program is used to control the turret to perform the required actions. The module is also used to write a content pre-reading program according to the actual pre-reading requirements. The content pre-reading program is used to obtain the content of the turret control program. In actual use, the turret control program can be written, modified, etc., according to the actual control requirements of the turret.

[0083] The program execution module is used to run the turret control program and the content pre-reading program. When any segment of program code instruction of the turret control program is executed, the content pre-reading program obtains several consecutive segments of program code instructions after the currently executed program code instruction from the turret control program, so as to obtain the subsequent action content in advance through several consecutive segments of program code instructions.

[0084] The parsing control module is used to parse several consecutive program code instructions obtained by the content pre-reading program. If the parsed consecutive program code instructions contain a tool change instruction, the module controls the turret to perform the preparatory actions required before the tool change instruction is executed, so as to reduce the waiting time when the tool change action is executed. The preparatory actions include, but are not limited to, spindle orientation, turret release and other preparatory actions before the tool change.

[0085] This invention employs a content pre-reading program that runs concurrently with the turret control program. The content pre-reading program retrieves and parses several consecutive program code instructions following the currently executed program code instruction from the turret control program, thereby pre-obtaining the subsequent action content. When a tool change instruction is found within these consecutive program code instructions, the turret is controlled to perform the necessary preparatory actions before executing the tool change instruction. This allows the tool change to proceed directly without waiting when the subsequent tool change instruction is executed, thus reducing the waiting time during the tool change process and improving the machine tool's working efficiency.

[0086] In some embodiments of the present invention, the content pre-reading program is configured with a number of pre-read program code instruction segments, and the number of pre-read program code instruction segments is between 2 and 8 segments, so as to better realize the preparatory actions required before tool change before executing the tool change instruction. In the program execution module, the content pre-reading program obtains the corresponding program code instruction from the turret control program according to the set number of segments.

[0087] In practical implementation, this invention aims to reduce waiting time during tool changes by pre-executing necessary preparatory actions before executing tool change instructions when a series of consecutive pre-fetched program code instructions contain such instructions. Since the execution of these preparatory actions does not require much time, the number of pre-fetched program code instruction segments does not need to be too large or too small. Therefore, in a preferred embodiment, the number of pre-fetched program code instruction segments is set between 4 and 6. Of course, this invention is not limited to this; the number of pre-fetched program code instruction segments can be adjusted according to actual needs during implementation.

[0088] In some embodiments of the present invention, in the parsing control module, if several consecutive program code instructions contain a tool change instruction, controlling the turret to perform preparatory actions required before executing the tool change instruction specifically includes:

[0089] When the currently executed program code instruction is not a tool change instruction, if several consecutive program code instructions contain a tool change instruction, it is determined whether the currently executed program code instruction is an interpolation cutting instruction. If so, the tool turret is not controlled to perform the preparatory actions required before the tool change. This is because when there is an interpolation cutting instruction, the tool on the tool turret needs to be used to cut the workpiece, etc., so the tool turret cannot be controlled to perform the preparatory actions required before the tool change.

[0090] If not, then continue to determine whether there is an interpolation cutting instruction between the currently executed program code instruction and the tool change instruction contained in several consecutive program code instructions. If there is, it means that the tool on the turret needs to be used to cut the workpiece, etc. At this time, the turret is not controlled to perform the preparatory actions required before the tool change. If not, it means that the tool on the turret does not need to be used to cut the workpiece, etc. At this time, the turret is controlled to perform the preparatory actions required before the tool change synchronously. That is, during the execution of the current program code instruction, the turret is controlled to perform the preparatory actions required before the tool change synchronously. The preparatory actions required before the tool change include receiving the tool change signal, spindle orientation, turret release or confirmation of turret release signal.

[0091] If the parsed code does not contain a tool change instruction, the turret will not be controlled to perform the preparatory actions required before the tool change.

[0092] In some embodiments of the present invention, the parsing control module is further configured to, when the currently executed program code instruction is a tool change instruction, if several consecutive program code instructions containing a tool change instruction are parsed, determine whether the next program code instruction corresponding to the currently executed program code instruction is an interpolation cutting instruction. If so, wait for the turret to complete the entire tool change process before continuing to execute the next program code instruction. Of course, during the waiting process, if the set timeout limit is exceeded, it indicates that an abnormality may occur, and an alarm can be generated. If not, after the tool change action is completed, directly continue to execute the next program code instruction, and during the execution of the next program code instruction, simultaneously execute other auxiliary actions after the tool change action is completed. These other auxiliary actions include, but are not limited to, actions such as turret locking. It should be noted that, in the technical solution of the present invention, when several consecutive program code instructions containing a tool change instruction are parsed, the next program code instruction is executed after the tool change instruction is executed. Previously, the turret was pre-executed with preparatory actions required before tool change. Therefore, when the tool change command was executed, if the tool change signal, spindle orientation, turret release, and turret release confirmation signals had all been pre-executed, the tool change servo of the turret could be directly controlled to rotate and perform the tool change. Meanwhile, under normal circumstances, the next action could only proceed after the turret was locked. However, to reduce unnecessary waiting time, this invention, after practical analysis, found that the turret is a precision-indexed four-axis structure that can withstand a certain load even without locking. While its rigidity and accuracy are affected without locking, it allows for rapid axis movement and spindle opening without damage. Therefore, this invention employs a method where, when the content pre-reading program determines that the next program code instruction corresponding to the currently executed program code instruction is not an interpolation cutting instruction, it directly continues to execute the next program code instruction and simultaneously executes other auxiliary actions such as turret locking. This delays the detection of the turret locking signal, thereby improving efficiency.

[0093] If several consecutive program code instructions are parsed and do not contain a tool change instruction, it is determined whether the next program code instruction corresponding to the currently executed program code instruction is an interpolation cutting instruction. If so, the process waits for the turret to complete the entire tool change process before continuing to execute the next program code instruction. If not, the process continues to execute the next program code instruction directly after the tool change action is completed. During the execution of the next program code instruction, other auxiliary actions after the tool change action is completed are executed simultaneously. These other auxiliary actions include, but are not limited to, actions such as turret locking.

[0094] In practice, if the next program code instruction is an interpolation cutting instruction, it means that the tool on the turret needs to be used immediately to cut the workpiece. Therefore, it is necessary to wait for the turret to complete the entire tool change process before continuing to execute the next program code instruction to ensure that the tool on the turret can be used to cut the workpiece. Conversely, if the next program code instruction is not an interpolation cutting instruction, it means that the tool on the turret does not need to be used immediately to cut the workpiece. Therefore, other auxiliary actions after the tool change can be executed later without waiting. Furthermore, since an interpolation cutting instruction will inevitably follow when the currently executed program code instruction is a tool change instruction (otherwise, there would be no need to execute the tool change instruction), regardless of whether the pre-fetched consecutive program code instructions contain a tool change instruction, it is possible to directly determine whether the next program code instruction corresponding to the currently executed program code instruction is an interpolation cutting instruction.

[0095] This invention, when the currently executed program code instruction is a tool change instruction, if the next program code instruction corresponding to the currently executed program code instruction is not an interpolation cutting instruction, will directly continue to execute the next program code instruction after the tool change action is completed. During the execution of the next program code instruction, other auxiliary actions after the tool change action is completed will be executed simultaneously. This can further reduce the waiting time during the tool change process of the turret, thereby further improving the working efficiency of the machine tool.

[0096] Based on the same inventive concept, this application provides an electronic device embodiment corresponding to Embodiment 1, as detailed in Embodiment 3.

[0097] Example 3

[0098] This embodiment provides an electronic device, such as... Figure 3 As shown, it includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it can implement any of the embodiments in Example 1.

[0099] Since the electronic device described in this embodiment is the device used to implement the method in Embodiment 1 of this application, those skilled in the art can understand the specific implementation method and various variations of the electronic device in this embodiment based on the method described in Embodiment 1 of this application. Therefore, how the electronic device implements the method in the embodiment of this application will not be described in detail here. Any device used by those skilled in the art to implement the method in the embodiment of this application falls within the scope of protection of this application.

[0100] Based on the same inventive concept, this application provides a storage medium corresponding to Embodiment 1, as detailed in Embodiment 4.

[0101] Example 4

[0102] This embodiment provides a computer-readable storage medium, such as... Figure 4 As shown, a computer program is stored thereon, which, when executed by a processor, can implement any of the embodiments in Example 1.

[0103] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0104] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus, and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0105] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0106] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0107] While specific embodiments of the present invention have been described above, those skilled in the art should understand that the specific embodiments described are merely illustrative and not intended to limit the scope of the present invention. Equivalent modifications and variations made by those skilled in the art in accordance with the spirit of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A turret control method, characterized in that, The method includes: Step S1: Write the turret control program according to the actual turret control requirements, and write the content pre-reading program according to the actual pre-reading requirements; Step S2: Run the turret control program and the content prefetching program. When any segment of program code instruction in the turret control program is executed, the content prefetching program obtains several consecutive segments of program code instructions following the currently executed program code instruction from the turret control program. Step S3: The content pre-reading program parses and obtains several consecutive program code instructions. If the parsed consecutive program code instructions contain a tool change instruction, the turret is controlled to perform the preparatory actions required before the tool change instruction is executed. Specifically, this includes: When the currently executed program code instruction is not a tool change instruction, if several consecutive program code instructions contain a tool change instruction, it is determined whether the currently executed program code instruction is an interpolation cutting instruction. If so, the turret is not controlled to perform the preparatory actions required before the tool change. If not, then continue to determine whether there is an interpolation cutting instruction between the currently executed program code instruction and the tool change instruction contained in several consecutive program code instructions. If there is, then do not control the turret to perform the preparatory actions required before the tool change. If not, then control the turret to perform the preparatory actions required before the tool change synchronously. If the parsed code does not contain a tool change instruction, the turret will not be controlled to perform the preparatory actions required before the tool change.

2. The turret control method according to claim 1, characterized in that: The content pre-reading program is configured with a number of segments of program code instructions to be pre-read, and the number of segments of program code instructions to be pre-read is between 2 and 8.

3. A turret control device, characterized in that, The device includes a programming module, a program execution module, and a parsing control module; The programming module is used to write turret control programs according to the actual turret control requirements and content pre-read programs according to the actual pre-read requirements. The program execution module is used to run the turret control program and the content prefetching program. When any segment of program code instruction of the turret control program is executed, the content prefetching program obtains several consecutive segments of program code instructions after the currently executed program code instruction from the turret control program. The parsing control module is used to parse several consecutive program code instructions obtained by the content pre-reading program. If the parsed consecutive program code instructions contain a tool change instruction, the module controls the turret to perform preparatory actions required before executing the tool change instruction, specifically including: When the currently executed program code instruction is not a tool change instruction, if several consecutive program code instructions contain a tool change instruction, it is determined whether the currently executed program code instruction is an interpolation cutting instruction. If so, the turret is not controlled to perform the preparatory actions required before the tool change. If not, then continue to determine whether there is an interpolation cutting instruction between the currently executed program code instruction and the tool change instruction contained in several consecutive program code instructions. If there is, then do not control the turret to perform the preparatory actions required before the tool change. If not, then control the turret to perform the preparatory actions required before the tool change synchronously. If the parsed code does not contain a tool change instruction, the turret will not be controlled to perform the preparatory actions required before the tool change.

4. The turret control device according to claim 3, characterized in that: The content pre-reading program is configured with a number of segments of program code instructions to be pre-read, and the number of segments of program code instructions to be pre-read is between 2 and 8.

5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 2.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 2.