Material sorting method based on dynamic path planning and numerical control system

Through dynamic path planning and visual inspection and correction, the workpiece material extraction path and suction cup combination are optimized, which solves the problems of unreasonable path planning and plate offset in the existing technology, and improves the material sorting efficiency and accuracy of laser processing equipment.

CN120244273APending Publication Date: 2025-07-04JINAN BODOR LASER CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510301767.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-14
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

The existing laser processing equipment has undynamic optimization of path planning in material sorting, resulting in high empty stroke and low efficiency, unreasonable suction cup coordinates lead to missucking or leakage, and the positioning error caused by plate offset is not fully considered.

Method used

The dynamic path planning method is adopted to construct the workpiece topology relationship diagram through the ant colony algorithm, optimize the material extraction path, and combine visual detection to correct the offset, dynamically configure suction cup combinations to generate picking instructions to improve picking accuracy and efficiency.

Benefits of technology

It has achieved improvements in workpiece picking efficiency and accuracy, reduced empty strokes, avoided workpiece deformation, ensured reasonable suction cup combination, corrected plate offset errors, and improved overall sorting accuracy and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120244273A_ABST
    Figure CN120244273A_ABST
Patent Text Reader

Abstract

The invention relates to a material sorting method and a numerical control system based on dynamic path planning, the material sorting method is used for an automatic picking scene of more than one workpiece in a sorting area of laser cutting, and the method comprises the following steps: on the basis of preset CAM nesting software information in laser cutting equipment, carrying out automatic sorting on more than one workpiece; center coordinates of each workpiece in the sorting area, attribute information of each workpiece and an initial material taking path are obtained; on the basis of the center coordinate and the attribute information of each workpiece, a topological relation graph of all the workpieces in the sorting area is obtained, initial material taking paths of all the workpieces are optimized on the basis of the topological relation graph, and the optimized material taking paths are obtained; and according to the center coordinate and the attribute information of each workpiece and the optimized material taking paths of all the workpieces, a suction cup combination of each workpiece to be picked according to the optimized material taking paths is determined, and a picking instruction is generated and sent to a control device of the picking mechanical arm. According to the method, the workpiece picking efficiency is improved, and meanwhile the picking precision and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and particularly to a material sorting method and a numerical control system based on dynamic path planning. Background Art

[0002] In the existing material sorting method after laser processing equipment, the robotic arm sorting adopts a fixed material taking order and cannot dynamically optimize the path according to the workpiece distribution, resulting in a high proportion of empty travel and low efficiency. When picking up parts, there is a phenomenon that the activated suction cup coordinates are unreasonable, resulting in mis-suction or missed suction. When the suction force of the suction cup is uneven, it usually causes workpiece deformation. In addition, the traditional method relies too much on the theoretical coordinate values given by CAM (Computer Aided Manufacturing) when sorting parts and does not fully consider the situation of sheet offset, resulting in positioning errors. Summary of the Invention

[0003] (I) Technical Problems to be Solved

[0004] In view of the above-mentioned disadvantages and deficiencies of the prior art, the present invention provides a material sorting method, device and numerical control system based on dynamic path planning.

[0005] (II) Technical Solutions

[0006] In order to achieve the above object, the main technical solutions adopted by the present invention include:

[0007] In the first aspect, an embodiment of the present invention provides a material sorting method based on dynamic path planning. The material sorting method is used for an automated picking scenario of one or more workpieces in a sorting area of laser cutting. The method includes:

[0008] S100. Based on the CAM nesting software information in the pre-given laser cutting equipment, obtain the center coordinates of each workpiece in the sorting area, the attribute information of each workpiece, and the initial material taking path;

[0009] S200. Based on the center coordinates and attribute information of each workpiece, obtain the topological relationship graph of all workpieces in the sorting area, and optimize the initial material taking path of all workpieces based on the topological relationship graph to obtain an optimized material taking path;

[0010] S300. According to the center coordinates, attribute information of each workpiece and the optimized material taking path of all workpieces, determine the suction cup combination for each workpiece to be picked up according to the optimized material taking path and generate a picking instruction to send to the control device of the picking robotic arm.

[0011] Optionally, before generating the picking instruction in S300, the method further includes:

[0012] S400. Determine whether there is an offset in the positions of one or more workpieces in the sorting area with the aid of a visual detection device. If there is no offset, directly generate the picking instruction;

[0013] Otherwise, according to the offset information of the workpiece, correct the picking instruction and send the corrected picking instruction to the control device of the picking robotic arm.

[0014] Optionally, the S100 includes: generating a DXF file and a JSON file storing two-dimensional design data according to the CAM nesting software information, loading the DXF file and the JSON file, and obtaining the center coordinates of each workpiece, the attribute information of each workpiece, and the initial material taking path in the sorting area while displaying the workpiece layout information on the interface;

[0015] The attribute information of each workpiece includes: workpiece identifier, workpiece size, set of vertices of the outer contour of the workpiece, workpiece thickness, workpiece margin; workpiece geometry; arrangement position of the workpiece on the to-be-processed plate; the initial material taking path is the material taking order of all workpieces on the to-be-processed plate.

[0016] Optionally, the S200 includes: constructing a topological relationship graph of all workpieces to be picked up by the ant colony algorithm, and optimizing the initial material taking path of all workpieces based on the topological relationship graph to obtain an optimized material taking path;

[0017] Specifically, S201. Traverse the attribute information of all workpieces to obtain the set of center coordinates of all workpieces C = {c1(x1,y1),.....,c n (x n ,y n )};

[0018] S202. Obtain the center distance between any two workpieces in C, and obtain the adjacency matrix A of all workpieces according to all center distances and a pre-given threshold of the center distance between adjacent workpieces;

[0019] S203. Based on the initialized ant colony algorithm parameters, adopt a path optimization method to obtain the optimal path as the optimized material taking path.

[0020] Optionally, the S203 includes: the initialized ant colony algorithm parameters include: pheromone intensity Q, evaporation coefficient ρ, heuristic factor weight β, pheromone weight α, number of ants m, maximum number of iterations T; the evaporation coefficient and the heuristic factor weight are associated with the workpiece size, workpiece density, and workpiece thickness;

[0021] S2031. Initialize the pheromone τ ij = 1, τ ij is the pheromone concentration on each edge of the adjacency matrix A;

[0022] S2032. For each ant k, where k ranges from 1 to m;

[0023] a. Each ant randomly selects a workpiece as the starting point at the beginning;

[0024] b. When an ant traverses the path, it constructs a taboo list to record the workpieces that have been visited, avoiding revisiting the workpieces that have already been visited;

[0025] c. When the ant is at the current node i, calculate the transition probability of moving from node i to each reachable node j

[0026] where, N i is all the adjacent nodes of node i, τ ij is the pheromone concentration on the edge (i→j) in the adjacency matrix A, is the heuristic factor, d ij is the straight-line distance from node i to j, that is, the actual distance between the two workpieces represented in the adjacency matrix A;

[0027] S2033. Roulette wheel selection of the next node: According to the calculated transition probability, the ant will use the roulette wheel selection method to determine the next-hop node j;

[0028] S2034. Update the taboo list and the path length: After the ant moves to the next node, it updates the taboo list to record the new path length;

[0029] S2035. Update the pheromone matrix: After each path traversal is completed, all ants update the pheromone matrix τ ij ,

[0030] where, is the increment of the pheromone released by the k-th ant on the path (i→j). If the ant k has passed through the edge (i→j) on the path, then If not, L k is the total length of the path traveled by the ant k, and t is the number of iterations;

[0031] S2036. Update the optimal path. After each iteration is completed, check whether the current path is the optimal path and update the global optimal path. If the current path is shorter, update the optimal path. Otherwise, continuously repeat the above steps until the number of iterations reaches T, and output the optimal path sequence as the optimized material-taking path.

