A method, apparatus and equipment for tool position recovery

By recording the tool movement trajectory to generate G-code files, the collision problem during tool reset is solved, thus improving safety and accuracy.

CN116690306BActive Publication Date: 2026-04-03INNOVISION INTELLIGENT TECH (HANGZHOU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-20
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

In existing technologies, when resetting tools after tool repair, collisions easily occur between the tool and the plate or model, leading to technical problems in the equipment. How to handle and avoid these problems during resetting is a key technical challenge.

Method used

By recording the tool movement trajectory, a G1 code block is generated in the G-code file to achieve automatic identification and marking of the tool position, thus avoiding collisions during reset.

Benefits of technology

It improves the safety and cutting accuracy during tool reset and avoids collisions between the tool and the sheet material or model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116690306B_ABST
    Figure CN116690306B_ABST
Patent Text Reader

Abstract

This disclosure provides a tool position recovery method, apparatus, and device. The method includes: when the tool's state during cutting meets recording conditions, changing the tool's control mode and generating a first G1 code block in a preset G-code file; controlling the tool to move according to the control mode and determining special point information of the tool during movement; generating corresponding G1 code blocks in the G-code file based on the special point information; acquiring the G-code file when the tool's movement state meets an end condition; and controlling the tool to recover its position according to the generated G-code file when the tool meets position recovery conditions. This achieves automatic identification and marking of special points, records the safe movement trajectory of the tool, and controls the tool's position recovery through the G-code file, avoiding collisions with the material or model during tool reset, improving safety, and thus ensuring cutting accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of control technology, and in particular to a tool position recovery method, apparatus, and device. Background Technology

[0002] With the advancement of society and science and technology, more and more workpieces are being processed by automated machine tools, eliminating the need for manual tool setting and calibration during traditional machining. In most machines, there may be pauses, alarms, or tool failures requiring maintenance during cutting.

[0003] Existing technology often involves manually moving the cutting tool to a safe position for maintenance or other operations, and then returning it to its initial position for cutting after maintenance is completed.

[0004] However, when the machine restarts the system to cut, the cutter may collide with the material or model due to the protrusions of the cut material or the complexity of the three-dimensional model. Summary of the Invention

[0005] The purpose of this invention is to overcome the collision problem that occurs when resetting a tool after maintenance in the prior art. It provides a tool position restoration device, apparatus and equipment that can avoid collisions during tool resetting by recording the tool movement trajectory.

[0006] In a first aspect, embodiments of this disclosure provide a tool position recovery method, the method comprising:

[0007] S1: When the state of the tool during the cutting process meets the recording conditions, change the control mode of the tool and generate the first G1 code block in the preset G code file;

[0008] S2: Control the tool to move according to the control method, and determine the special position information of the tool during the movement process;

[0009] S3: Based on the specific location information, generate the corresponding G1 code block in the G code file;

[0010] S4: When the movement state of the tool meets the termination condition, the G-code file is obtained to complete the trajectory recording of the tool;

[0011] S5: When the tool meets the position recovery condition, control the tool to perform position recovery according to the generated G-code file.

[0012] Optionally, step S1 specifically includes:

[0013] S11: Grant manual control access to the cutting tool;

[0014] S12: Obtain the position information and coordinate system type of the tool at the moment when the recording conditions are met;

[0015] S13: Record the location information and coordinate system type, and generate the first G1 code block in the preset G code file.

[0016] Optionally, step S2 specifically includes:

[0017] S21: When the tool is in a stopped state during movement, obtain the stopping point information of the stopping position of the tool and the previous special point information;

[0018] S22: Based on the stop point information and the previous special point information, determine whether the stop position meets the special point condition;

[0019] S23: If the stopping position satisfies the special point condition, then generate the special point information based on the stopping point information;

[0020] S24: When the tool is at a preset special point during movement, the special point information is generated based on the position information of the tool.

[0021] Optionally, the specific steps in step S22 to determine whether the stopping position meets the special point conditions include:

[0022] S221: Based on the stop point information and the previous special point information, determine the moving distance between the stop position and the previous special point to which the previous special point information belongs;

[0023] S222: If the moving distance is greater than a preset distance threshold, then the stopping position is deemed to meet the special point condition;

[0024] S223: Otherwise, it is determined that the stopping position does not meet the special point condition.

[0025] Optionally, step S3 specifically includes:

[0026] S31: Obtain the previous special point information corresponding to the special point information;

[0027] S32: Based on the special point information and the previous special point information, determine the movement trajectory information of the tool from the previous point to the special point corresponding to the special point information, wherein the movement trajectory information includes the direction of movement and the distance of movement.

[0028] S33: Record the special location information and generate the corresponding G1 code block based on the movement trajectory information.

[0029] Optionally, the method further includes:

[0030] When the control coordinate system of the tool changes during the movement of the tool, the switching position and switching method of the tool at the time of the switch are recorded in the G-code file.

[0031] Secondly, embodiments of this disclosure also provide a tool position recovery device, the device comprising:

[0032] The first generation module is used to change the control mode of the tool when the state of the tool during the cutting process meets the recording conditions, and generate the first G1 code block in the preset G code file.

[0033] The point information determination module is used to control the tool to move according to the control method and determine the special point information of the tool during the movement process;

[0034] The second generation module is used to generate a corresponding G1 code block in the G code file based on the special point information.

[0035] The file acquisition module is used to acquire the G-code file when the movement state of the tool meets the termination condition, so as to complete the trajectory recording of the tool.

[0036] The position recovery module is used to control the tool to perform position recovery according to the generated G-code file when the tool meets the position recovery conditions.

[0037] Thirdly, embodiments of this disclosure also provide an electronic device, the electronic device comprising:

[0038] At least one processor; and

[0039] A memory that is communicatively connected to at least one processor; wherein,

[0040] When the memory stores a computer program that can be executed by at least one processor, the computer program is executed by at least one processor to enable at least one processor to perform a tool position recovery device as described in any embodiment of the present disclosure.

[0041] Fourthly, embodiments of this disclosure provide a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements a tool position recovery device as described in any embodiment of this disclosure.

[0042] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description.

[0043] Therefore, the present invention has the following beneficial effects:

[0044] 1. During the tool movement process, special point information is determined, realizing the automatic identification and marking of special points.

[0045] 2. The G1 code block is determined based on the movement trajectory between adjacent special points, thus realizing the recording of the safe movement trajectory of the tool.

[0046] 3. By controlling the tool position recovery through G-code files, collisions between the tool and the sheet material or model are avoided during tool reset, improving safety and ensuring cutting accuracy. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 This is a flowchart of a tool position recovery method according to Embodiment 1 of the present invention;

[0049] Figure 2 This is a schematic diagram of another tool position recovery device provided in Embodiment 2 of the present invention;

[0050] Figure 3 This is a schematic diagram of the structure of an electronic device provided according to Embodiment 3 of the present invention. Detailed Implementation

[0051] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0052] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus. Example 1

