An interference detection method, device and medium
By establishing an octree hierarchical model of the workpiece shape and meshing the cutting head shape, combined with homogeneous coordinate transformation and binary tree storage, the problems of large computational load and poor real-time performance in the existing technology are solved, realizing fast and real-time interference detection and improving the safety and efficiency of the CNC system.
Patent Information
- Application Number
- CN202311225897.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-21
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2043-09-21
AI Technical Summary
Existing technologies lack a real-time method that can quickly complete interference detection in a short time. Especially in the process of CNC system simulation machining, the octree hierarchical spherical hybrid model algorithm needs to traverse a large number of child nodes, resulting in serious computational consumption and making it difficult to achieve real-time interference detection.
An octree hierarchical model is established for the workpiece shape, and the surface of the cutting head shape is meshed. The computational load is reduced by calculating the distance between the workpiece shape nodes and the cutting head mesh data points. A homogeneous coordinate transformation algorithm is used for coordinate system transformation, and a binary tree storage linked list is used to store the octree model. Only the distance between the virtual nodes and the cutting head mesh data points is calculated to achieve interference detection.
It greatly reduces the amount of computation, achieves real-time interference detection, improves detection efficiency, can quickly determine the position and time of interference collisions, and improves the safety and reliability of CNC systems.
Smart Images

