Welding robot welding path planning method, device and equipment
By setting the change probability parameters and introducing the average fitness value in the Gray Wolf algorithm, the problem of low search efficiency and insufficient optimization accuracy in the welding path planning of ship group workpieces is solved, and more efficient and accurate welding path planning is achieved.
Patent Information
- Application Number
- CN202510055424.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-04-25
AI Technical Summary
In the prior art, the gray wolf algorithm has problems of low search efficiency and insufficient optimization accuracy in the welding path planning of ship group-mounted workpieces.
By setting the probability parameters of individual change of gray wolf, the exchange probability is increased at the beginning of the iteration to jump out of the local optimal area, and the global search ability is maintained at the end of the iteration to verify and optimize the local optimal solution. At the same time, the average fitness value of the gray wolf population and the number of gray wolf below the average fitness value are introduced to maintain the global search ability and make fine adjustments to the better paths found.
It improves the reliability and stability of welding path planning, ensures that the obtained welding path is a globally optimal or close to globally optimal solution, and improves the efficiency and accuracy of welding path planning.
Smart Images

Figure CN119882607A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of shipbuilding, and in particular to a method, device and equipment for planning a welding path for a welder. Background Art
[0002] With the rapid development of the global shipbuilding industry and the accelerated advancement of intelligent transformation, improving production efficiency, reducing costs and ensuring product quality have become major challenges facing shipbuilding companies. In the shipbuilding process, welding operations are an indispensable key link, and their efficiency and quality directly affect the construction cycle and final performance of the entire ship. Traditionally, this link is highly dependent on manual operation, which is not only labor-intensive, but also the welding quality is easily affected by human factors, making it difficult to achieve standardization and efficiency.
[0003] In order to meet the above challenges, many shipyards have begun to explore and adopt advanced automation technologies, among which the application of welding robots is particularly significant. With its high precision, high efficiency and programmability, welding robots have shown great advantages in replacing manual labor for complex, repetitive and high-risk welding operations. Especially in the welding of small ship components, since these components are the primary assembly structures of the ship, the overall structure is relatively simple and highly standardized, making them an ideal scenario for the application of welding robots.
[0004] However, in practical applications, how to plan an optimal welding path for the welding robot to maximize its efficiency advantage has become an urgent problem to be solved. The planning of the welding path is not only about the welding speed, but also directly affects the energy consumption, material utilization and the final welding quality. At present, the industry generally adopts the path planning algorithm based on the traveling salesman problem (TSP) for trial. Although this type of algorithm can solve the path optimization problem to a certain extent, its inherent complexity, parameter sensitivity and cumbersome adjustment mechanism limit its practical application effect in the welding path planning of ship sub-workpieces.
[0005] In view of the limitations of the TSP algorithm, researchers began to explore more efficient and concise optimization algorithms. As an emerging swarm intelligence optimization algorithm, the Grey Wolf Optimizer (GWO) has attracted widespread attention because of its good balance between local search and global search capabilities, relatively simple algorithm structure, and uncomplicated parameter settings. The Grey Wolf Algorithm simulates the social hierarchy structure and hunting behavior of the grey wolf group, and achieves optimal solution to the problem through the collaborative cooperation of different roles such as leaders and followers.
[0006] Despite this, the Gray Wolf Algorithm still faces the problems of low search efficiency and insufficient optimization accuracy when applied to the welding path planning of small ship parts. This is mainly because the algorithm fails to make full use of known information to guide the search direction when searching the solution space, resulting in the difficulty of finding the optimal solution quickly and accurately in complex welding path planning tasks. Therefore, how to further improve the search efficiency and optimization accuracy of the Gray Wolf Algorithm while maintaining its search stability has become an urgent problem to be solved in the current intelligent manufacturing of ships. Summary of the invention
[0007] In view of the problems of low search efficiency and insufficient optimization accuracy when the Grey Wolf Algorithm is used for welding path planning of a welding robot in the prior art, the present application provides a welding path planning method, device and equipment for a welding robot.
[0008] An embodiment of the present application provides a welding path planning method for a welding robot, comprising the following steps:
[0009] S1, extracting all welding arc starting points of the workpiece of the ship group, and giving each welding arc starting point a different number;
[0010] S2, initializing the relevant parameters of the algorithm, setting the number of gray wolf individuals, the gray wolf individual change probability parameter, and the maximum number of iterations, the gray wolf individual is a welding path sequence formed by serializing the corresponding numbers of all the welding arc starting points in chronological order;
[0011] S3, respectively calculating the fitness value of each gray wolf individual, selecting the first three wolves with the largest fitness values as the first generation α wolf, β wolf, and δ wolf, the fitness value of the gray wolf individual is the reciprocal of the sum of the distances between all adjacent numbers in the welding path sequence;
[0012] S4, calculate the transformation sequence D of each gray wolf individual into the first generation α wolf, β wolf, and δ wolf respectively α , D β , D δ Each of the gray wolf individuals is respectively based on the transformation sequence D α , D β , D δ and the gray wolf individual change probability parameters are updated, and the fitness value of each gray wolf individual after the update is calculated respectively, and the average fitness value of the gray wolf population and the number of gray wolves below the average fitness value are calculated;
[0013] S5, judging whether the fitness value of the gray wolf individual is less than the average fitness value, if not, the gray wolf individual does not change; if yes, the gray wolf individual is randomly changed, and the fitness value of the randomly changed gray wolf individual is calculated; then the first three wolves with the largest fitness values of all gray wolves are used as the second generation α wolf, β wolf, and δ wolf;
[0014] S6. Update the number of iterations and determine whether the number of iterations is less than the maximum number of iterations. If so, repeat steps S3 to S5; if not, output the gray wolf individual with the largest fitness value to obtain the optimal welding path planning solution for the welding robot.
[0015] As an implementation manner, step S2 further includes:
[0016] Setting an initial gray wolf individual, wherein the initial gray wolf individual is one or more welding path sequences formed by all numbers in chronological order;
[0017] Establish multiple exchangers and form new gray wolf individuals. The exchangers are used to swap the position of the i-th number with the j-th number in the initial gray wolf individual to form a new gray wolf individual. The values of i and j in different exchangers are different.
[0018] As an implementation mode, in step S4, the transformation sequence D α , D β , D δ Calculated by the following formula:
[0019] D α =X α -X t
[0020] D β =X β -X t
[0021] D δ =X δ -X t
[0022] Among them, X α , X β , X δ They are the first generation α wolf, β wolf, and δ wolf respectively; X t For the gray wolf individual; D α For the gray wolf individual X t Transformed into the change sequence of the first generation α wolf; D β For the gray wolf individual X t Transformed into the changing sequence of the first generation of β wolf; D δ Gray Wolf Individual X t Transformed into the changing sequence of the first generation of delta wolves;
[0023] In step S4, each of the gray wolf individuals is updated according to the following formula:
[0024] X1=X t +rD α
[0025] X2=X t +rD β
[0026] X3=X t +rD δ
[0027] Among them, r is the probability parameter of gray wolf individual change; X1 is the probability parameter of gray wolf individual X t By transforming the sequence D α and the gray wolf individual change probability parameter r calculated by the second generation gray wolf individuals after the change; X2 is the gray wolf individual X t By transforming the sequence D β and the gray wolf individual change probability parameter r calculated by the second generation gray wolf individuals after the change; X3 is the gray wolf individual X t By transforming the sequence D δ The second generation of gray wolf individuals after changes are calculated using the gray wolf individual change probability parameter r.
[0028] As an implementation mode, the value of the gray wolf individual change probability parameter is between 0 and 1.
[0029] As an implementation mode, the value of the gray wolf individual change probability parameter is divided into three stages:
[0030] The first stage is an iteration number from 1 to 1 / 3 of the maximum iteration number, and the gray wolf individual transformation probability parameter is 0.8;
[0031] The second stage is an iteration number from 1 / 3 to 2 / 3 of the maximum iteration number, and the gray wolf individual transformation probability parameter is 0.5;
[0032] The third stage is an iteration number from 2 / 3 of the maximum iteration number to the maximum iteration number, and the gray wolf individual transformation probability parameter is 0.5.
[0033] As an implementation mode, in step S5, when the gray wolf individuals are randomly changed, the number of randomly changed gray wolf individuals is determined according to the following formula:
[0034] (Nn) / N=H
[0035] When H≥1 / 10, then Q*(Nn) / N=q;
[0036] When H≤1 / 10, then Q*1 / 10=q;
[0037] Among them, N is the maximum number of iterations; n is the current number of iterations; Q is the number of gray wolves with fitness values lower than the average; q is the number of randomly changing gray wolf individuals.
[0038] As an implementation mode, in step S1, all welding arc starting points of the workpieces of the ship group are extracted through machine vision and workpiece models.
[0039] Another embodiment of the present application provides a welding path planning device for a welding robot, comprising:
[0040] An extraction unit is used to extract all welding arc starting points of the workpiece of the ship group and give each welding arc starting point a different number;
[0041] The initial setting unit is used to initialize the relevant parameters of the algorithm, set the number of gray wolf individuals, the gray wolf individual change probability parameter, and the maximum number of iterations. The gray wolf individual is a welding path sequence formed by serializing the numbers corresponding to all welding arc starting points in order;
[0042] A first generation gray wolf selection unit is used to calculate the fitness value of each gray wolf individual, and select the first three wolves with the largest fitness values as the first generation α wolf, β wolf, and δ wolf, wherein the fitness value of the gray wolf individual is the reciprocal of the sum of the distances between all adjacent numbers in the welding path sequence;
[0043] A gray wolf population updating unit is used to calculate the transformation sequence D of each gray wolf individual into the first generation α wolf, β wolf, and δ wolf respectively. α , D β , D δ ; Make each of the gray wolf individuals according to the transformation sequence D α , D β , D δ and the gray wolf individual change probability parameters are updated, and the fitness value of each gray wolf individual after the update is calculated respectively, and the average fitness value of the gray wolf population and the number of gray wolves below the average fitness value are calculated;
[0044] The second generation gray wolf selection unit is used to determine whether the fitness value of the gray wolf individual is less than the average fitness value. If not, the gray wolf individual does not change; if yes, the gray wolf individual is randomly changed, and the fitness value of the randomly changed gray wolf individual is calculated; then the first three wolves with the largest fitness values of all gray wolves are used as the second generation α wolf, β wolf, and δ wolf;
[0045] The judgment unit is used to judge whether the number of iterations is less than the maximum number of iterations. If so, the second-generation gray wolf population is used as the first-generation gray wolf population, and the first-generation gray wolf selection unit is triggered; if not, the gray wolf individual with the largest fitness value is output to obtain the optimal welding path planning scheme of the welding robot.
[0046] As an implementation manner, the initial setting unit is further used for:
[0047] Setting an initial gray wolf individual, wherein the initial gray wolf individual is one or more welding path sequences formed by all numbers in chronological order;
[0048] Establish multiple exchangers and form new gray wolf individuals. The exchangers are used to swap the i-th number with the j-th number in the initial gray wolf individual to form a new gray wolf individual. The values of i and j in different exchangers are different.
[0049] Another embodiment of the present application provides a welding path planning device for a welding robot, the device comprising a processor and a memory;
[0050] The memory is used to store program code and transmit the program code to the processor;
[0051] The processor is used to execute the welding robot welding path planning method described in the above embodiment according to the instructions in the program code.
[0052] As described above, the welding robot welding path planning method, device and equipment of the present application have the following beneficial effects:
[0053] The welding path planning method of the welding robot of the present application is an optimization based on the traditional gray wolf algorithm. By setting the gray wolf individual change probability parameter, in the early stage of iteration, a higher exchange probability of the gray wolf individual exchange sequence helps the algorithm to jump out of the local optimal area and search the global solution space extensively; at the end of the iteration, it still maintains a certain global search capability, can further verify and optimize the local optimum, avoid the algorithm from converging to the local optimal solution too early, ensure that the final welding path is the global optimal or close to the global optimal solution, and improve the reliability and stability of welding path planning.
[0054] By introducing the average fitness value of the gray wolf population and the number of gray wolves with fitness values below the average, a strong global search capability is maintained in the early stage of iteration, and various possible welding paths can be widely explored; in the later stage of rapid convergence iteration, the ability to search globally is still maintained, and the better path found can be fine-tuned and optimized, further improving the rationality of the welding path and ensuring that the welding robot can perform welding operations according to a more precise and efficient path. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 Shown is a schematic flow chart of a welding path planning method for a welding robot in an embodiment of the present invention.
[0056] Figure 2 It shows a comparison chart of 20 simulation tests using the Grey Wolf Algorithm in the prior art and the improved Grey Wolf Algorithm of the embodiment of the present application.
[0057] Figure 3 It shows a comparison chart of 100 iterations of simulation experiments using the Grey Wolf Algorithm in the prior art and the improved Grey Wolf Algorithm of the embodiment of the present application.
[0058] Figure 4 Shown is a structural schematic diagram of a welding path planning device for a welding robot in an embodiment of the present invention. DETAILED DESCRIPTION
[0059] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention.
[0060] It should be noted that the illustrations provided in this embodiment are only used to illustrate the basic concept of the present invention in a schematic manner, and therefore the illustrations only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0061] When using welding robots to weld small structures of ships, the existing technology often adopts algorithms that solve the traveling salesman problem for path planning. However, such algorithms have disadvantages such as complex structure, too many parameters, and complicated adjustment mechanisms, which to a certain extent limit their application effect in welding path planning of small workpieces of ships.
[0062] As an optimization algorithm, the Gray Wolf Algorithm (GWO) is inspired by the hunting behavior and social hierarchy of gray wolves in nature. It efficiently searches for the optimal solution by simulating the roles of the alpha wolf, beta wolf, delta wolf, and omega wolf. Compared with traditional path planning algorithms, the Gray Wolf Algorithm is relatively stable in both local and global search capabilities, without the disadvantages of complex structure, too many parameters, and cumbersome adjustment mechanism. However, despite the advantages of strong search stability, the Gray Wolf Algorithm also has the disadvantages of low search efficiency and low optimization accuracy, which to a certain extent affects its application effect in the welding path planning of ship sub-assemblies and limits the further improvement of welding efficiency of welding robots.
[0063] In view of the shortcomings of existing path planning algorithms, especially the application bottleneck of the Grey Wolf algorithm in the welding path planning of ship sub-unit workpieces, the present application provides a welding robot welding path planning method, device and equipment. The following embodiments are now described in detail.
[0064] This embodiment provides a welding robot welding path planning method, such as Figure 1 As shown, the following steps are included:
[0065] S1: Extract all welding arc starting points of the ship group workpiece and give each welding arc starting point a different number;
[0066] S2: Initialize the relevant parameters of the algorithm, set the number of gray wolf individuals, the gray wolf individual change probability parameter, and the maximum number of iterations. The gray wolf individual is a welding path sequence formed by serializing the numbers corresponding to all welding arc starting points in order;
[0067] S3: Calculate the fitness value of each individual gray wolf, select the first three wolves with the largest fitness value as the first generation α wolf, β wolf, and δ wolf. The fitness value of the individual gray wolf is the reciprocal of the sum of the distances between all adjacent numbers in the welding path sequence;
[0068] S4: Calculate the transformation sequence D of each gray wolf individual into the first generation α wolf, β wolf, and δ wolf respectively α , D β , D δ Each gray wolf individual is respectively transformed according to the sequence D α , D β , D δ The fitness value of each individual gray wolf is calculated, and the average fitness value of the gray wolf population and the number of gray wolves below the average fitness value are calculated;
[0069] S5: Determine whether the fitness value of the gray wolf individual is less than the average fitness value. If not, the gray wolf individual does not change; if yes, the gray wolf individual is randomly changed, and the fitness value of the randomly changed gray wolf individual is calculated; then the first three wolves with the largest fitness values of all gray wolves are used as the second generation α wolf, β wolf, and δ wolf;
[0070] S6: Update the number of iterations and determine whether the number of iterations is less than the maximum number of iterations. If so, repeat steps S3 to S5; if not, output the gray wolf individual with the largest fitness value to obtain the optimal welding path planning solution for the welding robot.
[0071] Compared with the traditional gray wolf algorithm, this embodiment has faster efficiency and higher accuracy in the welding path planning of welding robots. The traditional gray wolf algorithm is prone to fall into local optimality in solving the welding path planning of welding robots, resulting in low rationality of welding path planning. This embodiment sets the probability of exchange of gray wolf individual exchange sequences according to the number of iterations, so that the gray wolf optimization algorithm provided by this embodiment has a higher global optimization ability in the early stage of iteration and tends to the global optimal in the late stage of iteration; at the same time, the average fitness value of the gray wolf population is introduced, and the number of gray wolves in the random change sequence of the gray wolf population that is lower than the average fitness value is set according to the number of iterations, so that the gray wolf optimization algorithm of this embodiment maintains a strong global search ability in the early stage of iteration, and still has the ability to search globally in the late stage of iteration with rapid convergence.
[0072] When extracting all welding arc starting points of the ship sub-workpiece in step S1, the extraction is performed through machine vision and the workpiece model. For example, if the ship sub-workpiece has N rib plate welds, then the ship sub-workpiece has N welding arc starting points. Since the welding arc starting point is a spatial coordinate point, in order to facilitate the subsequent use of the algorithm to plan the welding path, each welding arc starting point is given a non-repeating number, such as giving each welding arc starting point an Arabic numeral number, the first welding arc starting point corresponds to the number 1, the second welding arc starting point corresponds to the number 2, ..., and the Nth welding arc starting point corresponds to the number N.
[0073] Then, when all the numbers corresponding to the welding arc starting points are arranged in order, a welding path sequence can be formed. Since the first position may be occupied by N numbers, the second position may be occupied by N-1 numbers, ..., and the Nth position may be occupied by only one number, the numbers corresponding to all welding arc starting points are sorted in the above order. All the above possible sortings are a solution to the welding path sequence. The formed set can be represented by V, and one of the welding path sequences can be represented by V λ Indicates that, then V={V1,V2,…,V λ};
[0074] One of the welding path sequences can be expressed as: V λ =(V λ(1) , V λ(2) , …, V (λ(i)) ), (1≤i≤N);
[0075] The distance between two adjacent welding arc starting points can be expressed as: d(V λ(i) ,V λ(i+1) );
[0076] The total length of all welding arc starting points in a welding path sequence can be expressed as:
[0077] The fitness value A can be expressed as: A = 1 / S λ , the larger the fitness value A is, the shorter the total length of the welding path is.
[0078] In an optional embodiment, step S2 further includes:
[0079] Set an initial gray wolf individual, where the initial gray wolf individual is one or more welding path sequences formed by all numbers in order;
[0080] Establish multiple exchangers and form new gray wolf individuals. The exchanger is used to swap the position of the i-th number with the j-th number in the initial gray wolf individual to form a new gray wolf individual. The values of i and j in different exchangers are different.
[0081] The swapper C can be expressed as: C = Swap(i,j). The mechanism of action of the swapper is: the swapper acts on an initial welding path sequence, swapping the number at its i-th position with the number at its j-th position to form a new welding path sequence, that is, to form a new gray wolf individual.
[0082] The values of i and j in the exchanger C can be different numbers, so that multiple exchangers can be formed, such as C1, C2..., and the initial welding path sequence is exchanged in position according to the exchangers C1, C2... to form a new gray wolf population.
[0083] In an optional embodiment, in step S4, the sequence D is transformed α , D β , D δ Calculated by the following formula:
[0084] D α =X α -X t
[0085] D β =X β -X t
[0086] D δ =X δ -X t
[0087] Among them, X α , X β , X δ They are the first generation α wolf, β wolf, and δ wolf respectively; X t For the gray wolf individual; D α For the gray wolf individual X t Transformed into the change sequence of the first generation α wolf; D β For the gray wolf individual X tTransformed into the changing sequence of the first generation of β wolf; D δ Gray Wolf Individual X t Transformed into the changing sequence of the first generation of delta wolves;
[0088] In step S4, each individual gray wolf is updated according to the following formula:
[0089] X1=X t +rD α
[0090] X2=X t +rD β
[0091] X3=X t +rD δ
[0092] Among them, r is the probability parameter of gray wolf individual change; X1 is the probability parameter of gray wolf individual X t By transforming the sequence D α and the gray wolf individual change probability parameter r calculated by the second generation gray wolf individuals after the change; X2 is the gray wolf individual X t By transforming the sequence D β and the gray wolf individual change probability parameter r calculated by the second generation gray wolf individuals after the change; X3 is the gray wolf individual X t By transforming the sequence D δ The second generation of gray wolf individuals after changes are calculated using the gray wolf individual change probability parameter r.
[0093] In an optional embodiment, the value of the gray wolf individual change probability parameter is between 0 and 1, for example, it can be 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, etc.
[0094] In an optional embodiment, the value of the gray wolf individual change probability parameter is divided into three stages, the maximum number of iterations is represented by N, and the current number of iterations is represented by n:
[0095] The first stage is 1≤n≤1 / 3N (i.e., the number of iterations is from 1 to 1 / 3 of the maximum number of iterations), and the gray wolf individual transformation probability parameter is 0.8;
[0096] The second stage is 1 / 3N≤n≤2 / 3N (the number of iterations is from 1 / 3 of the maximum number of iterations to 2 / 3 of the maximum number of iterations), and the gray wolf individual transformation probability parameter is 0.5;
[0097] The third stage is 2 / 3N≤n≤N (the number of iterations is 2 / 3 of the maximum number of iterations to the maximum number of iterations), and the individual transformation probability parameter of the gray wolf is 0.5.
[0098] In an optional embodiment, in step S5, when the gray wolf individuals are randomly changed, the number of randomly changed gray wolf individuals is determined according to the following formula:
[0099] (Nn) / N=H
[0100] When H≥1 / 10, then Q*(Nn) / N=q;
[0101] When H≤1 / 10, then Q*1 / 10=q;
[0102] Among them, N is the maximum number of iterations; n is the current number of iterations; Q is the number of gray wolves with fitness values lower than the average; q is the number of randomly changing gray wolf individuals.
[0103] In order to illustrate the above logic, this embodiment takes three welding arc starting points as an example (but the actual number of welding arc starting points will be much greater than 3, and 3 is taken as an example only for illustration). For example, the spatial point set of the three welding arc starting points is [(6733, 784, 1955), (6562, -129, 1954), (6731, 774, 1955,)], and the three welding arc starting points are numbered 1, 2, and 3 respectively. Assume that the number of gray wolves is 3 (that is, there are 3 solutions to the welding path), and the initial welding path sequence is (1 ,2,3), swapper C1=Swap(1,2), swapper C2=Swap(1,3), swapper C1 acts on the initial welding path sequence (1,2,3), 1 at the first position and 2 at the second position in the initial welding path sequence are swapped to generate a new welding path sequence (2,1,3), swapper C2 then acts on the generated new welding path sequence (2,1,3), so that 2 at the first position and 3 at the third position are swapped to continue to generate a new welding path sequence (3,1,2). The gray wolf individual transformation probability parameter refers to the probability that the swapper does not take effect. Assuming its value is 0.5, the probability of the two swaps occurring is 0.5.
[0104] The fitness values of the above three welding path sequences (1,2,3), (2,1,3) and (3,1,2) are calculated to determine α wolf, β wolf and δ wolf. Since there are only three welding points, the total lengths of the welding paths are directly given as 1847mm, 939mm and 939mm respectively. In this way, the three welding path sequences can be arranged as (2,1,3), (3,1,2) and (1,2,3). Then, the optimal welding path sequences of the welding robot are finally obtained as (1,3,2) and (2,3,1). The total lengths of the above welding path sequences are all 928mm.
[0105] Since the number of the above welding arc starting points is small, all welding path sequences can be listed, a total of 6, namely (1,2,3), (1,3,2), (2,1,3), (2,3,1), (3,1,2), (3,2,1,), the total length of each welding path sequence is 1847mm, 928mm, 939mm, 928mm, 939mm, 1847mm, respectively. It can be seen that the optimal welding path sequence is (1,3,2) and (2,3,1). It can be seen that the optimal welding path sequence found in this embodiment is consistent with the actual situation. However, when the welding path planning method of this embodiment calculates more than 10 welding arc starting points, the effectiveness of the welding path planning method of this embodiment can be better reflected.
[0106] In order to verify the effectiveness and advantages of the improved gray wolf algorithm provided in this embodiment in the welding path planning of the welding robot, the gray wolf algorithm and the improved gray wolf algorithm were tested 20 times for comparison. The final test status is as follows Figure 2 As shown, the improved grey wolf algorithm has better optimization ability than the grey wolf algorithm. The grey wolf algorithm is a commonly used method step in the prior art.
[0107] The 20 calculation results were statistically analyzed, mainly including five indicators: the shortest path, the longest path, the average path, the standard deviation, and the time taken to obtain the shortest path. The statistical results are shown in Table 1:
[0108] Table 1
[0109] algorithm Improved Grey Wolf Algorithm Grey Wolf Algorithm Shortest path / mm 44509 46950 Longest path / mm 50166 55477 Average path / mm 48442 52225 Standard Deviation 1366 1661 Shortest path time / s 15 12
[0110] The shortest path trajectories of the two algorithms are as follows:
[0111] The trajectory obtained by the improved grey wolf algorithm is (23, 26, 29, 19, 21, 27, 24, 28, 25, 20, 18, 22, 1, 13, 2, 0, 6, 8, 16, 9, 17, 10, 11, 12, 14, 15, 7, 4, 5, 3);
[0112] The trajectory obtained by the Grey Wolf algorithm is (21, 26, 23, 19, 29, 18, 27, 28, 25, 20, 13, 24, 22, 1, 17, 2, 0, 6, 8, 16, 9, 14, 10, 11, 3, 12, 7, 15, 5, 4).
[0113] According to Table 1, under the condition of multiple tests, the shortest welding path obtained by the improved gray wolf algorithm is 44509mm, the shortest average path is 50166mm, and the minimum standard deviation is 1366, which shows that the improved gray wolf algorithm has good stability and excellent optimization ability. The time consumption to obtain the shortest path is 15s, which is 3s longer than the gray wolf algorithm. This is because the improved gray wolf algorithm increases the amount of calculation, resulting in a slightly longer time, but overall compared with the gray wolf algorithm, the improved gray wolf algorithm shows a better path planning ability and is a reliable method for robot welding path planning.
[0114] When the improved Gray Wolf Algorithm of this embodiment and the traditional Gray Wolf Algorithm are applied to the welding path planning of the welding robot, in 20 simulation tests, the average path planned by the improved Gray Wolf Algorithm is the shortest, the shortest path planned is the shortest, the standard deviation of the 20 tests is the smallest, and the total time consumption to obtain the optimal result in the iterative test is similar. This shows that the improved Gray Wolf Algorithm of this embodiment has better stability and higher accuracy in the welding path planning of the welding robot.
[0115] The optimal results of 100 tests of the gray wolf algorithm and the improved gray wolf algorithm are compared. The number of gray wolf populations in each algorithm is set to 300, and the maximum number of iterations is 100. The test results are as follows: Figure 3 As shown, it can be seen that the improved grey wolf algorithm still has good optimization ability in the later stage of iteration.
[0116] This embodiment also provides a welding robot welding path planning device, such as Figure 4 As shown, including:
[0117] The extraction unit 10 is used to extract all welding arc starting points of the ship group workpiece and give each welding arc starting point a different number;
[0118] The initial setting unit 20 is used to initialize the relevant parameters of the algorithm, set the number of gray wolf individuals, the gray wolf individual change probability parameter, and the maximum number of iterations. The gray wolf individual is a welding path sequence formed by serializing all welding arc starting points in sequence;
[0119] The first generation gray wolf selection unit 30 is used to calculate the fitness value of each gray wolf individual, and select the first three wolves with the largest fitness values as the first generation α wolf, β wolf, and δ wolf. The fitness value of the gray wolf individual is the reciprocal of the sum of the distances between all adjacent numbers in the welding path sequence;
[0120] The gray wolf population updating unit 40 is used to calculate the transformation sequence D of each gray wolf individual into the first generation α wolf, β wolf, and δ wolf respectively. α , D β , D δ ; Make each gray wolf individual according to the transformation sequence Dα , D β , D δ The fitness value of each individual gray wolf is calculated, and the average fitness value of the gray wolf population and the number of gray wolves below the average fitness value are calculated;
[0121] The second generation gray wolf selection unit 50 is used to determine whether the fitness value of the gray wolf individual is less than the average fitness value. If not, the gray wolf individual does not change; if yes, the gray wolf individual is randomly changed, and the fitness value of the randomly changed gray wolf individual is calculated; then the first three wolves with the largest fitness values of all gray wolves are used as the second generation α wolf, β wolf, and δ wolf;
[0122] The judgment unit 60 is used to judge whether the number of iterations is less than the maximum number of iterations. If so, the second-generation gray wolf population is used as the first-generation gray wolf population, and the first-generation gray wolf selection unit 30 is triggered; if not, the gray wolf individual with the largest fitness value is output to obtain the optimal welding path planning scheme of the welding robot.
[0123] In an optional embodiment, the initial setting unit is further used for:
[0124] Set an initial gray wolf individual, where the initial gray wolf individual is one or more welding path sequences formed by all numbers in order;
[0125] Establish multiple exchangers and form new gray wolf individuals. The exchanger is used to swap the position of the i-th number with the j-th number in the initial gray wolf individual to form a new gray wolf individual. The values of i and j in different exchangers are different.
[0126] This embodiment also provides a welding path planning device for a welding robot, the device comprising a processor and a memory;
[0127] The memory is used to store the program code and transmit the program code to the processor;
[0128] The processor is used to execute the welding path planning method of the welding robot according to the instructions in the program code.
[0129] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0130] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0131] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0132] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0133] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. A welding path planning method for a welding robot, characterized in that: The following steps are involved: S1, extracting all welding arc starting points of the workpiece of the ship group, and giving each welding arc starting point a different number; S2, initialize the relevant parameters of the algorithm, set the number of gray wolf individuals, gray wolf individual change probability parameters, and the maximum number of iterations, the gray wolf individual is the welding path sequence formed by the numbers corresponding to all the welding arc starting points in sequence List; S3, respectively calculate the fitness value of each gray wolf individual, select the first three wolves with the largest fitness value as the first generation of α wolf, β wolf, and δ wolf, and the fitness value of the gray wolf individual is the distance between all adjacent numbers in the welding path sequence. The reciprocal of the sum of the distances; S4, calculate the transformation sequence D of each gray wolf individual into the first generation α wolf, β wolf, and δ wolf respectively α , D β , D δ Each of the gray wolf individuals is respectively based on the transformation sequence D α , D β , D δ and the gray wolf individual change probability parameters are updated, and the fitness value of each gray wolf individual after the update is calculated respectively, and the average fitness value of the gray wolf population and the number of gray wolves below the average fitness value are calculated; S5, judging whether the fitness value of the gray wolf individual is less than the average fitness value, if not, the gray wolf individual does not change; if yes, the gray wolf individual is randomly changed, and the fitness value of the randomly changed gray wolf individual is calculated; then the first three wolves with the largest fitness values of all gray wolves are used as the second generation α wolf, β wolf, and δ wolf; S6. Update the number of iterations and determine whether the number of iterations is less than the maximum number of iterations. If so, repeat step S3 to step S5; if not, output the gray wolf individual with the largest fitness value to obtain the optimal welding path of the welding robot Planning scheme.
2. The welding path planning method for a welding robot according to claim 1, characterized in that: Step S2 also includes: Setting an initial gray wolf individual, wherein the initial gray wolf individual is one or more welding path sequences formed by all numbers in chronological order; Establish multiple exchangers and form new gray wolf individuals. The exchangers are used to swap the i-th number with the j-th number in the initial gray wolf individual to form a new gray wolf individual. The values of i and j in different exchangers are different.
3. The welding path planning method for a welding robot according to claim 1, characterized in that: In step S4, the transformation sequence D α , D β , D δ Calculated by the following formula: D α =X α -X t D β =X β -X t D δ =X δ -X t Among them, X α , X β , X δ They are the first generation α wolf, β wolf, and δ wolf respectively; X t For the gray wolf individual; D α For the gray wolf individual X t Transformed into the change sequence of the first generation α wolf; D β For the gray wolf individual X t Transformed into the changing sequence of the first generation of β wolf; D δ Gray Wolf Individual X t Transformed into the changing sequence of the first generation of delta wolves; In step S4, each of the gray wolf individuals is updated according to the following formula: X1=X t +rD α X2=X t +rD β X3=X t +rD δ Among them, r is the probability parameter of gray wolf individual change; X1 is the probability parameter of gray wolf individual X t By transforming the sequence D α and the gray wolf individual change probability parameter r calculated by the second generation gray wolf individuals after the change; X2 is the gray wolf individual X t By transforming the sequence D β and the gray wolf individual change probability parameter r calculated by the second generation gray wolf individuals after the change; X3 is the gray wolf individual X t By transforming the sequence D δ The second generation of gray wolf individuals after changes are calculated using the gray wolf individual change probability parameter r.
4. The welding path planning method for a welding robot according to any one of claims 1 to 3, characterized in that: The value of the gray wolf individual change probability parameter is between 0 and 1.
5. The welding path planning method for a welding robot according to claim 4, characterized in that: The value of the gray wolf individual change probability parameter is divided into three stages: The first stage is an iteration number from 1 to 1 / 3 of the maximum iteration number, and the gray wolf individual transformation probability parameter is 0.8; The second stage is an iteration number from 1 / 3 to 2 / 3 of the maximum iteration number, and the gray wolf individual transformation probability parameter is 0.5; The third stage is an iteration number from 2 / 3 of the maximum iteration number to the maximum iteration number, and the gray wolf individual transformation probability parameter is 0.
5.
6. The welding path planning method for a welding robot according to claim 1, characterized in that: In step S5, when the gray wolf individuals are randomly changed, the number of randomly changed gray wolf individuals is determined according to the following formula: (Nn) / N=H When H≥1 / 10, then Q*(Nn) / N=q; When H≤1 / 10, then Q*1 / 10=q; Among them, N is the maximum number of iterations; n is the current number of iterations; Q is the number of gray wolves with fitness values lower than the average; q is the number of randomly changing gray wolf individuals.
7. The welding path planning method for a welding robot according to claim 1, characterized in that: In step S1, all welding arc starting points of the workpiece of the ship group are extracted through machine vision and workpiece model.
8. A welding path planning device for a welding robot, characterized in that: include: An extraction unit is used to extract all welding arc starting points of the workpiece of the ship group and give each welding arc starting point a different number; The initial setting unit is used to initialize the relevant parameters of the algorithm, set the number of gray wolf individuals, the gray wolf individual change probability parameter, and the maximum number of iterations. The gray wolf individual is a welding path sequence formed by serializing the numbers corresponding to all welding arc starting points in order; A first generation gray wolf selection unit is used to calculate the fitness value of each gray wolf individual, and select the first three wolves with the largest fitness values as the first generation α wolf, β wolf, and δ wolf, wherein the fitness value of the gray wolf individual is the reciprocal of the sum of the distances between all adjacent numbers in the welding path sequence; A gray wolf population updating unit is used to calculate the transformation sequences Dα, Dβ, and Dδ of each gray wolf individual into the first generation α wolf, β wolf, and δ wolf respectively; each gray wolf individual is updated according to the transformation sequences Dα, Dβ, and Dδ and the gray wolf individual change probability parameters, and the fitness value of each gray wolf individual after the update is calculated respectively, and the average fitness value of the gray wolf population and the number of gray wolves below the average fitness value are calculated; The second generation gray wolf selection unit is used to determine whether the fitness value of the gray wolf individual is less than the average fitness value. If not, the gray wolf individual does not change; if yes, the gray wolf individual is randomly changed, and the fitness value of the randomly changed gray wolf individual is calculated; then the first three wolves with the largest fitness values of all gray wolves are used as the second generation α wolf, β wolf, and δ wolf; The judgment unit is used to judge whether the number of iterations is less than the maximum number of iterations. If so, the second-generation gray wolf population is used as the first-generation gray wolf population, and the first-generation gray wolf selection unit is triggered; if not, the gray wolf individual with the largest fitness value is output to obtain the optimal welding path planning scheme of the welding robot.
9. The welding path planning device for a welding robot according to claim 8, characterized in that: The initial setting unit is also used for: Setting an initial gray wolf individual, wherein the initial gray wolf individual is one or more welding path sequences formed by all numbers in chronological order; Establish multiple exchangers and form new gray wolf individuals. The exchangers are used to swap the i-th number with the j-th number in the initial gray wolf individual to form a new gray wolf individual. The values of i and j in different exchangers are different.
10. A welding robot welding path planning device, characterized in that: The device comprises a processor and a memory; The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the welding path planning method for a welding robot according to any one of claims 1 to 7 according to the instructions in the program code.