Method, device and computer readable storage medium for generating a machining path
By discretizing and biasing the workpiece model, the machining path of the tool is generated, which solves the problems of low efficiency and high cost of existing software, realizes a fast and low-cost automated quenching process for insert-type molds, and improves the efficiency and safety of machining path generation.
Patent Information
- Application Number
- CN202311125103.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-01
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2043-09-01
AI Technical Summary
Existing offline programming and simulation software for robots is inefficient in the automated quenching process of insert-type molds, manual teaching trajectories are difficult to meet the requirements of complex surfaces, and third-party software is expensive, resulting in high application costs.
By obtaining the machining path of the workpiece model, discretization and offset operations are performed. The offset direction and distance are determined by the normal vector and curvature of the surface to be machined, and the machining path of the tool is generated, avoiding collision between the tool and the workpiece, thus achieving fast and low-cost machining path generation.
It enables rapid and low-cost generation of machining paths, improves the efficiency of automated quenching of insert-type molds, avoids collisions between tools and workpieces, and reduces operational complexity and cost.
Smart Images

Figure CN116945189B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, and particularly relates to a machining path generation method and device, equipment and computer readable storage medium. BACKGROUND
[0002] In robot off-line programming and simulation, machining track lines need to be generated by professional CAM software. Currently, commonly used software with CAM function includes Mastercam, UG, Robotmaster, etc., which are usually used in the fields of machine tool machining and robot simulation.
[0003] However, in the process of implementing automatic quenching of the insert type mold, the traditional teaching method of the teach pendant is inefficient and needs real-time operation on site. Moreover, for complex profiles, the manual teaching track cannot meet the quenching requirements of the complex profiles. The CAM function of the Mastercam, UG, Robotmaster and other software has certain limitations and inconvenience in the process of automatic quenching. Moreover, the software is third-party charged software, which is expensive and leads to high application cost. SUMMARY
[0004] To solve the above technical problems, the present disclosure provides a machining path generation method, device, equipment and computer readable storage medium.
[0005] In a first aspect, the present disclosure provides a machining path generation method, comprising:
[0006] obtaining a machining path of a workpiece model, the workpiece model comprising at least one machining surface;
[0007] discretizing the machining path to determine a discrete point set corresponding to the machining path;
[0008] determining a bias direction of each discrete point in the discrete point set according to a normal vector of the machining surface to which the discrete point belongs;
[0009] determining a bias distance of each discrete point in the discrete point set according to a curvature of a corresponding position of the discrete point on the machining surface;
[0010] performing a bias operation on each discrete point in the discrete point set based on the bias direction and the bias distance to obtain a bias point set, the bias point set comprising a plurality of bias points, and each bias point in the bias point set corresponding to a discrete point in the discrete point set;
[0011] generating a machining path of a tool according to the bias point set.
[0012] In some embodiments, the to-be-processed path comprises a plurality of edges, and the discretizing the to-be-processed path to determine a set of discrete points corresponding to the to-be-processed path comprises:
[0013] discretizing each edge uniformly according to a preset discrete point density;
[0014] performing a deduplication process on the discrete points obtained after the uniform discretization;
[0015] for a plurality of discrete points corresponding to each edge, forming a discrete point vector for each pair of adjacent discrete points, and calculating an included angle of each pair of adjacent discrete point vectors;
[0016] if the included angle of the pair of adjacent discrete point vectors meets a preset condition, removing the discrete point at the intersection of the pair of adjacent discrete point vectors.
[0017] In some embodiments, if the included angle of the pair of adjacent discrete point vectors meets a first preset condition, the discrete point at the intersection of the pair of adjacent discrete point vectors is removed, and the method comprises:
[0018] if a product of the included angle and a modulus of the discrete point vector is less than or equal to a preset radian threshold, it is determined that the included angle of the pair of adjacent discrete point vectors meets the first preset condition.
[0019] In some embodiments, before determining a bias direction of each discrete point according to a normal vector of a to-be-processed surface to which the discrete point belongs in the set of discrete points, the method further comprises:
[0020] determining at least one to-be-processed surface in the workpiece surface, wherein a target line is collinear with at least one edge in the to-be-processed path on the to-be-processed surface.
[0021] In some embodiments, determining a bias distance of each discrete point according to a curvature of a corresponding position of the discrete point on the to-be-processed surface in the set of discrete points comprises:
[0022] if a normalized curvature of the corresponding position of the discrete point on the to-be-processed surface is less than a preset curvature threshold, the bias distance of the discrete point is determined as a first preset bias distance;
[0023] if the normalized curvature of the corresponding position of the discrete point on the to-be-processed surface is greater than or equal to the preset curvature threshold, the bias distance of the discrete point is determined as a second preset bias distance, and a difference between the second preset bias distance and the first preset bias distance is a product of a difference between the normalized curvature of the corresponding position of the discrete point on the to-be-processed surface and the curvature threshold and a preset coefficient.
[0024] In some embodiments, before the generating the machining path according to the offset point set, the method further comprises:
[0025] adjusting positions of a start point and an end point in the offset point set.
[0026] In some embodiments, the adjusting positions of the start point and the end point in the offset point set comprises:
[0027] offsetting the start point in a direction from a start point to an end point of the machining path according to a preset start point offset distance;
[0028] offsetting the end point in a direction from the end point to the start point of the machining path according to a preset end point offset distance.
[0029] In a second aspect, the embodiments of the present disclosure provide a machining path generation device, comprising:
[0030] an acquisition module configured to acquire a machining path of a workpiece model, the workpiece model comprising at least one machining surface;
[0031] a discretization module configured to discretize the machining path to determine a discrete point set corresponding to the machining path;
[0032] a first determination module configured to determine a biasing direction of each discrete point in the discrete point set according to a normal vector of a machining surface to which the discrete point belongs;
[0033] a second determination module configured to determine a biasing distance of each discrete point in the discrete point set according to a curvature of a corresponding position of the discrete point on the machining surface;
[0034] a biasing module configured to perform a biasing operation on each discrete point in the discrete point set based on the biasing direction and the biasing distance to obtain an offset point set, the offset point set comprising a plurality of offset points, the offset points corresponding one-to-one to the discrete points in the discrete point set;
[0035] a generation module configured to generate a machining path of a tool according to the offset point set.
[0036] In a third aspect, the embodiments of the present disclosure provide an electronic device, comprising:
[0037] a memory;
[0038] a processor; and
[0039] a computer program;
[0040] The computer program is stored in the memory and is configured to be executed by the processor to implement the method according to the first aspect.
[0041] In a fourth aspect, the embodiments of the present disclosure provide a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the method according to the first aspect.
[0042] In a fifth aspect, the embodiments of the present disclosure also provide a computer program product, which includes a computer program or instructions. The computer program or instructions are executed by a processor to implement the machining path generation method.
[0043] The machining path generation method, device, equipment and computer readable storage medium provided by the embodiments of the present disclosure realize rapid positioning on the workpiece model based on computer aided design software, and take the direction, curvature and other attribute characteristics of the surface to be machined as the reference basis for the curve bias direction and bias distance, thereby realizing a rapid and low-cost machining path generation method. BRIEF DESCRIPTION OF DRAWINGS
[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and serve to explain the principles of the present disclosure together with the specification.
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.
[0046] Figure 1 The machining path generation method flowchart provided by the embodiments of the present disclosure;
[0047] Figure 2 The machining path generation method flowchart provided by another embodiment of the present disclosure;
[0048] Figure 3 The machining path generation method flowchart provided by another embodiment of the present disclosure;
[0049] Figure 4 The workpiece surface schematic diagram provided by the embodiments of the present disclosure;
[0050] Figure 5 The structure schematic diagram of the machining path generation device provided by the embodiments of the present disclosure;
[0051] Figure 6 The structure schematic diagram of the electronic device provided by the embodiments of the present disclosure. DETAILED DESCRIPTION
[0052] In order to enable a more clear understanding of the above-mentioned objects, features and advantages of the present disclosure, the schemes of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0053] In the following description, a large number of specific details are set forth in order to facilitate a thorough understanding of the present disclosure, but the present disclosure can also be implemented in other manners different from those described herein; obviously, the embodiments described in the specification are only a part of the embodiments of the present disclosure, and not all the embodiments.
[0054] The present disclosure provides a machining path generation method, which will be introduced below in combination with specific embodiments.
[0055] Figure 1 The machining path generation method flowchart provided by the embodiments of the present disclosure. The method can be applied in a device with data processing function, for example, realized by a computer aided design (CAD) software in the device. It can be understood that the machining path generation method provided by the embodiments of the present disclosure can also be applied in other scenarios.
[0056] The machining path generation method shown in the above Figure 1 The machining path generation method shown in the above includes the following specific steps:
[0057] S101, acquiring a machining path of a workpiece model, the workpiece model including at least one machining surface.
[0058] Among them, the workpiece model can be a simulation model of the workpiece established in the computer aided design (CAD) software. Specifically, the workpiece model can be a block model. After importing the workpiece model into the software, the imported workpiece model is clamped.
[0059] Determine the workpiece model origin coordinate system {p1}, the robot simulation software workpiece model origin coordinate system {p'1}, the robot simulation software workpiece model clamping point coordinate system is {p'0}, and the workpiece model clamping point coordinate system {p0} is determined according to the coordinate conversion relationship:
[0060] The machining path of the workpiece model is the trajectory of the workpiece surface that needs to be processed by a tool (such as a quenching tool). The machining path includes at least one edge line, and the machining path is a set E of at least one edge line, where E={E(i)|1≤i≤n}, where i is a positive integer, n represents the number of edge lines contained, and E(i) is the i-th edge line.
[0061] The path to be processed includes at least a starting edge, a direction edge, and a termination edge. The starting edge is the first edge of the trajectory to be processed; the direction edge is the second edge of the trajectory to be processed that is connected to the starting edge. The starting edge and the direction edge have a common endpoint, which determines the extension direction of the processed trajectory; and the termination edge is the last edge of the trajectory to be processed.
[0062] Let the starting edge be E1, the direction edge be E2, and the ending edge be E3. Specifically, when i ≤ 3, when i = 1, E1 = E2 = E3 = E(1), that is, the only edge is used as the starting edge, direction edge, and ending edge simultaneously; when i = 2, E1 = E(1), E2 = E3 = E(2), that is, the first edge is used as the starting edge, and the second edge is used as the direction edge and ending edge; when i = 3, E1 = E(1), E2 = E(2), E3 = E(3), that is, the first edge is used as the starting edge, the second edge is used as the direction edge, and the third edge is used as the ending edge.
[0063] When i ≥ 4, determine the starting edge E1 = E(1), the direction edge E2 = E(2), and the ending edge E n =E(n), and then determine the other edges E(3), E(4)...E(n-1), the specific process is as follows:
[0064] Selecting a direction edge E(2), then along the direction from E(1) to E(2), determine the starting point and ending point of the direction edge E(2), that is, the endpoint of E(2) that shares a point with E(1) is the starting point C0(2), and the other is the ending point C1(2). Obtain the set of edges Q that share a point C1(2) with E(2), obtain the tangent vector σ2 of edge E(2) at point C1(2), and the tangent vector σ2(i) of edge set Q at the point C1(2). Calculate the angle β2(i) between σ2(i) and σ2, and the minimum angle β2(i). min The edge line is E(3).
[0065] in,
[0066]
[0067] The same operation is then performed on E(3) until a set E of at least one edge is obtained, which is the processing path of the workpiece model.
[0068] S102. Discretize the path to be processed to determine the set of discrete points corresponding to the path to be processed.
[0069] The path to be processed is discretized, that is, each edge in the set E of at least one edge is discretized to obtain the set of discrete points B = {B(i)|1≤i≤K} corresponding to the path to be processed, where B(i) represents the number of edges obtained by discretizing E. iK represents the total number of discrete points.
[0070] It can be understood that the discrete point set B corresponding to the above-mentioned to-be-processed path can be a set of discrete points remaining after the discrete points are screened according to the preset discrete point screening rule and meet the preset discrete point requirements.
[0071] S103, determining a bias direction of each discrete point in the discrete point set according to a normal vector of the to-be-processed surface to which the discrete point belongs.
[0072] Each discrete point in the discrete point set is located on a to-be-processed surface of the workpiece model. For each discrete point, the normal vector of the to-be-processed surface to which the discrete point belongs is taken as the bias direction of the discrete point.
[0073] S104, determining a bias distance of each discrete point in the discrete point set according to the curvature of the position of the discrete point on the to-be-processed surface.
[0074] The to-be-processed surface can be a plane or a curved surface, and any point on the to-be-processed surface has its own curvature. For each discrete point, the position of the discrete point on the to-be-processed surface to which it belongs is determined, and the bias distance of the discrete point is determined according to the curvature of the position.
[0075] In some embodiments, to avoid collision between the tool and the workpiece when the tool processes the workpiece according to the processing path, the bias distance of the discrete point at a position with a larger curvature of the to-be-processed surface is greater than the bias distance of the discrete point at a position with a smaller curvature of the to-be-processed surface, so that the tool is relatively far away from the to-be-processed surface at the position with a larger curvature of the to-be-processed surface.
[0076] S105, performing a bias operation on each discrete point in the discrete point set based on the bias direction and the bias distance to obtain a bias point set, the bias point set including a plurality of bias points, and the bias points in the bias point set corresponding one-to-one to the discrete points in the discrete point set.
[0077] After the bias direction and the bias distance are determined, a bias operation is performed on each discrete point in the discrete point set. Specifically, for each discrete point, the discrete point is moved along the bias direction by the bias distance to obtain a bias point corresponding to the discrete point. Each discrete point will obtain a corresponding bias point after the bias operation, and the bias point set composed of the bias points corresponding to each discrete point in the discrete point set is obtained after the bias operation on each discrete point in the discrete point set, and the bias points in the bias point set correspond one-to-one to the discrete points in the discrete point set.
[0078] S106, generating a processing path of a tool according to the bias point set.
[0079] According to the position information (such as coordinate information) of each offset point in the offset point set, the machining path of the tool can be determined, and further, the offset point set is output in the form of a machining file.
[0080] The embodiment of the present disclosure obtains a machining path of a workpiece model, the workpiece model comprising at least one machining surface; discretizes the machining path to determine a discrete point set corresponding to the machining path; determines a bias direction of each discrete point in the discrete point set according to a normal vector of the machining surface to which the discrete point belongs; determines a bias distance of each discrete point in the discrete point set according to a curvature of a corresponding position of the discrete point on the machining surface; performs a bias operation on each discrete point in the discrete point set based on the bias direction and the bias distance to obtain an offset point set, the offset point set comprising a plurality of offset points, the offset points one-to-one corresponding to the discrete points in the discrete point set; and generates a machining path of a tool according to the offset point set, so as to realize rapid positioning of the workpiece model based on a computer-aided design software, and provide a reference basis for the direction and curvature of the machining surface as a curve bias direction and a bias distance, thereby realizing a rapid and low-cost machining path generation method.
[0081] Figure 2 A machining path generation method flowchart provided by another embodiment of the present disclosure is shown in FIG. 2, and the method comprises the following steps: Figure 2
[0082] S201, obtaining a machining path of a workpiece model, the workpiece model comprising at least one machining surface.
[0083] The machining path comprises a plurality of edge lines.
[0084] S202, uniformly discretizing each edge line according to a preset discrete point density.
[0085] The preset discrete point density is the distance between two adjacent discrete points along the direction of the edge line, denoted as d. Each edge line is uniformly discretized. For example, the length of an edge line is L i Each edge line in the offset edge line set E is uniformly discretized, and the number of discrete points contained in the offset edge line E(i) is:
[0086]
[0087] It can be understood that the length of the edge line is only an example of the embodiment of the present disclosure, and is not a limitation of the embodiment of the present disclosure.
[0088] S203, performing a de-duplication process on the discrete points obtained after uniform discretization.
[0089] The starting point of the latter edge line is the ending point of the former edge line, and there are two coincident discrete points. After uniform discretization, the discrete points are de-duplicated, for example, the discrete points at the starting point of each edge line except the first edge line are removed. That is, the first discrete point of the edge line E(i+1) is removed, that is, the starting point of the edge line E(i+1).
[0090] Optionally, the discrete points at the ending point of each edge line except the last edge line can also be removed.
[0091] S204, for each edge line corresponding to a plurality of discrete points, each adjacent two discrete points form a discrete point vector, and the included angle of each adjacent two discrete point vectors is calculated.
[0092] S205, if the included angle of the adjacent two discrete point vectors meets the preset condition, the discrete point at the intersection of the adjacent two discrete point vectors is removed.
[0093] Specifically, if the product of the included angle and the modulus of the discrete point vector is less than or equal to the preset radian threshold, it is determined that the included angle of the adjacent two discrete point vectors meets the first preset condition.
[0094] At the place where the curvature of the workpiece surface is small, the number of discrete points can be appropriately reduced, so that the discrete point at the intersection of the adjacent two discrete point vectors with small included angle is removed.
[0095] Specifically, the set B composed of the discrete points remaining after S203 is B={B(i)|1≤i≤K}, where any adjacent three discrete points are B i , B i+1 , B i+2 The cosine value of the included angle of the vectors and is:
[0096] The radian threshold is set as θ0, α is a to-be-determined coefficient, and the preset radian threshold is the product of the radian threshold and the to-be-determined coefficient. If , the included angle θ of the vectors and meets the preset condition, and the discrete point B i+1 at the intersection of the vectors and is removed. The above calculation is performed for each discrete point to determine whether the discrete point needs to be removed.
[0097] S206, the discrete point set is formed based on the remaining discrete points.
[0098] S207, according to the normal vector of the to-be-processed surface to which each discrete point in the discrete point set belongs, the bias direction of each discrete point is determined.
[0099] S208, determining a bias distance of each discrete point in the discrete point set according to the curvature of the corresponding position of the discrete point on the surface to be processed.
[0100] S209, performing a bias operation on each discrete point in the discrete point set based on the bias direction and the bias distance, to obtain a bias point set, the bias point set comprising a plurality of bias points, the bias points corresponding one-to-one to the discrete points in the discrete point set.
[0101] S210, generating a machining path of a tool according to the bias point set.
[0102] Specifically, the implementation process and principles of S207-S210 and S103-S106 are the same, and will not be repeated here.
[0103] The embodiment of the present disclosure realizes the discretization of the edge line in the simulation software, especially realizes the variable-density discretization of the discrete points based on the curvature of the curve by screening the discrete points, so that the finally generated machining path is more accurate, and the collision between the tool and the workpiece is effectively avoided.
[0104] Figure 3 The processing path generation method flowchart provided by another embodiment of the present disclosure is shown in FIG. 3. Figure 3 The method comprises the following steps:
[0105] S301, obtaining a machining path of a workpiece model, the workpiece model comprising at least one surface to be processed.
[0106] S302, discretizing the machining path to determine a discrete point set corresponding to the machining path.
[0107] Specifically, S302 can be realized by the method described in S202-S206, which will not be repeated here.
[0108] S303, determining at least one surface to be processed in the workpiece surface, the surface to be processed having a target line collinear with at least one edge line in the machining path.
[0109] It can be understood that the workpiece surface is the surface of the workpiece model.
[0110] Figure 4 The workpiece surface diagram provided by the embodiment of the present disclosure is shown in FIG. 2. Figure 4 First, the starting surface S1 in the workpiece surface is determined, and the starting edge E1 in the above embodiment is located on the starting surface S1.
[0111] Obtain all face sets S 1k(like Figure 4 S shown 11 S 12 S 13 S 14 ), and obtain the set of edges e corresponding to each face of the workpiece surface. k The edge set is composed of all the edges on that face. For each face in the face set, if... This indicates that the trajectory to be processed has no intersection with this surface, and it is determined that the surface to which this set of edges belongs is not the surface to be processed (e.g. Figure 4 S in 11 S 12 );like This indicates that the trajectory to be processed intersects with S1. Further analysis is needed to determine the intersection of surface S1 and surface S. 1k If the intersection line of (k) is collinear with a certain edge line in the trajectory to be processed, then determine the surface S. 1k (k) is not the surface to be processed (e.g.) Figure 4 S in 14 ), and then from S 1k A surface S2 to be processed is determined, and the same processing is performed on S2 to finally obtain the set of surfaces to be processed S = {S(j)|1≤j≤m}.
[0112] S304. Determine the offset direction of each discrete point based on the normal vector of the surface to be processed to which each discrete point belongs in the set of discrete points.
[0113] Based on the steps for obtaining the set of surfaces to be processed, S = {S(j)|1≤j≤m}, it can be found that each discrete point in the set of discrete points is located on a certain surface to be processed in the set of surfaces to be processed. Further calculations can be made of the discrete points B in the set of discrete points B = {B(i)|1≤i≤K}. i In the corresponding plane S j The normal vector N(i) at point B is taken as the discrete point B. i The bias direction.
[0114] S305. Determine the offset distance of each discrete point based on the curvature of the corresponding position of each discrete point in the set of discrete points on the surface to be processed.
[0115] Specifically, if the normalized curvature of the discrete point at the corresponding position on the surface to be processed is less than a preset curvature threshold, then the offset distance of the discrete point is determined to be a first preset offset distance; if the normalized curvature of the discrete point at the corresponding position on the surface to be processed is greater than or equal to the preset curvature threshold, then the offset distance of the discrete point is determined to be a second preset offset distance, and the difference between the second preset offset distance and the first preset offset distance is the product of the difference between the normalized curvature of the discrete point at the corresponding position on the surface to be processed and the curvature threshold and a preset coefficient.
[0116] Considering that the curvature of the curved surface is too large at the discrete bias points, if equidistant bias is adopted, collision between the tool and the workpiece will occur when the tool is machined according to the biased trajectory, and the bias distance at the position where the curvature is too large needs to be adjusted. The adjustment method is: calculating the maximum value p of the curvature of each discrete point in the discrete point set at the corresponding position on the surface to be machined min and the minimum value p min , then the curvature p(i) of any discrete point at the corresponding position on the surface to be machined can be normalized as:
[0117]
[0118] Then the bias distance of any discrete point can be expressed as:
[0119]
[0120] Where p0 is the curvature threshold, and l is a set coefficient.
[0121] S306, based on the bias direction and the bias distance, performing a bias operation on each discrete point in the discrete point set to obtain a bias point set, the bias point set including a plurality of bias points, the bias points one-to-one corresponding to the discrete points in the discrete point set.
[0122] The bias form of the discrete point can be expressed as:
[0123] B'(i) = B(i) + D(i) · N(i)
[0124] In the formula, B'(i) represents the biased discrete point, i.e., the bias point, B(i) represents the discrete point, D(i) represents the bias distance, and N(i) represents the bias direction.
[0125] Further, the coordinate vector of the bias point is calculated to determine the machining direction of the tool at each bias point. Specifically, the coordinate vector of the bias point is used to represent the direction perpendicular to the face and the edge line to which the bias point belongs. The calculation process is: taking the normal vector N(i) of the bias point B(i) at the corresponding position on the face S j as a first direction vector and taking the tangent vector of the discrete point B(i) at the corresponding edge line E(i) as a second direction vector Since the edge line E(i) is located on the face S j , the first direction vector is orthogonal to the second direction vector . The coordinate vector of the bias point B(i) is calculated as: That is, a coordinate system corresponding to each bias point is established with the bias point as the origin, and the first direction vector and the second direction vector Coordinate vector The direction where the coordinate vector is located determines the coordinate axis, and in the process of simulating machining by design software, the coordinate system corresponding to the machining tool coincides with the coordinate system corresponding to each offset point at each offset point, so as to determine the machining direction of the machining tool to the workpiece at the offset point.
[0126] S307, generating a machining path of the tool according to the set of offset points.
[0127] The embodiment of the present disclosure selects a to-be-machined surface based on a to-be-machined path, so as to provide a reference for quickly selecting a feature surface as a feature curve offset direction by design software, and to realize equidistant and non-equidistant offsetting of a discrete point set based on curvature change according to different conditions, thereby further improving the flexibility of the machining path generation method.
[0128] On the basis of the above-mentioned embodiment, before the machining path is generated according to the set of offset points, the method further comprises adjusting the positions of a starting point and an ending point in the set of offset points. Specifically, the starting point is offset along the direction from the starting point to the ending point of the to-be-machined path according to a preset starting point offset distance, and the ending point is offset along the direction from the ending point to the starting point of the to-be-machined path according to a preset ending point offset distance.
[0129] Under the default condition, the starting point of the set of offset points is the starting endpoint of the starting edge, and the ending point of the set of offset points is the ending endpoint of the ending edge. The positions of the starting point and the ending point in the set of offset points are adjusted according to a preset starting point offset distance and a preset ending point offset distance defined in advance. Specifically, the preset starting point offset distance l1 is defined, the starting point is offset along the direction from the starting point to the ending point of the to-be-machined path, the offset distance is l1, and the offset starting point is obtained; the preset ending point offset distance l2 is defined, the ending point is offset along the direction from the ending point to the starting point of the to-be-machined path, the offset distance is l2, and the offset ending point is obtained.
[0130] The embodiment of the present disclosure defines the offset distances of the starting point and the ending point in the set of offset points, considers the special conditions at the beginning and the end of machining in the actual situation, and makes the finally generated machining path more reasonable.
[0131] Figure 5 A structural schematic diagram of a machining path generation device provided by the embodiment of the present disclosure is provided. The machining path generation device can be a device with a data processing function as described in the above embodiment, or the machining path generation device can be a component or assembly in the device with the data processing function. The machining path generation device provided by the embodiment of the present disclosure can execute the processing flow provided by the machining path generation method embodiment, such as Figure 5As shown, the machining path generation apparatus 50 comprises: an acquisition module 51, a discretization module 52, a first determination module 53, a second determination module 54, a biasing module 55, and a generation module 56; the acquisition module 51 is configured to acquire a machining path of a workpiece model, the workpiece model comprising at least one machining surface; the discretization module 52 is configured to discretize the machining path to determine a set of discrete points corresponding to the machining path; the first determination module 53 is configured to determine a biasing direction of each discrete point in the set of discrete points according to a normal vector of the machining surface to which the discrete point belongs; the second determination module 54 is configured to determine a biasing distance of each discrete point in the set of discrete points according to a curvature of a corresponding position of the discrete point on the machining surface; the biasing module 55 is configured to perform a biasing operation on each discrete point in the set of discrete points based on the biasing direction and the biasing distance to obtain a set of biasing points, the set of biasing points comprising a plurality of biasing points, each biasing point in the set of biasing points corresponding to a discrete point in the set of discrete points; and the generation module 56 is configured to generate a machining path of a tool according to the set of biasing points.
[0132] Optionally, the discretization module 52 comprises a discretization unit 521, a de-duplication unit 522, a calculation unit 523, and a removal unit 524; the discretization unit 521 is configured to uniformly discretize each edge line according to a preset density of discrete points; the de-duplication unit 522 is configured to perform de-duplication processing on the discrete points obtained after uniform discretization; the calculation unit 523 is configured to, for a plurality of discrete points corresponding to each edge line, form a discrete point vector for each pair of adjacent discrete points, and calculate an included angle between each pair of adjacent discrete point vectors; and the removal unit 524 is configured to remove a discrete point at an intersection of each pair of adjacent discrete point vectors if an included angle between the pair of adjacent discrete point vectors meets a preset condition.
[0133] Optionally, the removal unit 524 is further configured to determine that the included angle between the pair of adjacent discrete point vectors meets a first preset condition if a product of the included angle and a modulus of the pair of adjacent discrete point vectors is less than or equal to a preset radian threshold.
[0134] Optionally, the first determination module 53 is further configured to determine at least one machining surface in the workpiece surface before determining the biasing direction of each discrete point in the set of discrete points according to a normal vector of the machining surface to which the discrete point belongs, the at least one machining surface having a target line that is collinear with at least one edge line in the machining path.
[0135] Optionally, the second determining module 54 is specifically configured to determine the offset distance of the discrete point as a first preset offset distance if the normalized curvature of the corresponding position of the discrete point on the surface to be processed is less than a preset curvature threshold; or determine the offset distance of the discrete point as a second preset offset distance if the normalized curvature of the corresponding position of the discrete point on the surface to be processed is greater than or equal to the preset curvature threshold, wherein a difference between the second preset offset distance and the first preset offset distance is a product of a difference between the normalized curvature of the corresponding position of the discrete point on the surface to be processed and the curvature threshold and a preset coefficient.
[0136] Optionally, the machining path generation apparatus 50 further comprises an adjusting module 57 configured to adjust positions of a start point and an end point in the set of offset points.
[0137] Optionally, the adjusting module 57 is further configured to offset the start point in a direction from a start point to an end point of the surface to be processed according to a preset start point offset distance, and offset the end point in a direction from the end point to the start point of the surface to be processed according to a preset end point offset distance.
[0138] Figure 5 The machining path generation apparatus of the illustrated embodiment can be used to execute the technical solutions of the method embodiments described above, and has similar implementation principles and technical effects, which will not be described here again.
[0139] Figure 6 A structural schematic diagram of an electronic device provided by the embodiments of the present disclosure is shown. The electronic device can be a device with a data processing function as described in the above embodiments. The electronic device provided by the embodiments of the present disclosure can execute the processing flow provided by the machining path generation method embodiments, such as Figure 6 As shown, the electronic device 60 comprises a memory 61, a processor 62, a computer program and a communication interface 63; wherein the computer program is stored in the memory 61 and is configured to be executed by the processor 62 to execute the machining path generation method as described above.
[0140] In addition, the embodiments of the present disclosure also provide a computer readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the machining path generation method described in the above embodiments.
[0141] In addition, the embodiments of the present disclosure also provide a computer program product, which comprises a computer program or instructions, and the computer program or instructions are executed by a processor to implement the machining path generation method as described above.
[0142] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0143] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for generating a processing path, characterized in that, The method includes: Obtain the processing path of the workpiece model, wherein the workpiece model includes at least one surface to be processed; Discretize the path to be processed to determine the set of discrete points corresponding to the path to be processed. The normal vector of the surface to be processed to which each discrete point belongs in the set of discrete points is determined as the offset direction of each discrete point; The offset distance of each discrete point is determined based on the curvature of the corresponding position of each discrete point in the set of discrete points on the surface to be processed. Based on the offset direction and the offset distance, an offset operation is performed on each discrete point in the discrete point set to obtain an offset point set. The offset point set includes multiple offset points, and each offset point corresponds one-to-one with a discrete point in the discrete point set. Based on the set of bias points, the tool's machining path is generated; The step of determining the offset distance of each discrete point based on the curvature of the corresponding position of each discrete point in the set of discrete points on the surface to be processed includes: If the normalized curvature of the discrete point at the corresponding position on the surface to be processed is less than a preset curvature threshold, then the offset distance of the discrete point is determined to be a first preset offset distance. If the normalized curvature of the discrete point at the corresponding position on the surface to be processed is greater than or equal to a preset curvature threshold, then the offset distance of the discrete point is determined as a second preset offset distance. The difference between the second preset offset distance and the first preset offset distance is the product of the difference between the normalized curvature of the discrete point at the corresponding position on the surface to be processed and the curvature threshold, and a preset coefficient.
2. The method according to claim 1, characterized in that, The path to be processed includes multiple edge lines. Discretizing the path to be processed and determining the set of discrete points corresponding to the path to be processed includes: Each edge line is uniformly discretized according to the preset discrete point density; The discrete points obtained after uniform discretization are deduplicated. For each edge line corresponding to multiple discrete points, each pair of adjacent discrete points forms a discrete point vector, and the angle between each pair of adjacent discrete point vectors is calculated. If the product of the included angle and the magnitude of the discrete point vector is less than or equal to a preset radian threshold, then the included angle of the two adjacent discrete point vectors is determined to meet the first preset condition, and the discrete point at the intersection of the two adjacent discrete point vectors is removed.
3. The method according to claim 1, characterized in that, Before determining the offset direction of each discrete point based on the normal vector of the surface to be processed to which each discrete point belongs in the set of discrete points, the method further includes: Identify at least one surface to be processed on the surface of the workpiece, wherein the target line on the surface to be processed is collinear with at least one edge line in the processing path.
4. The method according to claim 1, characterized in that, Before generating the tool's machining path based on the set of bias points, the method further includes: Based on the preset starting point offset distance, the starting point is offset along the direction from the starting point to the ending point of the path to be processed; Based on the preset end point offset distance, the end point is offset along the direction from the end point to the start point of the path to be processed.
5. A processing path generation device, characterized in that, include: The acquisition module is used to acquire the processing path of the workpiece model, wherein the workpiece model includes at least one surface to be processed; The discrete module is used to discretize the path to be processed and determine the set of discrete points corresponding to the path to be processed. The first determining module is used to determine the normal vector of the surface to be processed to which each discrete point in the set of discrete points belongs as the offset direction of each discrete point; The second determining module is used to determine the offset distance of each discrete point based on the curvature of the corresponding position of each discrete point in the set of discrete points on the surface to be processed. The bias module is used to perform a bias operation on each discrete point in the discrete point set based on the bias direction and the bias distance to obtain a bias point set, wherein the bias point set includes multiple bias points and the bias points correspond one-to-one with the discrete points in the discrete point set. The generation module is used to generate the tool's processing path based on the set of bias points; The second determining module is specifically used to determine the offset distance of the discrete point as a first preset offset distance if the normalized curvature of the position corresponding to the discrete point on the surface to be processed is less than a preset curvature threshold. Alternatively, if the normalized curvature of the discrete point at the corresponding position on the surface to be processed is greater than or equal to a preset curvature threshold, then the offset distance of the discrete point is determined as a second preset offset distance. The difference between the second preset offset distance and the first preset offset distance is the product of the difference between the normalized curvature of the discrete point at the corresponding position on the surface to be processed and the curvature threshold, and a preset coefficient.
6. An electronic device, characterized in that, include: Memory; processor; as well as Computer programs; The computer program is stored in the memory and configured to be executed by the processor to implement the method as described in any one of claims 1-4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-4.
Citation Information
Patent Citations
Device and method for machining three-dimensional impeller blade welding groove through robot
CN112757307A
Robot force control grinding and polishing trajectory planning method and system suitable for cylindrical grinding and polishing tool
CN114924527A