A Grinding Path Planning Method and System Based on Point Cloud Meshization

By using a grinding path planning method based on point cloud meshing, the optimal grinding path for the defective area of ​​the casting is adaptively generated, which solves the problems of low efficiency and poor accuracy of traditional methods and improves the quality and efficiency of castings.

CN121403243BActive Publication Date: 2026-11-10SHANGHAI CHANGQING DEKE INTELLIGENT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511284116.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-09
Publication Date
2026-11-10
Estimated Expiration
2045-09-09

AI Technical Summary

Technical Problem

Traditional methods for planning grinding paths for castings rely on manual experience, which is inefficient and makes it difficult to generate accurate grinding paths. This leads to material waste and substandard quality, failing to meet the demands of modern manufacturing for casting quality and complex shapes.

Method used

A grinding path planning method based on point cloud meshing is adopted. By acquiring the workpiece defect image, the point cloud information of the defect area is extracted, voxelization is performed and mesh cells are divided to generate the initial grinding path. The grinding trajectory point set is determined according to the maximum grinding depth of each mesh cell, and the optimal grinding path is adaptively planned.

Benefits of technology

It improves grinding efficiency and quality, ensures complete coverage and proper grinding of defective areas in castings, avoids over- or under-grinding, and enhances the dimensional accuracy and production efficiency of castings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121403243B_ABST
    Figure CN121403243B_ABST
Patent Text Reader

Abstract

This invention provides a grinding path planning method and system based on point cloud meshing, belonging to the field of grinding path planning technology. The method includes: acquiring a workpiece defect image, extracting the defect region to obtain the region of interest (ROI) and defect point cloud information; voxelizing the point cloud, dividing the ROI into several mesh units to obtain a defect point cloud mesh; traversing the mesh units to generate an initial grinding path; determining the maximum grinding depth based on the defect point cloud set within each mesh unit of the initial grinding path; and generating a grinding trajectory point set based on the maximum grinding depth and outputting it as the grinding path. Beneficial effects: By performing meshing processing based on defect point cloud information, an initial grinding path is first planned, then the maximum grinding depth is determined based on the point cloud set within each mesh unit of the initial grinding path, thereby generating a grinding trajectory point set. This adaptively realizes grinding path planning, generating the optimal grinding path in the defect region of the workpiece, improving grinding efficiency and quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of grinding path planning technology, and in particular to a grinding path planning method and system based on point cloud meshing. Background Technology

[0002] The quality of a workpiece is crucial to the overall performance and safety of a product. Taking castings as an example, as important workpieces widely used in many industries such as machinery manufacturing, automotive, and aerospace, their quality directly affects the reliability and stability of related equipment and products. During the casting process, due to various factors such as casting technology, raw material quality, and mold design, castings often exhibit defects of different types and degrees on their surface, such as porosity, sand holes, cracks, and slag inclusions. These surface defects not only affect the appearance quality of the casting but also have a serious negative impact on its mechanical properties, physical properties, and safety in use.

[0003] Grinding is a common and effective method for repairing surface defects in castings. However, traditional methods for planning grinding paths often rely on manual planning based on worker experience. This approach is not only inefficient but also prone to errors due to the inherent uncertainties of human factors, making it difficult to guarantee the accuracy and rationality of the grinding path. When faced with complex shapes and irregularly distributed surface defects in castings, traditional planning methods struggle to generate optimal grinding paths for the defective areas, easily leading to over-grinding or under-grinding. Over-grinding results in wasted casting material, increased production costs, and may also affect the dimensional accuracy of the casting; while under-grinding fails to completely eliminate surface defects, causing the casting quality to fall short of expectations.

[0004] Furthermore, with the increasing demands for casting quality in modern manufacturing and the growing complexity of casting shapes and structures, traditional grinding path planning methods are no longer sufficient to meet the needs of actual production. Summary of the Invention

[0005] To address the above technical problems, this invention provides a grinding path planning method based on point cloud meshing.

[0006] The technical problem solved by this invention can be achieved by the following technical solutions:

[0007] A grinding path planning method based on point cloud meshing includes:

[0008] Step S1: Obtain a workpiece defect image, extract the defect region in the workpiece defect image, and obtain the region of interest and the corresponding defect point cloud information.

[0009] Step S2: Voxelize the defect point cloud information and divide the region of interest into several grid cells to obtain the defect point cloud grid.

[0010] Step S3: Traverse all grid cells of the defect point cloud mesh to generate an initial grinding path, wherein the initial grinding path is a set of grid cells containing the defect point cloud.

[0011] Step S4: Determine the maximum grinding depth of each grid cell based on the defect point cloud set in each grid cell of the initial grinding path;

[0012] Step S5: Based on the maximum grinding depth, generate a set of grinding trajectory points and output them as the planned grinding path.