[0032] Optionally, the S300 includes:

[0033] For each workpiece on the material taking path, according to the set of outer contour vertex coordinates of the workpiece, calculate the center point of the minimum bounding rectangle of the workpiece, and screen the suction cup candidate points along the long axis of the minimum bounding rectangle according to the specified rules, and obtain the suction cup combination of the workpiece based on the screened suction cup candidate points.

[0034] Optionally, the S300 includes:

[0035] S301. Obtain the minimum bounding rectangle MBR of the workpiece from the set of outer contour vertex coordinates V of the workpiece;

[0036] S302. Calculate the convex hull of V: Use the Graham Scan algorithm to calculate the convex hull of V. Sort all points by the x coordinate, and in the case of the same x coordinate, sort by the y coordinate. Select the leftmost point v as the starting point, v ∈ V, traverse the remaining points in order, and use the cross product to judge the direction of the current point relative to the previous two points. If the current point and the previous two points form a clockwise direction, pop the middle point and continue to check. If a counterclockwise or collinear direction is formed, add the current point to the convex hull. The finally obtained convex hull is a set of vertices arranged in counterclockwise order;

[0037] S303. Select an initial edge in the convex hull. Select the edge from the first vertex to the second vertex in the convex hull as the initial edge, calculate the direction angle of this edge. The direction angle is the angle between the positive x-axis and the edge, and calculate the normal vector of this edge for projection;

[0038] S304. Traverse the convex hull edges and calculate the direction angle of each edge: For each edge in the convex hull, calculate its direction angle θ. If the direction of the edge is from (x i , x j ) to (y i , y j ), then If the edge is vertical, i.e., x j = x i , then

[0039] S305. Project the vertex set in the convex hull to the θ direction and calculate the MBR area: For each vertex in the convex hull, according to the direction angle θ of the current edge, calculate its projection coordinates (x', y') in the θ direction, calculate the maximum and minimum values of all projected vertices x', y', i.e., max(x'), min(x'), and then calculate the area Area(θ) of the MBR. The projected point set is V' = {(x1', y1'), (x2', y2')......, (x n ', y n ')}:

[0040] x' = x · cosθ + y · sinθ

[0041] y' = -x·sinθ + y·cosθ

[0042] Area(θ) = (max(x') - min(x')) × (max(y') - min(y'));

[0043] S306. Use the rotating calipers algorithm to find the minimum MBR: Starting from the initial edge, assume the current edge is edge e, find the normal vector perpendicular to edge e, project all vertices onto this normal vector, calculate the MBR area, and successively rotate to the next edge that may form a smaller MBR, that is, select the next vertex, then calculate the new direction angle, and repeat the above steps until all possible edges are traversed. During the traversal, record the MBR area corresponding to each direction θ, and select the direction θ with the minimum Area(θ) as the final MBR direction;

[0044] S307. Output parameters: The center point (c x , c y ) of the MBR, the major axis length L, the minor axis length W, Length = max(x') - min(x'), Width = max(y') - min(y'), the rotation angle θ, the center point of the MBR is the geometric center of the outer bounding rectangle, the major axis and the minor axis are two mutually perpendicular sides of the rectangle, and the rotation angle θ describes the rotation angle of the rectangle relative to the horizontal direction.

[0045] Optionally, S300 further includes:

[0046] S308. Generate candidate points along the two major axes of the MBR based on the pre - established local coordinate system of the suction cup matrix and the coding information of each suction cup node in the suction cup matrix:

[0047] a. Determine the starting point and the ending point. The starting point is at one end of the major axis, at a first specified distance from the edge; the ending point is at the other end of the major axis, also at the first specified distance.

[0048] b. Generate candidate points successively from the starting point to the ending point at a step size of twice the first specified distance;

[0049] c. The set P of candidate points that form the suction cup combination = {p1,..., p k};

[0050] S309. Screen the suction cups that finally need to be enabled based on the set of suction cup candidate points:

[0051] For each point p in the candidate set P, p ∈ P, first convert it from the MBR coordinate system to the local coordinate system of the suction cup matrix. X_suction_origin is the real-time coordinate of the center of the suction cup matrix provided by the control device of the picking robot arm. row[i] is the row number, the suction cup pitch is 50 mm, and θ is the angle of rotation of the suction cup matrix around the Z-axis;

[0052] x local = X_suction_origin + row[i] × 50 × cosθ - col[i] × 50 × sinθ

[0053] y local = Y_suction_origin + row[i] × 50 × sinθ + col[i] × 50 × sinθ

[0054] S310. Calculate the row and column numbers where the suction cup is located: According to the converted local coordinates, calculate the row and column numbers of each candidate point p in the suction cup matrix, which is used to map the offset of the local coordinates to the actual row and column numbering system;

[0055] S311. Check the suction cup validity. Use the ray method to determine whether the suction cup coordinate point is inside the workpiece contour polygon, and evaluate whether the pressure value at this suction cup position is greater than or equal to the material-specific threshold to ensure that there is sufficient suction force at this position to firmly grasp the workpiece;

[0056] If there is a suction cup coordinate point outside the workpiece contour polygon, then adjust the MBR or the first specified distance, and repeat the above steps until the suction cup is a valid suction cup.

[0057] Optionally, the S400 includes:

[0058] S401. Calibrate the vision detection device based on the checkerboard calibration method and establish the mapping relationship between the image coordinates and the mechanical coordinates;

[0059] S402. Based on the image of the sorting area obtained by the vision detection device, use the ORB feature extraction and matching method to determine whether the positions of one or more workpieces are offset.

[0060] S403. If there is an offset, then calculate the affine transformation matrix M that maps the feature points in the template image to the feature points in the real-time image. src_pts and dst_pts represent the feature point coordinates in the template image and the real-time image respectively. calibration_scale is the calibration coefficient, estimateAffinePartial2D is the given function, and a, b, c, and d are the given parameters;

[0061] M = cv2.estimateAffinePartial2D(src_pts, dst_pts)

[0062] The horizontal offset dx = M[0, 2] * calibration_scale;

[0063] The vertical offset dy = M[1, 2] * calibration_scale;

[0064] Where M[0, 2] corresponds to t in the matrix x , and M[1, 2] corresponds to t y ;

[0065]

[0066] S404. When the offset satisfies |Δx| ≥ 2mm or |Δy| ≥ 2mm, trigger compensation and calculate the compensation amounts Δx, Δy, where k is the damping coefficient;

[0067] Δy = M[0, 2] * 0.1, y comp = y dxf + Δy · k

[0068] Δx = M[0, 2] * 0.1, x comp = x dxf + Δx · k

[0069] S405. Update the workpiece coordinates in the picking instruction; and trigger the path replanning in S200: and the update of the suction cup combination configuration in S300.

[0070] In a second aspect, an embodiment of the present invention further provides a numerical control system, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program stored in the memory and executes the steps of any one of the above-mentioned material sorting methods based on dynamic path planning in the first aspect.

[0071] (III) Beneficial effects

[0072] In the embodiment of the present invention, by pre-acquiring the center coordinates, attribute information, and initial material taking paths of each workpiece in the sorting area, the topological relationship graph of all workpieces is obtained, and the optimal material taking path is generated. Then, based on the optimal material taking path, the suction cup combination of each workpiece in the path is determined, so that the control device of the picking robotic arm can accurately pick each workpiece, improving the picking efficiency and accuracy of the workpiece.

[0073] The method of the embodiment of the present invention is different from the traditional static path planning. Specifically, it can generate the optimal motion trajectory based on the ant colony algorithm and the workpiece topological relationship, reducing the empty travel.

[0074] Furthermore, in specific implementation, the layout limitation of using fixed suction cups in the traditional way is broken through. The minimum suction cup combination is intelligently selected according to the contour features of each workpiece, realizing the dynamic configuration of the suction cup matrix, reducing energy consumption and preventing the deformation of thinner plates.

