Multi-chromosome particle swarm-based complex curved surface spraying path planning method and system

CN116384608BActive Publication Date: 2026-09-15SHANDONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310426383.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-17
Publication Date
2026-09-15
Estimated Expiration
2043-04-17

AI Technical Summary

Technical Problem

[0005]针对现有技术存在的不足,本发明的目的是提供一种基于多染色体粒子群的复杂曲面喷涂路径规划方法及系统,基于孔洞检测算法和分层分割将复杂曲面分为多个简单的子区域;其次确定了单个子区域内的路径连接方式;最后提出了一种基于多染色体粒子群优化算法(Multiple Chromosomes Particle Swarm Optimization algorithm,MCPSO)用于优化子区域间的连接路径,实现复杂曲面的全局最优路径规划,有效解决了复杂自由曲面的自动路径规划问题

Benefits of technology

[0041]This invention discloses a method and system for complex surface spraying path planning based on multi-chromosome particle swarm optimization. It proposes a region segmentation method for complex surfaces, using a 3D hole detection algorithm to perform layered segmentation of the complex surface. Based on coarse and fine segmentation, the complex surface is divided into sub-regions without holes and with simple geometric and topological shapes. Compared to existing methods, this invention can more precisely divide 3D complex surfaces, solving the problem of ignoring small holes in existing complex surface segmentation methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116384608B_ABST
    Figure CN116384608B_ABST
Patent Text Reader

Abstract

The application discloses a kind of complex curved surface spraying path planning method and system based on multi-chromosome particle swarm, and relates to the technical field of complex curved surface spraying path planning.It includes to be sprayed free curved surface, according to hole detection algorithm, the hole of free curved surface on free curved surface is detected;Free curved surface is respectively coarsely segmented and finely segmented, and is divided into multiple sub-regions without holes;According to the end point of characteristic line, the connection mode of the characteristic line in each sub-region path is planned using raster type path, to obtain multiple possible full coverage paths;Considering the connection order of different types of raster type path and each sub-region, the multiple possible full coverage paths are optimized using multi-chromosome particle swarm algorithm, to obtain the optimal spraying path.The application reasonably avoids the holes of different sizes and shapes in complex free curved surface to obtain the optimal spraying path, and improves the quality of spraying.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of complex surface spraying path planning technology, and in particular to a method and system for complex surface spraying path planning based on multi-chromosome particle swarm optimization. Background Technology