[0013] Preferably, step S1 further includes:

[0014] The bounding box of the region of interest is expanded in all directions to obtain the expanded region of interest.

[0015] Preferably, step S3 includes:

[0016] Step S31: Initialize the row index set, column index set, and initial trajectory point set;

[0017] Step S32: Obtain the number of rows and columns of the defect point cloud mesh;

[0018] Step S33: Traverse the column direction of the defect point cloud mesh to the number of columns with a preset column step size, and add the column index corresponding to each mesh cell to the column index set;

[0019] Step S34: Traverse the row direction of the defect point cloud mesh to the number of rows with a preset row step size, and add the row index corresponding to each mesh cell to the row index set;

[0020] Step S35: Reverse the order of the row indices;

[0021] Step S36: Traverse each column index in the column index set and each row index in the row index set, add the center point information of the grid cell to the initial trajectory point set, and generate the initial grinding path.

[0022] Preferably, each grid cell has an index, which includes a row index and a column index, wherein the row index is:

[0023]

[0024] The column index is:

[0025]

[0026] Where i represents the row index of the grid cell; j represents the column index of the grid cell; (x, y) represents the point cloud coordinates of the defect point cloud information contained in the grid cell; x min This represents the minimum coordinate value of the region of interest in the x-axis direction before expansion; y min The value represents the minimum coordinate of the region of interest in the y-axis direction before expansion; n represents the step size by which the region of interest expands outwards.

[0027] Preferably, the center point of the grid cell is the centroid of the point cloud set of defects, and the centroid is calculated using the following formula:

[0028]

[0029] in, Represents the coordinates of the centroid of the point cloud; i represents the row index of the grid cell; j represents the column index of the grid cell; P i,j (i,j) represents the set of defect point clouds within the grid cell (i,j); (x,y,z) represents the set of defect point clouds P. i,j The coordinates of the defect point cloud.

[0030] Preferably, the center point information of the grid cell includes the coordinates and normal vector of the center point; wherein, the coordinates of the center point are the intersection of the plane formed by the line perpendicular to each grid cell and passing through the center point of the grid cell and the center points of the three adjacent grids of the grid cell; the normal vector of the center point is the normal vector corresponding to the nine-square grid point set constructed with the center points of the grid cells.

[0031] Preferably, the method for determining the coordinates of the center point is as follows:

[0032] Step A1, calculate the center coordinates of the grid cell:

[0033]

[0034] in, The coordinates of the center of the grid cell are represented by: i; j; x. min This represents the minimum coordinate value of the region of interest in the x-axis direction before expansion; y min The value represents the minimum coordinate of the region of interest in the y-axis direction before expansion; n represents the step size of the region of interest as it expands outwards; k represents the mesh size.

[0035] Step A2: Based on the plane Π formed by the centers of the three adjacent grid cells of the aforementioned grid cell, calculate the normal vector of plane Π:

[0036]

[0037] Here, the center of the three adjacent grids of the grid cell is defined as p1 = center. i-1,j-1 p2 = center i-1,j p3 = center i,j-1 ;

[0038] Step A3, assuming the normal vector of plane Π is n=(A,B,C), construct the equation of plane Π as follows:

[0039] Ax + By + Cz + D = 0

[0040] Where D = -n·p1 is defined; (x,y,z) represents the set of defect point clouds P on plane Π. i,j Defect point cloud coordinates;

[0041] Step A4, given line L i,j Point P on L And the direction vector d, establish a straight line L i,j The parametric equation is:

[0042] P(t)=P L +td

[0043] Where P(t) represents the straight line L i,j The parametric equation is given by t, where t represents the independent variable.

[0044] Step A5, calculate the straight line L i,j The coordinates of the center point are obtained by finding the intersection point with the plane Π. The coordinates of the center point are calculated using the following formula:

[0045] p i,j =P L +t i,j d

[0046] Among them, the definition p i,j The coordinates of the center point are indicated.

[0047] Preferably, step S4 includes:

[0048] Step S41: Initialize the maximum grinding depth;

[0049] Step S42: For each mesh cell in the initial grinding path, calculate the projection distance of each defect point cloud in the defect point cloud set along the normal vector direction.

[0050] Step S43: Determine the maximum grinding depth value based on the maximum value among the projected distances of all defect point clouds in the defect point cloud set.

[0051]

[0052] Among them, D i,j represents the maximum value among the projected distances of all defect point clouds within grid cell (i,j); p represents the coordinates of the defect point clouds involved in the calculation within the defect point cloud set; p i,j Represents the coordinates of the center point of the grid cell (i,j); n i,j Represents the normal vector of the mesh cell (i,j);