[0075] In particular, based on the visual-aided positioning compensation method of the vision detection device, the deviation of the theoretical picking coordinates can be corrected, solving the defect of the picking coordinate deviation caused by the displacement of the plate, and better improving the accuracy and efficiency of picking. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] Figure 1 It is a schematic flow chart of the material sorting method based on dynamic path planning provided by an embodiment of the present invention;

[0077] Figure 2 It is a schematic diagram of importing a DXF file into CAM in an embodiment of the present invention;

[0078] Figure 3 It is a schematic diagram of metadata in the JSON configuration file shown in an embodiment of the present invention;

[0079] Figure 4 It is a schematic diagram of the adjacency matrix constructed in an embodiment of the present invention;

[0080] Figure 5 It is a schematic diagram of the iterative process in the ant colony algorithm in an embodiment of the present invention;

[0081] Figure 6 It is a schematic diagram of calibrating the vision system through a checkerboard in an embodiment of the present invention;

[0082] Figure 7 It is a schematic diagram of the suction cup matrix;

[0083] Figure 8 It is a schematic diagram of the optimal suction cup combination provided by an embodiment of the present invention;

[0084] Figure 9 It is a schematic flow chart of the material sorting method based on dynamic path planning provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0085] In order to better explain the present invention for easy understanding, the present invention will be described in detail below with reference to the accompanying drawings through specific embodiments.

[0086] Embodiment 1

[0087] As Figure 9As shown in the figure, this embodiment provides a schematic flowchart of a material sorting method based on dynamic path planning. The execution subject of the method in this embodiment can be a numerical control system, or an upper computer of a laser cutting device. The upper computer can be integrated with a numerical control system or an upper computer independent of the numerical control system. This embodiment does not limit it. The method in this embodiment is used for the automatic picking scenario of one or more workpieces in the sorting area of laser cutting. The material sorting method may include the following steps.

[0088] S100. Based on the CAM nesting software information in the pre-given laser cutting device, obtain the center coordinates of each workpiece in the sorting area, the attribute information of each workpiece, and the initial material taking path.

[0089] For example, according to the CAM nesting software information, generate a DXF file and a JSON file storing two-dimensional design data, load the DXF file and the JSON file, and while displaying the workpiece layout information on the interface, obtain the center coordinates of each workpiece in the sorting area, the attribute information of each workpiece, and the initial material taking path;

[0090] The attribute information of each workpiece includes: workpiece identification, workpiece size, set of outer contour vertices of the workpiece, workpiece thickness, workpiece margin; workpiece geometry; arrangement position of the workpiece on the to-be-processed plate, workpiece density, etc.;

[0091] The initial material taking path is the material taking order of all workpieces on the to-be-processed plate.

[0092] In practical applications, the DXF file and the JSON file can be directly imported into the numerical control system before the laser cutting device cuts.

[0093] S200. Based on the center coordinates and attribute information of each workpiece, obtain the topological relationship graph of all workpieces in the sorting area, and optimize the initial material taking path of all workpieces based on the topological relationship graph to obtain the optimized material taking path.

[0094] For example, construct the topological relationship graph of all workpieces to be picked up through the ant colony algorithm, and optimize the initial material taking path of all workpieces based on the topological relationship graph to obtain the optimized material taking path.

[0095] S300. According to the center coordinates, attribute information of each workpiece, and the optimized material taking path of all workpieces, determine the suction cup combination for each workpiece to be picked up according to the optimized material taking path and generate a picking instruction to send to the control device of the picking robotic arm.

[0096] For example, for each workpiece in the material taking path, calculate the center point of the minimum circumscribed rectangle of the workpiece according to the set of outer contour vertex coordinates of the workpiece, and screen the suction cup candidate points along the long axis of the minimum circumscribed rectangle according to the specified rules, and obtain the suction cup combination of the workpiece based on the screened suction cup candidate points.

[0097] Further, as Figure 1 shown, before generating the picking instruction in S300, the method further includes the following step S400:

[0098] S400. Determine whether there is an offset in the position of one or more workpieces in the sorting area by means of a visual detection device. If there is no offset, directly generate the picking instruction;

[0099] Otherwise, according to the offset information of the workpiece, correct the picking instruction and send the corrected picking instruction to the control device of the picking robot arm.

[0100] In this embodiment, according to the calculated offset information of the workpiece, the material taking path in S200 is updated again, and the picking instruction is corrected based on the updated material taking path. The picking instruction in this embodiment includes: the picking order of all workpieces in the picking area, the position coordinates of each picked workpiece, and the suction cup combination information of each picked workpiece.

[0101] The method of this embodiment obtains the topological relationship diagram of all workpieces by pre-acquiring the central coordinates, attribute information and initial material taking path of each workpiece in the sorting area, generates the optimal material taking path, and then determines the suction cup combination of each workpiece in the path based on the optimal material taking path. Thus, the control device of the picking robot arm can accurately pick each workpiece, improving the picking efficiency and accuracy of the workpiece.

[0102] The method of this embodiment is applicable to the scenario of multiple workpieces, and the effect of path optimization is more significant; it is also applicable to the scenario of single or two workpieces.

[0103] Embodiment 2

[0104] The material sorting method of this embodiment is applicable to medium and large workpieces after laser cutting, such as an automated picking scenario where the workpiece size ≧ 400mm * 400mm. Based on the main process of Embodiment 1, the method of this embodiment mainly includes DXF parsing steps such as S100, path planning steps such as S200, suction cup configuration steps such as S300, and visual compensation steps such as S400. The results of the visual compensation steps recorded in the following embodiments can be fed back to the path planning steps in real time to achieve closed-loop control.

[0105] To better understand the specific processes of the above steps in the embodiments, the above steps will be described in detail below in combination with the specific sub-steps of the implementation.

[0106] First, for the DXF parsing step in S100, it may include the following sub-steps 101 to 105.

[0107] 101. Before processing with a laser cutting device, use software such as AutoCAD to design the workpiece drawing in advance and save it in DXF format. This file contains the geometric shapes, dimensions, and arrangement positions of all workpieces on the sheet metal.

[0108] 102. Import the DXF file into CAM (Computer-Aided Manufacturing software) and set relevant parameters (sheet metal size, material thickness, cutting gap, workpiece margin, workpiece size, etc.), and perform automatic nesting optimization to increase the material utilization rate to over 92%, as Figure 2 shown.

[0109] 103. After completing the nesting layout and setting relevant parameters in CAM, two key files will be output to the local area, namely the updated DXF file (the updated DXF file includes the optimized workpiece layout vector data), and the JSON configuration file (the JSON configuration file includes the metadata of each workpiece stored in key-value pairs, such as workpiece ID, workpiece size, theoretical / initial picking coordinates, etc., as Figure 3 shown).

[0110] 104. The host computer calls the DxfToImgmap() method to parse the DXF file:

[0111] (1) Read the vector graphic data; (2) Convert the graphic into a bitmap image, such as converting it into an Img image and displaying it on the front-end interface of the host computer for convenient viewing by the user;

[0112] (3) Display the sheet metal layout diagram on the front-end interface.

[0113] 105. Call JsonToWorkpiece() to parse the JSON file and establish a linked list of workpiece objects. Each node contains information such as workpiece ID, theoretical coordinates, workpiece size, and a set of outer contour vertices (extracted from the DXF file by parsing the POLYLINE or LWPOLYLINE entities in the DXF).

[0114] That is, in this embodiment, according to the CAM nesting software information required by the laser cutting device in China, a DXF file is generated, and the DXF file is parsed to obtain the center coordinates of the workpieces to be picked up after processing.

[0115] The DXF file is a vector graphic file format used to store two-dimensional design data.