[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.

[0003] Spray painting is a widely used coating process in manufacturing industries such as automobiles, ships, and aircraft. Traditional spray painting is done manually, which exposes workers to harsh environments for extended periods, impacting their health. Furthermore, manual spray painting is inefficient and often results in significant paint waste. In recent years, automated spray painting has gradually replaced manual spray painting, becoming the mainstream method in large workshops and factories. Spray path planning is a crucial component of automated spray painting. However, compared to the automation of the spray painting process, spray path planning has not yet been automated. Currently, spray path planning is primarily done manually, relying on personal experience, requiring extensive trial and error, and is very time-consuming. This significantly reduces work efficiency; therefore, achieving automated spray path planning is essential.

[0004] Currently, automated Coverage Path Planning (CPP) is mostly applied to simple freeform surfaces, with relatively few applications for complex freeform surfaces. Complex freeform surfaces have complex geometry and topology, often containing holes of varying numbers, sizes, and shapes. Clearly, these hole areas do not need to be painted; properly avoiding these holes can significantly reduce paint waste and shorten painting cycle time. Existing methods use manual or automatic surface segmentation algorithms to divide the surface into simple sub-surfaces without holes, then plan painting paths for each sub-surface separately, and finally combine and connect the paths of each sub-surface to form a global painting path. Common segmentation methods include trapezoidal segmentation, ox-plowing segmentation, Morse segmentation, and projection methods; however, these methods are all segmentation algorithms for two-dimensional surfaces and cannot segment three-dimensional surfaces. However, some scholars have proposed better methods, such as first projecting the 3D surface onto a 2D surface, then obtaining an approximate polygonal outline on the 2D surface, segmenting the 2D surface based on this outline, and finally backprojecting the 2D segmentation result back into 3D to complete the 3D segmentation of the complex freeform surface. However, this segmentation method is only suitable for holes with regular shapes and a small number of holes; it is not effective for segmenting holes with irregular shapes and a large number of holes. As for the combination planning between sub-surface patches, current methods mostly perform path planning within each sub-surface patch first, and then combine and connect the sub-surface patches, so the resulting total path is often not optimal. Therefore, how to reasonably avoid holes of different sizes and shapes in complex freeform surfaces to obtain the optimal spraying path has become a problem that needs to be solved by existing technologies. Summary of the Invention

[0005] To address the shortcomings of existing technologies, the present invention aims to provide a method and system for complex surface spraying path planning based on multi-chromosome particle swarm optimization (MCPSO). The method divides the complex surface into multiple simple sub-regions based on a hole detection algorithm and layered segmentation. Secondly, it determines the path connection method within each sub-region. Finally, it proposes a multi-chromosome particle swarm optimization algorithm (MCPSO) to optimize the connection paths between sub-regions, achieving globally optimal path planning for complex surfaces and effectively solving the problem of automatic path planning for complex freeform surfaces.

[0006] To achieve the above objectives, the present invention is implemented through the following technical solution:

[0007] The first aspect of this invention provides a method for planning spraying paths on complex curved surfaces based on multi-chromosome particle swarm optimization, comprising the following steps:

[0008] Obtain the freeform surface to be sprayed, and perform hole detection on the freeform surface using a scanning surface scanning method based on the hole detection algorithm, marking the critical points of the holes and the intersection planes of the holes.

[0009] Using the intersection planes of all the entrance and exit holes as the dividing lines, the freeform surface is roughly divided into multiple sub-regions;

[0010] The sub-region containing holes is further subdivided into multiple sub-regions without holes based on the different types of hole thresholds; each sub-region without holes contains intersection points obtained by multiple intersecting planes intersecting the freeform surface.

[0011] A set of intersection points obtained by the same intersecting plane is abstracted into an intersection line, denoted as a characteristic line, and the two endpoints of each characteristic line are recorded.

[0012] A raster-type path is used to plan the connection method of feature lines in each sub-region based on the endpoints of the feature lines, resulting in multiple possible full-coverage paths.

[0013] Considering different types of raster paths and the connection order of each sub-region, a multi-chromosome particle swarm optimization algorithm is used to optimize multiple possible full-coverage paths to obtain the optimal spraying path.

[0014] Furthermore, the specific steps for hole detection on a freeform surface using a scanning surface method are as follows:

[0015] The freeform surface is scanned using the tangent plane as the scanning plane, with the scanning direction along the z-axis. When a hole is detected, the critical intersection point between the tangent plane and the surface is recorded as the critical point of the hole, and the current tangent plane is marked as the intersection plane for entering and exiting the hole region, until the scanning is completed.

[0016] Furthermore, the specific steps of the hole detection algorithm are as follows:

[0017] The intersection calculation is performed between the current tangent plane and the intersecting free surface to obtain a set of intersecting line segments. The intersecting line segments are sorted from smallest to largest. In non-hole areas, the beginning and end of the intersecting line segments are connected. In hole areas, the beginning and end of the intersecting line segments are not connected. Hole detection is performed based on the connection status of the beginning and end of the intersecting line segments.

[0018] Furthermore, the specific steps for further subdividing the perforated subregion into multiple non-perforated subregions based on different types of perforation thresholds are as follows:

[0019] The critical points of holes are classified into left-side critical points and right-side critical points, and the left and right-side critical points of holes are marked. The intersection plane intersects the freeform surface along the z-axis at fixed intervals to obtain a series of intersection points. The intersection line segments are scanned from small to large along the y-axis. The situation is judged according to the critical points of holes at the first and last intersection points, and different types are classified. The different types are further subdivided to obtain multiple sub-regions without holes.

[0020] Furthermore, based on the critical point of the hole between the first and last intersection points, the situation can be divided into the following four types:

[0021] (1) The first intersection point is a non-critical point, and the last intersection point is a left or right critical point; (2) The first intersection point is a right critical point, and the last intersection point is a left critical point; (3) The first intersection point is a left critical point, and the last intersection point is a right critical point; (4) The first intersection point is a left or right critical point, and the last intersection point is a non-critical point.

[0022] Furthermore, the specific steps for using a raster-type path to plan the connection method of feature lines within the path of each sub-region based on the endpoints of the feature lines, and to obtain multiple possible full-coverage paths, are as follows:

[0023] The sub-regions are divided into sub-regions containing an odd number of feature lines and sub-regions containing an even number of feature lines based on the number of feature lines they contain.

[0024] The grating-type path is used to determine different path planning methods based on sub-regions with an odd number of feature lines and sub-regions with an even number of feature lines.

[0025] Furthermore, individuals are defined based on different types of raster-like paths. Each individual includes X and Y chromosomes, and the genes on the X and Y chromosomes represent different types of raster-like paths. The genes on the X chromosome represent the traversal order of the sub-regions, and the genes on the Y chromosome represent the different connection methods of the raster-like paths in each sub-region.

[0026] Furthermore, the multi-chromosome particle swarm optimization algorithm is used to optimize multiple possible full-coverage paths to obtain the optimal spraying path. The specific steps are as follows:

[0027] Initialize the individual by assigning the local optimum and global optimum to the individual value;

[0028] Perform crossover and mutation operations on individuals;

[0029] The current best individual is obtained by calculating the reward function value, and the calculated reward function value of the current best individual is used as the fitness function value.

[0030] If the fitness function value is better than the local optimum of the current generation, then the individual is taken as the local optimum of the current generation.

[0031] If the fitness function value is better than the global optimum, then the individual is considered the global optimum.

[0032] After a given number of iterations, the global optimum and the global optimum individual are obtained, and thus the optimal spraying path is obtained.

[0033] Furthermore, the reward function consists of four parts: path length reward within a sub-region, path length reward between sub-regions, path turning number reward, and coverage reward.

[0034] A second aspect of the present invention provides a complex surface spraying path planning system based on multi-chromosome particle swarm optimization, comprising:

[0035] The 3D hole detection module is configured to acquire the freeform surface to be sprayed, and perform hole detection on the freeform surface using a scanning surface scanning method according to the hole detection algorithm, marking the critical points of the holes and the intersection planes of the holes.

[0036] The coarse segmentation module is configured to coarsely segment the freeform surface into multiple sub-regions based on the intersection planes of the entry and exit holes;

[0037] The fine segmentation module is configured to finely segment the sub-region containing holes according to the different types of hole critical points, into multiple sub-regions without holes; each sub-region without holes contains intersection points obtained by multiple intersecting planes intersecting the freeform surface; a set of intersection points obtained by the same intersecting plane is abstracted into an intersection line, denoted as a feature line, and the two endpoints of each feature line are recorded;

[0038] The raster-type path planning module is configured to use raster-type paths to plan the connection method of feature lines within the path of each sub-region based on the endpoints of feature lines, thereby obtaining multiple possible full-coverage paths.

[0039] The multi-chromosome particle swarm optimization module is configured to consider different types of raster paths and the connection order of each sub-region, and use the multi-chromosome particle swarm optimization algorithm to optimize multiple possible full-coverage paths to obtain the optimal spraying path.

[0040] The above one or more technical solutions have the following beneficial effects:

[0041] This invention discloses a method and system for complex surface spraying path planning based on multi-chromosome particle swarm optimization. It proposes a region segmentation method for complex surfaces, using a 3D hole detection algorithm to perform layered segmentation of the complex surface. Based on coarse and fine segmentation, the complex surface is divided into sub-regions without holes and with simple geometric and topological shapes. Compared to existing methods, this invention can more precisely divide 3D complex surfaces, solving the problem of ignoring small holes in existing complex surface segmentation methods.

[0042] This invention obtains path connection combinations for sub-regions based on the number of intercepts in each sub-region, achieving local planning. It uses intersecting planes to intersect complex surfaces, obtaining a series of intersection points, each group of which is abstracted as a feature line. Different path connection combinations are obtained based on the varying number of feature lines within different sub-regions. This invention proposes a multi-chromosome-based particle swarm optimization algorithm to solve the spraying path planning problem for complex surfaces. By introducing three chromosomes while retaining the core mechanism of the particle swarm optimization algorithm, crossover and mutation operations are used to update the offspring. Global optimal planning is performed by combining local planning with different path connection combinations to obtain the optimal path. This invention addresses both local and global planning, considering curvature and shape changes between sub-regions, resulting in better spraying paths and improved spraying quality.

[0043] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0044] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0045] Figure 1 This is a schematic diagram illustrating four ways to connect adjacent sub-paths in Embodiment 1 of the present invention;

