Cutter path planning method, device and equipment suitable for curved surface
The parameter domain path of the surface is processed through the cropping and depth cache algorithm, and a high-precision tool processing path is generated, which solves the accuracy problem of toolpath planning on complex surfaces and improves machining efficiency and quality.
Patent Information
- Application Number
- CN202411521312.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-02-07
AI Technical Summary
The prior art is difficult to generate high-precision tool processing paths, especially when dealing with complex curved surfaces.
By obtaining the parameter domain path of the surface to be processed, cropping based on the outer boundary and inner boundary, generating the tool site path, and using the depth cache algorithm for collision detection, obtaining the post-detection path.
It realizes the generation of high-precision tool processing paths on complex surfaces, improves machining efficiency and quality, and reduces material waste and tool wear.
Smart Images

Figure CN119396078A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of tool path planning, and in particular to a tool path planning method, device and equipment suitable for curved surfaces. Background Art
[0002] Tool Path Planning is an important concept in the field of Computer-Aided Manufacturing (CAM), which mainly involves how to optimize the motion trajectory of the tool on the workpiece surface in CNC machining to achieve efficient and precise machining.
[0003] Good tool path planning can improve machining efficiency, ensure machining quality, reduce material waste and tool wear, and also shorten production cycles and reduce production costs. However, how to generate high-precision tool machining paths is a problem that needs to be solved. Summary of the invention
[0004] The embodiments of this specification provide a tool path planning method, device and equipment suitable for curved surfaces to generate a high-precision tool processing path.
[0005] To solve the above technical problems, the embodiments of this specification are implemented as follows:
[0006] The embodiment of this specification provides a tool path planning method applicable to a curved surface, comprising:
[0007] Get the parameter domain path of the surface to be processed;
[0008] Clipping the parameter domain path based on the outer boundary and the inner boundary of the surface to be processed, retaining the path in the parameter domain path located within the outer boundary and removing the path in the inner boundary, to obtain a clipped path;
[0009] Based on the clipped path, a tool position path for processing the surface to be processed is obtained;
[0010] A depth buffer algorithm is used to perform collision detection on the tool position path to obtain a detected path.
[0011] The embodiment of this specification provides a tool path planning device suitable for curved surfaces, comprising:
[0012] A parameter domain path acquisition module is used to obtain the parameter domain path of the surface to be processed;
[0013] A path clipping module, used for clipping the parameter domain path based on the outer boundary and the inner boundary of the surface to be processed, retaining the path in the parameter domain path located within the outer boundary and removing the path located within the inner boundary, so as to obtain a clipped path;
[0014] A tool location point path acquisition module, used for obtaining a tool location point path for processing the surface to be processed based on the clipped path;
[0015] The collision detection module is used to perform collision detection on the tool position path by using a depth buffer algorithm to obtain a detected path.
[0016] The embodiment of this specification provides a tool path planning device suitable for curved surfaces, including:
[0017] at least one processor; and,
[0018] a memory communicatively connected to the at least one processor; wherein,
[0019] 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:
[0020] Get the parameter domain path of the surface to be processed;
[0021] Clipping the parameter domain path based on the outer boundary and the inner boundary of the surface to be processed, retaining the path in the parameter domain path located within the outer boundary and removing the path in the inner boundary, to obtain a clipped path;
[0022] Based on the clipped path, a tool position path for processing the surface to be processed is obtained;
[0023] The tool position point path is subjected to collision detection using a depth cache algorithm to obtain a post-detection path; the post-detection path includes a path of the tool on the surface to be processed and a path where the tool is not on the surface to be processed; the path where the tool is not on the surface to be processed includes a tool lifting path, a tool lowering path, and a moving path between the tool lifting path and the tool lowering path.
[0024] An embodiment of this specification can achieve the following beneficial effects:
[0025] The embodiments of this specification disclose a tool path planning method, device and equipment suitable for curved surfaces, and the scheme includes: obtaining the parameter domain path of the surface to be processed; clipping the parameter domain path based on the outer boundary and inner boundary of the surface to be processed, retaining the path in the parameter domain path located within the outer boundary and removing the path located within the inner boundary to obtain the clipped path; based on the clipped path, obtaining the tool position point path for processing the surface to be processed; using the depth cache algorithm to perform collision detection on the tool position point path to obtain the detected path. The embodiments of this specification can generate high-precision tool processing paths for various complex surfaces. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0027] Figure 1 Schematic diagram of tool contact points and tool position points of different tools provided in the embodiments of this specification;
[0028] Figure 2 A schematic diagram of a residual height provided in an embodiment of this specification;
[0029] Figure 3 A schematic diagram of a knife contact path spacing on a plane provided in an embodiment of this specification;
[0030] Figure 4 A schematic diagram of the knife contact path spacing on a convex surface provided in an embodiment of this specification;
[0031] Figure 5 A schematic diagram of the knife contact path spacing on a concave surface provided in an embodiment of this specification;
[0032] Figure 6 A schematic diagram of a bow height residual provided in an embodiment of this specification;
[0033] Figure 7 A schematic diagram of a residual curve provided in an embodiment of this specification;
[0034] Figure 8 A schematic diagram of a tool envelope surface provided in an embodiment of this specification;
[0035] Fig. 9 A schematic diagram of a residual surface provided in an embodiment of this specification;
[0036] Fig.10 A schematic flow chart of a tool path planning method applicable to a curved surface provided in an embodiment of this specification;
[0037] Fig.11 A schematic diagram of a curved surface to be processed provided in an embodiment of this specification;
[0038] Fig.12 A schematic diagram of a parameter domain sampling point bias obtained based on an existing equal residual height method provided in an embodiment of this specification;
[0039] Fig.13A schematic diagram of a parameter domain sampling point offset obtained based on an adaptive equal residual height method provided in an embodiment of this specification;
[0040] Fig.14 A schematic diagram of a margin bias provided in an embodiment of this specification;
[0041] Fig.15 A schematic diagram before path deletion provided in an embodiment of this specification;
[0042] Fig.16 A schematic diagram of a path reduction based on a Z-buffer algorithm provided in an embodiment of this specification;
[0043] Fig.17 A schematic diagram of a ZigZag path provided in an embodiment of this specification;
[0044] Fig.18 A schematic diagram of a generated ZigZag path provided in an embodiment of this specification;
[0045] Fig.19 A schematic diagram of a generated ZigZag path provided in an embodiment of this specification;
[0046] Fig. 20 A schematic diagram of a generated ZigZag path provided in an embodiment of this specification;
[0047] Fig.21 A schematic diagram of a path generated based on a hole filling strategy provided in an embodiment of this specification;
[0048] Fig. 22 A schematic diagram of a path generated based on a hole filling strategy provided in an embodiment of this specification;
[0049] Fig.23 A schematic diagram of a path generated based on a spiral strategy provided in an embodiment of this specification;
[0050] Fig.24 The embodiments provided in this specification Fig.23 A partial enlarged view of
[0051] Fig.25 A schematic diagram of a path generated based on an existing path generation method provided in an embodiment of this specification;
[0052] Fig.26 A schematic diagram of a path generated based on a guide edge strategy provided in an embodiment of this specification. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solutions and advantages of one or more embodiments of this specification clearer, the technical solutions of one or more embodiments of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of one or more embodiments of this specification.
[0054] The following is an explanation of the existing terms involved in the embodiments of this specification.
[0055] Figure 1 Schematic diagram of tool contact points and tool position points of different tools provided in the embodiments of this specification, such as Figure 1 As shown,
[0056] Cutter Contact Point: In free-form surface multi-axis CNC machining, the point where the cutting surface of the cutter head contacts the machined surface is usually called the cutter contact point.
[0057] Cutter Location Point: Cutter Location Point refers to the positioning reference point of the cutter. The cutter location point of a ball-end cutter is the center of the ball head. The conversion between the cutter location point and the cutter contact point of a ball-end cutter is also relatively simple. The cutter location point can be obtained by offsetting the cutter contact point along the surface normal vector by the distance of the ball head radius. The cutter location point of a flat-bottom cutter is the center point of the bottom surface of the cutter. The conversion method between the cutter contact point and the cutter location point is that the cutter location point can be obtained by offsetting the cutter contact point along the direction perpendicular to the cutter axis by the distance of the bottom surface circle radius.
[0058] Scallop Height: Scallop height is referred to as residual height. When the surface is processed, traces of tool cutting will be left on its surface, forming a "wavy" surface, such as Figure 2 As shown in the figure. The smaller the tool contact path interval, the denser the tool path and the smaller the residual height, but the overall path length will increase, thus reducing the machining efficiency. It is usually necessary to set an acceptable limit for the residual height, that is, the residual height constraint. When the residual height does not exceed the limit, the tool contact path interval should be increased as much as possible to reduce the total path length.
[0059] The path spacing can be calculated based on the maximum residual height constraint. As the tool moves along the tool path trajectory, the residual height appears on the machined surface. The distance between the path trajectories is the tool contact path spacing,
[0060] like Figure 3-5As shown. The calculation of path spacing is related to the concavity of the surface. The path spacing depends on the local curvature radius R of the surface, the feed direction, the tool radius r and the height h of the residual on the surface. Usually, the maximum residual height constrained is much smaller than the tool radius r, so an approximate method can be used to simplify the calculation of path spacing. When using a ball-end tool for machining, the tool contact path spacing l on the plane flat , the knife contact path spacing on the convex surface l convex , the knife contact path spacing on the concave surface l concave It can be approximated by the following equation:
[0061]
[0062] Chord Error: Figure 6 As shown, when along the curve r c During machining, the machine tool cuts in the form of interpolation points (broken line segments), that is, the broken line segment AB is the actual route of the tool cutting, not on the parameter curve. The distance |PcQc| from the broken line segment AB to the parameter curve is called the bow height error. The bow height error describes the geometric appearance error of the workpiece, which directly affects the machining accuracy and quality. Generally, it needs to be restricted, that is, the bow height error constraint. Figure 6 ρ is the point P c The curvature radius at the point. At this time, the bow height error |PcQc| can be calculated by the following formula:
[0063]
[0064] Equal residual height path generation algorithm: The core idea of this algorithm is to select an initial path, and generate adjacent paths through this path and the residual height until the boundary is reached, thus obtaining a cluster of path curves with equal residual height.
[0065] Determine the initial path. Select the origin of the UV coordinate system as the initial point in the parameter domain, and a path starting from the initial point and along the offset direction is used as the initial path.
[0066] Determine the initial path. Select the origin of the UV coordinate system as the initial point in the parameter domain, and a path starting from the initial point and along the offset direction is used as the initial path.
[0067] Generate the next path. The determined initial parameter path corresponds to the tool contact point path on the surface, which can be converted into the tool location point path by the tool radius and normal direction. The tool location point path is the offset curve of the corresponding tool contact point path in the direction of the surface normal. The offset distance is equal to the tool radius R. The relationship between the tool contact point (CC) path and the tool location point (CL) path is expressed by the following formula:
[0068] CL(t)=CC(t)+nR
[0069] Among them, n in the relationship formula between the tool contact point (CC) path and the tool location point (CL) path is the unit normal vector corresponding to the tool contact point.
[0070] The scallop curve on one side of the path can be determined by the CL path, the given residual height and the tool radius. The scallop curve is the intersection of the tool envelope surface and the scallop surface corresponding to the CL path. Figure 7-9 shown.
[0071] The relationship between the residual surface and the original surface (input surface) is as follows:
[0072] P SC (u,v)=P(u,v)+nh
[0073] In the relationship formula between the residual surface and the original surface (input surface), P(u,v) is the input surface, n is the unit normal vector of the input surface, and h is the given residual height.
[0074] The generated curve of the tool envelope surface is a circle with a radius of R, which can be expressed as:
[0075]
[0076] Then the parametric equation of the tool envelope surface can be obtained in the fixed model coordinate system (MCS):
[0077] R M (t,θ)=w M [R]·R w (θ)+C1
[0078] in,
[0079] w M [R]=[i w ,j w ,k w ]
[0080] k w =n, i w =j w ×k w
[0081]
[0082] In the formula, i w ,j w ,k w They are positive x w ,y w ,zw A unit vector in a direction, such as Figure 8 , x w ,y w ,z w The coordinate system is based on a point C1 on the CL path as the origin, y w The positive direction of the axis is the tangent direction of the CL path curve at C1, w The positive direction of the axis is the surface normal direction corresponding to C1.
[0083] The residual curve can be obtained by solving the following equation:
[0084] P SC (u,v)-R M =0
[0085] Similarly, the next tool position path can be obtained through the residual curve, tool radius and residual height, and the tool contact path is obtained by subtracting the offset. The next path is calculated from the initial path to both sides of the parameter domain until the entire parameter domain is covered, and finally a tool contact path cluster with equal residual height can be obtained.
[0086] The following describes a tool path planning method applicable to curved surfaces provided in an embodiment of the present specification in conjunction with the accompanying drawings.
[0087] Fig.10 A schematic diagram of a process flow of a tool path planning method applicable to a curved surface provided in an embodiment of this specification, such as Fig.10 As shown, the method may include:
[0088] Step 1002: Obtain the parameter domain path of the surface to be processed.
[0089] In the embodiment of this specification, the surface to be processed may be a surface represented by B-rep.
[0090] In the embodiment of the present specification, the parameter domain path of the surface to be processed that is obtained may be the parameter domain path of the surface to be processed obtained by using an adaptive equal residual height method.
[0091] In practical applications, the existing equal residual height method can keep the residual height equal everywhere, but it will have unexpected breakpoints near the surface boundary, which will reduce the surface quality at the surface boundary and the machine tool will lift the tool more times, affecting the processing efficiency. For example, the surface parameter domain is [u min ,u max ]×[v min ,v max ], with the parameter line v = v minTaking the initial path as an example, n points are uniformly sampled on it, and these sampled points are offset along the positive direction of the v-axis, and the residual height is kept equal in the offset, so that the next n sampled points are obtained. If the surface is not flat, it is easy for a point on the initial path to reach the boundary first after several offsets, and at this time, other initial sampled points have not reached the boundary after the offset, which leads to many disconnected paths on the left and right of the point after the path is finally connected, instead of going directly from one side to the other. It can be seen that the existing equal residual height method, although strictly meeting the requirement of equal residual height, leads to a large number of tool lifts on the machine tool, and the processing efficiency is not high.
[0092] In the embodiments of this specification, the adaptive equal residual height method can be used to obtain the parameter domain path of the surface to be processed. Among them, the adaptive equal residual height method is also called the A-ISSH method. The A-ISSH method can solve the problems existing in the existing equal residual height method and is very suitable for the processing requirements of surface finishing. That is, the generated path can choose the u parameter direction or the v parameter direction. Specifically:
[0093] After n initial sampling points reach the boundary through different offset times, the sampling point with the most offset times is selected as the benchmark, and its offset times are set to k. A series of offset points corresponding to each other sampling point are interpolated to obtain an interpolation function, and k+1 points are resampled on the interpolation function, and the residual heights between these k+1 points are kept consistent. In this way, each initial sampling point corresponds to k offset points, and k+1 paths can be connected in the end. It should be noted that the method of this embodiment does not strictly guarantee that the global residual height is equal, but it can ensure that the residual height between the paths on the parameter line corresponding to each initial sampling point is consistent and less than or equal to the given tolerance, satisfying the residual height constraint, and the path looks more uniform. There will be no disconnected paths at the boundary, which is conducive to actual processing.
[0094] In actual processing, the bow height error (tolerance) also needs to be considered. Therefore, points are not uniformly selected on the initial path, but are accurately selected according to the bow height error. For a parametric surface with a rectangular parameter domain, that is, the parameter domain is [u min ,u max ]×[v min ,v max ], the algorithm flow of the A-ISSH method to generate the path is as follows:
[0095] (1) First, select a boundary on the parameter domain as the initial path, with v = v min For example, n points (u i ,v min )(i=0,1,...,n-1).
[0096] (2) For each sampling point (u i,v min ), calculate the next path on the parameter line u=u according to the residual height constraint i point;
[0097] (3) Repeat the process of (2) until the next calculated point is beyond the parameter domain;
[0098] (4) Count each parameter line u=u i The number of points obtained on the parameter line with the most points is recorded as k, and the points on each parameter line are respectively interpolated curves, which are resampled into k points, and the residual height between k points is guaranteed to be constant;
[0099] (5) Finally, the j-th points on all parameter lines are connected in sequence (j = 0, 1, ..., k), thus obtaining k uniform adaptive equal residual height paths.
[0100] The final path is a number of broken lines. The bow height error can be adjusted according to the actual processing requirements to adjust the number of sampling points on the initial path to achieve the desired accuracy.
[0101] like Figure 11-13 As shown, the adaptive equal residual height method of the embodiment of this specification can make the generated paths all run through the parameter domain, and will not generate trivial paths like the traditional method, which is beneficial to actual processing and facilitates the subsequent ZigZag path generation.
[0102] Step 1004: The parameter domain path is clipped based on the outer boundary and the inner boundary of the surface to be processed, the path in the parameter domain path located within the outer boundary is retained and the path located within the inner boundary is removed to obtain a clipped path.
[0103] In actual processing, various surfaces with holes are often encountered. Directly using the A-ISSH method cannot retain these hole features, and the surface does not necessarily have a rectangular parameter domain boundary. Therefore, after using the A-ISSH method to obtain the parameter domain path, the path needs to be clipped to retain the path inside the outer boundary and remove the path in the inner boundary. Based on the curvature of the parameter domain path of the surface to be processed, the embodiments of this specification propose different path clipping algorithms to cope with different situations.
[0104] Step 1004 of the embodiment of this specification may specifically include:
[0105] Determine whether the curvature of the parameter domain path of the surface to be processed is greater than or equal to a preset threshold, and obtain a determination result;
[0106] If the judgment result is that the curvature of the parameter domain path of the surface to be processed is greater than or equal to a preset threshold, the parameter domain path is clipped based on the outer boundary of the surface to be processed, and the path in the parameter domain path that is within the outer boundary is retained;
[0107] Based on the inner boundary of the to-be-processed curved surface, the paths located within the inner boundary are removed from the paths located within the outer boundary in the parameter domain path to obtain a clipped path.
[0108] Optionally, the clipping of the parameter domain path based on the outer boundary of the surface to be processed to retain the path in the parameter domain path that is within the outer boundary specifically includes:
[0109] For any path point on the parameter domain path, determine whether the any path point is within the outer boundary, and obtain a first path point within the outer boundary and a second path point not within the outer boundary;
[0110] Create a first new path;
[0111] Traversing the path points on the parameter domain path, if it is the second path point, skipping it, until the first path point is encountered; connecting the first path point encountered with the previous path point to obtain a first connecting line, calculating a first intersection point of the first connecting line and the outer boundary, and adding the first intersection point and the first path point encountered to the first new path;
[0112] Continue to traverse the path points on the parameter domain path, and add the first path point encountered to the new path; until the second path point is encountered, connect the second path point encountered with its previous path point to obtain a second connecting line, calculate the second intersection of the second connecting line and the outer boundary, and use the second intersection as the path point at the end of the first new path to obtain the path in the parameter domain path located within the outer boundary.
[0113] Optionally, removing the path located within the inner boundary from the path located within the outer boundary in the parameter domain path to obtain the clipped path specifically includes:
[0114] For any target path point on the path within the outer boundary in the parameter domain path, determine whether the any target path point is within the inner boundary, and obtain a third path point within the inner boundary and a fourth path point not within the inner boundary;
[0115] Create a second new path;
[0116] Traversing the path points on the path within the outer boundary in the parameter domain path, if they are the third path points, skipping them until the fourth path point is encountered; connecting the encountered fourth path point with its previous path point to obtain a third connecting line, calculating a third intersection point of the third connecting line and the inner boundary, and adding the third intersection point and the encountered fourth path point to the second new path;
[0117] Continue to traverse the path points on the path within the outer boundary in the parameter domain path, and add the fourth path point encountered to the second new path; until the third path point is encountered, the third path point encountered is connected with the previous path point to obtain a fourth connecting line, and the fourth intersection point of the fourth connecting line and the inner boundary is calculated, and the fourth intersection point is used as the path point at the end of the second new path to obtain the clipped path.
[0118] Specifically, when the curvature of the parameter domain path of the surface to be processed is greater than or equal to the preset threshold:
[0119] First, keep the part within the outer boundary. The specific process is as follows:
[0120] (1) For each path point, the ray method is used to determine whether it is inside the outer boundary and assign it a bool value. If the path point is inside the outer boundary, its bool value is true, otherwise it is false.
[0121] (2) Create an empty total path. For each path, traverse the points on it and determine its bool value. If it is false, skip it until you encounter the first point with a bool value of true. Create an empty path, calculate the intersection of the line segment formed by the point and the previous point with the outer boundary, and add the intersection and the true point to the empty path. Continue traversing. If you encounter a point with a bool value of true, add it to the path until you encounter a point with a bool value of false. Calculate the intersection of the line segment formed by the point and the previous point with the outer boundary, add it to the end of the path, add the path to the total path, and reset it to an empty value. Repeat this process to get the total path.
[0122] After obtaining the path within the outer boundary, the part within the inner boundary is removed. The specific process is as follows:
[0123] (1) For each path point, determine whether it is inside the inner boundary by using the ray method, and assign it a bool value with an initial value of false. Traverse the inner boundaries. If the path point is inside a certain inner boundary, its bool value is true, and the number of the inner boundary where the path point is located is recorded.
[0124] (2) Create an empty total path. For each path, traverse the points on it and determine its bool value. If it is true, skip it until the first point with a bool value of false is encountered. Create an empty path, calculate the intersection of the line segment formed by the point and the previous point with the inner boundary of the corresponding number, add it and the point to the empty path, and continue traversing. If a point with a bool value of false is encountered, add it to the path until a point with a bool value of true is encountered. Calculate the intersection of the line segment formed by the point and the previous point with the inner boundary of the corresponding number, add it to the end of the path, add the path to the total path, and reset it to an empty value. Repeat this process to obtain the total path.
[0125] For the case where the curvature of the parameter domain path of the surface to be processed is less than the preset threshold, based on the above algorithm, the A-ISSH path obtained according to the bow height error is almost a straight line, which is manifested in the parameter domain as adjacent path points on a path being far apart, and may cross the inner boundary or even the outer boundary, causing the above algorithm to fail. Therefore, for the case where the curvature of the parameter domain path of the surface to be processed is less than the preset threshold, that is, when the judgment result is that the curvature of the parameter domain path of the surface to be processed is less than the preset threshold, then it can be:
[0126] Calculating a fifth intersection point between the parameter domain path of the curved surface to be processed and the outer boundary, and calculating a sixth intersection point between the parameter domain path of the curved surface to be processed and the inner boundary;
[0127] Inserting the fifth intersection point and the sixth intersection point into the parameter domain path of the surface to be processed, and recording the indexes of the fifth intersection point and the sixth intersection point;
[0128] Based on the parameter domain path of the surface to be processed, the path between the fifth intersection point and the sixth intersection point is retained in sequence to obtain a clipped path.
[0129] Specifically:
[0130] (1) Calculate the intersection points of each path with the inner and outer boundaries, insert these intersection points into the original path, and record their indexes.
[0131] (2) Since the path runs through the inner and outer boundaries, there will always be an even number of intersections (considering repeated intersections). The paths between the two intersections are retained in order of the paths. If there are two repeated intersections, they are removed.
[0132] Step 1006: Based on the clipped path, a tool position point path for machining the surface to be machined is obtained.
[0133] The path after path clipping is a parameter domain path, which needs to be converted into a tool contact point path in three-dimensional space first, and then converted into a tool location point path through the allowance and tool parameters. The tool contact point path can be directly obtained from the parameter domain path and the parametric equation of the surface, and the key point is the conversion of the tool contact point into the tool location point.
[0134] Allowance offset. There are two ways to define allowance, one is normal allowance, and the other is split into axial allowance and radial allowance. If the allowance is normal allowance, the tool contact path can be offset by the length of the allowance along the surface normal vector. If the allowance is split into axial allowance and radial allowance, the tool contact path is offset upward along the tool axis direction by the length of the axial allowance, and then offset to the outside of the surface along the perpendicular direction of the tool axis direction by the length of the radial allowance. Fig.14 A schematic diagram of a margin bias provided in an embodiment of this specification.
[0135] Tool location point conversion. Based on the tool contact point path with the allowance offset, the tool contact point path is converted into the tool location point path. Here, three types of tools are mainly considered: ball-end tool, flat-bottom tool and end mill with rounded tip. The tool location point conversion of ball-end tool is relatively simple. The tool contact point is offset by the distance of the ball head radius along the surface normal vector to obtain the tool location point. The tool location point of the flat-bottom tool is the center point of the bottom circle of the tool. The conversion method between the tool contact point and the tool location point is that the tool contact point is offset by the distance of the bottom circle radius in the direction perpendicular to the tool axis direction to obtain the tool location point. For the end mill with rounded tip, the tool location point is the center point of the small circle on the bottom surface of the tool. The conversion method between the tool contact point and the tool location point is that if the tool radius is R and the tool tip radius is r, the tool contact point is first offset by a distance r along the surface normal, then by a distance Rr in the radial direction, and finally by a distance r in the opposite direction of the tool axis direction to obtain the tool location point.
[0136] Step 1008: perform collision detection on the tool position point path using a depth buffer algorithm to obtain a detected path.
[0137] To ensure the safety of actual processing, unnecessary collisions of the tool should be avoided during the processing. When a three-axis machine tool is used for processing, the tool may collide with the model when processing along the tool path in a certain tool axis direction. To avoid this, the generated tool path should be processed and some paths that may cause collisions should be cut off.
[0138] In the embodiments of this specification, the idea of the depth buffer algorithm (Z-buffer) in computer graphics is introduced to delete path points. The Z-buffer algorithm is mainly used to solve the visibility problem in real-time rendering, that is, to determine which pixels should be displayed in the final rendered image. The basic idea is to compare the geometry in the scene with a depth buffer (also called Z buffer) corresponding to the screen pixels to determine the frontmost pixel. In layman's terms, it will determine which objects are in front of other objects, and then only draw the frontmost objects and hide the obscured parts. Similarly, when processing in a certain tool axis direction, with the tool as the main perspective, when "looking" at the model to be processed and the tool path along the tool axis direction, a part of the tool path will be obscured by the model. When processing along this part of the path, it is necessary to pass through the model, which is not allowed. Therefore, according to the idea of Z-buffer, only the "seen" path can be displayed. Fig.15 This is a schematic diagram before path deletion provided in an embodiment of this specification. Fig.16 This is a schematic diagram of a path reduction based on the Z-buffer algorithm provided in an embodiment of this specification. Figure 15-16 The arrow in the middle is the direction of the tool axis.
[0139] After cutting along a certain section of the tool path, it is necessary to lift the tool. If you move directly to the endpoint of the next tool path, it may pass through the model, causing a collision. You can first lift the tool to a safe plane, quickly move it to the top of the next tool path endpoint on the safe plane, and then lower the tool for processing. In order to improve the surface finishing process, in the embodiments of this specification, both the Z-buffer algorithm and the tool lift can be added.
[0140] In an embodiment of the present specification, the post-detection path includes the path of the tool on the surface to be processed and the path of the tool not on the surface to be processed. The path of the tool not on the surface to be processed includes the tool lifting path, the tool lowering path and the moving path between the tool lifting path and the tool lowering path.
[0141] The embodiment of this specification also provides a feature processing strategy. Specifically, when the milling direction is arbitrary and the processing order is bidirectional, a ZigZag path is generated. When there are many tool paths, frequent tool lifts are required. In order to reduce the number of tool lifts, this strategy can be selected to connect adjacent paths. The general ZigZag path is as follows Fig.17 shown.
[0142] Two adjacent paths cannot be simply connected by line segments at the endpoints. Such line segments cannot fit the surface and may even pass through the surface, resulting in large errors. One solution is to connect the two adjacent paths along the surface boundary. For this purpose, an algorithm is designed in the embodiment of this specification. The initial path before clipping is input. Taking the parameter direction as the u direction as an example, the algorithm flow is as follows:
[0143] (1) Extract the outer boundary and inner boundary on the parameter domain and adjust the outer boundary to a counterclockwise order.
[0144] (2) The paths within the outer boundary are retained through the path clipping algorithm.
[0145] (3) Determine the endpoints of two adjacent paths. Suppose there are n paths. Traverse the parameter domain from bottom to top. The endpoints of the kth path and the k+1th path depend on the parity of k. If k is an odd number, the connected endpoints are on the right side of the two paths, otherwise they are on the left side of the two paths.
[0146] (4) Calculate the nearest points between the outer boundary and the two endpoints respectively. This can be accelerated by constructing a KD tree on the outer boundary.
[0147] (5) Determine whether the two nearest points are between the two endpoints. If not, move the nearest point so that it is exactly between the two endpoints. From the indexes of the two nearest points on the boundary, we can get a segment on the boundary. By connecting the two endpoints, we can form a connecting line between the two endpoints.
[0148] (6) Connect the adjacent paths with the corresponding connecting lines to form a ZigZag path.
[0149] (7) The paths within the inner boundary are eliminated through the path clipping algorithm to obtain the final path.
[0150] The ZigZag path in three-dimensional space can be obtained by converting the parameter domain path obtained above into the tool point path. The ZigZag path generated on some surfaces is as follows: Figure 18-20 shown.
[0151] In actual applications, for some surfaces with many holes, if the path is generated normally, many broken lines will be generated, and the tool needs to be lifted and lowered frequently during processing, which affects the processing efficiency. If the holes on the surface are concave rather than convex, the tool can directly pass over the holes for processing, so there is no need to lift the tool. This is the hole filling strategy. The path generated by the hole filling strategy is as follows Figure 21-22 shown.
[0152] Furthermore, for torus-like surfaces, that is, surfaces with only one inner boundary, the spiral strategy can be selected to generate a one-stroke spiral path to improve processing efficiency. In this case, the outer boundary can be offset to the inner boundary according to the residual height constraint to obtain a circle of contour lines, and finally the contour lines are converted into spiral lines. The path generated using the spiral strategy is as follows Figure 23-24 shown.
[0153] Furthermore, due to CAD modeling issues, the parameters of the surface to be processed are not well constructed, resulting in the normal generated path not matching the surface shape, forming many fragmented paths, which is not conducive to processing. In view of this situation, the embodiment of this specification designs an algorithm for generating paths by selecting guide edges, selecting several lower guide edges and upper guide edges, and offsetting the lower guide edges to the upper guide edges according to the residual height constraint, thereby obtaining tool paths. Fig.25 A schematic diagram of a path generated based on an existing path generation method provided in an embodiment of this specification, Fig.26 A schematic diagram of a path generated based on a guide edge strategy provided in an embodiment of this specification.
[0154] This embodiment of the present invention proposes a high-performance, multi-strategy surface finishing solution. It can be based on the adaptive equal residual height method A-ISSH, and can also be based on ZigZag, hole filling, spiral and other processing strategies to generate high-precision tool paths for complex surfaces in various situations.
[0155] Based on the same idea, the embodiments of this specification also provide a device corresponding to the above method.
[0156] A tool path planning device suitable for a curved surface, comprising:
[0157] A parameter domain path acquisition module is used to obtain the parameter domain path of the surface to be processed;
[0158] A path clipping module, used for clipping the parameter domain path based on the outer boundary and the inner boundary of the surface to be processed, retaining the path in the parameter domain path located within the outer boundary and removing the path located within the inner boundary, so as to obtain a clipped path;
[0159] A tool location point path acquisition module, used for obtaining a tool location point path for processing the surface to be processed based on the clipped path;
[0160] The collision detection module is used to perform collision detection on the tool position path by using a depth buffer algorithm to obtain a detected path.
[0161] Optionally, the step of obtaining the parameter domain path of the surface to be processed specifically includes:
[0162] Obtain the parameter domain path of the surface to be processed using the adaptive equal residual height method.
[0163] Optionally, the clipping of the parameter domain path based on the outer boundary and the inner boundary of the surface to be processed, retaining the path in the parameter domain path located within the outer boundary and removing the path located within the inner boundary, to obtain the clipped path, specifically includes:
[0164] Determine whether the curvature of the parameter domain path of the surface to be processed is greater than or equal to a preset threshold, and obtain a determination result;
[0165] If the judgment result is that the curvature of the parameter domain path of the surface to be processed is greater than or equal to a preset threshold, the parameter domain path is clipped based on the outer boundary of the surface to be processed, and the path in the parameter domain path that is within the outer boundary is retained;
[0166] Based on the inner boundary of the to-be-processed curved surface, the paths located within the inner boundary are removed from the paths located within the outer boundary in the parameter domain path to obtain a clipped path.
[0167] Optionally, the clipping of the parameter domain path based on the outer boundary of the surface to be processed to retain the path in the parameter domain path that is within the outer boundary specifically includes:
[0168] For any path point on the parameter domain path, determine whether the any path point is within the outer boundary, and obtain a first path point within the outer boundary and a second path point not within the outer boundary;
[0169] Create a first new path;
[0170] Traversing the path points on the parameter domain path, if it is the second path point, skipping it, until the first path point is encountered; connecting the first path point encountered with the previous path point to obtain a first connecting line, calculating a first intersection point of the first connecting line and the outer boundary, and adding the first intersection point and the first path point encountered to the first new path;
[0171] Continue to traverse the path points on the parameter domain path, and add the first path point encountered to the new path; until the second path point is encountered, connect the second path point encountered with its previous path point to obtain a second connecting line, calculate the second intersection of the second connecting line and the outer boundary, and use the second intersection as the path point at the end of the first new path to obtain the path in the parameter domain path located within the outer boundary.
[0172] Optionally, removing the path located within the inner boundary from the path located within the outer boundary in the parameter domain path to obtain the clipped path specifically includes:
[0173] For any target path point on the path within the outer boundary in the parameter domain path, determine whether the any target path point is within the inner boundary, and obtain a third path point within the inner boundary and a fourth path point not within the inner boundary;
[0174] Create a second new path;
[0175] Traversing the path points on the path within the outer boundary in the parameter domain path, if they are the third path points, skipping them until the fourth path point is encountered; connecting the encountered fourth path point with its previous path point to obtain a third connecting line, calculating a third intersection point of the third connecting line and the inner boundary, and adding the third intersection point and the encountered fourth path point to the second new path;
[0176] Continue to traverse the path points on the path within the outer boundary in the parameter domain path, and add the fourth path point encountered to the second new path; until the third path point is encountered, the third path point encountered is connected with the previous path point to obtain a fourth connecting line, and the fourth intersection point of the fourth connecting line and the inner boundary is calculated, and the fourth intersection point is used as the path point at the end of the second new path to obtain the clipped path.
[0177] Optionally, the method further includes:
[0178] If the judgment result is that the curvature of the parameter domain path of the surface to be processed is less than a preset threshold, then calculating the fifth intersection point of the parameter domain path of the surface to be processed and the outer boundary, and calculating the sixth intersection point of the parameter domain path of the surface to be processed and the inner boundary;
[0179] Inserting the fifth intersection point and the sixth intersection point into the parameter domain path of the surface to be processed, and recording the indexes of the fifth intersection point and the sixth intersection point;
[0180] Based on the parameter domain path of the surface to be processed, the path between the fifth intersection point and the sixth intersection point is retained in sequence to obtain a clipped path.
[0181] Optionally, the post-detection path includes a path of the tool on the surface to be processed and a path of the tool not on the surface to be processed, and the path of the tool not on the surface to be processed includes a tool lifting path, a tool lowering path, and a moving path between the tool lifting path and the tool lowering path.
[0182] Based on the same idea, the embodiments of this specification also provide a computer device corresponding to the above method.
[0183] A tool path planning device suitable for curved surfaces, characterized by comprising:
[0184] at least one processor; and,
[0185] a memory communicatively connected to the at least one processor; wherein,
[0186] 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:
[0187] Get the parameter domain path of the surface to be processed;
[0188] Clipping the parameter domain path based on the outer boundary and the inner boundary of the surface to be processed, retaining the path in the parameter domain path located within the outer boundary and removing the path in the inner boundary, to obtain a clipped path;
[0189] Based on the clipped path, a tool position path for processing the surface to be processed is obtained;
[0190] A depth buffer algorithm is used to perform collision detection on the tool position path to obtain a detected path.
[0191] Each embodiment in this 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 focuses on the differences from other embodiments. In particular, for the tool path planning device for curved surfaces and the tool path planning equipment for curved surfaces, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0192] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0193] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0194] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0195] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0196] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A tool path planning method suitable for curved surfaces, characterized in that: include: Get the parameter domain path of the surface to be processed; Clipping the parameter domain path based on the outer boundary and the inner boundary of the surface to be processed, retaining the path in the parameter domain path located within the outer boundary and removing the path in the inner boundary, to obtain a clipped path; Based on the clipped path, a tool position path for processing the surface to be processed is obtained; A depth buffer algorithm is used to perform collision detection on the tool position path to obtain a detected path.
2. The method according to claim 1, characterized in that The obtaining of the parameter domain path of the surface to be processed specifically includes: Obtain the parameter domain path of the surface to be processed using the adaptive equal residual height method.
3. The method according to claim 1, characterized in that The clipping of the parameter domain path based on the outer boundary and the inner boundary of the surface to be processed, retaining the path in the parameter domain path located within the outer boundary and removing the path located within the inner boundary, to obtain the clipped path, specifically includes: Determine whether the curvature of the parameter domain path of the surface to be processed is greater than or equal to a preset threshold, and obtain a determination result; If the judgment result is that the curvature of the parameter domain path of the surface to be processed is greater than or equal to a preset threshold, the parameter domain path is clipped based on the outer boundary of the surface to be processed, and the path in the parameter domain path that is within the outer boundary is retained; Based on the inner boundary of the to-be-processed curved surface, the paths located within the inner boundary are removed from the paths located within the outer boundary in the parameter domain path to obtain a clipped path.
4. The method according to claim 3, characterized in that The step of clipping the parameter domain path based on the outer boundary of the surface to be processed and retaining the path in the parameter domain path that is within the outer boundary specifically includes: For any path point on the parameter domain path, determine whether the any path point is within the outer boundary, and obtain a first path point within the outer boundary and a second path point not within the outer boundary; Create a first new path; Traversing the path points on the parameter domain path, if it is the second path point, skipping it, until the first path point is encountered; connecting the first path point encountered with the previous path point to obtain a first connecting line, calculating a first intersection point of the first connecting line and the outer boundary, and adding the first intersection point and the first path point encountered to the first new path; Continue to traverse the path points on the parameter domain path, and add the first path point encountered to the new path; until the second path point is encountered, connect the second path point encountered with its previous path point to obtain a second connecting line, calculate the second intersection of the second connecting line and the outer boundary, and use the second intersection as the path point at the end of the first new path to obtain the path in the parameter domain path located within the outer boundary.
5. The method according to claim 3 or 4, characterized in that: The step of removing the path located within the inner boundary from the path located within the outer boundary in the parameter domain path to obtain the clipped path specifically includes: For any target path point on the path within the outer boundary in the parameter domain path, determine whether the any target path point is within the inner boundary, and obtain a third path point within the inner boundary and a fourth path point not within the inner boundary; Create a second new path; Traversing the path points on the path within the outer boundary in the parameter domain path, if they are the third path points, skipping them until the fourth path point is encountered; connecting the encountered fourth path point with its previous path point to obtain a third connecting line, calculating a third intersection point of the third connecting line and the inner boundary, and adding the third intersection point and the encountered fourth path point to the second new path; Continue to traverse the path points on the path within the outer boundary in the parameter domain path, and add the fourth path point encountered to the second new path; until the third path point is encountered, the third path point encountered is connected with the previous path point to obtain a fourth connecting line, and the fourth intersection point of the fourth connecting line and the inner boundary is calculated, and the fourth intersection point is used as the path point at the end of the second new path to obtain the clipped path.
6. The method according to claim 3, characterized in that: The method further comprises: If the judgment result is that the curvature of the parameter domain path of the surface to be processed is less than a preset threshold, then calculating the fifth intersection point of the parameter domain path of the surface to be processed and the outer boundary, and calculating the sixth intersection point of the parameter domain path of the surface to be processed and the inner boundary; Inserting the fifth intersection point and the sixth intersection point into the parameter domain path of the surface to be processed, and recording the indexes of the fifth intersection point and the sixth intersection point; Based on the parameter domain path of the surface to be processed, the path between the fifth intersection point and the sixth intersection point is retained in sequence to obtain a clipped path.
7. The method according to claim 1, characterized in that The post-detection path includes the path of the tool on the surface to be processed and the path of the tool not on the surface to be processed. The path of the tool not on the surface to be processed includes the tool lifting path, the tool lowering path and the moving path between the tool lifting path and the tool lowering path.
8. A tool path planning device suitable for curved surfaces, characterized in that: include: A parameter domain path acquisition module is used to obtain the parameter domain path of the surface to be processed; A path clipping module, used for clipping the parameter domain path based on the outer boundary and the inner boundary of the surface to be processed, retaining the path in the parameter domain path located within the outer boundary and removing the path located within the inner boundary, so as to obtain a clipped path; A tool location point path acquisition module, used for obtaining a tool location point path for processing the surface to be processed based on the clipped path; The collision detection module is used to perform collision detection on the tool position path by using a depth buffer algorithm to obtain a detected path.
9. The device according to claim 7, characterized in that The path clipping module specifically includes: A judging unit, used to judge whether the curvature of the parameter domain path of the surface to be processed is greater than or equal to a preset threshold value, and obtain a judgment result; A clipping unit, configured to clip the parameter domain path based on the outer boundary of the surface to be processed, and retain the path in the parameter domain path that is within the outer boundary, if the judgment result is that the curvature of the parameter domain path of the surface to be processed is greater than or equal to a preset threshold; The path removal unit is used to remove the paths located within the inner boundary from the paths located within the outer boundary in the parameter domain path based on the inner boundary of the surface to be processed, so as to obtain a clipped path.
10. A tool path planning device suitable for curved surfaces, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, 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: Get the parameter domain path of the surface to be processed; Clipping the parameter domain path based on the outer boundary and the inner boundary of the surface to be processed, retaining the path in the parameter domain path located within the outer boundary and removing the path in the inner boundary, to obtain a clipped path; Based on the clipped path, a tool position path for processing the surface to be processed is obtained; A depth buffer algorithm is used to perform collision detection on the tool position path to obtain a detected path.
Citation Information
Cited By
Processing path planning method for complex curved surface
CN119973719A