[0053] Figure 1 This document provides a flowchart of a tool position recovery method according to Embodiment 1 of the present invention. This embodiment is applicable to situations where the tool needs to be reset during cutting. The method can be executed by the tool position recovery device provided in this disclosure, which can be implemented in software and / or hardware and is generally integrated into an electronic device. The method of this disclosure specifically includes:

[0054] S1: When the state of the tool during the cutting process meets the recording conditions, change the tool control mode and generate the first G1 code block in the preset G code file.

[0055] In this embodiment, the cutting tool can be understood as a mechanical tool used for cutting. Recording conditions can be states such as the device corresponding to the cutting tool being in an alarm, collision, reset, stop, or replacement state. The control method can be understood as the way the movement of the cutting tool is controlled, which can be automatic or manual. The G-code file can be understood as a numerical control programming language used to control the cutting tool. The first G1 code block can be understood as the code block generated when the cutting tool is in its initial position.

[0056] Specifically, when the cutting tool encounters an alarm, collision, reset, stop, or replacement during the cutting process, and the tool's status meets the recording conditions, the processor can change the tool's control mode from automatic control to manual control, record the tool's current position, and generate the first G1 code block in the preset G code file based on the position.

[0057] S2: Control the tool to move according to the control method, and determine the special position information of the tool during the movement process.

[0058] In this embodiment, special point information can be understood as special points such as when the tool stops moving within a certain range or when it encounters a sharp bend or corner.

[0059] Specifically, the processor can grant manual control permissions, allowing relevant personnel to manually control the corresponding control panel and receive control commands from the control panel to control the movement of the tool. During the movement, it can detect in real time whether the tool stops within a certain range or encounters special points such as sharp bends or corners, and record the positions of these special points to obtain special point information.