[0046] Figure 2 This is a schematic diagram of the layered segmentation of a three-dimensional complex freeform surface in Embodiment 1 of the present invention;

[0047] Figure 3 This is a schematic diagram of the hole detection algorithm in Embodiment 1 of the present invention;

[0048] Figure 4 This is a schematic diagram of the layered division of the rear of the bus in Embodiment 1 of the present invention;

[0049] Figure 5 This is a schematic diagram of the feature line connection method in the odd-number case of Embodiment 1 of the present invention;

[0050] Figure 6This is a schematic diagram of the feature line connection method in the even-number case of Embodiment 1 of the present invention;

[0051] Figure 7 This is a schematic diagram of the structures of chromosomes X, Y1, and Y2 in Embodiment 1 of the present invention;

[0052] Figure 8 This is a schematic diagram showing the selection of ingress and egress endpoints corresponding to different values ​​of genes on chromosome Y in Embodiment 1 of the present invention;

[0053] Figure 9(a) is a schematic diagram of the coverage path without using internal path length reward in Embodiment 1 of the present invention;

[0054] Figure 9(b) is a schematic diagram of the coverage path using internal path length reward in Embodiment 1 of the present invention. Detailed Implementation

[0055] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0056] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0057] Example 1:

[0058] The painting path planning problem is similar to the Traveling Salesman Problem (TSP), which is a combinatorial optimization problem, but there are two significant differences: (1) In the painting path combinatorial planning problem, after visiting all sub-paths, it is not necessary to return to the starting point. (2) In the TSP problem, each point is regarded as a city to be visited. In the painting path combinatorial planning problem, each path has two endpoints to choose from. Entering from one endpoint will necessarily lead to leaving from the other endpoint. Different endpoint choices will result in different lengths of the connecting lines (the lines connecting cities), thus causing changes in the length of the painting path.

[0059] Therefore, this invention defines the combinatorial planning problem of spraying paths as the Generalized Traveling Salesman Problem (GTSP). Like the TSP, the GTSP is also an NP-hard problem with factorial complexity. This invention defines a straight line connecting two endpoints as a feature line, i.e., a city, where each city contains two endpoints. The GTSP is the problem of traversing all sub-paths (cities), and each sub-path can be visited exactly once, to find the shortest spraying path. Mathematically, using graph theory, it is represented as follows:

[0060] In a complete covering graph G = (V, E), V = {V i The set of vertices, i = 1, 2, ..., n, represents n sub-paths, each with two endpoints, i.e., V. i ={A i B i};E={(V i V j ):i≠j,V i V j ∈V} is the edge set in the graph, representing the connecting line between the i-th and j-th sub-paths; W={w(V i V j ):i≠j,V i V j Let ∈V} be the weight set in the graph, representing the length of the connection between the i-th and j-th sub-paths. Since each sub-path has two endpoints, the sub-path V... i V j There are four possible connection methods, corresponding to w(V) i V j It has 4 different values.

[0061] Introduce a binary variable l = {l i :i=1,2,...,n} represents the i-th sub-path V i The spraying direction, when l i When = 1, it means V i The starting point for spraying is A i The spraying endpoint is B. i When l i When = -1, it means V i The starting point for spraying is B. i The spraying endpoint is A. i .

[0062] Subpath V i V j Connection wires such as Figure 1 As shown, its corresponding weight w(V) iV j ), that is, V i V j The length of the connecting line can be expressed as:

[0063]

[0064] Among them, |B i A j | represents the distance between endpoint Bi and endpoint Aj, |A i A j | represents the distance from endpoint Ai to endpoint Aj, |B i B j | represents the distance between endpoint Bi and endpoint Bj, |A i B j | represents the distance between endpoint Ai and endpoint Bj. The goal of solving the GTSP problem is to find the path with the shortest sum of the lengths of the connecting lines between all sub-paths. Therefore, the spraying path combination planning problem can be described as follows:

