Large-area special-shaped curved surface high-uniformity coating gun moving track generation method
By adopting a combination of linear and arc motion mode in large-area special-shaped surface spraying, combining KD tree and differential evolution algorithm to optimize the path points, the contradiction between the number of path points and the error is solved, and efficient and accurate coating generation is achieved, which is suitable for large-area special-shaped surface spraying.
Patent Information
- Application Number
- CN202510440464.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-07-11
AI Technical Summary
In the process of spraying large-area special-shaped curved surfaces, the contradiction between the number of path points and the error is difficult to resolve, resulting in low spray efficiency, large errors and insufficient flexibility, and the inability to effectively fit complex curves.
The combined mode of linear and arc motion is adopted, combined with KD tree and differential evolution algorithm, path point selection is optimized, and a highly uniform coating line gun trajectory is generated. The optimal path point is automatically selected through multiple fitting modes to reduce the number of path points and fitting error.
It improves the spray efficiency and fitting accuracy, can better fit complex curves, reduce the number of path points, and is suitable for larger surface spraying tasks.
Smart Images

Figure CN120295228A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of spraying robots, and particularly to a method for generating a gun running trajectory for a large-area special-shaped curved surface with high uniformity coating. Background Art
[0002] With the continuous development of automation technology, the process of spraying paint on products to form a coating has gradually been replaced by robots. Automated spraying can effectively improve the spraying efficiency, reduce manual operations, and improve the coating quality. Current automated spraying operations require pre-planned paths and parameters. Especially for spraying operations on large-area special-shaped curved surfaces to meet the high-precision requirements of the coating, it is necessary to plan the gun running trajectory and control the spraying robot to hold the spray gun to perform a curved motion along the target curve on the surface of the workpiece to achieve uniform spraying. The target curve is the ideal motion curve when planning the movement of the robot along the special-shaped curved surface. Since the target curve is not a motion mode supported by the robot controller, it is necessary to segmentally fit the target curve with the motion modes supported by the robot controller. Generally, an infinite number of path points are required to fit the target curve without error, that is, the smaller the allowable fitting error, the more path points are required. Also, due to the processing capacity limitation of the robot controller, it is impossible to input so many points into the robot controller. Therefore, it is more ideal to extract some points on the target curve as the path points input to the robot controller. Currently, the structure and process of traditional robot path planning methods are usually as follows: input dense original points, and the distance between the original points is small (the distance is about 1 mm) to form the target curve; extract path points at a fixed interval; connect adjacent path points with straight lines to generate a fitting curve. For example, in a method and system for path planning of a thermal spraying robot based on an index curve with the publication number CN106423657A, the generation position of the index curve is deduced and selected according to the coating thickness, and the shortest surface coverage path is generated.
[0003] In summary, the traditional robot path planning method has the following disadvantages:
[0004] There is a contradiction between the number of path points and the error. Increasing the interval can reduce the number of path points, but the straight line fitting results in a significant increase in error (the original curve becomes a broken line);
[0005] The efficiency is limited. To ensure that the error does not exceed the threshold, more path points need to be retained, which may exceed the storage limit of the controller, resulting in the controller being unable to handle large-range curved surface spraying tasks;
[0006] The flexibility is insufficient. Only using linear motion to fit the target curve cannot make better use of circular arc motion to fit complex curves. Summary of the Invention
[0007] The technical problem to be solved by the present invention is to provide a fitting method that can achieve the same fitting accuracy with fewer path points than the prior art, which is used to generate the gun movement trajectory of a large-area special-shaped curved surface with high uniformity coating, so as to effectively improve the fitting effect and planning efficiency.
[0008] To achieve the above object, the technical solution adopted by the present invention is: a method for generating the gun movement trajectory of a large-area special-shaped curved surface with high uniformity coating, the method comprising: Step 1, presetting a fitting mode, forming a fitting mode according to the combination and combination order of motion types according to the processing scenario; Step 2, input data processing, including inputting the list of original point matrices constituting the target curve, performing cumulative arc length parameterization and normalization on the target curve, and creating a KDtree for each target curve; Step 3, outputting the path points of the fitting curve corresponding to the current target curve, including obtaining the fitting error by sequentially optimizing the path point selection for each fitting mode according to the order of the preset fitting mode; Step 4, until the fitting optimization of the last target curve is completed, the generation of the gun movement trajectory of the large-area special-shaped curved surface with high uniformity coating is completed.
[0009] Further, the motion types include linear motion and circular arc motion, and it is defined that each linear motion contains two path points, each circular arc motion contains three path points, and they are sorted according to the increase in the number of path points.
[0010] Further, in the Step 1, the list of original point matrices is a list composed of multiple N*3 matrices, each matrix contains a target curve, and each N*3 matrix represents N original points P(x i , y i , z i ) of the target curve, i = 0, 1, 2,... N, and each row is the xyz coordinates of an original point.
[0011] Further, in the Step 2, the specific process of performing cumulative arc length parameterization and normalization on the target curve is: calculating the distance l i (the modulus of the vector between two points) between each original point and the previous original point and storing it in a vector with a length of N; since the first original point has no previous original point, its distance is filled with 0, and the calculation of l i is as follows:
[0012]
[0013] l0 = 0;
[0014] Accumulating the above vector in sequence to obtain a vector with a length of N, representing the arc length t i from each original point to the first original point, which is used as the position deviation of the original point on the target curve. The first original point is 0, and the last original point is equal to the length of the target curve. The expression of t i is as follows: For k = 1, 2, 3, …, i, divide all elements of the above vector by the arc length t of the target curve N , and scale it to the range of [0, 1] as the normalized position deviation ct of the original points on the target curve i , ct i is expressed as follows:
[0015] Furthermore, obtaining the optimal fitting error in step 3 specifically includes: defining an objective function, and the input parameters of the objective function are the normalized position deviation lists of M path points T j , j = 1, 2, 3, …, M on the target curve j = 1, 2, 3, … M; sort the list, if the difference between adjacent elements in the sorted list is less than or equal to the interval threshold (such as 0.05), then the objective function outputs +inf; for the j-th path point T j , its normalized position deviation is find the two original points P and less than greater than in the normalized position deviation of the target curve and closest to i1 and P i2 ; let the normalized position deviations of these two original points be ct i1 and ct i2 , then the position of this path point is At this point, the path points required in the currently attempted fitting mode have been determined, and then interpolation is performed on the path points according to the motion specified by the fitting mode to obtain a list of fitting points evenly distributed on the fitting curve with an interval not greater than the specified step size (such as 1 mm). Query the KDtree of the target curve for all fitting point lists to obtain the distances from the fitting points to the nearest original points on the target curve, and output the maximum of these distances as the return value of the objective function;
[0016] Use the differential evolution algorithm to optimize the objective function, and the parameters to be optimized are j = 1, 2, 3, … M, and the minimum return value of the optimized objective function is the optimal fitting error If the optimal fitting error is greater than the fitting error threshold e limit , then end this loop and try the next fitting mode. If the optimal fitting error is less than the fitting error threshold, then:
[0017] Convert the list of normalized position deviations of the optimal path points into a list of path point positions in the same way as in the objective function;
[0018] Use the list of path point positions as the path points of the fitting curve corresponding to the current target curve until the last target curve.
[0019] Term Explanation:
[0020] Target Curve: The trajectory of the robot's movement in ideal conditions;
[0021] Original Point: The points that make up the target curve;
[0022] Path Point: Points extracted or interpolated from the original points according to a certain method;
[0023] Fitting: The movement mode of the robot from one path point (optionally passing through a certain path point in the middle) to another path point, moving in a straight line or an arc;
[0024] Fitting Mode: The combined order of fitting;
[0025] Fitting Curve: The trajectory of the robot's movement defined by the fitting mode + path points;
[0026] Fitting Error: The difference between the fitting curve and the target curve;
[0027] Position Deviation of a Point on the Curve: The distance traveled along the curve from the starting point of the curve to this point;
[0028] Normalized Position Deviation: Position Deviation / Curve Length;
[0029] KDTree: KDtree is a data search structure that can quickly output which original point is the closest to the query point based on the input spatial position (query point), and give the distance from the query point to the closest original point. It can be implemented using the open-source library open3d.geometry.KDTreeFlann;
[0030] Differential Evolution Algorithm: An optimization algorithm that can automatically try to input different parameters or parameter lists into the objective function to find the parameters or parameter list that makes the return value of the objective function the smallest. It can be implemented using the open-source library scipy.optimize.differential_evolution.
[0031] The present invention adopts the above technical solutions, proposes various combination modes of straight lines (L) and arcs (C) (such as LCL, CC, LCCL, etc.), and establishes a priority order (from the least to the most number of path points). By iteratively selecting the mode that meets the error threshold and has the fewest path points, a better fitting effect is achieved. Compared with the traditional equally spaced straight-line motion fitting, the number of path points can be greatly reduced while maintaining the same fitting error, which greatly increases the path length that the program can accommodate, meaning that a larger area of the curved surface can be sprayed at one time. Taking the normalized position deviation of the path points as the optimization parameter and the fitting error as the cost function, the differential evolution algorithm is used to automatically search for the optimal path point positions, improving the efficiency of the planning process and ensuring the best fitting accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art and the beneficial effects of the present invention, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other structures can be obtained based on the structures shown in these drawings.
[0033] Figure 1 Schematically shows seven fitting modes and their order of the embodiments of the present invention.
[0034] Figure 2 Schematically shows the schematic flow chart of the method of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0035] Specific embodiments of the present invention:
[0036] As Figure 1 , Figure 2 shown, a method for generating a gun trajectory with high uniformity coating for a large-area special-shaped curved surface in this embodiment, step 1, preset the fitting mode and fitting order. The fitting mode adopted in this embodiment refers to the combination order of linear motion (L) and circular arc motion (C).
[0037] Among them, each linear motion requires two path points, namely the starting point and the ending point of the straight line;
[0038] Each circular arc motion requires three path points, namely the starting point of the circular arc, any point passed by the circular arc, and the ending point of the circular arc;
[0039] For example, "LCL" means that the first motion is a linear motion, the second motion is a circular arc motion, and the third motion is a linear motion. The ending point of the previous motion is the starting point of the next motion. LCL requires 5 path points.
[0040] The common fitting modes and the number of path points are as follows (sorted in ascending order of the number of path points):
[0041] L = 2, C = 3, LCL = 5, CC = 5, LCCL = 7, CCC = 7, LCCCL = 9;
[0042] Step 2, input data processing: The input data can be represented as a list of multiple N*3 matrices. Each matrix contains a target curve (N for each curve may be different). Each N*3 matrix represents N original points P(x i , y i , z i ) that make up the target curve, where i = 0, 1, 2, …, N. Each row is the xyz coordinates of an original point. Calculate the distance l i (the magnitude of the vector between two points) of each original point to the previous original point and store it in a vector of length N; Since there is no previous original point for the first original point, its distance is filled with 0.
[0043]
[0044] l0 = 0,
[0045] Accumulate the above vector sequentially to obtain a vector of length N, representing the arc length t i of each original point to the first original point, which is used as the position deviation of the original point on the target curve; The first original point is 0, and the last original point is equal to the length of the target curve. Divide all elements of the above vector by the arc length of the target curve to scale it to the range of [0, 1], which is used as the normalized position deviation ct i of the original point on the target curve.
[0046]
[0047] Create a KDtree for each target curve.
[0048] Step 3, for each target curve, in the order of the fitting modes given above, sequentially optimize the selection of path points for each fitting mode to obtain the fitting error. The core code for this step is as follows:
[0049] 1 for target curve in target curve list:
[0050] 1.1 for fitting mode in fitting mode list:
[0051] 1.1.1 Define the objective function
[0052] The input parameters of the objective function are the normalized position deviation list of M path points T j , j = 1, 2, 3, …, M on the target curve j = 1, 2, 3, … M;
[0053] Sort the list. If the difference between adjacent elements in the sorted list is less than or equal to the interval threshold (e.g., 0.05), the objective function outputs +inf;
[0054] For the j-th path point T j , its normalized position deviation is Find the two original points P and less than greater than in the normalized position deviation of the target curve that are closest to i1 and P i2 ;
[0055] Let the normalized position deviations of these two original points be ct i1 and ct i2 , then the position of this path point is
[0056] So far, the path points required in the current attempted fitting mode have been determined;
[0057] Then, perform interpolation on the path points according to the motion specified by the fitting mode to obtain a list of fitting points evenly distributed on the fitting curve with an interval not greater than the specified step size (e.g., 1 mm);
[0058] Query the KDtree of the target curve for all lists of fitting points to obtain the distances from the fitting points to the closest original points on the target curve;
[0059] Output the maximum of these distances as the return value of the objective function;
[0060] 1.1.2 Use the differential evolution algorithm to optimize the objective function. The parameters to be optimized are j = 1, 2, 3, … M, and the minimum return value of the optimized objective function is the optimal fitting error
[0061] If the optimal fitting error is greater than the fitting error threshold e limit , then end this loop and try the next fitting mode;
[0062] If the optimal fitting error is less than the fitting error threshold, then:
[0063] Convert the list of optimal path point normalized position deviations into a list of path point positions in the same way as in the objective function;
[0064] Break the loop in 1.1 and use the list of path point positions as the path points of the fitting curve corresponding to the current target curve;
[0065] end for
[0066] end for
[0067] The advantages of the method of the present invention over the traditional method are as follows: First, the connection between path points in the traditional method only uses linear motion, while the connection between path points in the method of the present invention will include circular motion with linear motion to achieve a better fitting effect. This method defines several fitting modes, where the fitting mode refers to the combination order of linear motion (L) and circular motion (C), including: L, C, LCL, LCCL, LCCCL, CC, CCC. The system will automatically select the fitting mode with the fitting error not exceeding the threshold and the minimum number of path points within the predefined several fitting modes. The system will try each fitting mode in ascending order of the number of path points. When trying a certain fitting mode, the selection of path points will be adjusted to obtain the minimum fitting error that can be obtained by this fitting mode. If this fitting error is less than the preset threshold, then this fitting mode and the path points with the minimum fitting error will be output as the result. If this fitting error is less than the preset threshold, then continue to try the fitting mode with more path points. By combining linear motion and circular motion to fit the target curve, compared with the traditional equidistant linear motion fitting, the number of path points can be greatly reduced while keeping the fitting error equal, so that the path length that the program can accommodate is greatly increased, which means that a larger area of the surface can be sprayed at one time.
[0068] Second, this method can automatically select the path points with the minimum fitting error. When trying a certain fitting mode, the positions of the path points are used as optimization parameters, and the fitting error is used as the cost function. The differential evolution algorithm is used for optimization. Through the iterative + optimization method, the most efficient combination of linear motion and circular motion is automatically selected, and the path points with the minimum fitting error are automatically determined, improving the efficiency of the planning process and ensuring the best fitting accuracy.
[0069] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be similarly included in the patent protection scope of the present invention.
Claims
1. A method for generating the gun travel trajectory of a large-area special-shaped curved surface with high uniformity coating, characterized in that, The method includes: Step 1, preset a fitting mode, and form a fitting mode according to the combination and combination order of motion types in the machining scenario; Step 2, input data processing, including inputting the list of original point matrices that make up the target curve, performing cumulative arc length parameterization and normalization on the target curve, and creating a KDtree for each target curve; Step 3, outputting the path points of the fitting curve corresponding to the current target curve, including sequentially optimizing the selection of path points for each fitting mode according to the order of the preset fitting mode to obtain the fitting error; Step 4, until the last target curve is fitted and optimized, the generation of the gun travel trajectory for the large-area special-shaped surface with high uniformity coating is completed.
2. The method for generating the gun travel trajectory of the large-area special-shaped curved surface high-uniformity coating according to claim 1, wherein The motion types include linear motion and circular arc motion. It is defined that each linear motion segment contains two path points, and each circular arc motion segment contains three path points, and they are sorted according to the increase in the number of path points.
3. The method for generating the gun path of the large-area special-shaped curved surface high-uniformity coating according to claim 2, wherein In Step 1, the list of original point matrices is a list composed of multiple N*3 matrices. Each matrix contains a target curve, and each N*3 matrix represents N original points that make up the target curve. Each row is the xyz coordinates of an original point.
4. The method for generating the gun path of a large-area special-shaped curved surface high-uniformity coating according to claim 3, wherein In the said step 2, the specific process of performing cumulative arc length parameterization and normalization on the target curve is as follows: calculate the distance \(l\) from each original point to the previous original point i and store it on a vector of length \(N\); since the first original point has no previous original point, its distance is filled with 0, and the calculation of \(l\) is as follows: i l0=0; Accumulate the above vectors in sequence to obtain a vector of length N, representing the arc length t from each original point to the first original point i , which serves as the position deviation of the original points on the target curve. The first original point is 0, and the last original point is equal to the length of the target curve. t i is expressed as follows: For k = 1, 2, 3, …, i, divide all elements of the above vector by the arc length of the target curve to scale it to the range of [0, 1], which serves as the normalized position deviation ct of the original points on the target curve i , ct i is expressed as follows: t N is the arc length of the target curve.
5. The method for generating the gun travel trajectory of the large-area special-shaped curved surface high-uniformity coating according to claim 4, wherein Specifically, obtaining the optimal fitting error in Step 3 includes: defining an objective function, determining the required path points in the current fitting mode through the objective function, then interpolating the path points according to the motion specified by the fitting mode to obtain a list of fitting points evenly distributed on the fitting curve with an interval not greater than the specified step size, querying the KDtree of the target curve for all the fitting point lists, obtaining the distance from the fitting points to the nearest original points on the target curve, and outputting the maximum of these distances as the return value of the objective function; using the differential evolution algorithm to optimize the objective function, normalizing the list of optimal path point position deviations, and converting the normalized position deviations into a list of path point positions in the same way as in the objective function; using the list of path point positions as the path points of the fitting curve corresponding to the current target curve until the last target curve.
Citation Information
Patent Citations
Thermal spraying robot path planning method and system based on index curve
CN106423657A
Cited By
Micro-channel structure forming method and device
CN120755237A