[0116] In the programming environment, the netDXF library can be downloaded (different development languages may correspond to different DXF file parsing tool libraries) and installed, and start parsing the vertex coordinates of the closed polyline;

[0117] Locate the ENTITIES section (where geometric entity information is stored), find the LWPOLYLINE entity, traverse the VERTEX sub-entities, and extract the (x, y) coordinates of each vertex. For example, if the vertices are (x1, y1), (x2, y2), (x3, y3); calculate the center coordinates, which are the arithmetic mean of the vertex coordinates: x(center) = (x1 + x2 + x3) / 3, y(center) = (y1 + y2 + y3) / 3.

[0118] Second, for the path planning step in S200, it may include the following sub-steps 201 to 203.

[0119] In the path planning step of this embodiment, an ant colony algorithm is used to construct a topological relationship graph of the workpieces to be picked up and optimize the material taking path.

[0120] For example, after parsing and obtaining the set of workpiece center coordinates from the DXF file, calculate its adjacency matrix, and use the ant colony algorithm to optimize the material taking path of the robotic arm to reduce the empty travel.

[0121] It should be noted that the existing material taking path is generated based on the fixed order of the workpieces in the JSON file. Whichever workpiece's information is first will be picked up first, without considering other factors, resulting in low efficiency. In this embodiment, by constructing a topological relationship graph and using the ant colony algorithm, the material taking path is dynamically optimized to reduce the empty travel, which can improve the efficiency.

[0122] In addition, the topological relationship in this embodiment describes the spatial distribution and connection relationship between workpieces and is implemented through an adjacency matrix. The topological relationship graph is the basis for optimizing the material taking path, which transforms the material taking path optimization problem into the shortest path problem of a graph.

[0123] In this embodiment, the workpiece center coordinate is the center position of a single workpiece, and the set of workpiece center coordinates is the summary of the center coordinates of all workpieces in the sorting area. Based on the description in step S100, the workpiece center coordinates are calculated by parsing geometric entities (such as closed polylines, circles) in the DXF file, and these center coordinates are summarized into a set of workpiece center coordinates for the following adjacency matrix calculation and path optimization.

[0124] 201. Topological relationship modeling:

[0125] (1) Traverse the attribute information of all workpieces in the sorting area to obtain the set of center coordinates of all workpieces in the sorting area C = {c1(x1, y1),....., c n (x n , y n )}; 1... n belong to the number of workpieces in the picking area, and n is a natural number greater than 1.

[0126] (2)Construct the adjacency matrix \(A\) (\(n\times n\) dimension). When the center distance \(d\) of the workpieces ij <50mm, it is marked as adjacent, as shown in the schematic diagram of constructing the Figure 4 adjacency matrix;

[0127] x i ,y i is the center coordinate of the \(i\)-th workpiece, \(x\) j ,y j is the center coordinate of the \(j\)-th workpiece;

[0128] It should be noted that the center distance of the workpieces can be the Euclidean distance, that is, the center distance between two workpieces is calculated through the geometric center points of the two workpieces. The value ranges of \(i\) and \(j\) are from 1 to \(n\).

[0129] 202. Initialization of ant colony algorithm parameters:

[0130]

[0131] It can be understood that the parameters in the table are given in advance. In practical applications, the parameters can be dynamically adjusted within their value ranges according to the specific scenario and the thickness, density, etc. of the plate to be cut.

[0132] For example, according to the different sizes of the plates or the densities of the workpieces, adjust the pheromone evaporation coefficient and the weight of the heuristic factor to optimize the algorithm performance:

[0133] (1) If the longest length of the plate increases to more than 2000mm, increase \(\rho\) to 0.45 to accelerate convergence, and increase \(Q\) to 180 to enhance the exploration ability of long paths during the path optimization process;

[0134] (2) If the density of the workpieces is relatively high and the distance \(d\) between them ij is less than 100mm, it is necessary to reduce \(\alpha\) to 0.9 to avoid local optimality during the path optimization process, and increase \(\beta\) to 2.2 to enhance the distance sensitivity during the path optimization process.

[0135] 203. Path optimization process:

[0136] (1) Initialize the pheromone \(\tau\) ij = 1, \(\tau\) ij is the pheromone concentration on each edge of the adjacency matrix \(A\) in sub-step 201;

[0137] (2) For each ant \(k\) (1...m):

[0138] a. Each ant randomly selects a workpiece as the starting point at the beginning;

[0139] b. When the ant traverses the path, it will construct a taboo list to record the workpieces that have been visited, avoiding repeated visits to the already visited workpieces;

[0140] c. When the ant is at the current node i, calculate the transition probability of moving from node i to each reachable node j

[0141] where N i is all the adjacent nodes of node i, τ ij is the pheromone concentration on the edge (i→j) in the adjacency matrix A, is the heuristic factor, d ij is the straight-line distance from node i to j, that is, the actual distance between the two workpieces represented in the adjacency matrix, α is the pheromone weight, and β is the heuristic factor weight.

[0142] (3) Roulette wheel selection of the next node: According to the calculated transition probability, the ant will use the roulette wheel selection method to determine the next-hop node j;

[0143] (4) Update the taboo list and path length: After the ant moves to the next node, it will update the taboo list to record the new path length;

[0144] (5) Update the pheromone matrix: After each path traversal is completed, all ants will update the pheromone matrix τ ij ,

[0145] where is the increment of the pheromone released by the k-th ant on the path (i→j). If the ant k has passed through the edge (i→j) on the path, then If not, ρ is the pheromone evaporation coefficient, Q is the pheromone intensity constant, L k is the total length of the path walked by the ant k, and t is the number of iterations.

[0146] (6) Update the optimal path: After each iteration is completed, the algorithm will check whether the current path is the optimal path and update the global optimal path. If the current path is shorter, the optimal path will be updated; otherwise, repeat the above steps continuously until the number of iterations reaches T, and output the optimal path sequence, that is, the material taking order. The iterative solution process is as Figure 5 shown.

[0147] For example, the optimal path sequence is the material taking order of the robotic arm output by the ant colony algorithm. Assuming the optimal path sequence is [workpiece 4, workpiece 2, workpiece 3, workpiece 1], then the robotic arm takes workpiece 4, workpiece 2, workpiece 3, and workpiece 1 in sequence.

[0148] Third, for the suction cup configuration steps in S300, the following sub-steps 301 to 305 may be included.

[0149] The existing 6*6 suction cup matrix is as Figure 7 shown. Dynamically configure the suction cup matrix, and dynamically determine the suction cup activation strategy based on the workpiece contour. Here, the suction cup activation strategy may be to screen the suction cups that need to be turned on or off.

[0150] In this step, break through the traditional fixed suction cup matrix strategy. In this embodiment, the set of vertex coordinates of the outer contour polygon of the workpiece is obtained by parsing the DXF file, the center point of the minimum circumscribed rectangle is calculated, and after generating suction cup candidate points along the long axis of the minimum circumscribed rectangle according to specific rules, then screen the suction cup combinations that meet specific conditions, that is Figure 8 the suction cup combination of the four small blue circles on the right, ensuring that the workpiece is sucked by the minimum number of suction cups, as Figure 8 shown. Figure 8 The left side is the existing traditional fixed suction cup matrix. Figure 8 In the right figure in the middle, the square is the minimum circumscribed rectangle, and the large gray circle represents the workpiece. In the suction cup combination in the prior art, the number and position of the suction cups are both unreasonable. In this embodiment, suction cup candidate points are generated along the long axis of the minimum circumscribed rectangle at a certain step size, and then the suction cup combination is finally determined, which ensures that the number and position of the suction cups are optimal, reduces the idle stroke of the suction cups, and improves the utilization efficiency of the suction cups.