[0053] Step S44: Determine the maximum grinding depth for each of the grid cells based on the maximum value between the calculated maximum grinding depth and the initial maximum grinding depth.

[0054] Preferably, step S5 includes:

[0055] Step S51: Initialize the grinding trajectory point set;

[0056] Step S52, the grinding depth D is increased from the maximum grinding depth D using a preset grinding step size. max Begin by gradually decreasing the number of cells, traversing each grid cell in the initial grinding path, and determining the coordinates and normal vector of the grinding trajectory point:

[0057] c grind.p =p i +(D max -D)·n i

[0058] c grind.n =n i

[0059] Where p represents the coordinates of the center point; n represents the normal vector; i represents the row index of the grid cell; j represents the column index of the grid cell; c grind.p c represents the coordinates of each grinding trajectory point in the grinding trajectory point set; grind.n This represents the normal vector of each grinding trajectory point in the grinding trajectory point set.

[0060] On the other hand, a grinding path planning system based on point cloud meshing is provided for implementing the grinding path planning method based on point cloud meshing as described above, including:

[0061] The defect region extraction unit is used to acquire a workpiece defect image, extract the defect region in the workpiece defect image, and obtain the region of interest and the corresponding defect point cloud information.

[0062] A meshing unit, connected to the defect region extraction unit, is used to perform voxelization processing on the defect point cloud information, dividing the region of interest into several meshing units to obtain a defect point cloud mesh.

[0063] The first path generation unit, connected to the meshing unit, is used to traverse all mesh cells of the defect point cloud mesh and generate an initial grinding path, wherein the initial grinding path is a set of mesh cells containing the defect point cloud.

[0064] A grinding depth determination unit, connected to the first path generation unit, is used to determine the maximum grinding depth of each grid cell based on the set of defect point clouds in each grid cell of the initial grinding path.

[0065] The second path generation unit, connected to the grinding depth determination unit, is used to generate a set of grinding trajectory points based on the maximum grinding depth and output them as the planned grinding path.

[0066] The advantages or beneficial effects of the technical solution of this invention are as follows:

[0067] This invention uses gridded processing based on defect point cloud information to first plan an initial grinding path, then determines the maximum grinding depth based on the point cloud set in each grid cell of the initial grinding path, and then generates a grinding trajectory point set to adaptively realize grinding path planning. This generates the optimal grinding path in the defect area of ​​the workpiece, improving grinding efficiency and quality. Attached Figure Description

[0068] Figure 1 This is a flowchart illustrating the grinding path planning method based on point cloud meshing, as a preferred embodiment of the present invention.

[0069] Figure 2 This is a flowchart illustrating step S3 in a preferred embodiment of the present invention.

[0070] Figure 3 This is a flowchart illustrating step S4 in a preferred embodiment of the present invention.

[0071] Figure 4 This is a flowchart illustrating step S5 in a preferred embodiment of the present invention.

[0072] Figure 5 This is a schematic diagram of the trajectory of the defect point cloud mesh in a preferred embodiment of the present invention;

[0073] Figure 6 A structural block diagram of a grinding path planning system based on point cloud meshing is shown in a preferred embodiment of the present invention.

[0074] Figure 7 This is a schematic diagram of the overall process of robot machining trajectory planning in a preferred embodiment of the present invention. Detailed Implementation

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

[0076] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other.

[0077] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, but this is not intended to limit the scope of the invention.

[0078] In a preferred embodiment of the present invention, based on the above-mentioned problems existing in the prior art, a grinding path planning method based on point cloud meshing is provided. This method adopts a grid-based grinding path planning (GriPP) algorithm to achieve adaptive path planning based on point cloud information, and can generate the optimal grinding path in the defect area of ​​the workpiece.

[0079] like Figure 1 As shown, the method includes:

[0080] Step S1: Obtain a workpiece defect image, extract the defect region in the workpiece defect image, and obtain the region of interest and the corresponding defect point cloud information.

[0081] In this process, images of workpiece defects can be captured by image acquisition devices, such as structured light cameras (including but not limited to), to obtain RGB images of surface defects on workpieces (e.g., castings). Structured light cameras possess characteristics such as high precision and high resolution, enabling them to clearly capture minute defects on the surface of castings.

[0082] Furthermore, in step S1, a target detection algorithm, such as, but not limited to, the YOLOX algorithm based on a deep convolutional neural network, is used to identify the defective region in the obtained workpiece defect image, so as to extract the region of interest.

[0083] The region of interest is defined by the bounding box (bbox) of the defect region in the RGB image, and its bounding box coordinates are bbox = (x... min ,y min ,x max ,y max ), x min ,y min ,x max ,y max These are the coordinates of the top, bottom, left, and right boundaries of the bounding box.

