A Tracking Method for Electric Robots Based on an Improved Ant Colony Algorithm
By improving the gridding and multi-step search strategy of the ant colony algorithm, the path selection is optimized, solving the problems of path planning complexity and smoothness in the 3D electric robot environment, and realizing efficient and safe path planning.
Patent Information
- Application Number
- CN202411805514.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-12-10
AI Technical Summary
Traditional path planning algorithms suffer from high computational complexity, poor path quality, and insufficient obstacle handling capabilities in 3D electric robot environments. Ant colony algorithms, on the other hand, have slow convergence speed, insufficient path smoothness, and poor adaptability to high dimensions, making it difficult to meet the requirements of real-time performance and path smoothness.
An improved ant colony algorithm is adopted. By rasterizing the three-dimensional space, a multi-step search strategy and inflection point parameters are introduced. Combined with pheromone update rules, path selection is optimized, and step size and path smoothness are dynamically adjusted to enhance global search capabilities.
It improves the accuracy and efficiency of path planning, ensuring that robots can perform tasks safely and effectively in complex environments, reducing sharp turns, shortening path length, enhancing path smoothness and convergence speed, and meeting real-time requirements.
Smart Images

Figure CN119762692B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent control technology for electric robots, specifically relating to a line-following method for electric robots based on an improved ant colony algorithm. Background Technology
[0002] With the increasing complexity and intelligence of power systems, power robots are gradually becoming important tools in tasks such as power inspection and maintenance. These robots not only need to possess efficient autonomous navigation capabilities, but also must be able to adapt to various complex and dynamic three-dimensional spatial environments to perform tasks. Therefore, path planning and tracking technology for power robots have become one of their core technologies.
[0003] Traditional path planning methods, such as those based on graph theory, A* algorithm, and Dijkstra's algorithm, have achieved remarkable results in two-dimensional environments. However, with the introduction of three-dimensional environments, especially for electric robots that need to perform tasks in complex indoor, underground, aerial, or power facility environments, these traditional path planning methods face the following challenges:
[0004] (1) High computational complexity: The computational load and complexity of traditional algorithms in three-dimensional space are greatly increased. Especially when the environment is complex and there are a lot of obstacles, the time and resource consumption of path search are significantly increased, making it difficult to meet the real-time requirements.
[0005] (2) Poor path quality: In complex 3D environments, traditional algorithms usually only consider the shortest path or the lowest cost path, but fail to fully consider the smoothness of the path and its impact on the robot. For example, sharp turns in the path may cause the robot to run unstably or impair its working efficiency and safety.
[0006] (3) Insufficient obstacle handling capability: The distribution of obstacles in three-dimensional space is more complex. Traditional algorithms are weak in handling dynamic obstacles and it is difficult to adjust the path in real time to cope with changes in the environment.
[0007] To address the aforementioned problems, Ant Colony Optimization (ACO), an intelligent optimization algorithm that simulates the foraging behavior of ants, has been widely applied in path planning. ACO possesses strong global search capabilities and adaptability, enabling it to find effective paths in complex environments. However, traditional ACO also faces the following challenges in practical applications:
[0008] (1) Slow convergence speed: Traditional ant colony algorithm usually requires a large number of iterations to find the optimal solution and is prone to getting stuck in local optima, resulting in slow convergence speed, which cannot meet the real-time requirements of path planning in practical applications.
[0009] (2) Insufficient path smoothness: Standard ant colony algorithms usually rely only on pheromones and heuristic information to guide path search, ignoring the smoothness of the path, which may generate unnecessary sharp turns in the path and affect the stability of the robot's movement.
[0010] (3) Poor adaptability in high-dimensional space: Ant colony algorithm has poor adaptability in three-dimensional and higher-dimensional space. Especially when there are multiple dynamic obstacles in the environment, the algorithm is prone to low efficiency or even failure due to uneven distribution of pheromones. Summary of the Invention
[0011] The purpose of this invention is to overcome the shortcomings of the existing technology and provide a power robot tracking method based on an improved ant colony algorithm.
[0012] The objective of this invention can be achieved through the following technical solutions:
[0013] This invention provides a method for tracking electric robots based on an improved ant colony algorithm, comprising the following steps:
[0014] Step S1: Establish a three-dimensional spatial environment model, rasterize the three-dimensional spatial environment model to obtain a three-dimensional raster network, and specify the start and end points of the electric robot in the three-dimensional raster network;
[0015] Step S2: Set the initial parameters of the ant colony algorithm, including the current time, the current number of iterations, the maximum number of iterations, the current number of ants, set the pheromone decay factor, the step size of the multi-step strategy, and initialize the pheromone value and heuristic information of each grid in the 3D grid network.
[0016] Step S3: Place each ant at the starting point, use roulette wheel and state transition probability calculation formula to select the next node until the entire path search is completed. During this process, add the nodes that have been visited to the taboo list.
[0017] Step S4: Calculate the pheromone increment of each node on the path to the destination using the pheromone increment formula.
[0018] Step S5: Update the global pheromone using the pheromone update formula based on the pheromone decay factor and the pheromone increment of each node on each path;
[0019] Step S6: Determine whether the maximum number of iterations has been reached. If not, proceed to step S3. If yes, select the optimal path and determine the shortest path for the electric robot based on the optimal path.
[0020] Furthermore, the step of rasterizing the three-dimensional spatial environment model to obtain a three-dimensional raster network includes the following steps:
[0021] A three-dimensional rectangular coordinate system O-XYZ is established based on the three-dimensional spatial environment model;
[0022] Construct a three-dimensional space ABCD-EFGH, where C coincides with the origin O, CD coincides with the X-axis, CG coincides with the Y-axis, and CB coincides with the Z-axis;
[0023] Divide CG into m equal parts along the Y-axis and CB into l equal parts along the Z-axis. Divide the three-dimensional space ABCD-EFGH into n planes. Each plane can be divided into m×m grids, resulting in a three-dimensional grid network of n×m×l grids.
[0024] Furthermore, the heuristic information is as follows:
[0025]
[0026] Where, μ i,j (t) represents the heuristic information from node i to node j in the t-th iteration, d i,j Let d be the Euclidean distance between the current node i and the target node j. j,P Let h be the Euclidean distance from the target node j to the destination node p, and h be the weight coefficient.
[0027] Furthermore, the Euclidean distance calculation formula is as follows:
[0028]
[0029] Where, d i,j Let x be the Euclidean distance from node i to node j. i ,y i ,z i Let (x) be the three-dimensional coordinates of node i, and (x) be the coordinates of node i. j ,y j ,z j ) represents the three-dimensional coordinates of node j.
[0030] Furthermore, the selection of the next node using roulette wheel betting combined with the state transition probability calculation formula includes the following steps:
[0031] Get the set of neighboring nodes S = {1, 2, ..., j} of the current node, where j is the number of each neighboring node;
[0032] Randomly select a random number q between 0 and 1, or q greater than a first preset threshold q. o , 0≤q o If ≤1, then randomly select an adjacent node from the adjacent node set S as the next node;
[0033] If q≤q oThen, the state transition probability p of each adjacent node is calculated according to the state transition probability calculation formula. i,j (t);
[0034] Based on the state transition probability p of each adjacent node i,j (t) Assign a random number interval corresponding to the state transition probability of each neighboring node;
[0035] Generate a random number within a random number interval, determine which random number interval the random number falls into, and take the adjacent node corresponding to that random number interval as the next node.
[0036] Furthermore, the formula for calculating the state transition probability is as follows:
[0037]
[0038] Where, p ij (t) represents the state transition probability from node i to node j in the t-th iteration, τ ij (t) represents the pheromone concentration from node i to node j, μ i,j (t) represents the heuristic information from node i to node j in the t-th iteration, α is the weighting factor of pheromone concentration, β is the weighting factor of heuristic information, and S is the set of neighboring nodes of the current node i.
[0039] Furthermore, step S4 includes the following steps:
[0040] Delete the path of the ants that did not reach the destination;
[0041] Calculate the path length L of the remaining ant m. m ;
[0042] Calculate the angle between every two adjacent nodes i and j along the path of each ant m. If it is an acute angle, then set its inflection point parameter g. mij Assign a value of 3; if it is a right angle, then set its inflection point parameter g. mij Assign a value of 2; if it is an obtuse angle, then set its inflection point parameter g. mij Assign a value of 1; if it is a straight angle, then set its inflection point parameter g. mij The value is assigned to 0;
[0043] Based on the inflection point parameter g between every two adjacent nodes i and j in each ant m's path. mij The inflection point parameter g between every two adjacent nodes i and j in the path of each ant m is... mij The total inflection point parameter G of each ant's m-path is obtained by summing the parameters. m ;
[0044] Based on the length L of each ant's m-path m With the total inflection point parameter value Gm The pheromone increment of each node on each ant's m-path is calculated using the pheromone increment formula.
[0045] Furthermore, the formula for the pheromone increment is:
[0046]
[0047] Where, Δτ ij Let Q be the pheromone increment along path (i, j), where Q is a constant representing the intensity of the pheromone increment, and L is the pheromone increment. m Let m be the length of the ant's path, and G be the length of the path. m Let λ be the total inflection point parameter value of ant m's path, and λ be the weighting coefficient.
[0048] Furthermore, the pheromone update formula is as follows:
[0049] τ ij (t+1)=(1-ρ)·τ ij (t)+Δτ ij
[0050] Where, τ ij (t+1) represents the pheromone concentration of path (i, j) in the (t+1)th iteration, τ ij (t) represents the pheromone concentration of path (i, j) in the t-th iteration, ρ is the pheromone decay factor, and Δτ ij Let be the pheromone increment for path (i, j) in the t-th iteration.
[0051] Furthermore, the improved ant colony algorithm also includes a multi-step search strategy, which includes: setting an initial step size according to the size and complexity of the problem before the search begins; dynamically adjusting the step size during the search process based on information such as the distance between the current position and the target position and the distribution of obstacles; dividing the search space into multiple subspaces, each using a different step size for searching, and utilizing the characteristics of the search space for path optimization.
[0052] Compared with the prior art, the present invention has the following advantages:
[0053] (1) This invention performs path planning by rasterizing the three-dimensional spatial environment model of the electric robot and extending the two-dimensional space to three-dimensional space using the raster method. This technique effectively transforms the complex three-dimensional space into a discretized three-dimensional raster network, enabling the path search process to accurately consider the spatial position and environmental characteristics of each raster, thereby improving the accuracy and operability of path planning. It solves the problem of accurate modeling in three-dimensional path planning, more realistically reflects the working environment of the electric robot, improves the path planning accuracy of the electric robot in complex three-dimensional environments, and ensures that the robot can perform tasks safely and effectively.
[0054] (2) This invention introduces a multi-step search strategy, dynamically adjusting the step size during path search and optimizing it by combining heuristic information, obstacle distribution, and distance to the target location. By dividing the search space and setting different step sizes for each subspace, different regions can be searched more rationally, improving search efficiency. This effectively shortens the path length during the electric robot's line-following process and reduces unnecessary redundant searches. Dynamic step size adjustment makes the algorithm more flexible, automatically optimizing the path search process according to different environmental conditions, thereby improving the efficiency and practicality of path planning.
[0055] (3) This invention incorporates inflection point parameters into the path selection probability formula. By evaluating the sharpness and angle of each turn in the path, the smoothness of the path is used as an important evaluation index for path quality. Especially in complex environments, by reducing sharp turns, the path traveled by the electric robot is made smoother, reducing the number of turns and lowering operational risks. After introducing inflection point parameters, the smoothness of the path is significantly improved, thereby enhancing the stability of the electric robot path, avoiding too many sharp turns in the path, and ensuring the stability and safety of the robot when performing tasks. This optimization measure improves the efficiency of the robot when performing tasks and reduces the mechanical load and potential dangers caused by sharp turns.
[0056] (4) This invention optimizes the convergence speed of the ant colony algorithm by combining global pheromone update rules and local pheromone update strategies. By discarding "lost" ants and periodically clearing the taboo table, computational redundancy is effectively reduced, the algorithm's global search capability is enhanced, and the optimal path is found in a shorter time. This improves the convergence speed of path planning, enabling the electric robot to quickly find the optimal path and meet real-time requirements. By enhancing the global search capability, the occurrence of local optima is avoided, ensuring that the electric robot can find the globally optimal path in complex environments.
[0057] (5) This invention improves the pheromone increment formula of the traditional ant colony algorithm by introducing a path inflection point parameter and considering both path length and smoothness. By evaluating the angle changes of each segment on the path, the pheromone update strategy is adjusted to ensure path quality optimization and avoid generating unsmooth or excessively long paths. This improvement enhances path quality by considering not only path length optimization but also path smoothness, thereby improving the efficiency and safety of the electric robot's movement. By evaluating path angles, sharp turns in the path are reduced, enabling the electric robot to perform tasks more smoothly.
[0058] (6) This invention maps the state transition probability of each adjacent node to a random number interval corresponding to its probability value, assigning each node a different selection weight. This approach avoids the uniformity and limitations of path selection, increasing diversity and flexibility. Through the randomization mechanism (i.e., selecting paths based on probability intervals), the algorithm possesses better exploration capabilities, helping to avoid early convergence or local optima in path search, especially in complex or dynamically changing environments, where it can effectively explore new possible paths. By combining random number intervals and transition probabilities, the path selection strategy can be dynamically adjusted, ensuring that each selection has a certain degree of randomness and flexibility. This flexible selection method avoids getting trapped in local optima due to pheromone concentration on certain paths, maintaining the breadth and globality of the search. It enhances global search capabilities, avoids common local optima in path search, and increases the likelihood of the electric robot finding the globally optimal path during the tracking process, making it particularly suitable for complex and dynamic environments.
[0059] (7) The heuristic information of this invention combines the Euclidean distance between the current node and the target node with the distance from the target node to the destination, enabling path selection to consider not only the direct distance between the current node and the next node, but also the overall direction of the path to the target. This design effectively guides path selection toward the target area, reducing invalid paths and unnecessary deviations. It enhances the guidance of path selection, helps the electric robot quickly approach the target, reduces invalid searches, and thus improves tracking efficiency and accuracy. Attached Figure Description
[0060] Figure 1 This is a flowchart of the method of the present invention;
[0061] Figure 2 This is a schematic diagram of the three-dimensional grid network division of the three-dimensional environment of the present invention;
[0062] Figure 3 This is a flowchart of the improved ant colony algorithm of the present invention;
[0063] Figure 4 The image shows the simulation results of the traditional ant colony algorithm in Example 2.
[0064] Figure 5 The figure shows the simulation results of the present invention in Example 2. Detailed Implementation
[0065] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0066] Example 1:
[0067] This embodiment provides a method for tracking electric robots based on an improved ant colony algorithm, such as... Figure 1 As shown, it includes the following steps:
[0068] Step S1: Establish a three-dimensional spatial environment model, rasterize the three-dimensional spatial environment model to obtain a three-dimensional raster network, and specify the start and end points of the electric robot in the three-dimensional raster network;
[0069] Step S2: Set the initial parameters of the ant colony algorithm, including the current time, the current number of iterations, the maximum number of iterations, the current number of ants, set the pheromone decay factor, the step size of the multi-step strategy, and initialize the pheromone value and heuristic information of each grid in the 3D grid network.
[0070] Step S3: Place each ant at the starting point, use roulette wheel and state transition probability calculation formula to select the next node until the entire path search is completed. During this process, add the nodes that have been visited to the taboo list.
[0071] Step S4: Calculate the pheromone increment of each node on the path to the destination using the pheromone increment formula.
[0072] Step S5: Update the global pheromone using the pheromone update formula based on the pheromone decay factor and the pheromone increment of each node on each path;
[0073] Step S6: Determine if the maximum number of iterations has been reached. If not, proceed to step S3. If yes, select the optimal path and determine the shortest path for the electric robot based on the optimal path.
[0074] The process of rasterizing the 3D spatial environment model to obtain a 3D raster network includes the following steps:
[0075] A three-dimensional rectangular coordinate system O-XYZ is established based on the three-dimensional spatial environment model;
[0076] Construct a three-dimensional space ABCD-EFGH, where C coincides with the origin O, CD coincides with the X-axis, CG coincides with the Y-axis, and CB coincides with the Z-axis;
[0077] Divide CG into m equal parts along the Y-axis and CB into l equal parts along the Z-axis. Divide the three-dimensional space ABCD-EFGH into n planes. Each plane can be divided into m×m grids, resulting in a three-dimensional grid network of n×m×l grids.
[0078] The heuristic information is as follows:
[0079]
[0080] Where, μ i,j (t) represents the heuristic information from node i to node j in the t-th iteration, d i,j Let d be the Euclidean distance between the current node i and the target node j. j,P Let h be the Euclidean distance from the target node j to the destination node p, and h be the weight coefficient.
[0081] The Euclidean distance is calculated as follows:
[0082]
[0083] Where, d i,j Let x be the Euclidean distance from node i to node j. i ,y i ,z i Let (x) be the three-dimensional coordinates of node i, and (x) be the coordinates of node i. j ,y j ,z j ) represents the three-dimensional coordinates of node j.
[0084] The selection of the next node using roulette wheel betting combined with the state transition probability calculation formula includes the following steps:
[0085] Get the set of neighboring nodes S = {1, 2, ..., j} of the current node, where j is the number of each neighboring node;
[0086] Randomly select a random number q between 0 and 1, or q greater than a first preset threshold q. o , 0≤q o If ≤1, then randomly select an adjacent node from the adjacent node set S as the next node;
[0087] If q≤q o Then, the state transition probability p of each adjacent node is calculated according to the state transition probability calculation formula. i,j (t);
[0088] Based on the state transition probability p of each adjacent node i,j (t) Assign a random number interval corresponding to the state transition probability of each neighboring node;
[0089] Generate a random number within a random number interval, determine which random number interval the random number falls into, and take the adjacent node corresponding to that random number interval as the next node.
[0090] The formula for calculating the state transition probability is as follows:
[0091]
[0092] Where, p ij (t) represents the state transition probability from node i to node j in the t-th iteration, τ ij (t) represents the pheromone concentration from node i to node j, μ i,j (t) represents the heuristic information from node i to node j in the t-th iteration, α is the weighting factor of pheromone concentration, β is the weighting factor of heuristic information, and S is the set of neighboring nodes of the current node i.
[0093] Step S4 includes the following steps:
[0094] Delete the path of the ants that did not reach the destination;
[0095] Calculate the path length L of the remaining ant m. m ;
[0096] Calculate the angle between every two adjacent nodes i and j along the path of each ant m. If it is an acute angle, then set its inflection point parameter g. mij Assign a value of 3; if it is a right angle, then set its inflection point parameter g. mij Assign a value of 2; if it is an obtuse angle, then set its inflection point parameter g. mij Assign a value of 1; if it is a straight angle, then set its inflection point parameter g. mij The value is assigned to 0;
[0097] Based on the inflection point parameter g between every two adjacent nodes i and j in each ant m's path. mij The inflection point parameter g between every two adjacent nodes i and j in the path of each ant m is... mij The total inflection point parameter G of each ant's m-path is obtained by summing the parameters. m ;
[0098] Based on the length L of each ant's m-path m With the total inflection point parameter value G m The pheromone increment of each node on each ant's m-path is calculated using the pheromone increment formula.
[0099] The formula for pheromone increment is:
[0100]
[0101] Where, Δτ ij Let Q be the pheromone increment along path (i, j), where Q is a constant representing the intensity of the pheromone increment, and L is the pheromone increment. m Let m be the length of the ant's path, and G be the length of the path. m Let λ be the total inflection point parameter value of ant m's path, and λ be the weighting coefficient.
[0102] The pheromone update formula is as follows:
[0103] τ ij(t+1)=(1-ρ)·τ ij (t)+Δτ ij
[0104] Where, τ ij (t+1) represents the pheromone concentration of path (i, j) in the (t+1)th iteration, τ ij (t) represents the pheromone concentration of path (i, j) in the t-th iteration, ρ is the pheromone decay factor, and Δτ ij Let be the pheromone increment for path (i, j) in the t-th iteration.
[0105] Among them, the improved ant colony algorithm also includes a multi-step search strategy, which includes: setting an initial step size according to the size and complexity of the problem before the search begins; dynamically adjusting the step size during the search process based on information such as the distance between the current position and the target position and the distribution of obstacles; dividing the search space into multiple subspaces, each using a different step size for the search, and utilizing the characteristics of the search space for path optimization.
[0106] Example 2:
[0107] The parts not mentioned in this embodiment are the same as in Embodiment 1.
[0108] The embodiments of the present invention provide a pathfinding method for electric robots based on an improved ant colony algorithm. By performing planarization processing, rasterization modeling, optimization of pheromone update rules, and application of a multi-step search strategy for the three-dimensional spatial environment in which the electric robot is located, the quality and efficiency of the pathfinding path are effectively improved.
[0109] like Figure 3 As shown, firstly, the three-dimensional spatial environment in which the electric robot operates is modeled using rasterization technology. Specifically, as... Figure 2 As shown, a three-dimensional Cartesian coordinate system O-XYZ is defined. A three-dimensional space containing a cube ABCD-EFGH is constructed, where C coincides with the origin O, CD coincides with the X-X axis, CG coincides with the Y-axis, and CB coincides with the Z-axis. CG is divided into m equal parts along the Y-axis, and CB is divided into l equal parts along the Z-axis. The three-dimensional space ABCD-EFGH is divided into n planes, and each plane can be divided into m×m grids, ultimately resulting in a three-dimensional grid network of n×m×l grids.
[0110] Next, the pathfinding problem of the electric robot is solved using an improved ant colony algorithm. Initial parameters are set, including the current time t = 0, the number of iterations N = 0, the maximum number of iterations Nmax, the current number of ants m = 1, and the set pheromone decay factor and the step size of the multi-step strategy. Simultaneously, the pheromone value and heuristic information of each grid cell in the 3D grid network are initialized. The initialization rules for pheromone and heuristic information are as follows: Heuristic information is:
[0111]
[0112] Where, μ i,j (t) represents the heuristic information from node i to node j in the t-th iteration, d i,j Let d be the Euclidean distance between the current node i and the target node j. j,P Let h be the Euclidean distance from the target node j to the destination node p, and h be the weight coefficient.
[0113] The Euclidean distance formula is:
[0114]
[0115] Where, d i,j Let x be the Euclidean distance from node i to node j. i ,y i ,z i Let (x) be the three-dimensional coordinates of node i, and (x) be the coordinates of node i. j ,y j ,z j ) represents the three-dimensional coordinates of node j.
[0116] In the ant's path selection process, a roulette wheel approach combined with a state transition probability calculation formula is used to select the next node. The set of neighboring nodes of the current node i is S = {1, 2, ..., j}, where j is the number of each neighboring node. A random number q between 0 and 1 is randomly selected, or q is greater than a first preset threshold q. o , 0≤q o If ≤1, then randomly select an adjacent node from the adjacent node set S as the next node;
[0117] If q≤q o Then, the state transition probability p of each adjacent node is calculated according to the state transition probability calculation formula. i,j (t);
[0118] Based on the state transition probability p of each adjacent node i,j (t) Assign a random number interval corresponding to the state transition probability of each neighboring node;
[0119] Generate a random number within a random number interval, determine which random number interval the random number falls into, and take the adjacent node corresponding to that random number interval as the next node.
[0120]
[0121] Where, p ij (t) represents the state transition probability from node i to node j in the t-th iteration, τ ij (t) represents the pheromone concentration from node i to node j, μ i,j (t) represents the heuristic information from node i to node j in the t-th iteration, α is the weighting factor of pheromone concentration, β is the weighting factor of heuristic information, and S is the set of neighboring nodes of the current node i.
[0122] During pathfinding, a multi-step search strategy is used to optimize path selection. Specifically, an initial step size is set, and the step size is dynamically adjusted based on factors such as the distance between the current node and the target location, and the distribution of obstacles, to improve pathfinding efficiency. The search space is divided into multiple subspaces, each of which is searched using a different step size, thereby leveraging the characteristics of the search space for path optimization.
[0123] After the ants complete their path search, they calculate the pheromone increment at each node along the path. The formula for calculating the pheromone increment along the path is:
[0124]
[0125] Where, Δτ ij Let Q be the pheromone increment along path (i, j), where Q is a constant representing the intensity of the pheromone increment, and L is the pheromone increment. m Let m be the length of the ant's path, and G be the length of the path. m Let λ be the total inflection point parameter value of ant m's path, and λ be the weighting coefficient.
[0126] Calculate the angle between every two adjacent nodes i and j along the path of each ant m. If it is an acute angle, then set its inflection point parameter g. mij Assign a value of 3; if it is a right angle, then set its inflection point parameter g. mij Assign a value of 2; if it is an obtuse angle, then set its inflection point parameter g. mij Assign a value of 1; if it is a straight angle, then set its inflection point parameter g. mij The value is assigned to 0;
[0127] Based on the inflection point parameter g between every two adjacent nodes i and j in each ant m's path. mij The inflection point parameter g between every two adjacent nodes i and j in the path of each ant m is... mij The total inflection point parameter G of each ant's m-path is obtained by summing the parameters. m ;
[0128] Then, the global pheromone level is updated based on the pheromone increment. The pheromone update formula is:
[0129] τ ij (t+1)=(1-ρ)·τ ij (t)+Δτ ij
[0130] Where, τ ij (t+1) represents the pheromone concentration of path (i, j) in the (t+1)th iteration, τ ij (t) represents the pheromone concentration of path (i, j) in the t-th iteration, ρ is the pheromone decay factor, and Δτ ij Let be the pheromone increment for path (i, j) in the t-th iteration.
[0131] If the termination condition is met (i.e., the maximum number of iterations Nmax is reached), the algorithm terminates and outputs the optimal path. If the maximum number of iterations has not been reached, the algorithm continues to iterate, performing path search and pheromone updates until the optimal path is found.
[0132] Through the steps described above, the electric robot can perform efficient pathfinding in three-dimensional space, obtaining the shortest and smoothest path. This algorithm, by introducing a multi-step search strategy and inflection point parameter optimization, makes the pathfinding process more accurate, effectively avoiding unnecessary turns and improving the robot's stability and efficiency.
[0133] The proposed method was compared with the traditional ant colony algorithm through simulation. The simulation results are as follows: Figure 4 Figure 5 As shown, this embodiment proposes a path-following method for electric robots based on an improved ant colony algorithm. In a three-dimensional obstacle space environment, the path length can be reduced by 10.47% and the number of iterations can be reduced by 33.33%. The path-following algorithm of this patent can effectively improve the path-following search capability and convergence speed.
[0134] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0135] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for tracking electric robots based on an improved ant colony algorithm, characterized in that, Includes the following steps: Step S1: Establish a three-dimensional spatial environment model, rasterize the three-dimensional spatial environment model to obtain a three-dimensional raster network, and specify the start and end points of the electric robot in the three-dimensional raster network; Step S2: Set the initial parameters of the ant colony algorithm, including the current time, the current number of iterations, the maximum number of iterations, the current number of ants, set the pheromone decay factor, the step size of the multi-step strategy, and initialize the pheromone value and heuristic information of each grid in the 3D grid network. Step S3: Place each ant at the starting point, use roulette wheel and state transition probability calculation formula to select the next node until the entire path search is completed. During this process, add the nodes that have been visited to the taboo list. Step S4: Calculate the pheromone increment of each node on the path to the destination according to the pheromone increment formula; Step S5: Update the global pheromone using the pheromone update formula based on the pheromone decay factor and the pheromone increment of each node on each path; Step S6: Determine whether the maximum number of iterations has been reached. If not, proceed to step S3. If yes, select the optimal path and determine the shortest path for the electric robot based on the optimal path. The method of selecting the next node using roulette wheel betting combined with the state transition probability calculation formula includes the following steps: Get the set of neighboring nodes of the current node , j Number each adjacent node; Randomly select a number between 0 and 1 q ,like q Greater than the first preset threshold , Then from the set of adjacent nodes S Randomly select an adjacent node as the next node; like Then, the state transition probability of each adjacent node is calculated according to the state transition probability calculation formula. ; Based on the state transition probabilities of each adjacent node Assign a random number interval corresponding to the state transition probability of each neighboring node; Generate a random number within a random number interval, determine which random number interval the random number falls into, and take the adjacent node corresponding to that random number interval as the next node; The formula for calculating the state transition probability is: in, For the first Round iterates through the current node i To the node j The state transition probability, For nodes i To the node j pheromone concentration, For the first The next iteration starts from the node i To the node j Heuristic information, As a weighting factor for pheromone concentration, As a weighting factor for heuristic information, For the current node i The set of adjacent nodes; Step S4 includes the following steps: Delete the path of the ants that did not reach the destination; Calculate the remaining ants Path length ; Count the number of ants Every two adjacent nodes in the path i, j If the angle between them is acute, then its inflection point parameter is used. Assign a value of 3; if it is a right angle, then set its inflection point parameter. Assign a value of 2; if it is an obtuse angle, then set its inflection point parameter. Assign a value of 1; if it is a straight angle, then set its inflection point parameter. The value is assigned to 0; According to each ant Every two adjacent nodes in the path i, j Inflection point parameters between , each ant Every two adjacent nodes in the path i, j Inflection point parameters between Add them together to get the individual ants Total inflection point parameter values of the path ; According to each ant Path length With total inflection point parameter value Calculate the pheromone increment formula for each ant The pheromone increment at each node along the path.
2. The electric robot line-following method based on an improved ant colony algorithm according to claim 1, characterized in that, The process of rasterizing the three-dimensional spatial environment model to obtain a three-dimensional raster network includes the following steps: A three-dimensional rectangular coordinate system O-XYZ is established based on the three-dimensional spatial environment model; Construct a three-dimensional space ABCD-EFGH, where C coincides with the origin O, CD coincides with the X-axis, CG coincides with the Y-axis, and CB coincides with the Z-axis; Divide CG along the Y-axis into r Divide CB into equal parts along the Z-axis. l Divide the three-dimensional space ABCD-EFGH into equal parts. n There are planes, each plane can be divided into . r×l Each grid cell is obtained. A three-dimensional raster network of 100 grid cells.
3. The method for tracking electric robots based on an improved ant colony algorithm according to claim 1, characterized in that, The heuristic information is: in, For the first The next iteration starts from the node i To the node j Heuristic information, For the current node i With the target node j The Euclidean distance between them For the target node j To the finish line p Euclidean distance, These are the weighting coefficients.
4. The electric robot line-following method based on an improved ant colony algorithm according to claim 3, characterized in that, The Euclidean distance calculation formula is as follows: in, For nodes i To the node j Euclidean distance, For nodes i The three-dimensional coordinates For nodes j The three-dimensional coordinates.
5. The method for tracking electric robots based on an improved ant colony algorithm according to claim 1, characterized in that, The formula for the pheromone increment is: in, For path The increase in pheromones on the surface The constant represents the intensity of the pheromone increment. For ants Path length, For ants The total inflection point parameter value of the path, These are the weighting coefficients.
6. The method for tracking electric robots based on an improved ant colony algorithm according to claim 1, characterized in that, The pheromone update formula is: in, For path The pheromone concentration at the (t+1)th iteration For path The pheromone concentration at the t-th iteration, For pheromone decay factor, For path The increase in pheromones.
7. The method for tracking electric robots based on an improved ant colony algorithm according to claim 1, characterized in that, The improved ant colony algorithm also includes a multi-step search strategy, which includes: setting an initial step size based on the size and complexity of the problem before the search begins; dynamically adjusting the step size during the search process based on the distance between the current position and the target position and the obstacle distribution information; dividing the search space into multiple subspaces, each using a different step size for the search, and utilizing the characteristics of the search space for path optimization.
Citation Information
Patent Citations
Mobile robot intelligent path planning method
CN112631294A
Indoor AGV path planning method based on ant colony algorithm
CN113848919A