[0060] S3: Generate the corresponding G1 code block in the G code file based on the specific point information.

[0061] Specifically, the processor can generate corresponding G1 code blocks in the G code file according to the order of special point information. The position where the tool is in the cutting process and meets the recording conditions is the first special point.

[0062] For example, when the tool is at a special point P2, a second G1 code block is generated based on the position of the special point P2 and the movement trajectory of the tool from P1 to P2. When the tool is at a special point P3, a third G1 code block is generated based on the position of the special point P3 and the movement trajectory of the tool from P2 to P3, and so on.

[0063] S4: When the tool's movement state meets the termination condition, obtain the generated G-code file to complete the tool trajectory recording.

[0064] In this embodiment, the termination condition can be understood as the tool's movement distance being insufficient to meet the recording requirements and no longer encountering sharp bends or corners.

[0065] Specifically, when the tool's movement distance from the previous specific point is insufficient to meet the recording requirements and it no longer encounters sharp turns or corners, the processor determines that the tool's movement meets the termination condition. At this point, the tool moves to a safe position, and the processor does not record this safe position or generate a G1 code block. Instead, it uses this point as the starting point for the next tool movement. The processor can then obtain a G-code file containing multiple G1 code blocks to complete the recording of the tool's trajectory for this operation.

[0066] S5: When the tool meets the position recovery conditions, control the tool to perform position recovery according to the generated G-code file.

[0067] In this embodiment, the position recovery condition can be understood as the resolution of problems such as tool replacement, alarm, collision, and pause.

[0068] Specifically, when issues such as tool replacement, alarms, collisions, and pauses are resolved, i.e. when manual mode is deactivated and tool feeding resumes, the tool starts feeding from a safe position point as the starting point. The tool is controlled to restore its position according to the generated G-code file, returning to the starting position when the tool's state during the cutting process met the recording conditions, and then the cutting operation continues.

[0069] Furthermore, step S1 specifically includes:

[0070] S11: Enable manual control of cutting tools.

[0071] Specifically, the processor can stop automatic control and grant manual control access to the tool when the tool's state during the cutting process meets the recording conditions.

[0072] S12: Obtain the position information and coordinate system type of the tool at the moment when the recording conditions are met.

[0073] In this embodiment, the coordinate system type can be understood as the coordinate system used to control the movement of the tool, such as the machine coordinate system (joint coordinate system), the world coordinate system, and the tool coordinate system.

[0074] Specifically, the processor can query and obtain the position information and coordinate system type of the tool at the moment when the recording conditions are met.

[0075] S13: Record the position information and coordinate system type, and generate the first G1 code block in the preset G code file.

[0076] Specifically, the processor can record the position information and coordinate system type and generate the first G1 code block in a preset G code file.

[0077] Furthermore, step S2 specifically includes:

[0078] S21: When the tool is stopped during movement, obtain the stopping point information of the tool's current stopping position and the previous special point information.

[0079] In this embodiment, the stop point information can be understood as the position information corresponding to the stop state. The previous special point information can be understood as the adjacent previous special point.

[0080] Specifically, when the tool is stationary during movement, the processor can obtain the stopping point information of the tool's stopping position and the information of the previously determined adjacent special point.

[0081] S22: Based on the stop point information and the previous special point information, determine whether the stop position meets the special point conditions.

[0082] Specifically, the processor can determine whether the stopping position meets the special point condition based on the interval between the stopping point information and the previous special point information.

[0083] S23: If the stopping position meets the special point conditions, then generate special point information based on the stopping point information.

[0084] Specifically, if the stopping position meets the special point conditions, the processor can label the stopping point information and combine it with the stopping position information in the stopping point information to generate special point information. For example, if the previous special point information is P2(X1, Y2), then the special point information corresponding to this stopping position can be P3(X1, Y3).

[0085] S24: When the tool is at a preset special point during the movement, special point information is generated based on the tool's position information.

[0086] In this embodiment, special locations can be understood as sharp bends, corners, and other similar locations.

[0087] Specifically, when the tool is at a sharp bend or corner during its movement, the processor can generate special position information based on the tool's position information and sequence number.

[0088] Furthermore, step S22 specifically includes:

[0089] S221: Based on the stop point information and the previous special point information, determine the moving distance between the stop position and the previous special point to which the previous special point information belongs.