[0084] In order to ensure the integrity of the defect area and avoid missing some defects due to improper selection of the bounding box, step S1 also includes: expanding the bounding box of the region of interest to all four directions to obtain the expanded region of interest.

[0085] Specifically, the top, bottom, left, and right boundaries of the bounding box of the region of interest are each expanded by n millimeters. The expanded bounding box of the region of interest is denoted as bbox-enlarge, and its coordinates are bbox-enlarge = (x... min -n,y min -n,x max +n,y max +n).

[0086] In this embodiment, the expansion step of the four boundaries (top, bottom, left, and right) is uniformly set to n millimeters for illustration. However, in practical applications, the expansion step of each boundary can be set as needed. The expansion steps of the four boundaries can be different to expand according to the characteristics of defects in different directions; they can also be partially the same or completely identical.

[0087] Subsequently, in the point cloud information map corresponding to the RGB image, based on the position range of the four boundary coordinates (up, down, left, right) of the expanded region of interest (bbox-enlarge), the defect point cloud information corresponding to the defect region is extracted, denoted as P. defect This is used for subsequent path planning.

[0088] Step S2: Voxelize the defect point cloud information and divide the region of interest into several grid cells to obtain the defect point cloud grid.

[0089] To facilitate subsequent analysis, the defect point cloud information P defect Voxelization is performed. The defect region is divided into several k×k mm meshes using the expanded region of interest (bbox-enlarge) as the boundary.

[0090] Each grid cell has an index, which includes a row index and a column index.

[0091] The row index is:

[0092]

[0093] The column index is:

[0094]

[0095] Where i represents the row index of the grid cell;

[0096] j represents the column index of the grid cell;

[0097] (x,y) represents the point cloud coordinates of the defect point cloud information contained within the grid cell;

[0098] x min This represents the minimum coordinate value of the region of interest in the x-axis direction before expansion;

[0099] y min This represents the minimum coordinate value of the region of interest in the y-axis direction before expansion;

[0100] n represents the step size as the region of interest expands outwards.

[0101] For each grid cell, calculate the centroid of its internal defect point cloud. Let P be the set of defect point clouds within grid cell (i,j). i,j Point cloud center of mass Calculate using the following formula:

[0102]

[0103] Among them, c i,j This represents the centroid of the point cloud in the grid cell (i,j). The coordinates of the centroid of the point cloud are represented by ; i represents the row index of the grid cell; j represents the column index of the grid cell.

[0104] P i,j This represents the set of defect point clouds within the grid cell (i,j);

[0105] |P i,j | represents the number of defect point clouds within the grid cell (i,j);

[0106] (x,y,z) represents the defect point cloud set P. i,j The coordinates of the defect point cloud.

[0107] Using the top-left corner coordinates (x0, y0) of the expanded region of interest (bbox-enlarge) and the mesh size k as a reference, calculate the equation of the line perpendicular to each mesh cell and passing through the center point of the mesh cell, denoted as L. Specifically:

[0108] Step A1, calculate the center coordinates of the grid cell (i,j):

[0109]

[0110] Where, x0 = x min -n, y0=y min -n;

[0111] That is, the center coordinates of the grid cell for:

[0112]

[0113] Where, x min This represents the minimum coordinate value of the region of interest in the x-axis direction before expansion;

[0114] y min This represents the minimum coordinate value of the region of interest in the y-axis direction before expansion.

[0115] Assume the index range of the defect point cloud mesh is (i start ,j start i end ,j end The grid index containing the defect is (i) defect ,j defect ). Among them, i start Indicates the starting point of the row index; i end Indicates the end point of the row index; j start Indicates the starting point of the column index; j end Indicates the end point of the column index; i defect Indicates the index of the grid row containing the defect; j defect This represents the grid column index containing defects.

[0116] Step A2: Calculate the normal vector of plane Π, which is formed by the centers of three adjacent grid cells of a grid cell.