[0065]

[0066]

[0067]

[0068] with x ij =0 or 1 (3)

[0069] Where n is the number of subpaths, w(V i V j x is the distance between the connecting lines of the i-th sub-path and the j-th sub-path. ij Let x be the defined decision variable. ij =1 indicates that the spray gun starts from subpath V i Move to subpath V j Formula (3) ensures that each sub-path can be visited exactly once.

[0070] The detailed steps of the specific embodiment are as follows:

[0071] Embodiment 1 of the present invention provides a method for planning the spraying path of complex curved surfaces based on multi-chromosome particle swarm optimization, comprising the following steps:

[0072] Step 1: Obtain the freeform surface to be sprayed. Based on the hole detection algorithm, use the scanning surface scanning method to detect holes on the freeform surface and mark the critical points of holes and the intersection planes of the holes.

[0073] Step 1.1: For three-dimensional curved surfaces, scan lines cannot mark units; therefore, in this embodiment, scan surfaces are used instead of scan lines to complete the layer segmentation. For example... Figure 2 As shown, the freeform surface is scanned using the tangent plane as the scanning plane, with the scanning direction along the z-axis. When a hole is detected using a hole detection algorithm, the critical intersection point between the tangent plane and the surface is recorded as the hole critical point, and the current tangent plane is marked as the intersection plane for entering and exiting the hole region, until the scan is complete. In this embodiment, the tangent plane marking the entry and exit of the hole, i.e., the tangent plane that detects the hole, is a special tangent plane. It serves as the boundary for (coarse) segmentation, and is therefore named the critical intersection plane.

[0074] Step 1.2, the specific steps of the hole detection algorithm are as follows: Figure 3 As shown, the intersection calculation is performed between the current tangent plane and the intersecting free surface to obtain a set of intersecting line segments. The intersecting line segments are sorted from smallest to largest. In non-hole areas, the beginning and end of the intersecting line segments are connected. In hole areas, the beginning and end of the intersecting line segments are not connected. Hole detection is performed based on the connection status of the beginning and end of the intersecting line segments.

[0075] Step 1.2.1, find a set of intersection line segments {L:l} where the tangent plane intersects the curved surface. i =(p i ,q i ), i = 1, 2, ..., k}, where p i ,q i These are the endpoints of the intersecting line segments, and k is the number of intersecting line segments. If a triangular facet intersects the plane with only one vertex, it is considered as a line segment with a length of 0, i.e., p. i =q i .

[0076] Step 1.2.2, for each pair (p) i ,q i Adjustments are made for i = 1, 2, ..., k, if p i The y-axis coordinate is greater than q i Given the y-axis coordinate, let tmp = p i ,p i =q i ,q i =tmp.