[0090] Specifically, the processor can determine the distance the stopping position is to the previous special point to which the previous special point belongs, based on the stopping point information and the position information in the previous special point information.

[0091] S222: If the moving distance is greater than the preset distance threshold, the stopping position is considered to meet the special point condition.

[0092] Specifically, the processor can compare the moving distance with a preset distance threshold. If the moving distance is greater than the preset distance threshold, the stopping position is determined to meet the special point condition.

[0093] S223: Otherwise, the stopping position is deemed not to meet the special point conditions.

[0094] Specifically, the processor can compare the moving distance with a preset distance threshold. If the moving distance is less than or equal to the preset distance threshold, it is determined that the stopping position does not meet the special point conditions.

[0095] Furthermore, step S3 specifically includes:

[0096] S31: Obtain the information of the previous special point corresponding to the special point information.

[0097] Specifically, the processor can subtract 1 from the label corresponding to the current special point information to obtain the previous label corresponding to the previous special point information, and then retrieve the previous special point information according to the previous label. For example, if the label of the current special point information is P4, then the label of the previous special point information is P3.

[0098] S32: Based on the special point information and the previous special point information, determine the movement trajectory information of the tool from the previous point to the special point corresponding to the special point information. The movement trajectory information includes the direction of movement and the distance of movement.

[0099] Specifically, the processor determines the movement trajectory of the tool from the previous point to the current point based on the specific point information and the previous specific point information. The movement trajectory information includes the direction and distance of movement. For example, the movement trajectory from the previous point P3 to the specific point P4 is a distance of 10 units in the X direction.

[0100] S33: Record information on special locations and generate corresponding G1 code blocks based on movement trajectory information.

[0101] Specifically, the processor can record information about specific locations and generate corresponding G1 code blocks based on the movement trajectory information.

[0102] Optionally, the method further includes:

[0103] When the control coordinate system changes during tool movement, the tool's switching position and switching method are recorded in the G-code file.

[0104] Specifically, the processor can detect the control coordinate system in real time during the tool movement process. When the control coordinate system of the tool changes during the tool movement, the processor records the switching position and switching method of the tool in the G-code file.

[0105] At the same time, if the coordinate system is switched during the movement, the switching action will also be recorded. For example, if it was originally the machine coordinate system (joint coordinate system), and then switched to the world coordinate system or tool coordinate system after a period of movement, when the tool is fed again, it will first switch to the world coordinate system or tool coordinate system, and then switch to the machine coordinate system (joint coordinate system) after reaching the switching point.

[0106] The technical solution of this invention involves changing the tool's control method and generating a first G1 code block in a preset G-code file when the tool's state during cutting meets the recording conditions. The tool is then controlled to move according to the control method, and special point information during its movement is determined. Based on this special point information, corresponding G1 code blocks are generated in the G-code file. When the tool's movement state meets the termination condition, the G-code file is retrieved to complete the tool's trajectory recording. When the tool meets the position recovery condition, its position is restored according to the generated G-code file. Determining special point information during tool movement enables automatic identification and marking of these points. Determining G1 code blocks based on the movement trajectories between adjacent special points records the safe movement trajectory of the tool. Controlling the tool's position recovery via the G-code file avoids collisions with the material or model during tool reset, improving safety and ensuring cutting accuracy.

[0107] For example, to facilitate understanding of this method, a specific example is used as a demonstration: when the device on which the tool is set alarms or resets and stops, the processor can grant the tool manual control permission, switch to manual start of movement, and record all movement trajectories in sequence. X, Y, and Z represent the directions in the coordinate system, and these values ​​are all distances moved.

[0108] (Currently in tool coordinate system, G115) Z20. (Switch to tool joint coordinate system (machine coordinate system), G112) X10. Y10. C10. (Switch to world coordinate system, G111) X15. Y15. (Then switch to automatic preparation for startup)

[0109] The following code is generated before startup:

[0110] Seventh G1 code block: G111 (Since the previous data recorded the movement distance, the rollback should also roll back the incremental distance, so G91 is defined)

[0111] Sixth G1 code block: G91G01X15.

[0112] Fifth G1 code block: F100. (Speed ​​F can be defined by the user within the control system) Y15.

[0113] Fourth G1 code block: G112 $3C10.

[0114] Third G1 code block: Y10.

[0115] Second G1 code block: X10.