[0117] Among them, the mesh containing defects (i defect ,j defect The center point of (i,j) is calculated using the center coordinates of three adjacent grid cells. The formula for calculating the center coordinates of these three adjacent grid cells can be found by referring to the formula for calculating the center coordinates of the aforementioned grid cell (i,j).

[0118]

[0119] p1, p2, and p3 represent the centers of three adjacent grid cells of grid cell (i,j). These three points form the plane Π.

[0120] The normal vector of plane Π is calculated using the following formula:

[0121]

[0122] Where n represents the normal vector of plane Π;

[0123] Step A3, assuming the normal vector of plane Π is n=(A,B,C), construct the equation of plane Π as follows:

[0124] Ax + By + Cz + D = 0

[0125] Here, D is defined as -n·p1, meaning the dot product of the normal vector n and a point p1 on plane Π is negative; (x,y,z) represents the set of defect point clouds P on plane Π. i,j The coordinates of the defect point cloud.

[0126] Step A4, given line L i,j Point P on L And the direction vector d, establish a straight line L i,j The parametric equation is:

[0127] P(t)=P L +td

[0128] Where P(t) represents the straight line L i,j The parametric equation is given, where t is the independent variable, used to control the position of point P(t) on the straight line;

[0129] Step A5, calculate line L i,j The intersection with plane Π yields the grid (i) defect ,j defect Center point c i,j coordinates p i,j =P L +t i,j d, where:

[0130]

[0131] p i,j Represents the coordinates of the center point.

[0132] Subsequently, principal component analysis (PCA) algorithm was used to analyze the grid (i) defect ,j defect Center point c i,j Construct a 3x3 grid of points centered on the grid and calculate the normal vector n. i,j .

[0133] Specifically, the points in the nine-square grid are used to form a point cloud containing nine 3D points, with the goal of estimating the normal vector n of the best-fit plane. i,j ∈R3. The algorithm includes the following steps:

[0134] First, the mean (centroid) of the point cloud of 9 3D points is calculated to center the data:

[0135]

[0136] Where, μ=(μ x ,μ y ,μ z ) represents the geometric center of the point cloud, p i Let i represent, where i = 1, ..., m, and m represent.

[0137] Centering each point, we get:

[0138]

[0139] in, express.

[0140] Based on the centered points, construct the covariance matrix C:

[0141]

[0142] in, express The transpose of .

[0143] Covariance matrix C∈R 3×3 It is a symmetric positive definite matrix that describes the distribution characteristics of the point cloud in various directions. Subsequently, eigenvalue decomposition is performed on the covariance matrix C:

[0144] Cv a =λ a v a

[0145] Among them, Cv a λ represents the set of eigenvalues ​​and eigenvectors after decomposition; a represents the feature index, a = 1, 2, 3; a Represents eigenvalues; v a Represents the eigenvalue λ a The corresponding eigenvector, and the eigenvalue λ a Sort in ascending order, that is:

[0146] λ1≤λ2≤λ3

[0147] The eigenvector v1 corresponding to the minimum eigenvalue λ1 represents the direction with the minimum variance of the point cloud distribution, i.e., the normal vector of the plane.

[0148] Normalize the eigenvector v1 to obtain the unit normal vector:

[0149]

[0150] Step S3: Traverse all mesh elements of the defect point cloud mesh to generate an initial grinding path. The initial grinding path is a set of mesh elements containing the defect point cloud; where, for example... Figure 2 As shown, step S3 includes:

[0151] Step S31: Initialize the row index set, column index set, and initial trajectory point set;

[0152] Step S32: Obtain the number of rows and columns of the defect point cloud mesh;

[0153] Step S33: Adjust the column direction of the defect point cloud mesh by a preset column step size col. step Iterate through the columns and add the column index corresponding to each grid cell to the column index set;

[0154] Step S34: Adjust the row direction of the defect point cloud mesh by a preset row step size (row). step Iterate through the rows and add the row index corresponding to each grid cell to the row index set;

[0155] Step S35: Reverse the order of the row indices;

[0156] Step S36: Traverse each column index in the column index set and each row index in the row index set, add the center point information of the grid cell to the initial trajectory point set, and generate the initial grinding path.

[0157] Specifically, by adopting an alternating traversal method, a path similar to raster scanning is achieved, that is, alternating and reversing row by row from the upper left corner to the lower right corner. This ensures that the trajectory changes along the curve, reduces the invalid movement of the tool (such as returning to the starting point), makes the grinding path more continuous, and reduces the movement time and energy consumption of the robotic arm.

[0158] The algorithm uses defect point cloud information P defect The defect area is divided into several k×k millimeter grid cells, and the center point of each grid cell is used as the trajectory point. This ensures full coverage of the defect area and avoids repeated processing of adjacent areas, thereby improving efficiency.

[0159] The center point of the grid cell is the centroid of the point cloud set of defects.

[0160] In a preferred embodiment, the center point information of the grid cell includes the coordinates of the center point and the normal vector.

[0161] Specifically, the coordinates of the center point are the intersection of the plane formed by the line perpendicular to each grid cell and passing through the center point of the grid cell and the center points of the three adjacent grid cells of the grid cell.

[0162] Specifically, the normal vector of the center point is the normal vector corresponding to the nine-square grid point set constructed with the center points of the grid cells.

[0163] Step S4: Determine the maximum grinding depth of each grid cell based on the defect point cloud set in each grid cell of the initial grinding path;

[0164] Among them, such as Figure 3 As shown, step S4 includes:

[0165] Step S41: Initialize the maximum grinding depth;

[0166] Step S42: For each mesh cell in the initial grinding path, calculate the projection distance of each defect point cloud in the defect point cloud set along the normal vector direction.

[0167] Step S43: Determine the maximum grinding depth based on the maximum value among the projected distances of all defect point clouds in the defect point cloud set.

[0168]

[0169] Among them, D i,j This represents the maximum value among the projected distances of all defect point clouds within the grid cell (i,j);

[0170] p represents the coordinates of the defect point cloud that are involved in the calculation within the defect point cloud set;

[0171] p i,j Represents the coordinates of the center point of the grid cell (i,j);

[0172] n i,j Represents the normal vector of the mesh cell (i,j);

[0173] Step S44: Determine the maximum grinding depth for each grid cell based on the maximum value between the calculated maximum grinding depth and the initial maximum grinding depth.

[0174] Step S5: Based on the maximum grinding depth, generate a set of grinding trajectory points and output them as the planned grinding path.

[0175] Among them, such as Figure 4 As shown, step S5 includes:

[0176] Step S51: Initialize the grinding trajectory point set;

[0177] Step S52, the grinding depth D is increased from the maximum grinding depth D using a preset grinding step size -d. max Begin by gradually decreasing the number of cells, traversing each grid cell in the initial grinding path, and determining the coordinates and normal vector of the grinding trajectory points:

[0178] c grind.p =p i +(D max -D)·n i

[0179] c grind.n =n i

[0180] Where p represents the coordinates of the center point; n represents the normal vector; i represents the row index of the grid cell; j represents the column index of the grid cell; c grind.p c represents the coordinates of each grinding trajectory point in the grinding trajectory point set; grind.nThis represents the normal vector of each grinding trajectory point in the grinding trajectory point set.

[0181] Based on the above meshing results, starting from the top left corner of the defect region, we traverse row by row to the bottom right corner to calculate the coordinates of the center point and its normal vector for each mesh cell:

[0182] C = G(P) defect ,k)=[c i,j ]=[(p,n) i,j ]

