Welding robot welding path planning method based on backtracking method
Through the backtracking method, the problem of low hollow travel and arc rate of flat welding robot path planning is solved, the scientificity and efficiency of welding paths are achieved, the welding production efficiency and system stability are improved, and welding automation is suitable for welding in the field of ship manufacturing.
Patent Information
- Application Number
- CN202510616715.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-14
- Publication Date
- 2025-07-18
AI Technical Summary
In the prior art, there are unreasonable aspects in the path planning of flat welding robots, resulting in the robots being empty and running, the overall arc rate is low, and the welding efficiency is not fully utilized, which affects the market competitiveness of shipbuilding companies.
The welding path planning method of welding robots based on backtracking is adopted, combined with the characteristics of linear segments, and the path planning is optimized by backtracking. Based on the solution ideas of travelers' problems, we ensure that the robot walks the shortest path when welding and moving between multiple workpieces, avoid memory overflow, and improve calculation speed.
The scientificity and rationality of the welding path is achieved, the empty stroke time and energy consumption is reduced, the welding production efficiency is improved, the production cost is reduced, the algorithm operation speed and system stability are improved, and the reliability and intelligence level of the welding automation system are enhanced.
Smart Images

Figure CN120326232A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of shipbuilding, and specifically relates to a welding path planning method for a welding robot based on the backtracking method. Background Art
[0002] At present, with the continuous progress of robot technology, the shipbuilding industry has actively introduced robots for welding work. There are various types of ship welding, mainly including spot welding, flat welding, and vertical welding. Among them, spot welding is to weld a specific point, while flat welding and vertical welding are to weld line segments, which makes there are essential differences in the welding routes between spot welding and flat welding, vertical welding. In the shipbuilding industry, spot welding is mostly concentrated in the assembly link, and its workload is much less than that of flat welding and vertical welding.
[0003] For the path planning of flat welding and vertical welding robots, when building an automatic welding unit, a working platform is usually set up. This platform not only restricts the placement range of workpieces but also facilitates the distinction from the ground and other environments. Multiple workpieces to be welded can be placed on the platform, and the positions of these workpieces usually only need to meet the welding distance requirements. In addition, to avoid affecting the loading and unloading operations, the robot will stop on the other side of the platform after each welding operation to avoid taking the same path back.
[0004] At present, there are many research results on welding path planning. Experts and scholars at home and abroad have made efforts. A variety of methods such as heuristic algorithms, neural networks, genetic simulated annealing algorithms, and improved genetic algorithms have been used in the research of various robot path planning. However, most of these algorithms are mainly applied to the field of spot welding robot path planning. In terms of the path planning of flat welding robots, there are still some unreasonable aspects in the existing research results. For example, the movement routes between individual workpieces are not reasonable enough, and the distance between the last welding point and the robot stop end point is relatively far. These unreasonable path plans will cause unnecessary empty running of the robot, and the empty running will occupy the effective welding time within a unit time, thereby reducing the overall arcing rate. As a result, the welding efficiency of the robot cannot be fully exerted, which runs counter to the original intention of shipbuilding enterprises to introduce robot welding to improve work efficiency, and is also not conducive to the development of shipbuilding enterprises in the fierce market competition to a certain extent. Summary of the Invention
[0005] In view of the problems of empty running, low overall arcing rate, and insufficient exertion of the welding efficiency of the robot caused by the unreasonable welding path planning in the prior art, the present application provides a welding path planning method for a welding robot based on the backtracking method.
[0006] The present application provides a welding path planning method for a welding robot based on the backtracking method, including the following steps:
[0007] S1. Establish a workpiece endpoint matrix and an initial node matrix, initialize the planned welding path, the shortest welding path, and the length of the shortest welding path; put the starting points and ending points of all workpieces into the workpiece endpoint matrix, and put the starting point and ending point of the same workpiece together; the nodes in the initial node matrix correspond to the starting points or ending points of the workpieces in the workpiece endpoint matrix, and the initial node matrix indicates that all the starting points or ending points of the workpieces in the workpiece endpoint matrix have not been planned into the planned welding path; the planned welding path is a welding route formed by arranging all nodes in a certain order, the initialized planned welding path is empty, the initialized shortest welding path is empty, and the initialized length of the shortest welding path is the system maximum value;
[0008] S2. Determine whether all nodes are already included in the planned welding path. If not, go to step S3; if so, calculate the total length of the current planned welding path, compare the size between the total length of the current planned welding path and the length of the shortest welding path. If the total length of the current planned welding path is smaller than the length of the shortest welding path, assign the total length of the current planned welding path to the length of the shortest welding path, and assign the current planned welding path to the shortest welding path, then go to step S5;
[0009] S3. Determine whether the value of i is the set maximum threshold. If so, output the shortest welding path and the length of the shortest welding path at this time; if not, determine whether the i-th value in the initial node matrix has been planned. If not, go to step S4; if so, go to step S6;
[0010] S4. Set the i-th value in the initial node matrix as having been planned, add i to the planned welding path, determine whether the j-th node in the workpiece endpoint matrix that belongs to the same workpiece as the i-th node has been planned. If not, set the j-th value in the initial node matrix as having been planned, and add j to the planned welding path, let k = i + 1, then go to step S2;
[0011] S5. Calculate the number of nodes a in the planned welding path, set the (a - 1)-th number and the (a - 2)-th number in the planned welding path as empty, and set the (a - 1)-th number and the (a - 2)-th number in the initial node matrix as not having been planned. At this time, i is k, then go to step S3;
[0012] S6. Determine whether the j-th node in the workpiece endpoint matrix that belongs to the same workpiece as the i-th node has been planned. If not, set the j-th value in the initialized node matrix to "planned", add j to the planned welding path, increment i by 1, and go to step S2; if so, calculate the number of nodes a in the planned welding path, set the (a - 1)-th and (a - 2)-th numbers in the planned welding path to empty, and set the (a - 1)-th and (a - 2)-th numbers in the initialized node matrix to "not planned". At this time, i is k, and go to step S3.
[0013] As an implementation, the number of nodes in the initialized node matrix in step S1 is equal to twice the number of all workpieces.
[0014] As an implementation, define the number of all workpieces as n, the number of nodes as 2n, and initialize the initialized node matrix with 2n false values; if the i-th node in the workpiece endpoint matrix is planned into the planned welding path, the i-th false value in the initialized node matrix becomes true.
[0015] As an implementation, the maximum threshold is 2n - 1, where n is the number of workpieces, the value range of i is 0 to 2n - 1, and the initial value of i is 0.
[0016] As an implementation, calculating the total length of the current planned welding path in step S2 specifically includes:
[0017] Calculate the path length L2 between all the planned nodes in the planned welding path, the distance L1 between the first planned node in the planned welding path and the starting position of the robot, and the distance L3 between the last planned node in the planned welding path and the ending position of the robot, and calculate the sum of L1, L2, and L3.
[0018] As an implementation, the starting and ending points of different workpieces in the workpiece endpoint matrix in step S1 are randomly arranged.
[0019] As described above, the welding path planning method for a welding robot based on the backtracking method of the present application has the following beneficial effects:
[0020] The welding path planning method for a welding robot based on the backtracking method in this application closely combines the characteristics of straight-line segments, ensuring the scientificity and rationality of the welding robot path planning, effectively meeting the actual needs for the robot to smoothly transition to the next workpiece for welding after completing the welding of one workpiece, and guaranteeing the coherence and high efficiency of the welding operation. Based on the solution idea of the traveling salesman problem, it can accurately plan the shortest path for the robot to move during welding among multiple workpieces, significantly reducing the idle travel time and energy consumption of the robot during the welding process, remarkably improving the welding production efficiency, and reducing the production cost. By optimizing the algorithm with the backtracking method, even when the number of workpieces is large, it can quickly perform path planning calculations, greatly shortening the calculation time, increasing the running speed of the algorithm, enabling it to better adapt to the real-time planning requirements of large-scale welding tasks. It effectively avoids problems such as memory overflow, reduces the occupation of computer resources by the algorithm, enables the welding robot control system to operate more stably and reliably, reduces the risk of system freezing or crashing caused by insufficient memory, and improves the stability and usability of the entire welding automation system. The calculation results are accurate and have strong applicability. Whether for workpieces of different types and layouts or in various complex welding production environments, it can provide effective path planning solutions for the robot, helping to comprehensively improve the working efficiency and intelligent level of the welding robot, and promoting the further development and application of welding automation technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It shows a top view structural schematic diagram of the workpiece and its placement platform.
[0022] Figure 2 It shows a flow schematic diagram of the welding path planning method for a welding robot based on the backtracking method in an embodiment of the present invention.
[0023] Figure 3 It shows the possible walking paths of a straight-line segment type welding robot.
[0024] Figure 4 It shows a top view structural schematic diagram of the workpiece welding platform and the weld seam.
[0025] Figure 5 It shows the optimal welding path of the arc welding robot. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0026] The following uses specific specific examples to illustrate the embodiments of the present invention. Those skilled in the art can easily understand the other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention.
[0027] It should be noted that the illustrations provided in this embodiment only schematically illustrate the basic concept of the present invention. Therefore, only the components related to the present invention are shown in the illustrations, rather than being drawn according to the number, shape, and size of the components in actual implementation. The type, quantity, and proportion of each component in actual implementation can be arbitrarily changed, and the component layout type may also be more complex.
[0028] With the continuous progress of robot technology, the shipbuilding industry has gradually introduced robots to perform welding work. In the shipbuilding industry, welding types are mainly divided into spot welding, flat welding, and vertical welding. Among them, spot welding is to weld a single point, while flat welding and vertical welding are to weld line segments. Spot welding is mainly applied to the assembly link, and its workload is much less than that of flat welding and vertical welding.
[0029] In the research on robot path planning for flat welding and vertical welding straight-line segment welding methods in the shipbuilding industry, an automatic welding unit is usually built, such as Figure 1 shown. This automatic welding unit includes a working platform and several workpieces to be welded placed on the working platform. The working platform not only restricts the placement range of the workpieces but also helps to distinguish them from the environment such as the ground. The position of the workpieces to be welded usually only needs to meet the requirements of the welding distance. In order not to affect the loading and unloading operations, the robot will dock on the side of the working platform after each welding is completed. Moreover, in order to achieve the shortest path, the robot generally starts from one side of the working platform, welds all the workpieces to be welded in sequence, and finally stops on the other side of the working platform, thus avoiding taking a detour.
[0030] In recent years, experts and scholars at home and abroad have achieved many research results in the field of welding path planning, including using heuristic algorithms, neural networks, genetic simulated annealing algorithms, improved genetic algorithms, etc. to perform path planning for various robots. However, most of these algorithms are applied to the path planning of spot welding robots. At present, there are some unreasonable points in the research results of flat welding robot path planning, such as unreasonable movement path planning between single workpieces, and a relatively long distance between the last welding point and the robot stop end point. Such unreasonable path planning will cause the robot to make unnecessary empty runs, thus squeezing the effective welding time within a unit time and reducing the overall arcing rate. In this way, the welding efficiency of the robot cannot be fully exerted, which is contrary to the original intention of shipbuilding enterprises to introduce robot welding to improve work efficiency and is not conducive to shipbuilding enterprises gaining an advantage in the fierce market competition.
[0031] In view of the deficiencies of the prior art, the present application provides a welding path planning method for a welding robot based on the backtracking method. The following is a detailed description through specific embodiments.
[0032] This embodiment provides a welding path planning method for a welding robot based on the backtracking method, such as Figure 2As shown, it includes the following steps:
[0033] S1: Establish a workpiece endpoint matrix points and an initialized node matrix visited, and initialize the planned welding path path, the shortest welding path min_path, and the shortest welding path length min_distance.
[0034] Put the starting points and ending points of all workpieces into the workpiece endpoint matrix points. The starting point and ending point of the same workpiece are placed together, that is, the starting point and ending point of the same workpiece can be set to have a related relationship, and there is no related relationship between the starting points and ending points of different workpieces, and they can be randomly arranged.
[0035] The nodes in the initialized node matrix visited correspond to the starting points or ending points of the workpieces in the workpiece endpoint matrix points. For the sake of description below, the starting points or ending points of the workpieces in the workpiece endpoint matrix points are also called nodes; the initialized node matrix visited indicates that all nodes in the workpiece endpoint matrix points have not been planned into the planned welding path path. As a specific implementation method, for example, if the number of workpieces is n, then the number of nodes is 2n. Then the initialized node matrix visited includes 2n falses, that is, visited = [false, false,..., false, false], indicating that 2n nodes have not been planned. When the i-th node in the workpiece endpoint matrix points is planned into visited, the i-th false in visited becomes true.
[0036] The planned welding path path is a welding route formed by arranging all nodes in a certain order. The order between nodes in the welding route (the arrangement of the starting point and ending point of the same workpiece is relatively fixed, for example, the starting point of the same workpiece is in the front and the ending point is in the next position after the starting point, or the ending point of the same workpiece is in the front and the starting point is in the next position after the ending point) is random; the initialized planned welding path path is empty, that is, path = [].
[0037] The initialized shortest welding path min_path is empty, that is, min_path = [].
[0038] The initialized shortest welding path length min_distance is the system maximum value. By setting a very large value, it is ensured that all actual path lengths are less than the initial value, thereby triggering the subsequent path update logic.
[0039] S2: Determine whether all nodes are already included in the planned welding path path. If not, proceed to step S3; if so, calculate the total length of the current planned welding path path, and compare the total length of the current planned welding path path with the shortest welding path length min_distance. If the total length of the current planned welding path path is smaller than the shortest welding path length min_distance, assign the total length of the current planned welding path path to the shortest welding path length min_distance, and assign the planned welding path path to the shortest welding path min_path, then proceed to step S5; if the total length of the current planned welding path path is larger than the shortest welding path length min_distance, directly proceed to step S5.
[0040] S3: Determine whether the value of i is the set maximum threshold. If so, output the shortest welding path min_path and the shortest welding path length min_distance at this time; if not, determine whether the i-th value in the initialized node matrix visited has been planned (i.e., whether the i-th value is true). If not (i.e., the i-th value is false), proceed to step S4; if so (i.e., the i-th value is true), proceed to step S6.
[0041] S4: Set the i-th value in the initialized node matrix visited to be planned (i.e., set the i-th value to true), and add i to the planned welding path path (indicating that the i-th node in the workpiece endpoint matrix points is planned into the planned welding path path). Determine whether the j-th node (j = i - 1 or i + 1) in the workpiece endpoint matrix points that belongs to the same workpiece as the i-th node has been planned. If not, set the j-th value in the initialized node matrix visited to be planned (i.e., set the j-th value to true), and add j to the planned welding path path, record k = i + 1, then proceed to step S2.
[0042] S5: Calculate the number of nodes a in the planned welding path path, set the (a - 1)-th and (a - 2)-th numbers in the planned welding path path to be empty []; and set the (a - 1)-th and (a - 2)-th numbers in the initialized node matrix visited to be unplanned (i.e., set the (a - 1)-th and (a - 2)-th numbers in visited to false). At this time, i is k, then proceed to step S3.
[0043] S6: Determine whether the j-th node in the workpiece endpoint matrix points that belongs to the same workpiece as the i-th node has been planned. If not, set the j-th value in the initialized node matrix visited to planned (i.e., set the j-th value in visited to true), add j to the planned welding path path, increment i by 1, and go to step S2; if so, calculate the number of nodes a in the planned welding path path, set the (a - 1)-th and (a - 2)-th numbers in the planned welding path path to empty [], and set the (a - 1)-th and (a - 2)-th numbers in the initialized node matrix visited to unplanned (i.e., set the (a - 1)-th and (a - 2)-th numbers in visited to false). At this time, i is k, and go to step S3.
[0044] The welding path planning method for a welding robot based on the backtracking method in this embodiment combines the characteristics of straight-line segments and uses the backtracking method to optimize it, which can meet the requirement that the robot welds one workpiece and then moves to another workpiece for welding. Most importantly, the path planned by this welding path planning method for the robot is the shortest when moving between multiple workpieces. The welding path planning method for a welding robot based on the backtracking method in this embodiment is based on the solution idea of the traveling salesman problem, has a scientific basis, and uses the backtracking method to optimize it. When there are many workpieces, it can calculate quickly and avoid problems such as memory overflow.
[0045] In an alternative embodiment, the set maximum threshold is 2n - 1, where n is the number of workpieces, the value range of i is 0 to 2n - 1, and the initial value of i is 0.
[0046] In an alternative embodiment, calculating the total length of the current planned welding path path in step S2 includes the path length L2 between all the planned nodes in the planned welding path path, the distance L1 between the first planned node in the planned welding path path and the starting position of the robot, and the distance L3 between the last planned node in the planned welding path path and the ending position of the robot. The total length of the planned welding path path is the sum of L1, L2, and L3.
[0047] The idea of the welding path planning method for a welding robot based on the backtracking method provided in this embodiment is as follows:
[0048] Figure 1 For the shown workpiece placement method, according to the exhaustive method, all welding paths as shown in Figure 3 can be obtained.
[0049] When using the welding path planning method provided in this embodiment, the backtracking process is as follows:
[0050] (1) Calculate the length of the first route 0-1-2-3-4-5-6-7, and record it as the current optimal solution;
[0051] (2) Since node 6 is a leaf node, its parent node 5 should be traced back one generation upward to node 4, and then other paths under node 4 are searched, and the operations of searching to the end or pruning in advance are performed;
[0052] (3) Since there is only one branch for the parent node 3 of node 4, at this time node 3 is similar to node 5. Therefore, when tracing back from node 4 upward, it must be traced back two generations to node 2, and then other paths under node 2 are searched, and the operations of searching to the end or pruning in advance are performed.
[0053] Compared with the traditional backtracking method, the backtracking point of the backtracking method used in this embodiment needs to be traced back two generations upward. The reason for this difference is the difference in the moving modes of flat welding and spot welding in the workpiece.
[0054] Taking the welding of 5 single-plate and single-reinforcement workpieces as an example, the brute-force exhaustive method and the welding path planning method of the welding robot based on the backtracking method provided in this embodiment are used for illustration.
[0055] As Figure 4 shown, there are 5 single-plate and single-reinforcement workpieces on the platform. The black line segments are the weld seams of the workpieces, and the red dots at both ends of the black line segments are the ends of the single-plate and single-reinforcement. The two black dots on the left and right of the platform are the starting point and the ending point of the robot's operation respectively. The coordinates of the robot's starting point p0 are (3, 6), and the coordinates of the ending point p1 are (26, 6); there are 10 ends for the 5 single-plate and single-reinforcement workpieces, and the coordinates of each end are: (4, 12), (10, 4), (12, 3), (22, 1), (11, 6), (14, 12), (18, 4), (20, 10), (11, 13), (25, 11).
[0056] According to permutations and combinations, there are 3,840 possible welding paths. Using the straight-line segment type welding path planning algorithm based on the brute-force exhaustive method and the straight-line segment type welding path planning algorithm optimized based on the backtracking method provided in this embodiment can both obtain the path as Figure 5 shown, and its total length is 76 units, which is the minimum value of all path lengths. It can be seen from Figure 5 that the planned path is reasonable, without invalid return trips or large-stroke empty runs.
[0057] However, comparing from the calculation speed, the comparison results between the algorithm used in this embodiment and the brute-force exhaustive method are shown in Table 1.
[0058] Table 1:
[0059]
[0060] As can be seen from Table 1, for the straight-line segment type welding path planning algorithm based on brute-force exhaustive search, when the number of workpieces is small, the calculation time increases slightly and is still acceptable. When the number of workpieces increases from 4 to 5, the time increases by 70 times. For the algorithm provided in this embodiment, when the number of workpieces is relatively large, it takes much less time than the straight-line segment type welding path planning algorithm based on brute-force exhaustive search. When the number of workpieces is the same, the time used is only 1 / 400 of that of the straight-line segment type welding path planning algorithm based on brute-force exhaustive search, and the calculation time is greatly shortened.
[0061] The welding path planning method for a welding robot based on the backtracking method provided in this embodiment has accurate calculation results, fast calculation speed, strong applicability, and the obtained results help to improve the effective working efficiency of the robot.
[0062] The above embodiments are only illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Any person familiar with this technology can modify or change the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or changes completed by those with ordinary knowledge in the technical field without departing from the spirit and technical ideas disclosed by the present invention should still be covered by the claims of the present invention.
Claims
1. A welding path planning method for a welding robot based on the backtracking method, characterized in that, Including the following steps: S1. Establish a workpiece endpoint matrix and an initialized node matrix, and initialize the planned welding path, the shortest welding path, and the length of the shortest welding path; put the starting points and ending points of all workpieces into the workpiece endpoint matrix, and put the starting point and ending point of the same workpiece together; the nodes in the initialized node matrix correspond to the starting points or ending points of the workpieces in the workpiece endpoint matrix, and the initialized node matrix indicates that all the starting points or ending points of the workpieces in the workpiece endpoint matrix have not been planned into the planned welding path; the planned welding path is a welding route formed by arranging all nodes in a certain order, the initialized planned welding path is empty, the initialized shortest welding path is empty, and the initialized length of the shortest welding path is the system maximum value; S2. Judge whether all nodes are already included in the planned welding path. If not, go to step S3; if so, calculate the total length of the current planned welding path, compare the size between the total length of the current planned welding path and the length of the shortest welding path. If the total length of the current planned welding path is smaller than the length of the shortest welding path, assign the total length of the current planned welding path to the length of the shortest welding path, and assign the current planned welding path to the shortest welding path, and go to step S5; S3. Judge whether the value of i is the set maximum threshold. If so, output the shortest welding path and the length of the shortest welding path at this time; if not, judge whether the i-th value in the initialized node matrix has been planned. If not, go to step S4; if so, go to step S6; S4. Set the i-th value in the initialized node matrix as planned, add i to the planned welding path, judge whether the j-th node in the workpiece endpoint matrix that belongs to the same workpiece as the i-th node has been planned. If not, set the j-th value in the initialized node matrix as planned, and add j to the planned welding path, record k = i + 1, and go to step S2; S5. Calculate the number of nodes a in the planned welding path, set the (a - 1)-th number and the (a - 2)-th number in the planned welding path as empty, and set the (a - 1)-th number and the (a - 2)-th number in the initialized node matrix as not planned. At this time, i is k, and go to step S3; S6. Judge whether the j-th node in the workpiece endpoint matrix that belongs to the same workpiece as the i-th node has been planned. If not, set the j-th value in the initialized node matrix as planned, and add j to the planned welding path, i = i + 1, and go to step S2; If so, calculate the number of nodes a in the planned welding path, set the (a - 1)-th number and the (a - 2)-th number in the planned welding path as empty, and set the (a - 1)-th number and the (a - 2)-th number in the initialized node matrix as not planned. At this time, i is k, and go to step S3. In step S1, the number of nodes in the initialized node matrix is equal to twice the number of all workpieces. 2. The welding path planning method of the welding robot based on the backtracking method according to claim 1, wherein, 3. The welding path planning method for a welding robot based on the backtracking method according to claim 1 or 2, characterized in that, Define the number of all workpieces as n, the number of the nodes as 2n, and initialize the 2n elements in the initialization node matrix to false; if the i-th node in the workpiece end point matrix is planned into the planned welding path, the i-th false in the initialization node matrix becomes true.
4. The method for welding path planning of a welding robot based on the backtracking method according to claim 3, wherein, The maximum threshold is 2n - 1, where n is the number of workpieces, the value range of i is 0 to 2n - 1, and the initial value of i is 0.
5. The welding path planning method for a welding robot based on the backtracking method according to claim 1, wherein, Step In step S2, calculate the total length of the current planned welding path, which specifically includes: Calculate the path length L2 between all the planned nodes in the planned welding path, the distance L1 between the first planned node in the planned welding path and the starting position of the robot, and the distance L3 between the last planned node in the planned welding path and the ending position of the robot, and calculate the sum of L1, L2, and L3. Step In step S1, the starting points and ending points of different workpieces in the workpiece end point matrix are randomly arranged.
6. The welding path planning method for a welding robot based on the backtracking method according to claim 1, characterized in that,