Figure CN117260392B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present specification relates to the technical field of simulation processing, and particularly relates to an interference detection method, device and medium. BACKGROUND
[0002] Interference collision between each moving part of a numerical control machine tool can cause accidents, especially cutting head, workpiece and even machine tool damage caused by interference collision in high-speed machining, and even cause personal accidents. Therefore, interference detection is important in numerical control system simulation processing.
[0003] Detecting whether interference occurs when the workpiece and machine tool processing parts move is one of the main functions of the simulation system, and efficient interference detection can quickly determine the position and time of interference collision and report the corresponding NC program segment or machine tool axis position coordinate value of the numerical control system that causes interference problems.
[0004] The octree single sphere combination model algorithm based on the rule entity surface gridding traversal is a method frequently used for collision interference detection in numerical control system simulation processing. Although the octree hierarchical sphere hybrid model algorithm can exhaustively detect collision interference between two complex shape entities, the octree hierarchical structure nodes of the two entities to be detected must be constantly traversed during the detection process, and the number of nodes to be traversed is usually large, which consumes a lot of system time. There is still considerable technical difficulty in realizing real-time simulation of collision interference under the current industrial PC system hardware environment.
[0005] In summary, for the simulation processing of a laser numerical control system, there is a lack of a method that is strong in real-time and can quickly complete interference detection in a short time. SUMMARY
[0006] One or more embodiments of the present specification provide an interference detection method for solving the technical problem that the prior art lacks a method that is strong in real-time and can quickly complete interference detection in a short time.
[0007] One or more embodiments of the present specification adopt the following technical solutions:
[0008] One or more embodiments of the present specification provide an interference detection method, which comprises:
[0009] Obtaining a cutting head shape and a workpiece shape, and constructing an octree hierarchical model of the workpiece shape, wherein the octree hierarchical model takes the minimum circumscribed cube of the workpiece shape as a root node, and the sub-cubes obtained by dividing the root node are taken as sub-nodes;
[0010] Grid processing is performed on the surface of the cutting head body, all grid data points on the surface of the cutting head body are traversed, and a first distance between each grid data point and a root node of the workpiece is calculated;
[0011] When the first distance is greater than a root node radius of the workpiece, it is determined that the cutting head does not interfere with the workpiece, and the root node radius is a minimum circumscribed spherical radius of the root node;
[0012] When the first distance is less than or equal to the root node radius of the workpiece, a second distance between the grid data point and a child node is calculated;
[0013] When the second distance is less than or equal to a child node radius, or the child node radius is less than a preset precision threshold, it is determined that the cutting head interferes with the workpiece, and an alarm is given, and the child node radius is a minimum circumscribed spherical radius of the child node.
[0014] Further, before it is determined that the cutting head interferes with the workpiece when the second distance is less than or equal to the child node radius, or the child node radius is less than the preset precision threshold, the method further comprises:
[0015] When the second distance is greater than the child node radius, the current child node is re-divided, and a cube of a next level obtained by the division is updated as a child node of the current level;
[0016] The second distance between the child node of the current level and the grid data point is calculated and compared with a child node radius of the current level;
[0017] If the second distance is greater than the child node radius, the steps of re-dividing the current child node, updating the child node and calculating the updated second distance are repeatedly performed until the second distance is less than or equal to the child node radius, or the child node radius is less than the preset precision threshold.
[0018] Further, the calculation of the second distance between the grid data point and the child node comprises:
[0019] All grid data points on the surface of the cutting head body are traversed, and all child nodes of the workpiece body at the current level are traversed;
[0020] The second distance between each child node and each grid data point is calculated.
[0021] Further, the method further comprises:
[0022] If the second distance between each child node of the current level and all grid data points is greater than the child node radius, it is determined that the cutting head does not interfere with the workpiece.
[0023] Further, the second distance between each child node and each grid data point is calculated, including:
[0024] All child nodes of the current level are traversed, and the positional relationship between the child nodes and the workpiece body boundary is detected;
[0025] When the child node is completely located inside or outside the workpiece body, the child node is determined as a real node, otherwise the node is determined as a virtual node;
[0026] The second distance between each virtual node and each grid data point is calculated.
[0027] Further, the current child node is further divided, and the next level of cubes obtained by the division are updated as child nodes, including:
[0028] The current virtual node is further divided, all child cubes of the current level obtained by the division are traversed, and the positional relationship between the child cubes and the workpiece body boundary is detected, all virtual nodes in the child cubes of the current level are determined, and the virtual nodes are updated as virtual nodes of the current level;
[0029] The second distance between the child nodes of the current level and the grid data points is calculated and compared with the child node radius of the current level, including:
[0030] The second distance between the virtual nodes of the current level and the grid data points is calculated and compared with the virtual node radius of the current level.
[0031] Further, it further includes:
[0032] According to the octree hierarchical model, a binary tree storage chain table is established;
[0033] In the storage chain table, 1 represents a real node and 0 represents a virtual node.
[0034] Further, it further includes:
[0035] The homogeneous coordinate transformation algorithm is used to convert the coordinate values of the root node and the child nodes in the workpiece coordinate system to the machine tool coordinate system, and the coordinate values of the surface data points in the cutting head coordinate system to the machine tool coordinate system;
[0036] Based on the coordinate values of the root node, the child nodes, and the surface data points in the machine tool coordinate system, the first distance and the second distance are calculated.
[0037] One or more embodiments of the present specification provide an interference detection device, comprising:
[0038] at least one processor; and,
[0039] a memory connected in communication with the at least one processor; wherein,
[0040] the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the following steps:
[0041] obtaining a cutting head shape and a workpiece shape, and constructing an octree hierarchical model of the workpiece shape, the octree hierarchical model taking a minimum circumscribed cube of the workpiece shape as a root node, and taking a child cube obtained by splitting the root node as a child node;
[0042] performing meshing processing on a surface of the cutting head shape, traversing the surface of the cutting head shape and obtaining mesh data points, and calculating a first distance between each of the mesh data points and a root node of a workpiece;
[0043] when the first distance is greater than a root node radius of the workpiece, determining that the cutting head does not interfere with the workpiece, the root node radius being a minimum circumscribed spherical radius of the root node;
[0044] when the first distance is less than or equal to the root node radius of the workpiece, calculating a second distance between the mesh data points and the child node;
[0045] when the second distance is less than or equal to a child node radius, or the child node radius is less than a preset precision threshold, determining that the cutting head interferes with the workpiece, and performing an alarm, the child node radius being a minimum circumscribed spherical radius of the child node.
[0046] One or more embodiments of the present specification provide a non-volatile computer storage medium, storing computer executable instructions, the computer executable instructions being configured to perform the following steps:
[0047] obtaining a cutting head shape and a workpiece shape, and constructing an octree hierarchical model of the workpiece shape, the octree hierarchical model taking a minimum circumscribed cube of the workpiece shape as a root node, and taking a child cube obtained by splitting the root node as a child node;
[0048] performing meshing processing on a surface of the cutting head shape, traversing the surface of the cutting head shape and obtaining mesh data points, and calculating a first distance between each of the mesh data points and a root node of a workpiece;
[0049] determining that the cutting head does not interfere with the workpiece when the first distance is greater than a root node radius of the workpiece, the root node radius being a minimum circumscribed spherical radius of the root node;
[0050] calculating a second distance between the grid data point and the sub-node when the first distance is less than or equal to the root node radius of the workpiece;
[0051] determining that the cutting head interferes with the workpiece and issuing an alarm when the second distance is less than or equal to a sub-node radius, or the sub-node radius is less than a preset precision threshold, the sub-node radius being a minimum circumscribed spherical radius of the sub-node.
[0052] The above at least one technical solution adopted by the embodiments of the present specification can achieve the following beneficial effects:
[0053] The present application only establishes an octree hierarchical model for the workpiece shape, and performs surface meshing processing on the regular shape entity of the cutting head, realizes interference detection by calculating the distance between the nodes of the workpiece shape and the grid data points of the cutting head, greatly reduces the calculation amount compared with the prior art, and can realize real-time detection of interference. BRIEF DESCRIPTION OF DRAWINGS
[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present specification or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments described in the present specification, and other drawings can also be obtained according to these drawings without creative labor. In the drawings:
[0055] Figure 1 a simple flowchart of an interference detection method provided by the embodiments of the present specification;
[0056] Figure 2 an octree single sphere combined model interference detection algorithm flowchart provided by the embodiments of the present specification;
[0057] Figure 3 a cutting head entity decomposition and surface traversal schematic diagram provided by the embodiments of the present specification;
[0058] Figure 4 an octree hierarchical structure representation schematic diagram of a workpiece shape provided by the embodiments of the present specification;
[0059] Figure 5 a simulation system coordinate system schematic diagram provided by the embodiments of the present specification;
[0060] Figure 6An octree node data conversion binary tree data structure schematic diagram provided by an embodiment of the present specification is shown in the following figure. DETAILED DESCRIPTION
[0061] In order to make the person skilled in the art better understand the technical solutions in the present specification, the technical solutions in the present specification will be described clearly and completely in the following with reference to the drawings in the present specification. Obviously, the described embodiments are only part of the embodiments of the present specification, not all. Based on the embodiments of the present specification, all other embodiments obtained by the person skilled in the art without creative labor should belong to the protection scope of the present specification.
[0062] The interference detection involved in the present application is an important function of the simulation processing process of the numerical control system. The octree hierarchical hybrid model algorithm in the prior art is a relatively mature detection algorithm, which represents the three-dimensional space occupied by an object in a spherical unit hierarchy. Generally, the cutting head shape and the workpiece shape are constructed as octree hierarchical models, and the cutting head shape and the workpiece shape are converted into two spherical regions, the interference detection is converted into the center distance detection of the two spherical regions, the coordinates of the center are calculated first, then the distance of the center is calculated, so as to realize the interference detection. Although this way has high precision, but in the detection process, the child nodes of the two octree hierarchical models need to be traversed constantly, and the calculation is very tedious. In order to ensure the real-time requirement of the simulation processing interference detection of the data system, the model and the algorithm are improved, which will be described in detail in the following reference embodiments.
[0063] An interference detection method is provided in an embodiment of the present specification. Figure 1 A simple flowchart of an interference detection method provided by an embodiment of the present specification is shown in the following figure. Figure 1 and Figure 2 As shown in the figure, the method mainly includes the following steps:
[0064] In step S101, the cutting head shape and the workpiece shape are obtained, and an octree hierarchical model of the workpiece shape is constructed, the octree hierarchical model takes the minimum circumscribed cube of the workpiece shape as the root node, and the child cubes obtained by dividing the root node are taken as the child nodes.
[0065] First, the minimum circumscribed cube of the workpiece shape is constructed and taken as the root node of the octree hierarchical model, and then the root node is divided into 8 (i.e. 23) child cubes, which are taken as the child nodes of the octree hierarchical model.
[0066] Figure 4Fig. 1 is a schematic diagram of the structure of an octree hierarchical model of a workpiece body in an embodiment of the present application. The minimum circumscribed cube of the workpiece entity is divided into eight sub-cubes according to the following principle. Let the minimum circumscribed cube be represented by four parameters X, Y, Z and L. The cube is divided into eight sub-cubes by cutting the edges along the X, Y and Z directions at the midpoint, respectively, to obtain the following eight sub-cubes: (1) (X, Y, Z, L / 2); (2) (X, Y+L / 2, Z, L / 2); (3) (X, Y, Z+L / 2, L / 2); (4) (X, Y+L / 2, Z+L / 2, L / 2); (5) (X+L / 2, Y, Z, L / 2); (6) (X+L / 2, Y+L / 2, Z, L / 2); (7) (X+L / 2, Y, Z+L / 2, L / 2); (8) (X+L / 2, Y+L / 2, Z+L / 2, L / 2).
[0067] The sub-cubes contained in any node of the octree hierarchical model of the workpiece only need to record their attribute information, and their geometric information can be calculated according to their position in the model. The traversal order of the nodes N is 1, 5, 7, and the calculation of the node parameters is as follows:
[0068] x = X + 3L / 8
[0069] y = Y + 3L / 8
[0070] z = Z + 3L / 8
[0071] where X, Y, Z and L are the node dimensions.
[0072] The position of the sub-cubes in the workpiece body is tested. If the sub-cubes are inside or outside the body, they are recorded as "real nodes", and if they are on the boundary of the workpiece body, they are recorded as "virtual nodes". Then the "real nodes" are further divided until the edge length of the sub-cubes is less than times the preset precision threshold. When the "real nodes" are divided hierarchically to an edge length less than times the detection precision, the lower nodes are defined as "virtual nodes". That is, when the real nodes are small enough, they can be classified as virtual nodes.
[0073] Since the "virtual nodes" save all the information of the surface of the workpiece entity, in the actual interference detection process, the interference between the "virtual nodes" of the workpiece model and the grid data points of the cutting head is checked. Only the second distance between the "virtual nodes" and the grid data points of the cutting head is calculated, thereby effectively reducing the calculation amount and improving the real-time performance of the interference detection.
[0074] As described above, when the workpiece body is divided, the sub-cubes are defined as two types of "real nodes" and "virtual nodes". The real node type of cubes includes cubes inside and outside the body. Referring to Figure 6In this way, the sub-cubes of each cube can be represented by a byte in the computer, and the bit number of the byte represents the serial number of the cube, and the value of the bit represents the attribute of the cube, 0 representing a "virtual node" and 1 representing a "real node". In this way, the octree hierarchical model can be stored in a 0-1 bitmap. In this way, the operation on the octree is converted into the operation on the binary tree, and the storage structure and algorithm of the tree structure of the binary tree are relatively simple. The octree and the binary tree have a natural one-to-one correspondence, and any octree can be uniquely corresponded to a binary tree, and vice versa. Therefore, the storage and traversal of the octree data structure can be converted into the storage and traversal of the binary tree data structure.
[0075] In step S102, the surface of the cutting head entity is meshed, the surface of the cutting head entity is traversed to obtain mesh data points, and a first distance between the mesh data points and a root node of the workpiece is calculated.
[0076] The cutting head entity shape can be processed as a regular shape entity in the simulation system. For example, referring to Figure 3 In laser bevel processing, the cutting head entity shape can be decomposed into a cylinder and a conical body, and then the surface information of the two regular shape entities can be obtained by meshing the side surface of the cylinder and the spherical surface of the conical body, so that the traversal calculation process of a large number of sub-nodes in the complex octree hierarchical spherical hybrid model of the cutting head entity shape is avoided, and the interference detection calculation can be performed more quickly.
[0077] Since the sub-nodes, the root node and the surface data points involved in the application are in the workpiece coordinate system and the cutting head coordinate system respectively, and the cutting head coordinate system and the workpiece coordinate system are always established with the center of the cutting head and the workpiece as the coordinate system origin. First, the workpiece coordinate system and the cutting head coordinate system need to be changed to the machine tool coordinate system by translation and rotation. Then the distance calculation is performed.
[0078] In the embodiment of the application, the coordinate system transformation is performed according to the homogeneous coordinate transformation principle, and the specific transformation steps are as follows:
[0079] Referring to Figure 5 The movement of the cutting head is X-direction translation, Y-direction translation and swing around the X-axis. The movement of the workpiece is Z-direction translation and rotation around the Y-axis. The spatial conversion of the translation and rotation of the cutting head and the workpiece uses homogeneous coordinate transformation.
[0080] Let a point P(x, y, z) on the tool, and according to the homogeneous coordinate transformation principle, the coordinates P(x', y', z') of the cutting head after X-direction translation are:
[0081] x' = x + 1; y' = y + m; z' = z + n;
[0082] Wherein, l, m, n are the movement of point P along X, Y, Z axis respectively. The rotation transformation matrix Tx of cutting head rotating around X axis is:
[0083]
[0084] Wherein, a is the rotation angle of cutting head around X axis. When cutting head rotates around X axis, the coordinate P(x', y', z') is derived as follows:
[0085]
[0086] Then x'=x; y'=y; z'=Y;
[0087] Similarly, other movements of cutting head can be calculated according to the above method.
[0088] Step S103, when the first distance is greater than the root node radius of the workpiece, it is determined that the cutting head does not interfere with the workpiece.
[0089] Wherein, in the present application, the radius of the minimum circumscribed sphere of the root node is taken as the root node radius, and when the first distance is greater than the root node radius, the cutting head and the workpiece will not interfere with each other.
[0090] Step S104, when the first distance is less than or equal to the root node radius of the workpiece, the child nodes of the octree hierarchical model are traversed, and the second distance between the grid data points and the child nodes of the workpiece is calculated.
[0091] When the first distance is greater than the root node radius of the workpiece, the child nodes of the octree hierarchical model are traversed, and the second distance between each child node and each grid data point is calculated. If the second distance is greater than the radius of the child node, the current child node is further divided to obtain the child nodes of the next level, and the second distance between the child nodes of the next level and the grid data points is calculated, and then the obtained second distance and the radius of the child nodes of the next level are compared. If the second distance is greater than the radius of the child node, the step of further dividing the child node is repeatedly executed until the second distance is less than or equal to the radius of the child node, or the radius of the child node is less than the preset accuracy threshold. Wherein, in the present application, the radius of the minimum circumscribed sphere of the child node is taken as the radius of the child node.
[0092] Step S105, when the second distance is less than or equal to the radius of the child node, or the radius of the child node is less than the preset accuracy threshold, it is determined that the cutting head interferes with the workpiece, and an alarm is given.
[0093] If the second distance is less than or equal to the radius of the child node, the cutting head and the workpiece interfere with each other.
[0094] The preset precision threshold refers to the minimum segmentation precision set by the worker in advance, when the sub-node radius is smaller than the preset precision threshold, the distance between the cutting head and the workpiece is very close, in order to improve the safety and reduce the number of segmentation and calculation, when the sub-node radius is smaller than the preset precision threshold, no longer segmentation and calculation is performed, and it is directly determined that the cutting head and the workpiece interfere.
[0095] In summary, the application only establishes an octree hierarchical model for the workpiece shape, and performs surface meshing processing on the regular shape entity of the cutting head shape, realizes interference detection by calculating the distance between the nodes of the workpiece shape and the mesh data points of the cutting head, greatly reduces the calculation amount compared with the prior art, and can realize real-time detection of interference.
[0096] The embodiment of the present application also provides an interference detection device, which comprises: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:
[0097] obtain a cutting head shape and a workpiece shape, and construct an octree hierarchical model of the workpiece shape, the octree hierarchical model taking a minimum circumscribed cube of the workpiece shape as a root node, and taking a sub-cube obtained by segmenting the root node as a sub-node;
[0098] perform meshing processing on the surface of the cutting head shape, traverse the surface of the cutting head shape and obtain mesh data points, and calculate a first distance between each mesh data point and the root node of the workpiece;
[0099] when the first distance is greater than a root node radius of the workpiece, determine that the cutting head does not interfere with the workpiece, the root node radius being a minimum circumscribed spherical radius of the root node;
[0100] when the first distance is smaller than or equal to the root node radius of the workpiece, calculate a second distance between the mesh data point and the sub-node;
[0101] when the second distance is smaller than or equal to a sub-node radius, or the sub-node radius is smaller than a preset precision threshold, determine that the cutting head interferes with the workpiece, and perform alarm, the sub-node radius being a minimum circumscribed spherical radius of the sub-node.
[0102] The embodiment of the present application also provides a non-volatile computer storage medium, which stores computer executable instructions, and the computer executable instructions are set to:
[0103] The cutting head shape and the workpiece shape are acquired, and an octree hierarchical model of the workpiece shape is constructed, the octree hierarchical model taking a minimum circumscribed cube of the workpiece shape as a root node, and a sub-cube obtained by splitting the root node as a sub-node;
[0104] The surface of the cutting head shape is subjected to a meshing process, the surface of the cutting head shape is traversed to obtain mesh data points, and a first distance between each mesh data point and the root node of the workpiece is calculated;
[0105] When the first distance is greater than a root node radius of the workpiece, it is determined that the cutting head does not interfere with the workpiece, the root node radius being a minimum circumscribed spherical radius of the root node;
[0106] When the first distance is less than or equal to the root node radius of the workpiece, a second distance between the mesh data point and the sub-node is calculated;
[0107] When the second distance is less than or equal to a sub-node radius, or the sub-node radius is less than a preset precision threshold, it is determined that the cutting head interferes with the workpiece, and an alarm is given, the sub-node radius being a minimum circumscribed spherical radius of the sub-node.
[0108] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment mainly describes the difference from other embodiments. Especially, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment.
[0109] The above describes specific embodiments of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different than the order in the embodiments and still achieve the desired result. In addition, the processes depicted in the figures do not necessarily require the particular order shown or sequential order to achieve the desired results. In some implementations, multitasking and parallel processing can be advantageous or possible.
[0110] The device and medium provided by the embodiments of the specification are one-to-one corresponding to the method, and therefore, the device and medium also have similar beneficial technical effects to the method. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the device and medium will not be described here.
[0111] Those skilled in the art will appreciate that embodiments of the present description can be readily used as a method, a system or a computer program product. Accordingly, the present description can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present description can take the form of a computer program product on one or more computer readable storage media (including, but not limited to, disk memory, CD-ROMs, optical storage devices, etc.) embodying computer readable program code.
[0112] The present description is described in reference to flow diagrams and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the present description. It will be understood that each block of the flow diagrams and / or block diagrams, and combinations of blocks in the flow diagrams 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 processing device 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, create means for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks. Figure 1 one or more functions specified in the flow diagram and / or block diagram block or blocks. Figure 1 one or more functions specified in the flow diagram and / or block diagram block or blocks.
[0113] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the flow diagrams and / or block diagrams block or blocks. Figure 1 one or more functions specified in the flow diagram and / or block diagram block or blocks. Figure 1 one or more functions specified in the flow diagram and / or block diagram block or blocks.
[0114] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the flow diagrams and / or block diagrams block or blocks. Figure 1 one or more functions specified in the flow diagram and / or block diagram block or blocks. Figure 1 one or more functions specified in the flow diagram and / or block diagram block or blocks.
[0115] In one typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0116] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) and / or cache memory. The memory can also include non-volatile memory, such as read-only memory (ROM), electrically programmable read-only memory (EPROM), electrically erasable read-only memory (EEPROM), flash memory, or a combination of non-volatile memories in different forms. The memory is an example of computer readable storage media.
[0117] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology for storing information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.
[0118] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusions, so that a process, method, article or apparatus that includes a list of elements does not only include those elements, but also includes other elements not explicitly listed, or other elements inherent to such a process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.
[0119] The above description is only one or more embodiments of the specification and is not intended to limit the specification. One or more embodiments of the specification can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the spirit and principles of one or more embodiments of the specification should be included in the scope of the claims of the specification.
Claims
1. An interferometric detection method, characterized in that, The method includes: Obtain the shape of the cutting head and the shape of the workpiece, and construct an octree hierarchical model of the workpiece shape. The octree hierarchical model takes the smallest outer cube of the workpiece shape as the root node, and the sub-cubes obtained by dividing the root node as the child nodes. The surface of the cutting head is meshed, the surface of the cutting head is traversed and mesh data points are obtained, and the first distance between each mesh data point and the root node of the workpiece is calculated. When the first distance is greater than the root node radius of the workpiece, it is determined that the cutting head and the workpiece do not interfere with each other, and the root node radius is the minimum circumscribed spherical radius of the root node; When the first distance is less than or equal to the root node radius of the workpiece, the second distance between the mesh data point and the child node is calculated, including: traversing all mesh data points on the surface of the cutting head shape and traversing all child nodes of the workpiece shape at the current level; calculating the second distance between each child node and each mesh data point; When the second distance is less than or equal to the sub-node radius, or the sub-node radius is less than a preset accuracy threshold, it is determined that the cutting head interferes with the workpiece, and an alarm is triggered. The sub-node radius is the minimum circumscribed spherical radius of the sub-node. Before determining that the cutting head interferes with the workpiece when the second distance is less than or equal to the child node radius, or when the child node radius is less than a preset accuracy threshold, the method further includes: When the second distance is greater than the radius of the child node, the current child node is further divided, and the cube of the next level obtained from the division is updated to the child node of the current level. Calculate the second distance between the child node of the current level and the grid data point, and compare it with the radius of the child node of the current level; If the second distance is greater than the radius of the child node, then repeat the above steps of further dividing the current child node, updating the child node, and calculating the updated second distance until the second distance is less than or equal to the radius of the child node, or the radius of the child node is less than a preset precision threshold. Calculating the second distance between each child node and each grid data point includes: Traverse all child nodes of the current level and detect the positional relationship between the child nodes and the workpiece shape boundary; When the child node is completely located inside or outside the workpiece shape, the child node is determined as a real node; otherwise, the node is determined as a virtual node. Calculate the second distance between each virtual node and each of the aforementioned grid data points; The process of further dividing the current child node and updating the cube of the next level obtained from the division with the child nodes of the current level includes: The steps include further segmenting the current virtual node, traversing all sub-cubes of the current level obtained by the segmentation, detecting the positional relationship between the sub-cubes and the workpiece shape boundary, determining all virtual nodes in the sub-cubes of the current level, and updating the virtual nodes to the virtual nodes of the current level. The calculation of the second distance between the child node of the current level and the grid data point, and the comparison with the radius of the child node of the current level, includes: Calculate the second distance between the virtual node at the current level and the grid data point, and compare it with the radius of the virtual node at the current level.
2. The interference detection method according to claim 1, characterized in that, Also includes: If the second distance between each child node of the current level and all grid data points is greater than the radius of the child node, it is determined that the cutting head and the workpiece will not interfere.
3. The interference detection method according to claim 1, characterized in that, Also includes: Based on the octree hierarchical model, establish a binary tree storage linked list; In the storage linked list, 1 represents a real node and 0 represents a virtual node.
4. The interference detection method according to claim 1, characterized in that, Also includes: The homogeneous coordinate transformation algorithm is used to transform the coordinate values of the root node and the child node in the workpiece coordinate system to the machine tool coordinate system, and to transform the coordinate values of the surface data points in the cutting head coordinate system to the machine tool coordinate system. The first distance and the second distance are calculated based on the coordinate values of the root node, the child node, and the surface data point in the machine tool coordinate system.
5. An interference detection device, characterized in that, The device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform an interference detection method according to any one of claims 1-4.
6. A non-volatile computer storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are capable of executing an interference detection method according to any one of claims 1-4.
Citation Information
Patent Citations
Voxel interference detection method and system for machine tool processing process simulation
CN113359608A
Interference detection method and system of sensor in five-axis roughness measurement
CN114739329A