[0183] Where C represents the center point information, including the center point c of the grid cell. i,j The coordinates p and its normal vector n; P defect This represents the original defect point cloud information, where k represents the mesh size, i represents the row index of the mesh cell, and j represents the column index of the mesh cell. Based on the working area of ​​the grinding tool, an optimal path covering the defect area is generated, and a machining path is generated according to the GriPP algorithm.

[0184] This invention employs a grid-based grinding path planning (GriPP) algorithm to plan the path for the defect area.

[0185] Algorithm input: Defect point cloud information P defect Grid size k, row step size row step column step size col step ;

[0186] Algorithm output: GrindingTrace set of grinding trajectory points.

[0187] The implementation steps of the GriPP algorithm are as follows:

[0188] 1:C←G(P defect ,k)

[0189] 2:

[0190] 3: rows←rows number of rows in C, cols←column number of columns in C

[0191] 4: For index←0 to cols, step size col step do

[0192] 5:col indices .add(index)

[0193] 6: End of discussion

[0194] 7: For index ← 0 to rows, step size col step do

[0195] 8:rowindices .add(index)

[0196] 9: End of discussion

[0197] 10: For j∈col indices do

[0198] 11: For i∈row indices do

[0199] 12:Trace.add(c i,j )

[0200] 13: End of discussion

[0201] 14:row indices .inverse

[0202] 15: End of discussion

[0203] 16:D max ←0

[0204] 17: For each trajectory point c i,j ∈C, and the set of defect point clouds P of the raster. i,j ∈P defect do

[0205]

[0206] 19:D max ←max(D max D i,j )

[0207] 20: End of discussion

[0208] twenty one:

[0209] 22: For D←D max to 0 step size -d do

[0210] 23: For each trajectory point c i ∈Trace do

[0211] 24:c grind.p ←p i +(D max -D)·n i

[0212] 25:c grind.n =n i

[0213] 26: GrindingTrace. Add (c grind )

[0214] 27: End of discussion

[0215] 28:Trace.inverse

[0216] 29: End of discussion

[0217] 30: Return to GrindingTrace

[0218] like Figure 5 The image shows a schematic diagram of the trajectory of the defect point cloud mesh. Red dots represent trajectory points obtained from the point cloud, outlining the area surrounding the defect; blue dots represent trajectory points in the defect area completed by the GriPP algorithm, highlighting the target grinding area.

[0219] In some embodiments, a grinding path planning system based on point cloud meshing is provided for implementing the grinding path planning method based on point cloud meshing as described above. Figure 6 As shown, it includes:

[0220] The defect region extraction unit 1 is used to acquire a workpiece defect image, extract the defect region in the workpiece defect image, and obtain the region of interest and the corresponding defect point cloud information.

[0221] Mesh unit 2, connected to defect region extraction unit 1, is used to perform voxelization processing on defect point cloud information, dividing the region of interest into several mesh units to obtain a defect point cloud mesh.