[0116] First G1 code block: G115 Z20. Example 2

[0117] Figure 2 This is a schematic diagram of a tool position recovery device according to Embodiment 2 of the present invention. This device can be implemented using software and / or hardware, and is generally integrated into the electronic device performing the method. For example... Figure 2 As shown, the device includes: a first generation module 21, a point information determination module 22, a second generation module 23, a file acquisition module 24, and a position recovery module 25. The first generation module 21 is used to change the control mode of the tool when the tool's state during cutting meets the recording conditions, and to generate a first G1 code block in a preset G-code file.

[0118] The point information determination module 22 is used to control the tool to move according to the control method and determine the special point information of the tool during the movement process.

[0119] The second generation module 23 is used to generate corresponding G1 code blocks in the G code file based on the special point information.

[0120] The file acquisition module 24 is used to acquire the G-code file when the movement state of the tool meets the termination condition, so as to complete the trajectory recording of the tool.

[0121] The position recovery module 25 is used to control the tool to perform position recovery according to the generated G-code file when the tool meets the position recovery conditions.

[0122] Furthermore, the first generation module 21 is specifically used for: granting manual control permission to the tool; obtaining the position information and coordinate system type of the tool at the moment the recording conditions are met; recording the position information and coordinate system type and generating a first G1 code block in a preset G code file.

[0123] Furthermore, the location information determination module 22 includes:

[0124] The information acquisition unit is used to acquire the stopping point information of the tool and the previous special point information when the tool is in a stopped state during movement.

[0125] The condition determination unit is used to determine whether the stopping position meets the special point condition based on the stopping point information and the previous special point information;

[0126] The first generation unit is used to generate the special point information based on the stop point information if the stop position satisfies the special point condition.

[0127] The second generation unit is used to generate the special point information based on the position information of the tool when the tool is at a preset special point during the movement.

[0128] Specifically, the condition determination unit is used to: determine the moving distance between the stopping position and the previous special point to which the previous special point belongs, based on the stopping point information and the previous special point information; if the moving distance is greater than a preset distance threshold, then the stopping position is deemed to meet the special point condition; otherwise, the stopping position is deemed not to meet the special point condition.

[0129] Further, the second generation module 23 is specifically used for: obtaining the previous special point information corresponding to the special point information; determining the movement trajectory information of the tool from the previous point to the special point information based on the special point information and the previous special point information, wherein the movement trajectory information includes the direction of movement and the distance of movement; recording the special point information and generating a corresponding G1 code block based on the movement trajectory information.

[0130] Optionally, the device further includes a switching recording module, used to record the switching position and switching method of the tool in the G-code file when the control coordinate system is switched during the movement of the tool.

[0131] The technical solution of this invention involves changing the tool's control method and generating a first G1 code block in a preset G-code file when the tool's state during cutting meets the recording conditions. The tool is then controlled to move according to the control method, and special point information during its movement is determined. Based on this special point information, corresponding G1 code blocks are generated in the G-code file. When the tool's movement state meets the termination condition, the G-code file is retrieved to complete the tool's trajectory recording. When the tool meets the position recovery condition, its position is restored according to the generated G-code file. Determining special point information during tool movement enables automatic identification and marking of these points. Determining G1 code blocks based on the movement trajectories between adjacent special points records the safe movement trajectory of the tool. Controlling the tool's position recovery via the G-code file avoids collisions with the material or model during tool reset, improving safety and ensuring cutting accuracy.

[0132] The tool position recovery device provided in this embodiment of the invention can execute a tool position recovery method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method. Example 3

[0133] Figure 3 This is a schematic diagram of the structure of an electronic device 400 provided in Embodiment 3 of the present invention. The electronic device in this embodiment can be a device corresponding to the backend service platform of an application, or a mobile terminal device with an application client installed. Specifically, the electronic device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 3 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0134] like Figure 3 As shown, electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 401, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 402 or a program loaded from storage device 408 into random access memory (RAM) 403. RAM 403 also stores various programs and data required for the operation of electronic device 400. Processing device 401, ROM 402, and RAM 403 are interconnected via bus 404. Input / output (I / O) interface 405 is also connected to bus 404.

[0135] Typically, the following devices can be connected to I / O interface 405: input devices 406 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 407 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 408 including, for example, magnetic tapes, hard disks, etc.; and communication devices 409. Communication device 409 allows electronic device 400 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 An electronic device 400 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0136] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 409, or installed from storage device 408, or installed from ROM 402. When the computer program is executed by processing device 401, it performs the functions defined in the methods of embodiments of this disclosure.