[0151] In the prior art, the suction cup coordinates are directly specified in the JSON file, and this coordinate is obtained by manual presetting or simple rules. In actual applications, it is very easy to pick up the belt board in this way because the activated suction cup may happen to be at the edge of the part. In addition, the number of activated suction cups is relatively large each time a workpiece is picked up, resulting in high energy consumption.

[0152] The suction cup activation strategy of this embodiment: The suction cup activation strategy is to dynamically select the suction cup combination with the minimum number according to the workpiece contour characteristics, ensuring reasonable suction cup layout, uniform suction force, and minimum energy consumption;

[0153] The above-mentioned set of vertex coordinates of the outer contour polygon (abbreviated as the outer contour set): The outer contour set is the set of points on the contour. The outer contour set of a circular workpiece is the set of a series of discrete points generated by the center coordinates and radius;

[0154] For example, the specific rules and generation method: Generate candidate points along the long axis at a step size of 80 mm (this step size can be adjusted according to actual needs), from the starting point to the ending point, and generate according to a fixed step size;

[0155] Specific conditions: The suction cup combination that satisfies being within the workpiece contour and having a pressure value greater than or equal to the threshold.

[0156] Step S300 may include the following sub-steps:

[0157] 301. Establish a local coordinate system for the suction cup matrix:

[0158] (1) Usually, a 6*6 suction cup matrix is installed at the end of the robotic arm. The definition of the local coordinate system: Origin: The center of the suction cup matrix; X and Y axes: Consistent with the X and Y axis directions in the CAM coordinate system.

[0159] (2) Suction cup ID coding rule: Suction cup ID = (row number - 1) × 6 + column number;

[0160] For example, for the suction cup in the 2nd row and 3rd column, suction cup ID = 1 × 6 + 3 = 9.

[0161] 302. For each workpiece, use the candidate suction cup generation algorithm to generate the suction cup candidate points for this workpiece.

[0162] The vertex set V of the outer contour of each workpiece = {(x1,y1),(x2,y2)......,(x n ,y n )}; Use the rotating calipers algorithm to calculate the minimum bounding rectangle (MBR) of the workpiece:

[0163] a. Calculate the convex hull of the point set V: Use the Graham Scan algorithm to calculate the convex hull of the point set V. Sort all points by the x coordinate. In the case of the same x coordinate, sort by the y coordinate. Select the leftmost point v (v ∈ V, the leftmost point is the point with the smallest x coordinate in the point set V) as the starting point, traverse the remaining points in order, and use the cross product to judge the direction (clockwise or counterclockwise) of the current point relative to the previous two points. If the current point and the previous two points form a clockwise direction, pop the middle point and continue to check. If they form a counterclockwise or collinear direction, add the current point to the convex hull. The final convex hull obtained is a vertex set arranged in counterclockwise order;

[0164] b. Initialize the rotating calipers algorithm: Select an initial edge in the convex hull. For example, select the edge from the first vertex to the second vertex as the initial edge, calculate the direction angle of this edge. The direction angle is the angle from the positive x axis to the edge, and calculate the normal vector of this edge for subsequent projections;

[0165] c. Traverse the convex hull edges and calculate the direction angle of each edge: For each edge in the convex hull, calculate its direction angle θ. If the direction of the edge is from (x i ,x j ) to (y i ,y j ), then If the edge is vertical (i.e., x j = x i), then

[0166] d. Project the vertex set in the projection convex hull to the θ direction, that is, map the vertex set in the convex hull to the direction of the normal vector of the current edge, calculate the projected coordinate values, and calculate the MBR area.

[0167] For each vertex in the convex hull, according to the direction angle θ of the current edge, calculate its projected coordinates (x', y') in the θ direction, calculate the maximum and minimum values of all projected vertices x', y', that is, max(x'), min(x'), and then calculate the area Area(θ) of the MBR. The projected point set is V = {(x1', y1'), (x2', y2')......, (x n ', y n ')}:

[0168] x' = x·cosθ + y·sinθ

[0169] y' = -x·sinθ + y·cosθ

[0170] Area(θ) = (max(x') - min(x')) × (max(y') - min(y'));

[0171] e. Use the rotating calipers algorithm to find the minimum MBR: Starting from the initial edge, assume the current edge is edge e, find the normal vector perpendicular to edge e, project all vertices onto this normal vector, calculate the MBR area, and successively rotate to the next edge that may form a smaller MBR, that is, select the next vertex, then calculate the new direction angle, and repeat the above steps until all possible edges are traversed. During the traversal process, record the MBR area corresponding to each direction θ, and select the direction θ with the minimum Area(θ) as the final MBR direction;

[0172] f. The center point (c x , c y )(where ), the major axis length L (where Length = max(x') - min(x')), the minor axis length W (where Width = max(y') - min(y')), the rotation angle θ. The MBR center point is the geometric center of the outer bounding rectangle. The major axis and the minor axis are two mutually perpendicular sides of the rectangle, and the rotation angle θ describes the rotation angle of the rectangle relative to the horizontal direction;

[0173] g. Generate candidate points along the two major axes of the MBR:

[0174] g-1. Determine the starting point and the ending point. The starting point is at one end of the major axis, 40 mm away from the edge; the ending point is at the other end of the major axis, also 40 mm away from the edge. The edge distance can be adjusted according to actual needs.

[0175] g-2. Generate candidate points sequentially from the starting point to the ending point with a step size of 80 mm (the step size can be adjusted as needed);

[0176] g-3. Construct the suction cup candidate point set P = {p1,..., p k}; k is the total number of candidate points.

[0177] 303. Screen the suction cups that ultimately need to be enabled based on the suction cup candidate point set:

[0178] 303-1. For the suction cup candidate point set P = {p1,..., p k}, initialize the valid suction cup list: Create an empty list valid_suction to store the IDs of the screened valid suction cups;

[0179] 303-2. For each point p in the candidate set P, first convert it from the MBR coordinate system to the local coordinate system of the suction cup matrix. X_suction_origin is the real-time coordinate of the center of the suction cup matrix provided by the PLC, row[i] is the row number, the suction cup pitch is 50 mm, and θ is the angle of rotation of the suction cup matrix around the Z axis;

[0180] x local = X_suction_origin + row[i] × 50 × cosθ - col[i] × 50 × sinθ

[0181] y local = Y_suction_origin + row[i] × 50 × sinθ + col[i] × 50 × sinθ

[0182] 303-3. Calculate the row and column numbers where the suction cup is located: According to the converted local coordinates, calculate the row and column numbers of each candidate point p in the suction cup matrix, which is used to map the offset of the local coordinates to the actual row and column numbering system. Since the suction cup pitch is 50 mm and the origin O is at the virtual center point between the 3rd and 4th rows and the 3rd and 4th columns of the matrix, the row number row and the column number col are calculated as follows, and then the ID of the activated suction cup is calculated according to the aforementioned step 203. floor() is the floor function:

[0183] row = floor(y local / 50) + 3.5

[0184] col = floor(x local / 50)+3.5

[0185] Furthermore, to better ensure that the selected suction cup combination is the optimal and effective one, this embodiment further includes the following sub-step 304:

[0186] 304. Check the effectiveness of the suction cup:

[0187] a. Use the ray method to determine whether the suction cup coordinate point is inside the workpiece contour polygon. Specifically, emit a horizontal ray from this point and count the number of intersections with the polygon edges. If it is odd, it is determined to be inside. In addition, calculate whether the shortest distance edge_dist from the candidate point p to the polygon (the polygon formed by the vertices of the outer contour of the workpiece) is greater than or equal to 35 mm to ensure that the suction cup is not near the edge of the workpiece and avoid instability or damage caused by the suction cup being too close to the workpiece edge. In the following formula, v i , v i+1 are two adjacent vertices of the polygon, ||p - v i ||, ||p - v i+1 || are the distances from the candidate point to the two vertices, and d proj is the effective projection distance from the candidate point to the edge v i v i+1 ;