[0077] Steps 1, 2, and 3, for l i =(p i ,q i Sort the numbers i = 1, 2, ..., k according to the sorting rule p. i The y-axis coordinates increase sequentially.

[0078] Step 1.2.4, set the hole detection threshold e, let d i =pi +1-q i If i = 1, 2, ..., k, and d i >e indicates that endpoint p i +1 and endpoint q i To satisfy the threshold size, the critical point on the hole boundary is recorded at the endpoint p. i +1 and endpoint q i The value of d. i The number of values ​​for 'e' represents the number of holes that meet the threshold when the current plane intersects. Specifically, when 'e' = 0, all holes can be identified; increasing the threshold 'e' allows some small holes to be ignored.

[0079] The problem of combinatorial planning for spraying paths on complex three-dimensional surfaces is even more challenging. The geometric characteristics of complex surfaces are generally intricate. First, three-dimensional freeform surfaces are discontinuous and their curvature varies. Second, complex three-dimensional surfaces may contain multiple holes, complicating coverage path planning. To address these two characteristics of complex surfaces, this invention first preprocesses the surface, proposing a three-dimensional hole detection algorithm to segment the complex surface into multiple simple sub-regions. Subsequently, these sub-regions are further divided into multiple sub-regions without holes and with minimal curvature variation based on hole thresholds.

[0080] Step 2: Using the intersection planes of all the entrance and exit holes as the dividing lines, the freeform surface is roughly divided into multiple sub-regions.

[0081] Based on the intersection planes of the entry and exit holes, the freeform surface is coarsely divided into multiple sub-regions, such as... Figure 2 Sub-regions 1, 2, and 3 are shown. The intersecting planes intersect the surface along the z-axis at fixed intervals, resulting in a series of intersection points, with the spacing approximately equal to the radius of the spray gun model. After obtaining these intersection points, a hole detection algorithm is used to obtain the critical points of the hole boundaries and the intersecting planes entering and exiting the hole regions. Using these critical intersecting planes as boundaries, the entire freeform surface is coarsely divided into multiple sub-regions.

[0082] Step 3: The sub-region containing holes is further subdivided into multiple sub-regions without holes according to the different types of hole critical points; each sub-region without holes contains intersection points obtained by multiple intersecting planes intersecting the freeform surface.

[0083] Step 3.1: Classify the critical points of the hole into left-side critical points and right-side critical points, and mark the left and right-side critical points, such as... Figure 4 As shown, the intersection segments are scanned from small to large along the y-axis. The situation is classified into different types based on the hole critical point between the first and last intersection points. The segments are then finely divided according to the different types to obtain multiple sub-regions without holes.

[0084] Among them, the situation is divided into the following four types based on the critical point of the hole between the first and last intersection points:

[0085] (1) The first intersection point is a non-critical point, and the last intersection point is a left or right critical point; (2) The first intersection point is a right critical point, and the last intersection point is a left critical point; (3) The first intersection point is a left critical point, and the last intersection point is a right critical point; (4) The first intersection point is a left or right critical point, and the last intersection point is a non-critical point.

[0086] In this embodiment, critical points of the same type are fitted into a curve using non-uniform rational B-spline (NURBS) technology, which is called the critical curve. This curve is used as the boundary for (fine) segmentation to obtain sub-regions without holes.

[0087] After the above layered segmentation, the freeform surface can be divided into multiple simple sub-regions without holes, each of which contains intersection points obtained by multiple intersecting planes intersecting the freeform surface.

[0088] Step 4: Abstract a set of intersection points obtained by the same intersection plane into an intersection line, denoted as a feature line, and record the two endpoints of each feature line. Therefore, each sub-region can be regarded as being covered by multiple feature lines. By completing the combination planning of these feature lines, the coverage path planning of the entire curved surface can be completed. In this embodiment, taking the rear panel spraying of a bus as an example, the layered segmentation method of the present invention is used for segmentation, such as... Figure 4 As shown, the sub-regions S1-S8 are obtained.

[0089] Step 5: In sub-region path planning, commonly used path types include raster and spiral. Compared to spiral paths, raster paths are simpler and more versatile; therefore, this embodiment selects raster paths for planning each sub-region. Using raster paths, the connection method of feature lines within the path of each sub-region is planned based on the endpoints of the feature lines, resulting in multiple possible full-coverage paths.

[0090] Step 5.1: Divide the sub-regions into sub-regions with an odd number of feature lines and sub-regions with an even number of feature lines based on the number of feature lines they contain. Different sub-regions contain different numbers of feature lines, but they can all be categorized into two cases: sub-regions with an odd number of feature lines and sub-regions with an even number of feature lines. Sub-regions with an odd number of feature lines have four different connection methods, and similarly, sub-regions with an even number of feature lines also have four different connection methods, such as... Figure 5 and Figure 6 As shown, the connection method differs depending on whether the number of feature lines contained in a subregion is odd or even.

[0091] Step 5.2: Using a raster-type path, different path planning methods are determined based on sub-regions containing an odd number of feature lines and sub-regions containing an even number of feature lines.

[0092] Step 5.2.1: Using the z-axis as the scanning direction for the intersection plane from smallest to largest, each sub-region is abstractly represented by two feature lines and four endpoints. The first and last feature lines are selected to represent the sub-region, and the two endpoints of the first feature line are labeled as A. i A j The two endpoints of the last feature line are B. i B j The raster-type connection method of the remaining feature lines in this sub-region varies depending on the way the endpoints of the first and last feature lines enter and exit.

[0093] Step 5.2.2: When a sub-region contains an odd number of feature lines, a connecting line entering from one endpoint of the sub-region will necessarily exit from the diagonal endpoint opposite that endpoint. For example, consider a sub-region containing three feature lines... Figure 5 As shown, (a) when the connecting line is from A i Upon entry, it will definitely be from B. j (a) Leave; (b) When the connecting line is from B i Upon entry, it will definitely be from A. j (c) When the connecting line leaves A j Upon entry, it will definitely be from B. i (d) When the connecting line leaves B j Upon entry, it will definitely be from A. i leave.

[0094] Step 5.2.2: When a sub-region contains an even number of feature lines, a connecting line entering from one endpoint of that sub-region will necessarily exit from the same side endpoint of that endpoint within the sub-region. For example, if a sub-region contains two feature lines... Figure 6 As shown, (a) when the connecting line is from A i Upon entry, it will definitely be from A. j (a) Leave; (b) When the connecting line is from B i Upon entry, it will definitely be from B. j (c) When the connecting line leaves A j Upon entry, it will definitely be from A. i (d) When the connecting line leaves B j Upon entry, it will definitely be from B. i leave.

[0095] Step 5.2.3, specifically, when a sub-region contains only one feature line, the connecting line enters from one endpoint of the sub-region and exits from the other endpoint.

[0096] Analysis of the connection methods within the sub-regions reveals that each sub-region has four possible path connections. Therefore, there are numerous possibilities for completing a full coverage path planning (CPP) for all sub-regions. The next problem to be solved in this embodiment is how to connect the sub-regions and the feature lines within each sub-region to form a globally optimal path.

[0097] Step 6: The standard particle swarm optimization (PSO) algorithm, where each particle has a position vector and a velocity vector, is iteratively updated using the current velocity vector, individual historical experience, and swarm historical experience. It is characterized by its simplicity, few parameters, and ease of convergence. While the standard PSO algorithm is suitable for finding the optimal value of continuous functions, the GTSP problem is based on an optimization objective function with discrete variables. Therefore, the MCPSO algorithm proposed in this embodiment retains the core mechanism of updating position based on individual and swarm experience information from the PSO algorithm, and introduces crossover and mutation operations from genetics to replace the position update function in the standard PSO, successfully solving the GTSP problem. Crossover between individuals in the population and the global optimum generates a new population, equivalent to reproducing superior genes in the current generation to optimize the offspring population; mutation operations are used to avoid getting trapped in local optima.

[0098] Specifically, considering different types of raster paths and the connection order of each sub-region, the multi-chromosome particle swarm optimization algorithm is used to optimize multiple possible full-coverage paths to obtain the optimal spraying path.

[0099] Step 6.1: Define individuals based on different types of raster-type paths. In this embodiment, each individual represents a global (entire surface) spraying path solution, i.e., a global raster-type spraying path. This path consists of a series of intersection points, which are connected sequentially in an optimized order to form the global path. Specifically, each individual includes X and Y chromosomes. Chromosome Y is composed of chromosome Y1 and chromosome Y2, therefore each individual contains three chromosomes. Genes on the X and Y chromosomes represent different types of raster-type paths. Genes on the X chromosome represent the traversal order of sub-regions, and genes on the Y chromosome represent the different connection methods of the raster-type paths within each sub-region.

[0100] In this embodiment, the Y chromosome consists of the Y1 chromosome and the Y2 chromosome, meaning that each individual contains three chromosomes, such as... Figure 7 As shown.

[0101] Step 6.1.1 The traversal order of gene-representing subregions on chromosome X can be represented by the function π1 as follows:

[0102] π1:O X ={O1,O2,...,O n} (4)

[0103] Among them, O i (i = 1, 2, ..., n) represents the sequence number of the sub-region, and n represents the number of sub-regions. For example, O X ={4,5,3,1,2} indicates that the complex surface is divided into 5 sub-regions and traversed in the order of 4-5-3-1-2.

[0104] Step 6.1.2: Chromosome Y is composed of chromosomes Y1 and Y2, and the genes on it represent different connection methods of raster-like paths in each subregion. The number of genes on chromosome Y is the same as that on chromosome X. The genes on chromosome Y take binary values ​​v. i = {1, -1}, i ∈ (1, 2, ..., n). Therefore, chromosome Y can be represented by the function π² as follows:

[0105] π2:

[0106]

[0107]

[0108]

[0109] Among them, O Y1 and O Y2 These represent the gene sequences on chromosomes Y1 and Y2, respectively, with n representing the number of subregions. For example... Figure 8 As shown, This indicates that the raster-shaped path enters from one endpoint of the first feature line of the i-th sub-region and exits from one endpoint of the last feature line of the i-th sub-region. Conversely, This indicates that the raster-type path enters from one endpoint of the last feature line of the i-th sub-region and exits from one endpoint of the first feature line of the i-th sub-region. This indicates that the raster-type path enters from the right endpoint of the first or last feature line of the j-th sub-region and exits from the left endpoint of the first or last feature line of the j-th sub-region. Conversely, This indicates that the raster-type path enters from the left endpoint of the first or last feature line of the j-th sub-region and exits from the right endpoint of the first or last feature line of the j-th sub-region.

[0110] In summary, the different gene values ​​on chromosomes Y1 and Y2 correspond to four different types of raster-like paths. For example, That is, (1, -1) indicates that the raster-shaped path in the m-th sub-region starts from the left endpoint of the first feature line and exits from one of the endpoints of the last raster-shaped path. Which endpoint it exits from depends on whether the number of feature lines contained in the m-th sub-region is odd or even.

[0111] Step 6.2: The distance matrix represents the distances of the connection paths between sub-regions. The distance between sub-regions is an important factor affecting the total path length, and can be expressed by the following formula:

[0112]

[0113] Among them, D ij It is point p i (x i ,y i ,z i ) and point p j (x j ,y j ,z j The Euclidean distance between them.

[0114] Step 6.3, Individual Initialization Phase.

[0115] During the initialization phase, the individual matrix is ​​initialized, and the local optimum P_best and the global optimum G_best are assigned the individual values.

[0116] Step 6.3, Iteration phase.

[0117] Step 6.3.1: Perform crossover and mutation operations on the individuals.

[0118] The crossover operator used in this embodiment is the Order Crossover Operator (OX). The Order Crossover method can preserve the relative order of parental genes as much as possible. The mutation operation used in this embodiment is the exchange mutation method, that is, randomly selecting two genes at the same position in the father and exchanging them.

[0119] Step 6.3.2: Obtain the current best individual by calculating the reward function value. The calculated reward function value of the current best individual is used as the fitness function value.

[0120] The quality of spraying is affected by various factors, such as path length, uniformity of paint film thickness, and coverage. Therefore, this embodiment sets up a reward function to measure the quality of spraying. The reward function in this embodiment consists of four parts, namely, the path length reward L(P) within the sub-region. I ), Path length reward between sub-regions L(P) CThe algorithm calculates the path turning point reward T(θ) and the coverage reward CR. After a given number of iterations, it obtains the global optimum and the optimal individual, thus yielding the optimal path.

[0121] More specifically, (1) the path length reward L(P) within the sub-region I )