[0222] The first path generation unit 3 is connected to the meshing unit 2 and is used to traverse all mesh cells of the defect point cloud mesh to generate an initial grinding path. The initial grinding path is a set of mesh cells containing the defect point cloud.

[0223] Grinding depth determination unit 4 is connected to first path generation unit 3 and is used to determine the maximum grinding depth of each grid cell based on the set of defect point clouds in each grid cell in the initial grinding path.

[0224] The second path generation unit 5 is connected to the grinding depth determination unit 4 and is used to generate a set of grinding trajectory points based on the maximum grinding depth and output the planned grinding path.

[0225] Specifically, in this embodiment, by performing meshing processing based on defect point cloud information, an initial grinding path is first planned, and then the maximum grinding depth is determined according to the point cloud set in each grid cell of the initial grinding path, thereby generating a grinding trajectory point set, adaptively realizing grinding path planning, generating the optimal grinding path in the defect area of ​​the workpiece, and improving grinding efficiency and quality.

[0226] Further implementation details of this system have been disclosed and will not be repeated in this embodiment.

[0227] like Figure 7 A schematic diagram of the overall process for robot machining trajectory planning is shown. First, a structured light camera is used to photograph the surface defects of the workpiece to obtain RGB images, and then...

[0228] The YOLOX algorithm extracts the defect region from the RGB image to obtain the defect point cloud. The GriPP algorithm is then used on the defect point cloud to obtain the grinding path in the camera coordinate system, i.e., the grinding trajectory point set mentioned above. Subsequently, a transformation matrix is ​​used to transform the grinding path in the camera coordinate system to finally obtain the machining trajectory in the robot coordinate system.

[0229] The transformation matrix mentioned above refers to the transformation matrix from the camera coordinate system to the robot coordinate system. This transformation matrix can be obtained through existing OpenCV open-source algorithms for calibration; the specific calibration process will not be described in detail here.

[0230] In some embodiments, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the grinding path planning method based on point cloud meshing in any of the above embodiments.

[0231] In some embodiments, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the grinding path planning method based on point cloud meshing in any of the above embodiments.

[0232] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0233] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0234] The above are merely preferred embodiments of the present invention and are not intended to limit the implementation methods and protection scope of the present invention. Those skilled in the art should recognize that any equivalent substitutions and obvious changes made using the content of this specification and illustrations should be included within the protection scope of the present invention.

Claims

1. A grinding path planning method based on point cloud meshing, characterized in that, include: Step S1: Obtain a workpiece defect image, extract the defect region in the workpiece defect image, and obtain the region of interest and the corresponding defect point cloud information. Step S2: The defect point cloud information is voxelized, and the region of interest is divided into several grid cells to obtain a defect point cloud grid; each grid cell has an index, which includes a row index and a column index, wherein the row index is: ; The column index is: ; Where i represents the row index of the grid cell; j represents the column index of the grid cell; (x, y) represents the point cloud coordinates of the defect point cloud information contained in the grid cell; x min This represents the minimum coordinate value of the region of interest in the x-axis direction before expansion; y min This represents the minimum coordinate value of the region of interest in the y-axis direction before expansion; n represents the step size by which the region of interest expands outwards. Step S3: Traverse all mesh cells of the defect point cloud mesh to generate an initial grinding path, wherein the initial grinding path is a set of mesh cells containing the defect point cloud; Step S3 includes: Step S31: Initialize the row index set, column index set, and initial trajectory point set; Step S32: Obtain the number of rows and columns of the defect point cloud mesh; Step S33: Traverse the column direction of the defect point cloud mesh to the number of columns with a preset column step size, and add the column index corresponding to each mesh cell to the column index set; Step S34: Traverse the row direction of the defect point cloud mesh to the number of rows with a preset row step size, and add the row index corresponding to each mesh cell to the row index set; Step S35: Reverse the order of the row indices; Step S36: Traverse each column index in the column index set and each row index in the row index set, add the center point information of the grid cell to the initial trajectory point set, and generate the initial grinding path. Step S4: Determine the maximum grinding depth of each grid cell based on the defect point cloud set in each grid cell of the initial grinding path; Step S5: Based on the maximum grinding depth, generate a set of grinding trajectory points and output it as the planned grinding path; The center point of the grid cell is the centroid of the defect point cloud set, and the centroid is calculated using the following formula: ; in, Represents the coordinates of the centroid of the point cloud; i represents the row index of the grid cell; j represents the column index of the grid cell; P i,j (i,j) represents the set of defect point clouds within the grid cell (i,j); (x,y,z) represents the set of defect point clouds P. i,j The coordinates of the defect point cloud.

