Welding path optimization method and system for welding robots based on improved ant lion optimization algorithm
By improving the ant lion optimization algorithm, combining the ant colony and the selfish sheep colony algorithm, dynamic step adjustment strategies are introduced to optimize the path of the welding robot, and the complexity and local optimization problems of path planning in the existing technology are solved, and efficient and accurate welding path optimization is achieved.
Patent Information
- Application Number
- CN202510042746.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2045-01-10
AI Technical Summary
The existing welding robot path optimization technology has path planning complexity, poor initial solution quality, slow algorithm convergence speed, insufficient accuracy, easy to fall into local optimality, difficulty in finding global optimal solutions, and insufficient consideration of welding process constraints.
The improved ant lion optimization algorithm is adopted to generate map coordinates by obtaining preset data sets and target welding joint information, initialize algorithm parameters, combine the ant colony algorithm to determine the optimal initial solution, randomly walk to generate the path, introduce selfish flock algorithm and dynamic step adjustment strategy, and gradually optimize the welding path.
The refined search of welding paths is realized to avoid falling into local optimization, improve the convergence speed and accuracy of the algorithm, find the global optimal solution, and consider welding process constraints.
Smart Images

Figure CN119457629B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of welding robot path optimization, and in particular to a welding robot welding path optimization method and system based on an improved ant lion optimization algorithm. Background Art
[0002] At present, welding robots have become one of the mature automated robots in industrial production. With the continuous development of science and technology and the continuous improvement of production processes, welding robots are also constantly being updated. The main technical indicators such as high performance, high precision, high reliability, and high flexibility have generally been improved. After improving the excellent performance, the application field of welding robots has been continuously expanded. In addition to the traditional automobile manufacturing industry, they can also be widely used in aerospace, machinery manufacturing, electronics, construction and other fields, becoming an indispensable production equipment for manufacturing companies.
[0003] At present, the path optimization technology of welding robots still has defects and shortcomings: the complexity of path planning and the poor quality of the initial solution lead to slow algorithm convergence and insufficient accuracy. Secondly, many optimization algorithms are prone to fall into local optimality and it is difficult to find the global optimal solution. In addition, the existing technology does not take into account the constraints of the welding process. Factors such as welding sequence are often ignored. The real-time and dynamic adaptability are also weak, making it difficult to cope with environmental changes.
[0004] Therefore, how to achieve refined search of welding paths and find the global optimal solution has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] In order to achieve refined search of welding paths and find the global optimal solution, the present application provides a welding path optimization method and system for a welding robot based on an improved ant lion optimization algorithm.
[0006] In the first aspect, the present application provides a welding robot welding path optimization method based on an improved ant lion optimization algorithm, which adopts the following technical solutions:
[0007] A welding path optimization method for a welding robot based on an improved ant lion optimization algorithm, comprising:
[0008] Obtain a preset data set and generate map coordinate information in combination with target welding point information;
[0009] Initialize algorithm parameters according to the map coordinate information;
[0010] Determine the optimal initial solution in the map coordinate information according to the algorithm parameters combined with the ant colony algorithm;
[0011] Using the optimal initial solution as the initial path of the ant lion and generating a first path through a random walk strategy;
[0012] Obtaining the length information of the first path and determining whether it is less than the optimal initial solution;
[0013] If yes, the first path is used as the optimal welding path;
[0014] If not, the selfish flock algorithm is introduced to determine the optimal welding path according to the survival value factor and the attraction factor;
[0015] Determine whether the maximum number of iterations has been reached;
[0016] If it is determined that the maximum number of iterations has not been reached, a dynamic step size adjustment strategy is introduced to adjust the algorithm parameters and the steps of determining the optimal initial solution in the map coordinate information according to the current algorithm parameters combined with the ant colony algorithm are performed;
[0017] If it is determined that the maximum number of iterations has been reached, the current optimal welding path will be used as the output result.
[0018] Optionally, the step of acquiring a preset data set and generating map coordinate information in combination with target welding point information includes:
[0019] Read the four datasets kroA100, att48, oliver30 and eil51 in the TSPTIB dataset as the preset datasets;
[0020] The target welding point information is obtained and the map coordinate information is generated in combination with the preset data set.
[0021] Optionally, the algorithm parameters include:
[0022] The number of ants m, the number of ant lions N, and the pheromone importance factor , heuristic information importance factor , pheromone volatile factors The maximum and minimum values, survival factor , attractiveness factor , step factor and the maximum number of iterations T.
[0023] Optionally, the step of determining the optimal initial solution in the map coordinate information according to the algorithm parameters in combination with an ant colony algorithm includes:
[0024] In the map coordinate information, the pheromone volatility factor in the map coordinate information is adjusted by using an ant colony algorithm combined with a dynamic volatility coefficient adjustment strategy. Make adjustments to determine the optimal initial solution:
[0025] ;
[0026] in, is the minimum value of the pheromone volatility coefficient, is the maximum value of the pheromone volatility coefficient, is the length of the optimal path found by all ants in the current iteration, that is, the shortest path in this iteration, is the length of the longest path found by all ants in the current iteration.
[0027] Optionally, the step of introducing the selfish flock algorithm and determining the optimal welding path according to the survival value factor and the attraction factor includes:
[0028] Introduce the selfish flock algorithm and generate the first random number;
[0029] Generate a first random number, determine whether the first random number is less than a survival factor, and if so, use the first path as an optimal welding path;
[0030] If it is determined that the first random number is greater than or equal to the survival factor, it is determined whether the first random number is less than the attraction factor. If so, the first path is used as the optimal welding path.
[0031] Optionally, the survival factor calculation formula is:
[0032] ;
[0033] in, is the survival value factor, the probability control factor when randomly selecting a suboptimal path; is the sensitivity of the control parameter used to adjust the survival probability; Indicates the length of the new path; Indicates the length of the current path;
[0034] The calculation formula of the attraction factor is:
[0035] ;
[0036] in, The attraction factor determines whether the path moves closer to the high-quality path; is the attraction constant, used to adjust the strength of attraction; is the distance between the new path and the current path.
[0037] Optionally, the step of introducing a dynamic step size adjustment strategy to adjust the algorithm parameters and executing the step of determining the optimal initial solution in the map coordinate information according to the current algorithm parameters in combination with an ant colony algorithm includes:
[0038] Introduce a dynamic step size adjustment strategy to adjust the algorithm parameter step size factor Make adjustments:
[0039] ;
[0040] in, is the step size at the tth iteration, is the initial step length, which indicates the initial random walk distance of the ant or individual in the solution space. is the step size reduction factor, which is set to a value close to 1, indicating that the step size is reduced by a fixed ratio in each iteration, and t is the current number of iterations in the algorithm parameters.
[0041] In a second aspect, the present application provides a welding robot welding path optimization system based on an improved ant lion optimization algorithm, and the welding robot welding path optimization system based on the improved ant lion optimization algorithm includes:
[0042] An information acquisition module, used to acquire a preset data set and generate map coordinate information in combination with target welding point information;
[0043] An initialization module, used to initialize algorithm parameters according to the map coordinate information;
[0044] An optimal initial solution module, used to determine the optimal initial solution in the map coordinate information according to the algorithm parameters combined with the ant colony algorithm;
[0045] A first path module, used to use the optimal initial solution as the initial path of the ant lion and generate a first path through a random walk strategy;
[0046] A length judgment module, used to obtain the length information of the first path and judge whether it is less than the optimal initial solution;
[0047] a welding path module, configured to use the first path as an optimal welding path if yes;
[0048] A factor judgment module is used to introduce a selfish flock algorithm and determine the optimal welding path according to the survival value factor and the attraction factor if no;
[0049] The iteration number judgment module is used to judge whether the maximum number of iterations has been reached;
[0050] A dynamic step-size adjustment strategy module, for introducing a dynamic step-size adjustment strategy to adjust the algorithm parameters and executing the step of determining the optimal initial solution in the map coordinate information according to the current algorithm parameters combined with the ant colony algorithm if it is determined that the maximum number of iterations has not been reached;
[0051] The output result module is used to output the current optimal welding path as the output result if it is determined that the maximum number of iterations has been reached.
[0052] In a third aspect, the present application provides a computer device, comprising: a memory and a processor, wherein the processor executes the method described above when running computer instructions stored in the memory.
[0053] In a fourth aspect, the present application provides a computer-readable storage medium, comprising instructions, which, when executed on a computer, enable the computer to execute the method described above.
[0054] In summary, the present application includes the following beneficial technical effects:
[0055] This application obtains a preset data set to generate map coordinate information; initializes algorithm parameters according to the map coordinate information; combines the ant colony algorithm to determine the optimal initial solution in the map coordinate information; uses the optimal initial solution as the initial path of the ant lion and generates the first path through a random walk strategy; introduces a selfish flock algorithm and determines the optimal welding path according to the survival value factor and the attraction factor; determines whether the maximum number of iterations has been reached; introduces a dynamic step adjustment strategy to adjust the algorithm parameters and determine the steps of the optimal initial solution; if it is determined that the maximum number of iterations has been reached, the current optimal welding path is used as the output result. Introduce attraction factors and survival value factors to adjust the path, and dynamically adjust the step factor to gradually reduce the search range, avoid falling into the local optimum, and achieve a refined search for the welding path. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 It is a schematic diagram of the computer device structure of the hardware operating environment involved in the embodiment of the present application;
[0057] Figure 2 It is a flow chart of the first embodiment of the welding path optimization method of a welding robot based on the improved ant lion optimization algorithm of the present application;
[0058] Figure 3 It is a comparative schematic diagram of the convergence curve of the att48 data set in the first embodiment of the welding path optimization method of the welding robot based on the improved ant lion optimization algorithm of the present application;
[0059] Figure 4 This is a schematic diagram of the comparison of the convergence curves of the eil51 data set of the first embodiment of the welding path optimization method for a welding robot based on the improved ant lion optimization algorithm of the present application;
[0060] Figure 5 This is a schematic diagram of the comparison of the convergence curves of the kroA100 data set of the first embodiment of the welding path optimization method for a welding robot based on the improved ant lion optimization algorithm of the present application;
[0061] Figure 6This is a schematic diagram of the comparison of the convergence curves of the oliver30 data set of the first embodiment of the welding path optimization method for a welding robot based on the improved ant lion optimization algorithm of the present application;
[0062] Figure 7 This is the PCB board circuit diagram of the first implementation of the welding robot welding path optimization method based on the improved ant lion optimization algorithm of this application;
[0063] Figure 8 This is the first implementation of the PCB board solder point scatter diagram of the welding robot welding path optimization method based on the improved ant lion optimization algorithm of this application;
[0064] Fig. 9 It is the best path diagram of the conventional ant lion algorithm in the PCB board solder joint instance of the first embodiment of the welding robot welding path optimization method based on the improved ant lion optimization algorithm of the present application;
[0065] Fig.10 This is the first embodiment of the welding robot welding path optimization method based on the improved ant lion optimization algorithm of the present application, which is the best path diagram of the PCB board solder joint instance of the improved ant lion optimization algorithm;
[0066] Fig.11 This is a schematic diagram of the comparison of convergence curves of four algorithms in a PCB solder joint example in the first embodiment of the welding robot welding path optimization method based on the improved ant lion optimization algorithm of the present application;
[0067] Fig.12 It is a structural block diagram of the first embodiment of the welding robot welding path optimization system based on the improved ant lion optimization algorithm of the present application. DETAILED DESCRIPTION
[0068] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below through the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0069] Reference Figure 1 , Figure 1 A schematic diagram of the computer device structure of the hardware operating environment involved in the embodiment of the present application.
[0070] like Figure 1As shown, the computer device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM), or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk storage. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0071] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the computer device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0072] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a welding robot welding path optimization program based on an improved ant lion optimization algorithm.
[0073] exist Figure 1 In the computer device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the present application can be set in the computer device, and the computer device calls the welding robot welding path optimization program based on the improved ant lion optimization algorithm stored in the memory 1005 through the processor 1001, and executes the welding robot welding path optimization method based on the improved ant lion optimization algorithm provided in the embodiment of the present application.
[0074] The present application embodiment provides a welding robot welding path optimization method based on an improved ant lion optimization algorithm, referring to Figure 2 , Figure 2 This is a flow chart of the first embodiment of the welding path optimization method for a welding robot based on the improved ant lion optimization algorithm of the present application.
[0075] In this embodiment, the welding path optimization method of the welding robot based on the improved ant lion optimization algorithm includes the following steps:
[0076] Step S10: Obtain a preset data set and generate map coordinate information in combination with target welding point information.
[0077] It should be noted that the step of obtaining a preset data set and generating map coordinate information in combination with the target solder joint information includes: reading the four data sets of kroA100, att48, oliver30 and eil51 in the TSPTIB data set as preset data sets; obtaining the target solder joint information and generating map coordinate information in combination with the preset data set.
[0078] Step S20: Initialize algorithm parameters according to map coordinate information.
[0079] It can be understood that the algorithm parameters include: the number of ants m, the number of ant lions N, the pheromone importance factor , heuristic information importance factor , pheromone volatile factors The maximum and minimum values, survival factor , attractiveness factor , step factor and the maximum number of iterations T.
[0080] Step S30: Determine the optimal initial solution in the map coordinate information according to the algorithm parameters combined with the ant colony algorithm.
[0081] In a specific implementation, the step of determining the optimal initial solution in the map coordinate information according to the algorithm parameters combined with the ant colony algorithm includes: adjusting the pheromone volatility factor in the map coordinate information by using the ant colony algorithm combined with the dynamic volatility coefficient adjustment strategy in the map coordinate information. Make adjustments to determine the optimal initial solution:
[0082] ;
[0083] in, is the minimum value of the pheromone volatility coefficient, is the maximum value of the pheromone volatility coefficient, is the length of the optimal path found by all ants in the current iteration, that is, the shortest path in this iteration, is the length of the longest path found by all ants in the current iteration.
[0084] In the specific implementation, combined with the ant colony algorithm, each ant selects the next unvisited city based on the pheromone concentration and heuristic information on the current path until all cities are traversed and a complete path is generated. By calculating the total length of each path and dynamically adjusting the pheromone concentration on the path, the ants with shorter paths will leave more pheromones on the path, thereby guiding other ants to the optimal initial solution.
[0085] In a specific implementation, step S30 further includes:
[0086] (1) Ant path construction and selection mechanism
[0087] When the ant chooses the next city, it uses the following formula based on a comprehensive consideration of pheromones and heuristic information. The ant will calculate the selection probability of each unvisited city based on this formula. The higher the pheromone concentration and the closer the city is, the greater the probability of the path being selected. This allows the algorithm to use historical experience to guide the selection of a better path while exploring new paths.
[0088] ;
[0089] In the formula, represents the set of cities that ant k is allowed to choose next. The taboo table records the cities that ant k has currently visited. When all n cities are added to the taboo table, ant k has completed a tour, and the path that ant k has traveled is a feasible solution to the TSP problem. is a heuristic factor that indicates the expected degree of ant migration from city i to city j. In the ant colony algorithm, Usually the inverse of the distance between city i and city j is taken. and Respectively represent the relative importance of pheromone and expectation heuristic factors.
[0090] (2) Pheromone renewal mechanism
[0091] Pheromone update is the core of the ant colony algorithm. According to the following formula, pheromone evaporates over time (given by the volatility coefficient control) to prevent all ants from over-concentrating on certain paths. Each ant Update the pheromones on the path passed. The shorter the path, the more pheromones the ants leave behind, thus encouraging subsequent ants to choose shorter paths. This mechanism can guide the algorithm to gradually converge to the optimal path. When all ants complete a tour, the pheromones on each path are updated according to the following formula:
[0092] ;
[0093] In the formula, (0< <1) indicates the evaporation coefficient of pheromone on the path, represents the persistence coefficient of pheromone; It represents the increment of pheromone on edge ij in this iteration. The relevant calculation is as follows:
[0094] ;
[0095] in represents the amount of pheromone that the kth ant leaves on edge ij in this iteration. If ant k does not pass through edge ij, then =0; It can be expressed as:
[0096] ;
[0097] in is a positive constant, It represents the length of the path traveled by the kth ant in this tour.
[0098] (3) Dynamic volatility coefficient adjustment strategy
[0099] Dynamic volatility coefficient adjustment is an important improvement in this embodiment in optimizing the initial solution. It aims to dynamically adjust the pheromone volatility rate according to the change of the current path quality, so as to better balance global exploration and local development. This part of the mechanism adjusts the pheromone volatility coefficient , controlling the dissipation speed of pheromones, ensuring that historical information can be flexibly maintained or eliminated in different optimization stages, thereby improving the performance of the algorithm.
[0100] In the classic ant colony algorithm, the volatility coefficient is a fixed value, usually between 0 and 1. The volatilization of pheromones is used to simulate the process of information forgetting, to prevent the selection advantage of a certain path from becoming absolute too early. If pheromones evaporate too quickly, it will be difficult to accumulate historical information, and ants will not be able to make full use of the existing high-quality path information, which will affect the convergence speed. If pheromones evaporate too slowly, the early pheromones will be retained, which may cause the later ants to be too concentrated on some suboptimal paths, thus falling into the local optimum. To solve this problem, the code adopts a dynamic volatilization coefficient adjustment mechanism to make the volatilization coefficient Automatically changes according to the quality of the current path. Its adjustment is:
[0101] ;
[0102] in, is the minimum value of the pheromone volatility coefficient, is the maximum value of the pheromone volatility coefficient. These two values control the upper and lower limits of the volatility coefficient. The corresponding values set in this embodiment are =0.1, =0.5.
[0103] It is the length of the optimal path found by all ants in the current iteration, that is, the shortest path in this iteration. is the length of the longest path found by all ants in the current iteration. is the dynamically adjusted volatility coefficient, which is calculated based on the change in path quality in the current iteration.
[0104] when near , it means that the path quality of all ants in this iteration is not much different. near , which means that the pheromone evaporates faster. This can encourage ants to explore new paths more extensively in the next iteration and prevent the algorithm from focusing too much on suboptimal solutions in the early stages.
[0105] when Much smaller than When , it means that the quality of the paths found by some ants in this iteration is significantly better than other paths. near , indicating that pheromones evaporate more slowly, so that more pheromones on high-quality paths can be retained, guiding subsequent ants to choose these high-quality paths more frequently, thereby accelerating the convergence of the algorithm.
[0106] Through this dynamic adjustment, the algorithm can maintain a large volatility coefficient in the initial stage ( larger), encouraging ants to explore more different paths; in the later stage, when high-quality paths gradually emerge, the volatility coefficient decreases ( Small), which helps to retain the pheromones of high-quality paths and gradually converge to the optimal solution.
[0107] Step S40: taking the optimal initial solution as the initial path of the ant lion and generating a first path through a random walk strategy.
[0108] In the specific implementation, the optimal initial solution obtained by the fusion ant colony algorithm is used as the initial path of the ant lion, and the random walk process is started based on this solution. The ant lion starts from the starting position of the current path and performs random movements in sequence to generate a new path. First, a step length array containing random directions is generated from the current starting point, with the direction being -1 or 1, indicating movement to the left or right. Then, the ant lion updates the position of the next step according to the step length to ensure that the moving position is within the specified boundary range. Through the loop, each step of movement will add the new position to the path, and finally form a complete random path. This path generation strategy allows ant lion individuals to conduct global exploration in the solution space, helping the algorithm avoid local optimality.
[0109] It should be noted that in each iteration, the antlion generates a new path based on random walk. After generating the new path, its length is first calculated. If the length of the new path is less than the length of the current path, the current path is directly replaced by the new path. If the length of the new path is longer, but it is determined by the survival value factor or the attraction factor, it is still possible to accept this new path, thereby increasing the diversity of the path and preventing the algorithm from falling into the local optimal solution too early.
[0110] In practice, the traps made by ant lions affect the routes of ants' random walks. To mathematically model this hypothesis:
[0111] ;
[0112] Where: is the minimum value of all variables at the tth iteration, is the maximum value of all variables at the tth iteration, is the minimum value of all variables of the ith ant. is the position of the selected j-th ant lion at the t-th iteration. The above formula shows that the ant walks randomly in a hypersphere defined by vectors c and d, which surrounds a selected ant lion.
[0113] Antlions are able to build traps based on their own adaptability, while ants need to move randomly. However, when antlions find an ant in the trap, they spray sand into the center of the pit. This behavior slides off trapped ants that try to escape. To mathematically model this behavior, the radius of the ant's random walk hypersphere is adaptively reduced. The following formula is proposed in this regard:
[0114] ;
[0115] in, is an adaptive coefficient, and , W can adjust the precision level of local development.
[0116] ;
[0117] ;
[0118] By introducing the adaptive coefficient, the radius of the ant position update is reduced and the sliding process of the ant in the pit is simulated, thus ensuring the full utilization of the search space.
[0119] Step S50: Obtain the length information of the first path and determine whether it is less than the optimal initial solution.
[0120] It should be noted that in each iteration, the antlion generates a new path based on random walk. After generating the new path, its length is first calculated. If the length of the new path is less than the length of the current path, the current path is directly replaced by the new path. If the length of the new path is longer, but the survival factor is or attraction factor It is still possible to accept this new path, thereby increasing the diversity of paths and preventing the algorithm from falling into a local optimal solution too early.
[0121] The path is updated as follows:
[0122] ;
[0123] in: To describe the probability of path update decision, probabilistic decision is made based on path length comparison, attraction factor and survival factor; rand() is a random number generation function, which usually generates a random number between 0 and 1. By comparing this random number with the threshold of attraction factor or survival factor, it decides whether to update the current path.
[0124] Step S60: If yes, the first path is used as the optimal welding path.
[0125] Step S70: If not, the selfish flock algorithm is introduced to determine the optimal welding path according to the survival value factor and the attraction factor.
[0126] In a specific implementation, the steps of introducing a selfish herd algorithm and determining the optimal welding path based on a survival value factor and an attraction factor include: introducing a selfish herd algorithm and generating a first random number; generating a first random number, determining whether the first random number is less than the survival factor, and if so, taking the first path as the optimal welding path; if it is determined that the first random number is greater than or equal to the survival factor, determining whether the first random number is less than the attraction factor, and if so, taking the first path as the optimal welding path.
[0127] It should be noted that the calculation formula of the survival factor is:
[0128] ;
[0129] in, is the survival value factor, the probability control factor when randomly selecting a suboptimal path; is the sensitivity of the control parameter used to adjust the survival probability; Indicates the length of the new path; Indicates the length of the current path; The calculation formula of the attraction factor is:
[0130] ;
[0131] in, The attraction factor determines whether the path moves closer to the high-quality path; is the attraction constant, used to adjust the strength of attraction; is the distance between the new path and the current path.
[0132] It should be noted that in order to maintain the global search capability of the algorithm and avoid falling into the local optimal solution, this embodiment introduces the survival value factor When the length of the new path generated is greater than the current path, a random number is first generated and multiplied by the survival factor Compare. If the random number is less than the survival factor , then the poor new path is retained with a certain random probability. Through this mechanism, the diversity of the population can be maintained, and the algorithm can be prevented from converging to the local optimum too early, which helps to better converge to the global optimal solution. This embodiment introduces the attraction factor Even if the new path is not as good as the current path, by generating a random number with the attraction factor Compare. If the random number is less than the attraction factor , then there is a certain probability to accept this new path. Through this strategy, the diversity of path updates can be increased, thereby enhancing the global search ability of the algorithm and improving the quality of the final solution.
[0133] Step S80: Determine whether the maximum number of iterations has been reached.
[0134] Step S90: If it is determined that the maximum number of iterations has not been reached, a dynamic step size adjustment strategy is introduced to adjust the algorithm parameters and a step of determining the optimal initial solution in the map coordinate information based on the current algorithm parameters combined with the ant colony algorithm is performed.
[0135] In a specific implementation, the steps of introducing a dynamic step size adjustment strategy to adjust the algorithm parameters and executing the steps of determining the optimal initial solution in the map coordinate information according to the current algorithm parameters combined with the ant colony algorithm include: introducing a dynamic step size adjustment strategy, adjusting the algorithm parameter step size factor Make adjustments:
[0136] ;
[0137] in, is the step size at the tth iteration, is the initial step length, which indicates the initial random walk distance of the ant or individual in the solution space. is the step size reduction factor, which is set to a value close to 1, indicating that the step size is reduced by a fixed ratio each iteration, and t is the current number of iterations in the algorithm parameters.
[0138] Step S100: If it is determined that the maximum number of iterations has been reached, the current optimal welding path is used as the output result.
[0139] In the specific implementation, this embodiment is compared with the ALO algorithm, the ACO algorithm and the SHO algorithm, and the kroA100, att48, oliver30 and eil51 data sets in the TSPLIB data set are used. The operating environment of the comparative test is the Windows 10 system, the test platform is PyCharm, the number of iterations is 200, and the number of tests is 20. Table 1 lists the maximum, minimum, average and average convergence times of the two algorithms on the test data set. The minimum value is used to evaluate the ability of the algorithm to solve the optimal solution.
[0140] Table 1 Comparison results of 20 test data sets
[0141]
[0142] As can be seen from Table 1, in the test of four data sets, kroA100, att48, oliver30 and eil51, the IALO algorithm performs best compared with the ALO algorithm, ACO algorithm and SHO algorithm in terms of the convergence speed in solving the optimal value and the problem solving process, and the optimization effect is significant. The convergence curves of the four algorithms on the four data sets are shown in Figure 1. Figure 3 , Figure 4 , Figure 5 and Figure 6 shown.
[0143] from Figure 3 , Figure 4 , Figure 5 and Figure 6 It can be clearly seen that the ALO algorithm has poor optimization ability and slow convergence speed; the ACO algorithm is prone to fall into local optimality and has average convergence speed; the SHO algorithm has poor convergence speed, and the IALO algorithm makes up for the shortcomings of the ALO algorithm, ACO algorithm and SHO algorithm. With the increase of the scale and complexity of the data set, the performance gap between the four algorithms in solving different problems is further increased. In general, the IALO algorithm has better optimization effect than the ALO algorithm, ACO algorithm and SHO algorithm.
[0144] In order to better verify the feasibility of the above results in PCB solder joint path optimization, a PCB board such as Figure 7 Assume that the lower left corner of the circuit board is the origin of the coordinates, obtain the coordinate information of the 31 solder joints on the PCB through Altium Designer, and obtain the solder joint scatter diagram through Python code as shown below: Figure 8 shown.
[0145] The ALO algorithm and IALO algorithm were used to experiment on solder joints, and the path diagrams of the two algorithms were obtained as shown in the figure. Fig. 9 and Fig.10 shown.
[0146] Depend on Fig. 9 and Fig.10 It can be seen that the optimal path of the IALO algorithm is obviously more orderly and regular than the optimal path of the ACO algorithm. In order to more directly compare the feasibility of the algorithm, this paper conducts a comparative experiment on the soldering path of the PCB solder joints using the IALO algorithm, the ALO algorithm, the ACO algorithm and the SHO algorithm. The number of comparative experiments is 20 times. Table 2 records the maximum, minimum, average, average number of iterations and variance of the four algorithms. The convergence curves are compared as shown in Figure 2. Fig.11 shown.
[0147] Table 2 Comparison of algorithm results
[0148]
[0149] Variance indicates the stability of the algorithm when solving problems. The smaller the variance, the better the stability of the algorithm when solving problems. It can be clearly seen from Table 2 above that the variance of the IALO algorithm is the smallest, so it can be concluded that the optimization performance of the IALO algorithm is more stable than the other three algorithms. Fig.11 It can be seen that in the PCB solder joint example, the IALO algorithm has better optimization effect and faster convergence speed than the ALO algorithm, ACO algorithm and SHO algorithm, and is significantly better than the other three algorithms.
[0150] This embodiment obtains a preset data set to generate map coordinate information; initializes algorithm parameters according to the map coordinate information; determines the optimal initial solution in combination with the ant colony algorithm; uses the optimal initial solution as the initial path of the ant lion and generates the first path through a random walk strategy; introduces a selfish flock algorithm and determines the optimal welding path according to the survival value factor and the attraction factor; determines whether the maximum number of iterations has been reached; introduces a dynamic step adjustment strategy to adjust the algorithm parameters and determine the optimal initial solution; and uses the current optimal welding path as the output result if it is determined that the maximum number of iterations has been reached. The attraction factor and the survival value factor are introduced to adjust the path, and the step factor is dynamically adjusted to gradually reduce the search range, avoid falling into the local optimum, and realize a refined search of the welding path.
[0151] In addition, an embodiment of the present application also proposes a computer-readable storage medium, on which is stored a program for optimizing the welding path of a welding robot based on an improved ant lion optimization algorithm. When the program for optimizing the welding path of a welding robot based on the improved ant lion optimization algorithm is executed by a processor, the steps of the method for optimizing the welding path of a welding robot based on the improved ant lion optimization algorithm as described above are implemented.
[0152] Reference Fig.12 , Fig.12 This is a structural block diagram of the first embodiment of the welding robot welding path optimization system based on the improved ant lion optimization algorithm of this application.
[0153] like Fig.12 As shown, the welding robot welding path optimization system based on the improved ant lion optimization algorithm proposed in the embodiment of the present application includes:
[0154] The information acquisition module 10 is used to acquire a preset data set and generate map coordinate information in combination with target welding point information;
[0155] Initialization module 20, used to initialize algorithm parameters according to map coordinate information;
[0156] The optimal initial solution module 30 is used to determine the optimal initial solution in the map coordinate information according to the algorithm parameters combined with the ant colony algorithm;
[0157] A first path module 40, configured to use the optimal initial solution as the initial path of the ant lion and generate a first path through a random walk strategy;
[0158] A length determination module 50, configured to obtain the length information of the first path and determine whether it is less than the optimal initial solution;
[0159] A welding path module 60, for taking the first path as the optimal welding path if yes;
[0160] A factor judgment module 70 is used to introduce a selfish flock algorithm and determine the optimal welding path according to the survival value factor and the attraction factor if no;
[0161] The iteration number determination module 80 is used to determine whether the maximum iteration number has been reached;
[0162] The dynamic step length adjustment strategy module 90 is used to introduce the dynamic step length adjustment strategy to adjust the algorithm parameters and perform the steps of determining the optimal initial solution in the map coordinate information according to the current algorithm parameters combined with the ant colony algorithm if it is determined that the maximum number of iterations has not been reached;
[0163] The output result module 100 is used to output the current optimal welding path as the output result if it is determined that the maximum number of iterations has been reached.
[0164] It should be understood that the above is only an example and does not constitute any limitation on the technical solution of the present application. In specific applications, technicians in this field can make settings as needed, and the present application does not impose any limitation on this.
[0165] This embodiment obtains a preset data set to generate map coordinate information; initializes algorithm parameters according to the map coordinate information; determines the optimal initial solution in combination with the ant colony algorithm; uses the optimal initial solution as the initial path of the ant lion and generates the first path through a random walk strategy; introduces a selfish flock algorithm and determines the optimal welding path according to the survival value factor and the attraction factor; determines whether the maximum number of iterations has been reached; introduces a dynamic step adjustment strategy to adjust the algorithm parameters and determine the optimal initial solution; and uses the current optimal welding path as the output result if it is determined that the maximum number of iterations has been reached. The attraction factor and the survival value factor are introduced to adjust the path, and the step factor is dynamically adjusted to gradually reduce the search range, avoid falling into the local optimum, and realize a refined search of the welding path.
[0166] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present application. In practical applications, technicians in this field can select part or all of it according to actual needs to achieve the purpose of the present embodiment, and no limitation is made here.
[0167] In addition, for technical details not described in detail in this embodiment, please refer to the method for optimizing the welding path of a welding robot based on the improved ant lion optimization algorithm provided in any embodiment of the present application, which will not be repeated here.
[0168] In addition, it should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0169] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0170] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory (ROM) / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.
[0171] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A welding path optimization method for a welding robot based on an improved ant lion optimization algorithm, characterized in that: include: Obtain a preset data set and generate map coordinate information in combination with target welding point information; Initialize algorithm parameters according to the map coordinate information; Determine the optimal initial solution in the map coordinate information according to the algorithm parameters combined with the ant colony algorithm; Using the optimal initial solution as the initial path of the ant lion and generating a first path through a random walk strategy; Obtaining the length information of the first path and determining whether it is less than the optimal initial solution; If yes, the first path is used as the optimal welding path; If not, the selfish flock algorithm is introduced to determine the optimal welding path according to the survival value factor and the attraction factor; Determine whether the maximum number of iterations has been reached; If it is determined that the maximum number of iterations has not been reached, a dynamic step size adjustment strategy is introduced to adjust the algorithm parameters and the steps of determining the optimal initial solution in the map coordinate information according to the current algorithm parameters combined with the ant colony algorithm are performed; If it is determined that the maximum number of iterations has been reached, the current optimal welding path is used as the output result; The step of introducing the selfish flock algorithm and determining the optimal welding path according to the survival value factor and the attraction factor includes: Introduce the selfish flock algorithm and generate the first random number; Generate a first random number, determine whether the first random number is less than a survival value factor, and if so, use the first path as an optimal welding path; If it is determined that the first random number is greater than or equal to the survival value factor, whether the first random number is less than the attraction factor is determined, and if so, the first path is used as the optimal welding path; The calculation formula of the survival value factor is: ; in, is the survival value factor, the probability control factor when randomly selecting a suboptimal path; is the sensitivity of the control parameter used to adjust the survival probability; Indicates the length of the new path; Indicates the length of the current path; The calculation formula of the attraction factor is: ; in, The attractiveness factor determines whether the path moves closer to the high-quality path; is the attraction constant, used to adjust the strength of attraction; is the distance between the new path and the current path; The step of introducing a dynamic step size adjustment strategy to adjust the algorithm parameters and executing the step of determining the optimal initial solution in the map coordinate information according to the current algorithm parameters combined with the ant colony algorithm includes: Introduce a dynamic step size adjustment strategy to reduce the step size of the algorithm parameters by a factor of Make adjustments: ; in, is the step size at the tth iteration, is the initial step length, which indicates the initial random walk distance of the ant or individual in the solution space. is the step size reduction factor, which is set to a value close to 1, indicating that the step size is reduced by a fixed ratio in each iteration, and t is the current number of iterations in the algorithm parameters.
2. The welding path optimization method of a welding robot based on an improved ant lion optimization algorithm according to claim 1, characterized in that: The step of acquiring a preset data set and generating map coordinate information in combination with target welding point information includes: Read the four datasets kroA100, att48, oliver30 and eil51 in the TSPTIB dataset as the preset datasets; The target welding point information is obtained and the map coordinate information is generated in combination with the preset data set.
3. The welding path optimization method of a welding robot based on an improved ant lion optimization algorithm according to claim 1, characterized in that: The algorithm parameters include: The number of ants m, the number of ant lions N, and the pheromone importance factor , heuristic information importance factor , pheromone volatile factors The maximum and minimum values, survival factor , attractiveness factor , step size reduction factor and the maximum number of iterations T.
4. The welding path optimization method of a welding robot based on an improved ant lion optimization algorithm according to claim 3 is characterized in that: The step of determining the optimal initial solution in the map coordinate information according to the algorithm parameters in combination with the ant colony algorithm comprises: In the map coordinate information, the pheromone volatility factor in the map coordinate information is adjusted by an ant colony algorithm combined with a dynamic volatility coefficient adjustment strategy. Make adjustments to determine the optimal initial solution; ; in, is the minimum value of the pheromone volatility coefficient, is the maximum value of the pheromone volatility coefficient, is the length of the optimal path found by all ants in the current iteration, that is, the shortest path in this iteration, is the length of the longest path found by all ants in the current iteration.
5. A welding robot welding path optimization system based on an improved ant lion optimization algorithm, characterized in that: Executing the method according to claim 1, the welding robot welding path optimization system based on the improved ant lion optimization algorithm comprises: An information acquisition module, used to acquire a preset data set and generate map coordinate information in combination with target welding point information; An initialization module, used to initialize algorithm parameters according to the map coordinate information; An optimal initial solution module, used to determine the optimal initial solution in the map coordinate information according to the algorithm parameters combined with the ant colony algorithm; A first path module, used to use the optimal initial solution as the initial path of the ant lion and generate a first path through a random walk strategy; A length judgment module, used to obtain the length information of the first path and judge whether it is less than the optimal initial solution; a welding path module, configured to use the first path as an optimal welding path if yes; A factor judgment module is used to introduce a selfish flock algorithm and determine the optimal welding path according to the survival value factor and the attraction factor if no; The iteration number judgment module is used to judge whether the maximum number of iterations has been reached; A dynamic step-size adjustment strategy module, for introducing a dynamic step-size adjustment strategy to adjust the algorithm parameters and executing the step of determining the optimal initial solution in the map coordinate information according to the current algorithm parameters combined with the ant colony algorithm if it is determined that the maximum number of iterations has not been reached; The output result module is used to output the current optimal welding path as the output result if it is determined that the maximum number of iterations has been reached.
6. A computer device, characterized in that: The device comprises: a memory and a processor, wherein the processor executes the method according to any one of claims 1 to 4 when running computer instructions stored in the memory.
7. A computer-readable storage medium, characterized in that: The method comprises instructions, which, when executed on a computer, cause the computer to execute the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Multi-unmanned aerial vehicle cooperative airway planning method based on improved sheep flock algorithm
CN111813144A
Shortest path planning method based on improved ant colony algorithm
CN113850423A
Path planning and welding control method, device and equipment for welding robot
CN118989777A