[0122] A key objective in spray coating path planning is to minimize path length. The total path length is divided into path length within sub-regions and connection length between paths within sub-regions. The reward function for path length within a sub-region is as follows:

[0123]

[0124] in, This represents the distance from the starting path point to the first path point after the starting path point in the j-th sub-region. p represents the starting path point of the j-th sub-region. j1 Represents the starting path point in the j-th sub-region. The first path point after n and N. k These represent the number of sub-regions and the number of path points in the j-th sub-region, respectively. ||·|| denotes the Euclidean distance. This reward minimizes the path length in each region, resulting in shorter global coverage paths. For example, Figure 9(a) shows a coverage path without the internal path length reward, which contains many overlapping and turning paths. In Figure 9(b), the internal path length reward is applied in the same environment, generating shorter and smoother paths.

[0125] (2) Path length reward between sub-regions L(P) C )

[0126] The length of the connecting paths between sub-regions is another important metric for measuring the total length of the coverage path. The shorter the path length between sub-regions, the shorter the distance the robotic arm travels from one region to another, and the less energy it consumes. The reward function for the path length between sub-regions is shown below:

[0127]

[0128] Where n is the number of subregions, This represents the path point that leaves from the j-th sub-region. This represents the path point for entering the (j+1)th sub-region. This represents the path length between adjacent sub-regions.