[0188] edge_dist = min{||p - v i ||, ||p - v i+1 ||, d proj}

[0189] b. Evaluate whether the pressure value at this suction cup position (obtained in real time through the PLC) is greater than or equal to the material-specific threshold to ensure that the suction cup has sufficient suction force to firmly grasp the workpiece at this position. According to the current vacuum suction cup technical specification standard, the threshold = the basic suction force of the material × the thickness coefficient. For example: for stainless steel, the basic suction force = 200 mbar, and the thickness coefficient = 1 + 0.2×(t - 1) (t≥1 mm, the thickness of the sheet). Then: the threshold for a 2-mm stainless steel sheet = 200×(1 + 0.2×1) = 240 mbar

[0190] 305. Abnormal situation handling (the candidate point may be outside the workpiece):

[0191] Contour contraction: Shrink the MBR inward by 20 mm to generate secondary candidate points;

[0192] Dynamic adjustment of the step size: If no effective suction cup is found in the first screening, reduce the step size to 40 mm and regenerate the candidate points;

[0193] Edge suction cup activation: Allow the suction cup to partially cover the workpiece (it is required to meet the pressure ≥ threshold);

[0194] Through the above processing, the algorithm will activate at least 1 suction cup. Otherwise, an abnormal alarm will be triggered, the system will record the coordinates of the workpiece and skip it, and it will be handled manually after other sorting is completed.

[0195] The above sub-steps 304 and 305 can be further optimized sub-steps and configured according to actual needs. Through the above sub-steps, it is ensured that the suction cup combination of each finally obtained workpiece is effective and can meet the optimal path suction cup combination.

[0196] Fourth, for the vision compensation step in S400, it may include the following sub-steps 401 to 403.

[0197] In the previous steps, the coordinates of the workpieces in the picking path are all the theoretically obtained picking coordinates from the initial parsed JSON file. In this step, a vision-assisted positioning compensation algorithm is used to correct the picking coordinates of the workpieces. For example, by introducing vision verification technology to detect whether the workpiece has moved. If it has moved, position compensation is triggered.

[0198] In specific applications, before picking each workpiece, visual detection is used to judge the position offset. If there is no offset, picking is directly performed; if an offset is detected, the corrected actual coordinates are sent to the PLC (i.e., the control device) to control the robotic arm to adjust to the correct position.

[0199] Action timing: The robotic arm moves above the theoretical coordinates → Trigger visual detection → If visual detection shows an offset → The PLC receives the corrected coordinates → The robotic arm moves to the actual coordinates → Perform picking.

[0200] In addition, the method of this embodiment is an automated picking after the laser cutting equipment has completed cutting, that is, the laser cutting machine will cut all the workpieces in the sheet on the machine tool, and then transfer this platform to the workpiece sorting area. Of course, the vision compensation process will occur after all the workpieces are cut. The specific timing is when the robotic arm moves above the workpiece and then triggers visual detection compensation.

[0201] Step S400 includes the following sub-steps:

[0202] 401. Vision system calibration: Through checkerboard calibration, establish the mapping relationship between image coordinates and mechanical coordinates, as Figure 6 shown.

[0203] 402. Feature matching process:

[0204] 402-1. Template image generation: Crop a 1000×1000 pixel area centered at the theoretical center from the IMG image converted from DXF for subsequent searching for matching parts in the real-time image.

[0205] It is understandable that "taking the theoretical center as the origin" means taking the theoretical center coordinates of the workpiece as the origin of the cutting area. The theoretical center coordinates are obtained by parsing the JSON configuration file, that is, by calling the JsonToWorkpiece() method to parse the JSON file and extract the theoretical center coordinates of each workpiece, and this coordinate is used as the origin when generating the template image.

[0206] 402-2. Real-time image acquisition: After the robotic arm moves to 400 mm directly above the object, the industrial camera is triggered to take a picture, and the exposure time is set to 15 ms to ensure the clarity of the image and avoid blurring caused by too long exposure time.

[0207] 402-3. ORB feature extraction: Use the ORB (Oriented FAST and Rotated BRIEF, feature point extraction and description algorithm) algorithm to extract feature points and descriptors from the template image and the real-time image (feature points are key points in the image, and descriptors are the feature vectors of these feature points). The nfeatures parameter is set to 500, indicating that at most 500 feature points are detected; the scaleFactor parameter is set to 1.2, which is the scaling factor of the image; the nlevels parameter is set to 8, indicating the number of layers of the image pyramid.

[0208] The following is the information of the code:

[0209] orb = cv2.ORB_create(nfeatures = 500, scaleFactor = 1.2, nlevels = 8)

[0210] kp_template, des_template = orb.detectAndCompute(template_img, None)

[0211] kp_real, des_real = orb.detectAndCompute(real_img, None).

[0212] 402-4. Feature matching and screening: Use BFMatcher (Brute-Force Matcher) for feature matching;

[0213] BFMatcher performs matching by calculating the distance between each descriptor and the template descriptor, and ensures the two-way consistency of the matching through the crossCheck parameter.

[0214] In the screening step, only the best 50 pairs of matching points are retained to reduce the influence of false matches and improve the accuracy of subsequent calculations.

[0215] The following is the information of the code:

[0216] bf = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck = True)

[0217] matches = bf.match(des_template, des_real)

[0218] matches = sorted(matches, key = lambda x: x.distance)[:50] # Select the top 50 best pairs.

[0219] 403. Coordinate compensation calculation:

[0220] Prerequisites for coordinate compensation calculation: When the number of matching points N ≥ 15, it can be considered that there is enough information for further coordinate transformation and compensation calculation;

[0221] 403-1. Calculate the affine transformation matrix: Use the estimateAffinePartial2D function of OpenCV (an open-source computer vision and image processing library) to calculate the affine transformation matrix M, which can map the feature points in the template image to the feature points in the real-time image. src_pts and dst_pts represent the coordinate points of the feature points in the template image and the real-time image respectively. calibration_scale is the calibration coefficient calculated based on the ratio of the actual size to the pixel size, used to convert pixel coordinates to actual physical coordinates. a, b, c, and d are all given parameters;

[0222] M = cv2.estimateAffinePartial2D(src_pts, dst_pts)

[0223] dx = M[0, 2] * calibration_scale # Horizontal offset (mm)

[0224] dy = M[1, 2] * calibration_scale # Vertical offset (mm)

[0225] Among them, M[0, 2] corresponds to t in the matrix x , and M[1, 2] corresponds to t y ;

[0226]

[0227] 403-2. Compensation logic (when the offset satisfies |Δx| ≥ 2mm or |Δy| ≥ 2mm):

[0228] a. Trigger compensation. The calculation formula for the compensation amount is as follows. k is the damping coefficient (with a value of 0.8, for smooth correction action to avoid violent movement and oscillation of the robotic arm due to excessive correction).

[0229] Δy = M[0,2] * 0.1, y comp = y dxf + Δy · k

[0230] Δx = M[0,2] * 0.1, x comp = x dxf + Δx · k

[0231] b. Update the workpiece coordinates.

[0232] The compensation coordinates in this embodiment are calculated based on the theoretical coordinates of the workpiece and the offset detected by vision. The specific formula is:

[0233] x compensation = x theoretical (the picking coordinate in json) + k * Δx (the calculated offset);

[0234] y compensation = y theoretical + k * Δy

[0235] where k is the damping coefficient (with a value of 0.8);

[0236] The compensation coordinates are the target positions for the robotic arm to perform the picking action, and are sent to the PLC to control the movement of the robotic arm. The compensation coordinates are a dynamic correction to the theoretical picking coordinate sequence generated in steps S200 and S300.

[0237] c. Trigger path replanning: Clear the taboo table of the ant colony algorithm and re - execute the path optimization in S200 with the new coordinates (i.e., the compensation coordinates).

