Welding robot path planning method and system based on improved whale optimization algorithm
By improving the whale optimization algorithm, combined with the integration of Gaussian functions and multi-leader mechanisms, the efficiency and accuracy of welding path planning are improved, the problem of low efficiency and accuracy in the existing technology is solved, and faster and more accurate path planning is achieved.
Patent Information
- Application Number
- CN202510766724.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-10
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-06-10
AI Technical Summary
The existing whale optimization algorithm is not efficient and accurate in welding path planning, which affects the welding quality of the engine front cover.
The whale optimization algorithm is improved by introducing nonlinear inertial weights and multi-leader mechanisms of Gaussian functions, and integrated it through the Stacking framework to form an optimally improved whale optimization algorithm for welding path planning.
The convergence speed and accuracy of the algorithm are improved, the robustness and adaptability of the algorithm are enhanced, and the welding path can be planned faster and more accurately.
Smart Images

Figure CN120395885A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of welding path planning, and specifically relates to a welding robot path planning method and system based on an improved whale optimization algorithm. Background Art
[0002] With the development of the automotive industry, the impact of welding quality on the performance of the whole vehicle has become increasingly prominent. Traditional manual welding has health risks and requires high operating skills, which promotes the research focus on welding automation. Although current industrial robots can complete basic welding, path planning optimization remains the key to improving efficiency. Research shows that when the welding gun speed is constant, the welding time is proportional to the path length, and this problem can be optimized by transforming it into the Traveling Salesman Problem (TSP). Among swarm intelligence algorithms, the whale optimization algorithm (WOA) is particularly suitable for path planning due to its simple parameters and strong adaptability.
[0003] Currently, the whale optimization algorithm used in welding path planning can achieve path planning, but there are still deficiencies in algorithm performance, with low efficiency and accuracy, which affects the effect of applying it to the welding path planning of the engine hood. Summary of the Invention
[0004] The purpose of the present invention is to provide a welding robot path planning method and system based on an improved whale optimization algorithm to solve the technical problem of insufficient algorithm performance of the standard whale optimization algorithm WOA in the welding path planning process of the engine hood in the prior art.
[0005] To solve the above technical problem, the present invention specifically provides the following technical solutions:
[0006] A welding robot path planning method based on an improved whale optimization algorithm, comprising the following steps:
[0007] Conduct path planning modeling of the welding robot on the engine hood of an automobile to obtain a mathematical model of welding path planning;
[0008] Improve the whale optimization algorithm WOA by integrating multiple strategies to obtain the optimal improved whale optimization algorithm GSWOA, and verify the performance of the optimal improved whale optimization algorithm GSWOA through four test functions;
[0009] Perform path planning on the welding path planning model through the optimal improved whale optimization algorithm GSWOA to obtain the optimal welding path on the engine hood of the automobile.
[0010] As a preferred solution of the present invention, the mathematical model of welding path planning is:
[0011]
[0012] Wherein, 4minf is the optimization objective function of the welding path planning, C1 is the first welding point in the welding path, and C i is the ith welding point in the welding path, C i+1 is the (i + 1)th welding point in the welding path, C n is the nth welding point in the welding path, d(C i , C i+1 ) is the distance between C i and C i+1 , d(C n , C1) is the distance between C n and C1, (x i+1 , y i+1 ) are the x and y coordinates of C i+1 , (x i , y i ) are the x and y coordinates of C i , (x1, y1) are the x and y coordinates of C1, (x n , y n ) are the x and y coordinates of C n , and n is the total number of welding points in the welding path.
[0013] As a preferred embodiment of the present invention, the method for improving the whale optimization algorithm by integrating multiple strategies includes:
[0014] Improve the whale optimization algorithm WOA by introducing a non - linear inertia weight based on the Gaussian function to obtain the first improved whale optimization algorithm;
[0015] Improve the whale optimization algorithm WOA by introducing a multi - leader mechanism to obtain the second improved whale optimization algorithm;
[0016] Integrate the first improved whale optimization algorithm and the second improved whale optimization algorithm into the optimal improved whale optimization algorithm through the Stacking framework.
[0017] As a preferred embodiment of the present invention, the construction method of the first improved whale optimization algorithm includes:
[0018] Set the non - linear inertia weight based on the Gaussian function, and the non - linear inertia weight is:
[0019]
[0020] Wherein, w is the non - linear inertia weight, t is the current iteration number, and Max_iter is the maximum iteration number;
[0021] Apply the non - linear inertia weight to the spiral search and enclosing prey - hunting processes in the Whale Optimization Algorithm (WOA) to obtain the first improved Whale Optimization Algorithm, and the first improved Whale Optimization Algorithm is as follows:
[0022]
[0023] D1 = |C * X * (t) - X1(t)|;
[0024] D1′ = |X * (t) - X1(t)|;
[0025] In the formula, X1(t + 1) is the individual position after the (t + 1)-th iteration of the first improved Whale Optimization Algorithm, X1(t) is the individual position at the current iteration number t of the first improved Whale Optimization Algorithm, X * (t) is the optimal individual position obtained by the first improved Whale Optimization Algorithm up to the current iteration number t, D1 is the distance between the individual position at the current iteration number t in the enclosing prey - hunting process of the first improved Whale Optimization Algorithm and X * (t), D1′ is the distance between the individual position at the current iteration number t in the spiral search process of the first improved Whale Optimization Algorithm and X * (t), A and C are correlation coefficients, b is a constant in the spiral equation, l is a random number in [-1, 1], p is a random number in [0, 1], t ∈ [1, Max_iter], t is the current iteration number, and Max_iter is the maximum number of iterations.
[0026] As a preferred solution of the present invention, the construction method of the second improved Whale Optimization Algorithm includes:
[0027] Sort the fitness values of the individuals at the current iteration number t, and select the first K(t) individuals as leaders. The remaining individuals randomly select one of the K(t) leaders as their own leader;
[0028] Apply the matching relationship between the individual and its own leader to the spiral search and enclosing prey - hunting processes in the Whale Optimization Algorithm (WOA) to obtain the second improved Whale Optimization Algorithm, and the second improved Whale Optimization Algorithm is as follows:
[0029]
[0030] D2 = |C * X i,leader (t) - X2(t)|;
[0031] D2′ = |X i,leader (t) - X2(t)|;
[0032] Wherein, X2(t + 1) is the individual position after the (t + 1)-th iteration of the second improved whale optimization algorithm, X2(t) is the individual position of the second improved whale optimization algorithm at the current iteration number t, X i,leader (t) is the leader position selected by the individual at the current iteration number t, D2 is the distance between the individual position at the current iteration number t and X i,leader (t) during the encircling prey process of the second improved whale optimization algorithm, D2' is the distance between the individual position at the current iteration number t and X i,leader (t) during the spiral search process of the second improved whale optimization algorithm, A and C are correlation coefficients, b is a constant in the spiral equation, l is a random number in [-1, 1], p is a random number in [0, 1], t ∈ [1, Max_iter], t is the current iteration number, and Max_iter is the maximum number of iterations.
[0033] As a preferred embodiment of the present invention, the method for integrating the first improved whale optimization algorithm and the second improved whale optimization algorithm through the Stacking framework includes:
[0034] Integrate X1(t + 1) in the first improved whale optimization algorithm and X2(t + 1) in the second improved whale optimization algorithm through the Stacking framework, and train to obtain an optimal improved whale optimization algorithm for integrally outputting the optimal update result of the individual position between X1(t + 1) and X2(t + 1);
[0035] The optimal improved whale optimization algorithm is:
[0036] X best (t + 1) = Stacking(X1(t + 1), X2(t + 1));
[0037] The loss function for training the optimal improved whale optimization algorithm includes:
[0038] Consistency loss of individual position update direction:
[0039] L1 = cos(X best (t + 1) ― X best (t), X1(t + 1) ― X1(t)) + cos(X best (t + 1)
[0040] ― X best (t), X2(t + 1) ― X2(t));
[0041] Consistency loss of individual fitness:
[0042] L2 = |F(X best (t + 1)) ― F(X1(t + 1))| + |F(Xbest |F(X(t + 1)) - F(X2(t + 1))|;
[0043] Where X best (t + 1) is the individual position after the (t + 1)-th iteration output by the optimal improved whale optimization algorithm, X1(t + 1) is the individual position after the (t + 1)-th iteration of the first improved whale optimization algorithm, and X2(t + 1) is the individual position after the (t + 1)-th iteration of the second improved whale optimization algorithm;
[0044] L1 is the loss of consistency of the individual position update direction, L2 is the loss of consistency of the individual fitness, X best (t) is the individual position after the t-th iteration output by the optimal improved whale optimization algorithm, X1(t) is the individual position after the t-th iteration of the first improved whale optimization algorithm, X2(t) is the individual position after the t-th iteration of the second improved whale optimization algorithm, cos(·) is the cosine similarity operation formula, F(·) is the fitness operation formula, F(X best (t + 1)) is X best (t + 1) corresponding fitness value, F(X1(t + 1)) is the fitness value corresponding to X1(t + 1), F(X2(t + 1)) is the fitness value corresponding to X2(t + 1), t ∈ [1, Max_iter], t is the current iteration number, and Max_iter is the maximum number of iterations.
[0045] As a preferred solution of the present invention, the optimization objective function of the welding path planning is used as the fitness operation formula.
[0046] As a preferred solution of the present invention, the number of leaders selected Where K(t) is the number of leaders selected at the current iteration number t, K max is the maximum value of the preset number of leaders selected, K min is the minimum value of the preset number of leaders selected, t is the current iteration number, and Max_iter is the maximum number of iterations.
[0047] As a preferred solution of the present invention, the four test functions are composed of three unimodal functions and one multimodal function.
[0048] As a preferred solution of the present invention, the present invention provides a welding robot path planning system based on an improved whale optimization algorithm, which is applied to a welding robot path planning method based on an improved whale optimization algorithm. The system includes:
[0049] A mathematical modeling unit for performing path planning modeling of a welding robot on the front cover of an automotive engine to obtain a welding path planning mathematical model;
[0050] An algorithm improvement unit for improving the Whale Optimization Algorithm (WOA) by integrating multiple strategies to obtain the optimal improved Whale Optimization Algorithm (GSWOA), and verifying the performance of the optimal improved Whale Optimization Algorithm (GSWOA) through four test functions.
[0051] A path planning unit for performing path planning on a welding path planning model through the optimal improved Whale Optimization Algorithm (GSWOA) to obtain the optimal welding path on the front cover of an automotive engine.
[0052] The present invention has the following beneficial effects compared with the prior art:
[0053] The present invention improves the Whale Optimization Algorithm (WOA) through multiple strategies, and then integrates the improvements of multiple strategies through a Stacking framework to achieve the integration of the advantages of each strategy, avoid the influence of the failure of a single strategy, enhance the robustness of the algorithm, and finally through experimental verification, it has a faster convergence speed and higher convergence accuracy compared with the standard WOA algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only exemplary, and those of ordinary skill in the art can also obtain other implementation drawings according to the provided drawings without creative efforts.
[0055] Figure 1 It is a flowchart of a welding robot path planning method based on an improved Whale Optimization Algorithm provided by an embodiment of the present invention;
[0056] Figure 2 It is a block diagram of a welding robot path planning system based on an improved Whale Optimization Algorithm provided by an embodiment of the present invention;
[0057] Figure 3 It is a comparison chart of the algorithm performance of WOA and GSWOA for four test functions provided by an embodiment of the present invention;
[0058] Figure 4 It is a welding path planning result chart of WOA and GSWOA provided by an embodiment of the present invention;
[0059] Figure 5 It is a comparison chart of the number of iterations of WOA and GSWOA provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0060] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0061] As Figure 1 shown, the present invention provides a welding robot path planning method based on an improved whale optimization algorithm, including the following steps:
[0062] Perform path planning modeling of the welding robot on the front cover of the automotive engine to obtain a mathematical model of welding path planning;
[0063] Improve the whale optimization algorithm WOA by integrating multiple strategies to obtain the optimal improved whale optimization algorithm GSWOA, and verify the performance of the optimal improved whale optimization algorithm GSWOA through four test functions;
[0064] On the welding path planning model, perform path planning through the optimal improved whale optimization algorithm GSWOA to obtain the optimal welding path on the front cover of the automotive engine.
[0065] The present invention first improves the standard whale optimization algorithm WOA by introducing a non-linear inertia weight based on the Gaussian function as an improvement strategy. Since the larger the weight w, the faster the search speed, but the lower the convergence accuracy; conversely, the smaller w, the slower the search speed and the higher the convergence accuracy. Therefore, the present invention sets Dynamically adjust the weight through the iteration number t to achieve the non-linear change of w, that is, the weight w increases non-linearly with the increase of the iteration number. Thus, if the convergence speed is too fast, the improved WOA algorithm will appropriately reduce the weight value in the final stage, thereby improving the convergence accuracy and making the obtained optimal solution more accurate.
[0066] Secondly, the present invention improves the standard whale optimization algorithm WOA by introducing a multi-leader mechanism as an improvement strategy to enhance the global search ability of the population and avoid falling into local optimum in the later stage of iteration. That is, multiple leaders are used to guide the population to explore different potential regions simultaneously, reducing the risk of falling into local optimum. Individuals are dispersed around different leaders to avoid premature over-aggregation. In complex multi-modal problems, multiple search directions may locate promising regions faster, thereby improving the optimization accuracy and convergence rate of the standard whale optimization algorithm WOA.
[0067] Both of these two improvement strategies can enhance the algorithm performance of the standard Whale Optimization Algorithm (WOA) from different aspects. However, they cannot fully guarantee the effectiveness between the two strategies when solving path planning problems in different scenarios. To prevent the failure of one strategy from interfering with the other during the planning process, the present invention integrates these two improvement strategies through a Stacking integration framework to achieve the self - independence of the two strategies. In the scenario where both are effective, the algorithm advantages of the two improvement strategies are integrated. In the case where one party fails, the addition of the failed algorithm can be blocked, and the algorithm advantages of the effective strategy can be maintained. Therefore, the Stacking integration of the two strategies can not only improve the algorithm performance but also enable the algorithm to obtain better robustness.
[0068] Furthermore, adopting the Stacking integration method can also improve the scalability of the algorithm. For example, based on the above two strategies, improvement strategies such as the improved strategy with Lévy flight and the improved strategy with non - linear convergence factor are introduced, so as to achieve the integration of three or four strategies. Or new strategies are used to replace the old strategies, so that the algorithm performance improvement has strong scalability and high performance diversity, and can adapt to various path planning scenarios.
[0069] In the process of integrating the advantageous performances of multiple strategies through the Stacking integration method in the present invention, the loss functions adopted are the individual position update direction consistency loss and the individual fitness consistency loss. Among them, the individual position update direction consistency loss is used to make the individual update position X best (t + 1) generated by the Stacking integration of the two strategies move in the same direction as the individual update positions X1(t + 1) and X2(t + 1) generated by the two improvement strategies, maintaining the internal consistency between the moving direction generated by the integrated optimal Whale Optimization Algorithm (GSWOA) and the two improvement strategies, maintaining the consistency of the search behavior, inheriting the bio - inspired characteristics, retaining the unique bio - inspired behavior patterns such as encirclement and bubble - net attack in the Whale Optimization Algorithm, preventing behavior alienation, avoiding learning search patterns that are contrary to the basic principles of the optimal Whale Optimization Algorithm (GSWOA) and WOA, smoothing the optimization trajectory, reducing the mutation jumps of the population position, forming a more continuous optimization path, avoiding ineffective oscillations, preventing individuals from wandering ineffectively near the local optimal region, reducing the divergence risk, reducing the probability of population divergence through direction constraints, focusing directionally, guiding the population to concentrate search resources in the most promising direction, reducing redundant exploration, avoiding wasting time in obviously hopeless regions, facilitating the finding of the optimal search path, remaining effective in high - dimensional space using cosine similarity, identifying the dominant search direction in complex solution spaces, being insensitive to the noise of the objective function, mainly focusing on direction rather than absolute position, and enhancing the noise robustness.
[0070] The individual fitness consistency loss is used to make the individual updated position X determined by integrating two strategies in Stacking best (t + 1) corresponding to the fitness value F(X best (t + 1)) is consistent with the fitness values F(X1(t + 1)) and F(X2(t + 1)) generated by the individual updated positions X1(t + 1) and X2(t + 1) produced by the two improved strategies, maintaining the fitness of the individual position generated by the integrated optimal whale optimization algorithm GSWOA to be consistent with the two improved strategies, enabling the integration process to directly optimize the final objective (fitness value) rather than intermediate metrics, achieving end-to-end optimization, which is a direct bridge connecting the search behavior and the actual optimization effect, prioritizing practical value to ensure that the optimization process generates actual performance improvement.
[0071] Therefore, in the present invention, the individual position update direction consistency loss provides the stability and inheritance of the algorithm behavior, and the individual fitness consistency loss ensures the practical value of the optimization effect. The two work together to achieve intelligent balance, maintaining the core advantages of the WOA improvement strategy while achieving adaptive adjustment for specific problems.
[0072] In the initial stage of welding, the robot end effector first reaches the final welding point and then returns to the starting point through the intermediate welding points. At each welding point, the robot end effector performs a single welding task. The planning of the welding point sequence aims to optimize the shortest path. The present invention optimizes the path for 14 welding points on the front cover of a certain engine. By observing and analyzing the distribution of the welding points, it can be seen that the vibration amplitude of the welding points in the Z-axis direction of space is approximately zero. To simplify the mathematical model, the vibration of the welding points in the Z-axis direction is ignored, and the distribution of the welding points is regarded as a two-dimensional plane for research. Based on the above analysis, taking the shortest total path connecting all welding points as the evaluation criterion, the mathematical model for welding path planning is constructed as follows:
[0073]
[0074] In the formula, 4minf is the optimization objective function of the welding path planning, C1 is the first welding point in the welding path, C i is the i-th welding point in the welding path, C i+1 is the (i + 1)-th welding point in the welding path, C n is the n-th welding point in the welding path, d(C i , C i+1 ) is the distance between C i and C i+1 , d(C n , C1) is the distance between C n and C1, (x i+1 , y i+1 ) is the x, y coordinates of C i+1 , (xi , y i ) is C i The x and y coordinates of, (x1, y1) are the x and y coordinates of C1, (x n , y n ) is C n The x and y coordinates of, and n is the total number of welding points in the welding path.
[0075] The method for improving the whale optimization algorithm by integrating multiple strategies includes:
[0076] Improve the whale optimization algorithm WOA by introducing a non-linear inertia weight based on the Gaussian function to obtain the first improved whale optimization algorithm;
[0077] Improve the whale optimization algorithm WOA by introducing a multi-leader mechanism to obtain the second improved whale optimization algorithm;
[0078] Integrate the first improved whale optimization algorithm and the second improved whale optimization algorithm into the optimal improved whale optimization algorithm through the Stacking framework.
[0079] The construction method of the first improved whale optimization algorithm includes:
[0080] Set the non-linear inertia weight based on the Gaussian function, and the non-linear inertia weight is:
[0081]
[0082] In the formula, w is the non-linear inertia weight, t is the current iteration number, and Max_iter is the maximum iteration number;
[0083] Apply the non-linear inertia weight to the spiral search and enclosing prey processes in the whale optimization algorithm WOA to obtain the first improved whale optimization algorithm, and the first improved whale optimization algorithm is:
[0084]
[0085] D1 = |C * X * (t) - X1(t)|;
[0086] D1' = |X * (t) - X1(t)|;
[0087] In the formula, X1(t + 1) is the individual position of the first improved whale optimization algorithm after the (t + 1)-th iteration, X1(t) is the individual position of the first improved whale optimization algorithm at the current iteration number t, X *(t) is the optimal individual position obtained by the first improved whale optimization algorithm up to the current iteration number t, D1 is the distance between the individual position at the current iteration number t in the encircling prey process of the first improved whale optimization algorithm and X * (t), D1' is the distance between the individual position at the current iteration number t in the spiral search process of the first improved whale optimization algorithm and X * (t), A and C are correlation coefficients, b is a constant in the spiral equation, l is a random number in [-1, 1], p is a random number in [0, 1], t ∈ [1, Max_iter], t is the current iteration number, and Max_iter is the maximum number of iterations.
[0088] The construction method of the second improved whale optimization algorithm includes:
[0089] Sort the fitness values of the individuals at the current iteration number t, and select the top K(t) individuals as leaders. The remaining individuals randomly select one of the K(t) leaders as their own leader;
[0090] Apply the matching relationship between the individual and its own leader to the spiral search and encircling prey processes in the whale optimization algorithm WOA to obtain the second improved whale optimization algorithm. The second improved whale optimization algorithm is:
[0091]
[0092] D2 = |C * X i,leader (t) - X2(t)|;
[0093] D2' = |X i,leader (t) - X2(t)|;
[0094] In the formula, X2(t + 1) is the individual position after the (t + 1)-th iteration of the second improved whale optimization algorithm, X2(t) is the individual position of the second improved whale optimization algorithm at the current iteration number t, X i,leader (t) is the leader position selected by the individual at the current iteration number t, D2 is the distance between the individual position at the current iteration number t in the encircling prey process of the second improved whale optimization algorithm and X i,leader (t), D2' is the distance between the individual position at the current iteration number t in the spiral search process of the second improved whale optimization algorithm and X i,leader (t), A and C are correlation coefficients, b is a constant in the spiral equation, l is a random number in [-1, 1], p is a random number in [0, 1], t ∈ [1, Max_iter], t is the current iteration number, and Max_iter is the maximum number of iterations.
[0095] Among them, A and C are correlation coefficients, and their calculation methods are shown in the following formulas: A = 2·a·r1 - a, C = 2·r2, a = 2·(1 - t / Max_iter), where r1 and r2 are random variables with a component value range of [0, 1], Max_iter is the maximum number of iterations, and a is a convergence factor that linearly decreases from 2 to 0 as t increases.
[0096] The method of integrating the first improved whale optimization algorithm and the second improved whale optimization algorithm through the Stacking framework includes:
[0097] Integrate X1(t + 1) in the first improved whale optimization algorithm and X2(t + 1) in the second improved whale optimization algorithm through the Stacking framework, and train to obtain an optimal improved whale optimization algorithm for integrating and outputting the optimal update result of the individual position between X1(t + 1) and X2(t + 1);
[0098] Stacking (stacked generalization) is an advanced integration technique that combines the prediction results of multiple base models by training a meta-model. In the improvement of WOA, different improvement strategies can be regarded as "base models", and then a meta-model is used to learn how to optimally combine them.
[0099] The optimal improved whale optimization algorithm is:
[0100] X best (t + 1) = Stacking(X1(t + 1), X2(t + 1));
[0101] The loss function for training the optimal improved whale optimization algorithm includes:
[0102] Individual position update direction consistency loss:
[0103] L1 = cos(X best (t + 1) - X best (t), X1(t + 1) - X1(t)) + cos(X best (t + 1) - X best (t), X2(t + 1) - X2(t));
[0104] Individual fitness consistency loss:
[0105] L2 = |F(X best (t + 1)) - F(X1(t + 1))| + |F(X best (t + 1)) - F(X2(t + 1))|;
[0106] In the formula, X best(t + 1) is the individual position after the (t + 1)-th iteration output by the optimal improved whale optimization algorithm, X1(t + 1) is the individual position after the (t + 1)-th iteration of the first improved whale optimization algorithm, and X2(t + 1) is the individual position after the (t + 1)-th iteration of the second improved whale optimization algorithm;
[0107] L1 is the loss of consistency in the individual position update direction, L2 is the loss of consistency in individual fitness, and X best (t) is the individual position after the t-th iteration output by the optimal improved whale optimization algorithm, X1(t) is the individual position after the t-th iteration of the first improved whale optimization algorithm, X2(t) is the individual position after the t-th iteration of the second improved whale optimization algorithm, cos(·) is the cosine similarity operation formula, F(·) is the fitness operation formula, and F(X best (t + 1)) is the fitness value corresponding to X best (t + 1), F(X1(t + 1)) is the fitness value corresponding to X1(t + 1), F(X2(t + 1)) is the fitness value corresponding to X2(t + 1), t ∈ [1, Max_iter], t is the current iteration number, and Max_iter is the maximum number of iterations.
[0108] In the loss of consistency in the individual position update direction, X best (t + 1) - X best (t) refers to the moving direction of the individual position update generated by Stacking integrating two strategies. X1(t + 1) - X1(t) refers to the individual position update direction generated by the first improved whale optimization algorithm, and X2(t + 1) - X2(t) refers to the individual position update direction generated by the second improved whale optimization algorithm. cos(X best (t + 1) - X best (t), X1(t + 1) - X1(t)) and cos(X best (t + 1) - X best (t), X2(t + 1) - X2(t)) are used to minimize the loss of two parts, so as to make the individual update position X determined by Stacking integrating two strategies best(t + 1) is generated by moving the individuals X1(t + 1) and X2(t + 1) produced by the two improved strategies in the same upward direction, maintaining the internal consistency between the moving direction generated by the integrated optimal whale optimization algorithm GSWOA and the two improved strategies, maintaining the consistency of the search behavior, inheriting the bio-inspired characteristics, retaining the bio-inspired behavior patterns unique to the whale optimization algorithm such as encirclement and bubble-net attack, preventing behavior alienation, avoiding learning search patterns that are contrary to the basic principles of the optimal whale optimization algorithm GSWOA and WOA, smoothing the optimization trajectory, reducing the mutation jumps of the population positions, forming a more continuous optimization path to avoid ineffective oscillations, preventing individuals from wandering ineffectively near the local optimal region, reducing the divergence risk, reducing the probability of population divergence through direction constraints, focusing directionally, guiding the population to concentrate search resources in the most promising direction, reducing redundant exploration, avoiding wasting time in obviously hopeless regions, facilitating finding the optimal search path, remaining effective in high-dimensional space using cosine similarity, identifying the dominant search direction in complex solution spaces, being insensitive to the noise of the objective function, mainly focusing on direction rather than absolute position, and enhancing the noise robustness.
[0109] In the individual fitness consistency loss, F(X best (t + 1)) - F(X1(t + 1)) refers to the smallest difference between the fitness value corresponding to X best (t + 1) and the fitness value corresponding to X1(t + 1), and F(X best (t + 1)) - F(X2(t + 1)) refers to the smallest difference between the fitness value corresponding to X best (t + 1) and the fitness value corresponding to X2(t + 1). The two parts |F(X best (t + 1)) - F(X1(t + 1))| and |F(X best( (t + 1)) - F(X2(t + 1))| have the smallest loss, which is used to make the fitness value F(X best (t + 1)) corresponding to the individual update position X best (t + 1) determined by integrating the two strategies be consistent with the fitness values F(X1(t + 1)) and F(X2(t + 1)) generated by the individual update positions X1(t + 1) and X2(t + 1) of the two improved strategies, maintaining the consistent fitness of the individual positions generated by the integrated optimal whale optimization algorithm GSWOA with the two improved strategies, enabling the integration process to directly optimize the final objective (fitness value) rather than intermediate metrics, achieving end-to-end optimization, which is the direct bridge connecting search behavior and actual optimization effect, prioritizing practical value, and ensuring that the optimization process generates actual performance improvement.
[0110] Take the optimization objective function of the welding path planning as the fitness calculation formula.
[0111] Number of leaders selected Where K(t) is the number of leaders selected at the current iteration t, and K max is the maximum value of the preset number of leaders selected, and K min is the minimum value of the preset number of leaders selected, t is the current iteration number, and Max_iter is the maximum number of iterations.
[0112] In the present invention, K(t) is set to be dynamic and can decrease dynamically as the number of iterations increases, so that a large number of leaders in the initial stage promotes exploration and avoids premature convergence, while a small number of leaders in the later stage promotes convergence and accelerates convergence to the optimal solution, playing a key role in balancing the Exploration-Exploitation Tradeoff.
[0113] The four test functions are composed of three unimodal functions and one multimodal function.
[0114] To verify the performance of the improved whale optimization algorithm (GSWOA), the present invention selects 4 standard test functions for experimental verification, and their mathematical expressions are shown in Table 1. Among them, F1-F3 are unimodal functions and F4 is a multimodal function.
[0115] Table 1 Test functions
[0116]
[0117] Through the comparative simulation experiments of 4 standard test functions, the present invention conducts performance tests on the basic whale optimization algorithm (WOA) and the improved algorithm (GSWOA). For easy observation and analysis, the algorithm parameters are set as follows: the population size is 30, and the number of iterations of the F1-F4 functions are 1500, 50, 50, and 80 times respectively.
[0118] Figure 3 The iteration curves of the GSWOA algorithm and the WOA algorithm under different test functions are shown. The faster the curve descends, the faster the algorithm converges. The results show that the convergence speed of the GSWOA algorithm on the four standard test functions is increased by 22.7% compared with the original algorithm, and the convergence accuracy is improved by 15.3%.
[0119] The GSWOA algorithm first generates a random path sequence Q_i=(x1,x2,...,x n ), which is sorted and encoded into a solder joint path sequence C (such as [3 2 1 5 4 8 7 6 10 9]). Through d(C i ,C i+1) Calculate the distances between adjacent points, use 4minf as the fitness function, and perform iterative optimization by combining three predation behaviors until the optimal path is obtained. Implement the algorithm based on the MATLAB platform and verify its performance advantages by comparing with the standard WOA.
[0120] As Figure 4 and Figure 5 shown, in the simulation test, 14 solder joints are set, and the optimal welding path is obtained through parameter optimization. The results show that: the standard WOA algorithm obtains the path 5→3→2→4→1→7→8→9→14→10→13→12→11→6 (total length 532.07 cm, 55 iterations), while the improved GSWOA algorithm obtains the path 9→8→1→7→6→5→3→2→4→11→12→13→10→14 (total length 502.71 cm, 43 iterations). The comparison shows that GSWOA shortens the total path length by 5.52% (reducing 29.35 cm), and at the same time improves the convergence speed by 21.8%, verifying its superiority.
[0121] As Figure 2 shown, the present invention provides a welding robot path planning system based on an improved whale optimization algorithm, which is applied to a welding robot path planning method based on an improved whale optimization algorithm. The system includes:
[0122] A mathematical modeling unit for performing path planning modeling of a welding robot on the front cover of an automotive engine to obtain a mathematical model of welding path planning;
[0123] An algorithm improvement unit for improving the whale optimization algorithm WOA by integrating multiple strategies to obtain the optimal improved whale optimization algorithm GSWOA, and verifying the performance of the optimal improved whale optimization algorithm GSWOA through four test functions;
[0124] A path planning unit for performing path planning on the welding path planning model through the optimal improved whale optimization algorithm GSWOA to obtain the optimal welding path on the front cover of the automotive engine.
[0125] The present invention improves the whale optimization algorithm WOA through multiple strategies, and then integrates the improvements of multiple strategies through the Stacking framework to realize the integration of the advantages of each strategy, and can also avoid the influence of the failure of a single strategy, improve the robustness of the algorithm. Finally, through experiments, it is verified that it has a faster convergence speed and higher convergence accuracy than the standard WOA algorithm.
[0126] The above embodiments are only exemplary embodiments of the present application and are not used to limit the present application. The protection scope of the present application is defined by the claims. Those skilled in the art can make various modifications or equivalent replacements within the essence and protection scope of the present application, and such modifications or equivalent replacements should also be regarded as falling within the protection scope of the present application.
Claims
1. A path planning method for a welding robot based on an improved whale optimization algorithm, characterized in that, It includes the following steps: Conduct path planning modeling of the welding robot on the front cover of the automotive engine to obtain the mathematical model of welding path planning; Improve the Whale Optimization Algorithm (WOA) by integrating multiple strategies to obtain the optimal improved Whale Optimization Algorithm (GSWOA), and verify the performance of the optimal improved Whale Optimization Algorithm (GSWOA) through four test functions; On the welding path planning model, conduct path planning through the optimal improved Whale Optimization Algorithm (GSWOA) to obtain the optimal welding path on the front cover of the automotive engine.
2. The path planning method of a welding robot based on an improved whale optimization algorithm according to claim 1, wherein: The mathematical model of the welding path planning is as follows: In the formula, 4minf is the optimization objective function for welding path planning, C1 is the first welding point in the welding path, and C i is the i-th welding point in the welding path, C i+1 is the (i + 1)-th welding point in the welding path, C n is the n-th welding point in the welding path, d(C i , C i+1 ) is the distance between C i and C i+1 , d(C n , C1) is the distance between C n and C1, (x i+1 , y i+1 ) are the x and y coordinates of C i+1 , (x i , y i ) are the x and y coordinates of C i , (x1, y1) are the x and y coordinates of C1, (x n , y n ) are the x and y coordinates of C n , and n is the total number of welding points in the welding path.
3. The path planning method of a welding robot based on an improved whale optimization algorithm according to claim 2, wherein: The method for improving the Whale Optimization Algorithm by integrating multiple strategies includes: Improve the Whale Optimization Algorithm (WOA) by introducing a non-linear inertia weight based on the Gaussian function to obtain the first improved Whale Optimization Algorithm; Improve the Whale Optimization Algorithm (WOA) by introducing a multi-leader mechanism to obtain the second improved Whale Optimization Algorithm; Integrate the first improved Whale Optimization Algorithm and the second improved Whale Optimization Algorithm into the optimal improved Whale Optimization Algorithm through the Stacking framework.
4. A path planning method for a welding robot based on an improved whale optimization algorithm according to claim 3, characterized in that: The construction method of the first improved Whale Optimization Algorithm includes: Set the non-linear inertia weight based on the Gaussian function, and the non-linear inertia weight is: In the formula, w is the non-linear inertia weight, t is the current iteration number, and Max_iter is the maximum iteration number; Apply the non-linear inertia weight to the spiral search and enclosing prey processes in the Whale Optimization Algorithm (WOA) to obtain the first improved Whale Optimization Algorithm, and the first improved Whale Optimization Algorithm is: D1 = |C * X * (t) - X1(t)|; D1′ = |X * (t) - X1(t)|; Wherein, X1(t + 1) is the individual position after the (t + 1)-th iteration of the first improved whale optimization algorithm, X1(t) is the individual position at the current iteration number t of the first improved whale optimization algorithm, and X * (t) is the optimal individual position obtained by the first improved whale optimization algorithm up to the current iteration number t, D1 is the distance between the individual position at the current iteration number t in the encircling prey process of the first improved whale optimization algorithm and X * (t), D1′ is the distance between the individual position at the current iteration number t in the spiral search process of the first improved whale optimization algorithm and X * (t), A and C are correlation coefficients, b is a constant in the spiral equation, l is a random number in [-1, 1], p is a random number in [0, 1], t ∈ [1, Max_iter], t is the current iteration number, and Max_iter is the maximum number of iterations.
5. The path planning method for a welding robot based on an improved whale optimization algorithm according to claim 4, wherein: The construction method of the second improved Whale Optimization Algorithm includes: Sort the fitness values of individuals at the current iteration number t, and select the top K(t) individuals as leaders. The remaining individuals randomly select one of the K(t) leaders as their own leader; Apply the matching relationship between the individual and its own leader to the spiral search and enclosing prey processes in the Whale Optimization Algorithm (WOA) to obtain the second improved Whale Optimization Algorithm, and the second improved Whale Optimization Algorithm is: D2 = |C * X i,leader (t) - X2(t)|; D2′ = |X i,leader (t) - X2(t)|; Where, X2(t + 1) is the individual position after the (t + 1)-th iteration of the second improved whale optimization algorithm, X2(t) is the individual position of the second improved whale optimization algorithm at the current iteration number t, X i,leader (t) is the leader position selected by the individual at the current iteration number t, D2 is the distance between the individual position at the current iteration number t and X i,leader (t) during the encircling prey process of the second improved whale optimization algorithm, D2′ is the distance between the individual position at the current iteration number t and X i,leader (t) during the spiral search process of the second improved whale optimization algorithm, A and C are correlation coefficients, b is a constant in the spiral equation, l is a random number in [-1, 1], p is a random number in [0, 1], t ∈ [1, Max_iter], t is the current iteration number, and Max_iter is the maximum number of iterations.
6. The path planning method of a welding robot based on an improved whale optimization algorithm according to claim 5, characterized in that: The method for integrating the first improved Whale Optimization Algorithm and the second improved Whale Optimization Algorithm through the Stacking framework includes: Integrate X1(t + 1) in the first improved Whale Optimization Algorithm and X2(t + 1) in the second improved Whale Optimization Algorithm through the Stacking framework, and train to obtain the optimal improved Whale Optimization Algorithm for integrating and outputting the optimal updated result of the individual position between X1(t + 1) and X2(t + 1); The optimal improved Whale Optimization Algorithm is: X best (t + 1) = Stacking(X1(t + 1), X2(t + 1)); The loss function for training the optimal improved Whale Optimization Algorithm includes: Consistency loss of individual position update direction: L1 = cos(X best (t + 1) - X best (t), X1(t + 1) - X1(t)) + cos(X best (t + 1) - X best (t), X2(t + 1) - X2(t)); Consistency loss of individual fitness: L2 = |F(X best (t + 1)) - F(X1(t + 1))| + |F(X best (t + 1)) - F(X2(t + 1))|; Where X best (t + 1) is the individual position after the (t + 1)-th iteration output by the optimal improved whale optimization algorithm, X1(t + 1) is the individual position after the (t + 1)-th iteration of the first improved whale optimization algorithm, and X2(t + 1) is the individual position after the (t + 1)-th iteration of the second improved whale optimization algorithm; Let \(L1\) be the consistency loss of the individual position update direction, \(L2\) be the consistency loss of the individual fitness, and \(X\) best (t) be the individual position after the \(t\)-th iteration output by the optimal improved whale optimization algorithm, \(X1(t)\) be the individual position after the \(t\)-th iteration of the first improved whale optimization algorithm, \(X2(t)\) be the individual position after the \(t\)-th iteration of the second improved whale optimization algorithm, \(\cos(\cdot)\) be the cosine similarity operation formula, \(F(\cdot)\) be the fitness operation formula, and \(F(X\) best (t + 1)) be the fitness value corresponding to \(X\) best (t + 1), \(F(X1(t + 1))\) be the fitness value corresponding to \(X1(t + 1)\), \(F(X2(t + 1))\) be the fitness value corresponding to \(X2(t + 1)\), \(t\in[1, Max\_iter]\), \(t\) is the current iteration number, and \(Max\_iter\) is the maximum iteration number.
7. A path planning method for a welding robot based on an improved whale optimization algorithm according to claim 6, characterized in that: Use the optimization objective function of the welding path planning as the fitness calculation formula.
8. A path planning method for a welding robot based on an improved whale optimization algorithm according to claim 7, characterized in that: The number of leaders selected where K(t) is the number of leaders selected at the current iteration number t, K max is the preset maximum value of the number of leaders selected, K min is the preset minimum value of the number of leaders selected, t is the current iteration number, and Max_iter is the maximum number of iterations.
9. A path planning method for a welding robot based on an improved whale optimization algorithm according to claim 8, characterized in that: The four test functions are composed of three unimodal functions and one multimodal function.
10. A welding robot path planning system based on an improved whale optimization algorithm, characterized in that, Applied to the welding robot path planning method based on the improved Whale Optimization Algorithm according to any one of claims 1 - 9, the system includes: A mathematical modeling unit for conducting path planning modeling of the welding robot on the front cover of the automotive engine to obtain the mathematical model of welding path planning; An algorithm improvement unit, which is used to improve the Whale Optimization Algorithm (WOA) by integrating multiple strategies to obtain the optimal improved Whale Optimization Algorithm (GSWOA), and verify the performance of the optimal improved Whale Optimization Algorithm (GSWOA) through four test functions; A path planning unit, which is used to perform path planning on the welding path planning model through the optimal improved Whale Optimization Algorithm (GSWOA) to obtain the optimal welding path on the front cover of the automotive engine.
Citation Information
Patent Citations
Cyclone separator structure parameter setting method based on Gaussian random whale algorithm
CN110737951A
Marine unmanned rescue airship path planning method based on improved whale algorithm
CN115655279A
Multi-strategy cooperative intelligent optimization method and device for vehicle path with load constraint
CN117784623A
Mechanical arm positioning error compensation method based on improved WOA-GA-BP neural network
CN118990515A
Gear fault diagnosis method based on feature fusion and GSWOA-KELM
CN119167183A
Cited By
Air-ground heterogeneous robot collaborative exploration method based on topological graph and hierarchical planning
CN121832621A