[0129] (3) Path turning number reward T(θ)

[0130] During the spraying process, the number of turns made by the robotic arm has a significant impact on the paint film thickness. Frequent turning movements often lead to defects on the sprayed surface. Therefore, the fewer the number of turns, the better the spraying quality. In this embodiment, a non-flat angle path is considered a turning movement. For example, path points p1, p2, and p3, as shown in Figure 9(a), are connected in sequence to form an angle ∠p1p2p3∈(0°, 180°). This angle is considered a non-flat angle and thus a turning movement. Therefore, the path turning number reward function can be transformed into the ratio of the number of non-flat angle path points to the total number of path points, as shown in the following formula:

[0131]

[0132]

[0133] Where p is the total number of path points in the total path, θ i (i = 1, 2, ..., p) represents the vector (p) i-1 -p i ) and vector (p i -p i+1 The included angle ∠p formed by ) i-1 p i p i+1 ∈(0°, 180°). A function used to determine whether an angle is not a straight angle.

[0134] (4) Coverage Bonus CR

[0135] Coverage is an important metric for measuring the quality of coverage paths. Coverage is defined as the ratio of the area covered by the generated path to the area that needs to be covered. The coverage reward function can be expressed as follows:

[0136]

[0137] Among them, Aera i Aera represents the area covered by the path generated in the i-th sub-region. all This represents the area that the entire surface needs to cover.

[0138] In summary, the overall reward function for complex surface covering path planning is as follows:

[0139]

[0140] Where, ω L ,ω T and ω CRThese are the weighting factors for path length reward, turning point reward, and coverage reward, respectively. These weighting factors influence the importance of their respective reward functions, and their values ​​are determined through multiple experimental optimizations. Once the optimal value of the reward function is obtained, the optimal coverage path can be derived. The optimal coverage path consists of a series of path points w. * The composition is as shown in the following formula:

[0141] w * =arg min(R) (14)

[0142] Step 6.3.3: After a given number of iterations, the global optimal value and the global optimal individual are obtained, and thus the optimal spraying path is obtained.

[0143] The current best individual is obtained as follows: if the fitness function value is better than the local optimum of the current generation, then the individual is taken as the local optimum of the current generation; if the fitness function value is better than the global optimum, then the individual is taken as the global optimum.

[0144] Example 2:

[0145] Embodiment 2 of the present invention provides a complex curved surface spraying path planning system based on multi-chromosome particle swarm optimization, comprising:

[0146] The 3D hole detection module is configured to acquire the freeform surface to be sprayed, and perform hole detection on the freeform surface using a scanning surface scanning method according to the hole detection algorithm, marking the critical points of the holes and the intersection planes of the holes.

[0147] The coarse segmentation module is configured to coarsely segment the freeform surface into multiple sub-regions based on the intersection planes of the entry and exit holes;

[0148] The fine segmentation module is configured to finely segment the sub-region containing holes according to the different types of hole critical points, into multiple sub-regions without holes; each sub-region without holes contains intersection points obtained by multiple intersecting planes intersecting the freeform surface; a set of intersection points obtained by the same intersecting plane is abstracted into an intersection line, denoted as a feature line, and the two endpoints of each feature line are recorded;

[0149] The raster-type path planning module is configured to use raster-type paths to plan the connection method of feature lines within the path of each sub-region based on the endpoints of feature lines, thereby obtaining multiple possible full-coverage paths.

[0150] The multi-chromosome particle swarm optimization module is configured to consider different types of raster paths and the connection order of each sub-region, and use the multi-chromosome particle swarm optimization algorithm to optimize multiple possible full-coverage paths to obtain the optimal spraying path.

[0151] The steps and methods described in Embodiment 2 correspond to those in Embodiment 1. For detailed implementation methods, please refer to the relevant descriptions in Embodiment 1. Those skilled in the art should understand that the modules or steps of the present invention described above can be implemented using general-purpose computer devices. Optionally, they can be implemented using computer-executable program code, thereby allowing them to be stored in a storage device for execution by a computer device, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. The present invention is not limited to any specific combination of hardware and software.

[0152] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.

Claims

1. A method for planning spraying paths on complex curved surfaces based on multi-chromosome particle swarm optimization, characterized in that, Includes the following steps: Obtain the freeform surface to be sprayed, and perform hole detection on the freeform surface using a scanning surface scanning method based on the hole detection algorithm, marking the critical points of the holes and the intersection planes of the holes. Using the intersection planes of all the entrance and exit holes as the dividing lines, the freeform surface is roughly divided into multiple sub-regions; The sub-region containing holes is further subdivided into multiple sub-regions without holes based on the different types of hole thresholds; each sub-region without holes contains intersection points obtained by multiple intersecting planes intersecting the freeform surface. A set of intersection points obtained by the same intersecting plane is abstracted into an intersection line, denoted as a characteristic line, and the two endpoints of each characteristic line are recorded. Using a raster-type path, the connection method of feature lines in each sub-region is planned based on the endpoints of the feature lines, resulting in multiple possible full-coverage paths. The specific steps are as follows: The sub-regions are divided into sub-regions containing an odd number of feature lines and sub-regions containing an even number of feature lines based on the number of feature lines they contain. Different path planning methods are determined based on sub-regions containing an odd number of feature lines and sub-regions containing an even number of feature lines using a raster-type path. Considering different types of raster paths and the connection order of each sub-region, a multi-chromosome particle swarm optimization algorithm is used to optimize multiple possible full-coverage paths to obtain the optimal spraying path; specifically including: Individuals are defined based on different types of raster-type paths. Each individual is a global raster-type spraying path. Each individual includes X and Y chromosomes. Different types of raster-type paths are represented by genes on the X and Y chromosomes. The genes on the X chromosome represent the traversal order of the sub-regions, and the genes on the Y chromosome represent the different connection methods of the raster-type paths in each sub-region.