[0137] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0138] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0139] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0140] The aforementioned computer-readable medium carries one or more programs. When the electronic device executes one or more of these programs, it causes the internal processes of the electronic device to execute: when the state of the tool during the cutting process meets the recording conditions, the control mode of the tool is changed, and a first G1 code block is generated in a preset G-code file; the tool is controlled to move according to the control mode, and special point information of the tool during the movement is determined; based on the special point information, a corresponding G1 code block is generated in the G-code file; when the movement state of the tool meets the termination condition, the generated G-code file is obtained to complete the trajectory recording of the tool; when the tool meets the position recovery condition, the tool is controlled to perform position recovery according to the generated G-code file.

[0141] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0142] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0143] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units are not, in some cases, intended to limit the specific unit.

[0144] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.

[0145] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0146] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this disclosure.

[0147] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0148] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A method for restoring the position of a cutting tool, characterized in that, Includes the following steps: S1: When the state of the tool during the cutting process meets the recording conditions, change the control mode of the tool and generate the first G1 code block in the preset G code file; S2: Control the tool to move according to the control method, and determine the special position information of the tool during the movement process; S3: Based on the specific location information, generate the corresponding G1 code block in the G code file; S4: When the movement state of the tool meets the termination condition, obtain the generated G-code file to complete the trajectory recording of the tool; S5: When the tool meets the position recovery condition, control the tool to perform position recovery according to the generated G-code file.

2. The tool position recovery method according to claim 1, characterized in that, Step S1 specifically includes: S11: Grant manual control access to the cutting tool; S12: Obtain the position information and coordinate system type of the tool at the moment when the recording conditions are met; S13: Record the location information and coordinate system type, and generate the first G1 code block in the preset G code file.

3. The tool position recovery method according to claim 1, characterized in that, Step S2 specifically includes: S21: When the tool is in a stopped state during movement, obtain the stopping point information of the stopping position of the tool and the previous special point information; S22: Based on the stop point information and the previous special point information, determine whether the stop position meets the special point condition; S23: If the stopping position satisfies the special point condition, then generate the special point information based on the stopping point information; S24: When the tool is at a preset special point during movement, the special point information is generated based on the position information of the tool.

4. The tool position recovery method according to claim 3, characterized in that, Step S22 specifically includes: S221: Based on the stop point information and the previous special point information, determine the moving distance between the stop position and the previous special point to which the previous special point information belongs; S222: If the moving distance is greater than a preset distance threshold, then the stopping position is deemed to meet the special point condition; S223: Otherwise, it is determined that the stopping position does not meet the special point condition.

5. The tool position recovery method according to claim 1, characterized in that, Step S3 specifically includes: S31: Obtain the previous special point information corresponding to the special point information; S32: Based on the special point information and the previous special point information, determine the movement trajectory information of the tool from the previous point to the special point corresponding to the special point information, wherein the movement trajectory information includes the direction of movement and the distance of movement. S33: Record the special location information and generate the corresponding G1 code block based on the movement trajectory information.

6. The tool position recovery method according to claim 1, characterized in that, Also includes: When the control coordinate system of the tool changes during the movement of the tool, the switching position and switching method of the tool at the time of the switch are recorded in the G-code file.

7. A tool position recovery device, characterized in that, include: The first generation module is used to change the control mode of the tool when the state of the tool during the cutting process meets the recording conditions, and generate the first G1 code block in the preset G code file. The point information determination module is used to control the tool to move according to the control method and determine the special point information of the tool during the movement process; The second generation module is used to generate a corresponding G1 code block in the G code file based on the special point information. The file acquisition module is used to acquire the G-code file when the movement state of the tool meets the termination condition, so as to complete the trajectory recording of the tool. The position recovery module is used to control the tool to perform position recovery according to the generated G-code file when the tool meets the position recovery conditions.

8. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.

9. A computer storage medium, characterized in that, The computer storage medium stores computer instructions that are used to cause a processor to execute the method of any one of claims 1-6.

Citation Information

Patent Citations

  • Automatic operating system for numerical controller

    JP1995334220A

  • Diesinking electric discharge machine controller and contouring work of diesinking electric discharge machine

    JP1997117827A