[0238] The new coordinates here, i.e., the compensation coordinates, are the actual positions of the workpiece.

[0239] d. Update the suction cup configuration: Recalculate the MBR based on the new coordinates and perform the suction cup screening in S300;

[0240] 403 - 3. Compensation data transmission: Finally, write the information of the sorted workpiece into the PLC register through the Modbus TCP protocol. The PLC adjusts the movement parameters of the robotic arm according to the received data so that it can accurately reach the target position.

[0241] It is understandable that the conclusion of judging whether the workpiece has shifted needs to be obtained after step 403 - 2. After calculating the offset in step 403 - 2, it is possible to determine whether the workpiece has moved based on the comparison results of the values of Δx and Δy with the threshold.

[0242] In addition, in the global coordinate system of the machine tool (CAM coordinate system), the lower left corner of the machine tool workbench is the origin (coinciding with the origin of the CAM nesting coordinate system). The axis along the long side of the machine tool is the Y-axis, and the axis along the short side is the X-axis. In the robotic arm coordinate system, the origin coincides with the origin of the machine tool coordinate system, and the X / Y axis directions are the same as those of the machine tool coordinate system. The real-time coordinates of the end of the robotic arm are obtained in real time through the PLC. In the local coordinate system of the suction cup, the origin is the center point of the suction cup matrix (i.e., the coordinates of the end of the robotic arm provided by the PLC in real time). Its coordinates in the machine tool coordinate system are provided by the PLC in real time. The X / Y axis directions are parallel to the machine tool coordinate system and can rotate by an angle θ around the Z-axis (obtained through the PLC).

[0243] In this embodiment, the above method improves the workpiece picking efficiency: through dynamic path planning, the robotic arm can automatically optimize the motion trajectory according to the actual distribution of the workpieces, reduce the non-productive travel, and improve the overall picking efficiency.

[0244] Reduce the phenomena of incorrect or missed suction of workpieces: The dynamic configuration of the suction cup matrix can intelligently select the most suitable suction cup combination according to the contour features of each workpiece, reducing the problems of incorrect or missed suction caused by unreasonable suction cup coordinates.

[0245] Keep the workpieces intact: Detect the suction cup pressure in real time, combined with the dynamically configured suction cup combination, to avoid workpiece deformation and ensure the integrity and consistency of the workpieces during the sorting process.

[0246] Improve the accuracy and reliability of workpiece picking: The vision-assisted positioning compensation corrects the theoretical coordinate deviation through local feature matching, can accurately locate the workpieces on the sheet metal, and can effectively reduce the picking coordinate deviation even if the sheet metal is displaced, improving the accuracy and reliability of the sorting.

[0247] According to another aspect of the embodiments of the present invention, the embodiments of the present invention further provide a numerical control system, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program stored in the memory and executes the steps of any one of the above-described material sorting methods based on dynamic path planning in the method embodiments.

[0248] For example, execute based on the information of the CAM nesting software in the pre-given laser cutting equipment, obtain the center coordinates and attribute information of each workpiece in the sorting area and the initial picking path; based on the center coordinates and attribute information of each workpiece, obtain the topological relationship graph of all workpieces in the sorting area, and optimize the initial picking paths of all workpieces based on the topological relationship graph to obtain the optimized picking paths; according to the center coordinates, attribute information of each workpiece and the optimized picking paths of all workpieces, determine the suction cup combination for each workpiece to be picked according to the optimized picking paths and generate a picking instruction to send to the control device of the picking robotic arm.

[0249] The numerical control system of this embodiment can automatically pick up in the picking area after laser cutting is completed, improving the accuracy of picking up.

[0250] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0251] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram can be implemented by computer program instructions, and the combination of flows and / or blocks in the flowchart and / or block diagram can also be implemented by computer program instructions.

[0252] It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in the claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention can be implemented by means of hardware including several different elements and by means of a suitably programmed computer. In the claims listing several apparatuses, several of these apparatuses can be embodied by the same piece of hardware. The use of the words first, second, third, etc. is only for convenience of expression and does not indicate any order. These words can be understood as part of the name of the element.

[0253] In addition, it should be noted that in the description of this specification, the description of terms such as "an embodiment", "some embodiments", "embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, without conflict, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0254] Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications after learning the basic creative concept. Therefore, the claims should be construed to cover the preferred embodiments as well as all changes and modifications that fall within the scope of the present invention.

[0255] Obviously, those skilled in the art can make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention should also cover these modifications and variations.

Claims

1. A material sorting method based on dynamic path planning, characterized in that, The described material sorting method is used for the automated picking scenario of more than one workpiece in the sorting area of laser cutting. The method includes: S100. Based on the CAM nesting software information in the pre-given laser cutting equipment, obtain the center coordinates, attribute information, and initial picking path of each workpiece in the sorting area; S200. Based on the center coordinates and attribute information of each workpiece, obtain the topological relationship graph of all workpieces in the sorting area, and optimize the initial picking paths of all workpieces based on the topological relationship graph to obtain the optimized picking paths; S300. According to the center coordinates, attribute information of each workpiece, and the optimized picking paths of all workpieces, determine the suction cup combination for each workpiece to be picked up according to the optimized picking path and generate a picking instruction to send to the control device of the picking robotic arm.

2. The method according to claim 1, characterized in that, Before generating the picking instruction in S300, the method further includes: S400. With the help of a vision detection device, determine whether the positions of more than one workpiece in the sorting area are offset. If there is no offset, directly generate the picking instruction; Otherwise, according to the offset information of the workpiece, correct the picking instruction and send the corrected picking instruction to the control device of the picking robotic arm.

3. The method according to claim 1, wherein The S100 includes: According to the CAM nesting software information, generate a DXF file and a JSON file for storing two-dimensional design data, load the DXF file and the JSON file, and while displaying the workpiece layout information on the interface, obtain the center coordinates, attribute information, and initial picking path of each workpiece in the sorting area; The attribute information of each workpiece includes: workpiece identification, workpiece size, set of outer contour vertices of the workpiece, workpiece thickness, workpiece margin; workpiece geometry; arrangement position of the workpiece on the to-be-processed plate; the initial picking path is the picking order of all workpieces on the to-be-processed plate.

4. The method according to claim 1, wherein The S200 includes: Construct the topological relationship graph of all workpieces to be picked up through the ant colony algorithm, and optimize the initial picking paths of all workpieces based on the topological relationship graph to obtain the optimized picking paths; Specifically, in S201, traverse the attribute information of all workpieces to obtain the set C of the central coordinates of all workpieces, C = {c1(x1, y1),....., c n (x n , y n )}; S202. Obtain the center distance between any two workpieces in C, and based on all center distances and a pre-given threshold of the center distance between adjacent workpieces, obtain the adjacency matrix A of all workpieces; S203. Based on the initialized ant colony algorithm parameters, adopt a path optimization method to obtain the optimal path as the optimized picking path.