2. The method for complex surface spraying path planning based on multi-chromosome particle swarm optimization as described in claim 1, characterized in that, The specific steps for hole detection on a freeform surface using a scanning surface method are as follows: The freeform surface is scanned using the tangent plane as the scanning plane, with the scanning direction along the z-axis. When a hole is detected, the critical intersection point between the tangent plane and the surface is recorded as the critical point of the hole, and the current tangent plane is marked as the intersection plane for entering and exiting the hole region, until the scanning is completed.

3. The method for complex surface spraying path planning based on multi-chromosome particle swarm optimization as described in claim 1, characterized in that, The specific steps of the hole detection algorithm are as follows: The intersection calculation is performed between the current tangent plane and the intersecting free surface to obtain a set of intersecting line segments. The intersecting line segments are sorted from smallest to largest. In non-hole areas, the beginning and end of the intersecting line segments are connected. In hole areas, the beginning and end of the intersecting line segments are not connected. Hole detection is performed based on the connection status of the beginning and end of the intersecting line segments.

4. The method for complex surface spraying path planning based on multi-chromosome particle swarm optimization as described in claim 1, characterized in that, The specific steps for further subdividing the pore-containing subregion into multiple pore-free subregions based on different types of pore thresholds are as follows: The critical points of the hole are classified into left-side critical points and right-side critical points, and the left and right-side critical points of the hole are marked. The intersecting plane intersects the freeform surface along the z-axis at fixed intervals to obtain a series of intersection points. Scan the intersection segments from smallest to largest along the y-axis. Based on the critical point of the hole between the first and last intersection points, classify the situation into different types. Then, further subdivide according to the different types to obtain multiple sub-regions without holes.

5. The method for complex surface spraying path planning based on multi-chromosome particle swarm optimization as described in claim 4, characterized in that, Based on the critical point of the hole between the first and last intersection points, the situation can be divided into the following four types: (1) The first intersection point is a non-critical point, and the last intersection point is a left or right critical point; (2) The first intersection point is a right critical point, and the last intersection point is a left critical point; (3) The first intersection point is a left critical point, and the last intersection point is a right critical point; (4) The first intersection point is a left or right critical point, and the last intersection point is a non-critical point.

6. The method for complex surface spraying path planning based on multi-chromosome particle swarm optimization as described in claim 1, characterized in that, The specific steps for optimizing multiple possible full-coverage paths using the multi-chromosome particle swarm optimization algorithm to obtain the optimal spraying path are as follows: Initialize the individual by assigning the local optimum and global optimum to the individual value; Perform crossover and mutation operations on individuals; The current best individual is obtained by calculating the reward function value, and the calculated reward function value of the current best individual is used as the fitness function value. If the fitness function value is better than the local optimum of the current generation, then the individual is taken as the local optimum of the current generation. If the fitness function value is better than the global optimum, then the individual is considered the global optimum. After a given number of iterations, the global optimum and the global optimum individual are obtained, and thus the optimal spraying path is obtained.

7. The method for complex surface spraying path planning based on multi-chromosome particle swarm optimization as described in claim 6, characterized in that, The reward function consists of four parts: path length reward within a sub-region, path length reward between sub-regions, path turning number reward, and coverage reward.

8. A complex surface spraying path planning system based on multi-chromosome particle swarm optimization, characterized in that, include: The three-dimensional hole detection module is configured to acquire the free-form surface to be sprayed, and perform hole detection on the free-form surface using a scanning surface scanning method according to the hole detection algorithm, marking the critical points of the holes and the intersection planes of the holes. The coarse segmentation module is configured to coarsely segment the freeform surface into multiple sub-regions based on the intersection planes of the entry and exit holes; The fine segmentation module is configured to finely segment the sub-region containing holes according to the different types of hole critical points, into multiple sub-regions without holes; each sub-region without holes contains intersection points obtained by multiple intersecting planes intersecting the freeform surface; a set of intersection points obtained by the same intersecting plane is abstracted into an intersection line, denoted as a feature line, and the two endpoints of each feature line are recorded; The raster-type path planning module is configured to plan multiple possible full-coverage paths by using raster-type paths to plan the connection method of feature lines in each sub-region based on the endpoints of feature lines. The specific steps are as follows: The sub-regions are divided into sub-regions containing an odd number of feature lines and sub-regions containing an even number of feature lines based on the number of feature lines they contain. Different path planning methods are determined based on sub-regions containing an odd number of feature lines and sub-regions containing an even number of feature lines using a raster-type path. The multi-chromosome particle swarm optimization module is configured to consider different types of raster paths and the connection order of each sub-region, and to optimize multiple possible full-coverage paths using the multi-chromosome particle swarm optimization algorithm to obtain the optimal spraying path; specifically including: Individuals are defined based on different types of raster-type paths. Each individual is a global raster-type spraying path. Each individual includes X and Y chromosomes. Different types of raster-type paths are represented by genes on the X and Y chromosomes. The genes on the X chromosome represent the traversal order of the sub-regions, and the genes on the Y chromosome represent the different connection methods of the raster-type paths in each sub-region.