2. The grinding path planning method based on point cloud meshing according to claim 1, characterized in that, Step S1 further includes: The bounding box of the region of interest is expanded in all directions to obtain the expanded region of interest.

3. The grinding path planning method based on point cloud meshing according to claim 1, characterized in that, The center point information of the grid cell includes the coordinates and normal vector of the center point; wherein, the coordinates of the center point are the intersection of the plane formed by the line perpendicular to each grid cell and passing through the center point of the grid cell and the center points of the three adjacent grid cells of the grid cell; the normal vector of the center point is the normal vector corresponding to the nine-square grid point set constructed with the center points of the grid cells.

4. The grinding path planning method based on point cloud meshing according to claim 3, characterized in that, The method for determining the coordinates of the center point is as follows: Step A1, calculate the center coordinates of the grid cell: ; in, The coordinates of the center of the grid cell are represented by: i; j; x. min This represents the minimum coordinate value of the region of interest in the x-axis direction before expansion; y min The value represents the minimum coordinate of the region of interest in the y-axis direction before expansion; n represents the step size of the region of interest as it expands outwards; k represents the mesh size. Step A2: Based on the plane Π formed by the centers of the three adjacent grid cells of the aforementioned grid cell, calculate the normal vector of plane Π: ; Wherein, the center of the three adjacent grids of the grid cell is defined as p1=center. i−1,j−1 p2=center i−1,j p3=center i,j−1 ; Step A3, assuming the normal vector of plane Π is n=(A,B,C), construct the equation of plane Π as follows: Ax + By + Cz + D = 0 Wherein, D = − n·p1 is defined; (x,y,z) represents the set of defect point clouds P on plane Π. i,j Defect point cloud coordinates; Step A4, given line L i,j Point P on L And the direction vector d, establish a straight line L i,j The parametric equation is: P(t)=P L +td Where P(t) represents the straight line L i,j The parametric equation is given by t, where t represents the independent variable. Step A5, calculate the straight line L i,j The coordinates of the center point are obtained by finding the intersection point with the plane Π. The coordinates of the center point are calculated using the following formula: p i,j =P L +t i,j d Among them, the definition ;p i,j The coordinates of the center point are indicated.

5. The grinding path planning method based on point cloud meshing according to claim 1, characterized in that, Step S4 includes: Step S41: Initialize the maximum grinding depth; Step S42: For each mesh cell in the initial grinding path, calculate the projection distance of each defect point cloud in the defect point cloud set along the normal vector direction. Step S43: Determine the maximum grinding depth value based on the maximum value among the projected distances of all defect point clouds in the defect point cloud set. ; Among them, D i,j represents the maximum value among the projected distances of all defect point clouds within grid cell (i,j); p represents the coordinates of the defect point clouds involved in the calculation within the defect point cloud set; p i,j Represents the coordinates of the center point of the grid cell (i,j); n i,j Represents the normal vector of the mesh cell (i,j); Step S44: Determine the maximum grinding depth for each of the grid cells based on the maximum value between the calculated maximum grinding depth and the initial maximum grinding depth.

6. The grinding path planning method based on point cloud meshing according to claim 5, characterized in that, Step S5 includes: Step S51: Initialize the grinding trajectory point set; Step S52, the grinding depth D is increased from the maximum grinding depth D using a preset grinding step size. max Begin by gradually decreasing the number of cells, traversing each grid cell in the initial grinding path, and determining the coordinates and normal vector of the grinding trajectory point: ; Where p represents the coordinates of the center point; n represents the normal vector; i represents the row index of the grid cell; j represents the column index of the grid cell; c grind.p c represents the coordinates of each grinding trajectory point in the grinding trajectory point set; grind.n This represents the normal vector of each grinding trajectory point in the grinding trajectory point set.

7. A grinding path planning system based on point cloud meshing, characterized in that, For implementing the grinding path planning method based on point cloud meshing as described in any one of claims 1-6, comprising: The defect region extraction unit is used to acquire a workpiece defect image, extract the defect region in the workpiece defect image, and obtain the region of interest and the corresponding defect point cloud information. A meshing unit, connected to the defect region extraction unit, is used to perform voxelization processing on the defect point cloud information, dividing the region of interest into several meshing units to obtain a defect point cloud mesh. The first path generation unit, connected to the meshing unit, is used to traverse all mesh cells of the defect point cloud mesh to generate an initial grinding path, wherein the initial grinding path is a set of mesh cells containing the defect point cloud. A grinding depth determination unit, connected to the first path generation unit, is used to determine the maximum grinding depth of each grid cell based on the defect point cloud set in each grid cell of the initial grinding path. The second path generation unit, connected to the grinding depth determination unit, is used to generate a set of grinding trajectory points based on the maximum grinding depth and output them as the planned grinding path.