5. The method according to claim 4, characterized in that The S203 includes: The initialized ant colony algorithm parameters include: pheromone intensity Q, evaporation coefficient ρ, heuristic factor weight β, pheromone weight α, number of ants m, maximum number of iterations T; the evaporation coefficient and heuristic factor weight are associated with the workpiece size, workpiece density, and workpiece thickness; S2031. Initialize pheromone τ ij = 1, where τ ij is the pheromone concentration on each edge of the adjacency matrix A; S2032. For each ant k, k takes 1...m; a. Each ant randomly selects a workpiece as the starting point at the beginning; b. When the ant traverses the path, it will construct a taboo list to record the workpieces that have been visited to avoid repeatedly visiting the workpieces that have been visited; c. When the ant is at the current node i, calculate the transition probability of moving from node i to each reachable node j Among them, N i is all adjacent nodes of node i, and τ ij is the pheromone concentration on the edge (i→j) in the adjacency matrix A, is the heuristic factor, and d ij is the straight-line distance from node i to j, that is, the actual distance between two workpieces represented in the adjacency matrix A; S2033. Roulette wheel selection for the next node: According to the calculated transition probability, the ant will use the roulette wheel selection method to decide the next-hop node j; S2034. Update the taboo list and path length: After the ant moves to the next node, it updates the taboo list to record the new path length. S2035. Update the pheromone matrix: After each path traversal is completed, all ants update the pheromone matrix τ according to the paths they have walked respectively. ij , Among them, is the increment of pheromone released by the k-th ant on the path (i→j). If ant k has passed through the edge (i→j) on the path, then If not passed through, L k is the total length of the path traveled by ant k, and t is the number of iterations; S2036. Update the optimal path. After each iteration is completed, check whether the current path is the optimal path and update the global optimal path. If the current path is shorter, update the optimal path; otherwise, repeat the above steps continuously until the number of iterations reaches T, and output the optimal path sequence as the optimized material taking path.

6. The method according to claim 1, wherein The said S300 includes: For each workpiece in the material taking path, according to the set of outer contour vertex coordinates of the workpiece, calculate the center point of the minimum circumscribed rectangle of the workpiece, and screen the suction cup candidate points along the long axis of the minimum circumscribed rectangle according to the specified rules, and obtain the suction cup combination of the workpiece based on the screened suction cup candidate points.

7. The method according to claim 6, characterized in that, The said S300 includes: S301. Obtain the minimum circumscribed rectangle MBR of the workpiece from the set of outer contour vertex coordinates V of the workpiece. S302. Calculate the convex hull of V: Use the Graham Scan algorithm to calculate the convex hull of V. Sort all points by the x coordinate, and in the case of the same x coordinate, sort by the y coordinate. Select the leftmost point v as the starting point, v ∈ V, traverse the remaining points in order, and use the cross product to judge the direction of the current point relative to the previous two points. If the current point and the previous two points form a clockwise direction, pop the middle point and continue to check; if they form a counterclockwise or collinear direction, add the current point to the convex hull. The finally obtained convex hull is a set of vertices arranged in counterclockwise order. S303. Select an initial edge in the convex hull. Select the edge from the first vertex to the second vertex in the convex hull as the initial edge, calculate the direction angle of this edge. The direction angle is the angle between the positive x-axis and the edge, and calculate the normal vector of this edge for projection. S304. Traverse the convex hull edges and calculate the direction angle of each edge: For each edge in the convex hull, calculate its direction angle θ. If the direction of the edge is from (x i , x j ) to (y i , y j ), then If the edge is vertical, i.e., x j = x i , then S305. Project the vertex set in the projection convex hull to the θ direction and calculate the MBR area: For each vertex in the convex hull, calculate its projection coordinates (x', y') in the θ direction according to the direction angle θ of the current edge, calculate the maximum and minimum values of all vertex x', y' after projection, that is, max(x'), min(x'), and then calculate the area Area(θ) of the MBR. The projected point set is V' = {(x1', y1'), (x2', y2')......, (x n ', y n ')}: x' = x·cosθ + y·sinθ y' = -x·sinθ + y·cosθ Area(θ) = (max(x') - min(x')) × (max(y') - min(y')); S306. Use the rotating calipers algorithm to find the minimum MBR: Start from the initial edge. Assume the current edge is edge e, find the normal vector perpendicular to edge e, and project all vertices onto this normal vector, calculate the MBR area, and rotate to the next edge that may form a smaller MBR in turn, that is, select the next vertex, and then calculate the new direction angle. Repeat the above steps until all possible edges are traversed. During the traversal process, record the MBR area corresponding to each direction θ, and select the direction θ with the minimum Area(θ) as the final MBR direction. S307. Output parameters: The center point (c x , c y ) of the MBR, the major axis length L, the minor axis length W, Length = max(x') - min(x'), Width = max(y') - min(y'), the rotation angle θ. The center point of the MBR is the geometric center of the outer bounding rectangle. The major axis and the minor axis are two mutually perpendicular sides of the rectangle. The rotation angle θ describes the rotation angle of the rectangle relative to the horizontal direction.

8. The method according to claim 7, wherein The said S300 further includes: S308. Generate candidate points along the two long axes of the MBR based on the pre-established local coordinate system of the suction cup matrix and the coding information of each suction cup node in the suction cup matrix: a. Determine the starting point and the ending point. The starting point is located at one end of the long axis, at a first specified distance from the edge; the ending point is located at the other end of the long axis, also at the first specified distance. b. Generate candidate points in turn from the starting point to the ending point at a step size of twice the first specified distance. c. The candidate point set \(P=\{p_1,\ldots,p\}\) that constitutes the suction cup combination k} S309. Screen the finally required suction cups based on the set of suction cup candidate points. For each point p in the candidate set P, p ∈ P, first convert it from the MBR coordinate system to the local coordinate system of the suction cup matrix. X_suction_origin is the real-time coordinate of the center of the suction cup matrix provided by the control device of the picking robot arm. row[i] is the row number, the suction cup pitch is 50 mm, and θ is the angle of rotation of the suction cup matrix around the Z axis; x local = X_suction_origin + row[i] × 50 × cosθ - col[i] × 50 × sinθ y local = Y_suction_origin + row[i] × 50 × sinθ + col[i] × 50 × sinθ S310. Calculate the row and column numbers where the suction cup is located: According to the converted local coordinates, calculate the row and column numbers of each candidate point p in the suction cup matrix, which is used to map the offset of the local coordinates to the actual row and column numbering system; S311. Check the validity of the suction cup. Use the ray method to determine whether the suction cup coordinate point is inside the workpiece contour polygon, and evaluate whether the pressure value at this suction cup position is greater than or equal to the material-specific threshold to ensure that the suction cup has sufficient suction force to firmly grasp the workpiece at this position; If there is a suction cup coordinate point outside the workpiece contour polygon, adjust the MBR or the first specified distance, and repeat the above steps until the suction cup is a valid suction cup.

9. The method according to claim 2, characterized in that, The S400 includes: S401. Calibrate the vision detection device based on the checkerboard calibration method and establish the mapping relationship between the image coordinates and the mechanical coordinates; S402. Based on the image of the sorting area obtained by the vision detection device, use the ORB feature extraction and matching method to determine whether the positions of one or more workpieces are offset; S403. If there is an offset, calculate the affine transformation matrix M that maps the feature points in the template image to the feature points in the real-time image. src_pts and dst_pts represent the feature point coordinates in the template image and the real-time image respectively. calibration_scale is the calibration coefficient, and estimateAffinePartial2D is a function; a, b, c, d are given parameters; M = cv2.estimateAffinePartial2D(src_pts, dst_pts) Horizontal offset dx = M[0, 2] * calibration_scale; Vertical offset dy = M[1, 2] * calibration_scale; Among them, M[0, 2] corresponds to t in the matrix x , and M[1, 2] corresponds to t y ; S404. When the offset satisfies |Δx| ≥ 2 mm or |Δy| ≥ 2 mm, trigger compensation and calculate the compensation amounts Δx and Δy. k is the damping coefficient; Δy = M[0,2] * 0.1, y comp = y dxf + Δy · k Δx = M[0,2] * 0.1, x comp = x dxf + Δx · k S405. Update the workpiece coordinates in the picking instruction; and trigger the path replanning in S200: and the update of the suction cup combination configuration in S300.

10. A numerical control system, characterized in that, It includes a memory and a processor. The memory stores a computer program. The processor executes the computer program stored in the memory and executes the steps of a material sorting method based on dynamic path planning according to any one of claims 1 to 9 above.

Citation Information

Cited By

  • Automatic surface mounting device and material taking path optimization method

    CN120977922A

  • An automated chip placement device and a method for optimizing the material handling path.

    CN120977922B