Mobile Robot Path Optimization Technology Based on Niche Genetic Algorithm

Mobile Robot Path Optimization Technology Based on Niche Genetic Algorithm

Mobile robot path planning is an important research field of robotics, and also a combination of artificial intelligence and robotics. Regardless of the type of mobile robot, it is required to walk along an optimal (or sub-optimal) path in the work space according to certain criteria (such as the shortest total length of the walking route, the least energy consumption, etc.).

Typical methods of path planning include graph search method, grid method, artificial potential field method, etc. These algorithms have certain limitations and are easy to fall into local optimal solutions, and genetic algorithms have good applicability in solving nonlinear problems. It has become a more used method in path planning. However, the standard genetic algorithm itself also has premature, easy to fall into the local optimal solution and other defects, can not guarantee the calculation efficiency and reliability requirements of path planning. In order to improve the solution quality and efficiency of path planning, an improved genetic algorithm based on the pre-selection mechanism niche technology is proposed and applied to the path planning of mobile robots. The complex two-dimensional coordinates are encoded as one-dimensional coordinates. The method effectively reduces the search space of the genetic algorithm; according to the walking characteristics of the mobile robot, the adaptive crossover operator, adaptive mutation operator, insertion operator, deletion operator, perturbation operator and inversion operator are designed. Computer simulation proves that the improved genetic algorithm obviously improves the search efficiency and convergence speed, and can ensure convergence to the global optimal solution. It overcomes the shortcomings of the standard genetic algorithm and quickly seeks an optimal path without collision for the robot.

1 Improvement and application of robot path planning algorithm based on genetic algorithm

In this paper, the path planning of mobile robots aims to find an optimal path on a two-dimensional map of known obstacles, so that the distance to the target point is the shortest, and at the same time maximize the distance from the obstacle . To simplify the discussion, consider the mobile machine as a particle, and the boundary of the obstacle expands outward, which is the maximum safe distance of the mobile robot.

1.1 The mechanism of niche genetic algorithm based on pre-selection mechanism technology

Since the simple genetic algorithm is a random method, it aims to perform implicit parallel optimization on multiple different individuals. Its operation process and implementation method are still serial in nature. Such an evolutionary operation process is relatively slow; at the same time, Basic genetic algorithms often converge to a local best point before each individual reaches the optimal solution, resulting in chromosomes converging, that is, producing "premature" phenomena. In order to overcome these deficiencies, the niche genetic mechanism was introduced, and the niche method based on the pre-selection mechanism technology was used to maintain the diversity of the group, avoid a large increase of individual individuals in the group, and realize the local optimal solution and the global optimal solution in the solution space. Solution optimization.

The niche technology is to divide each generation of individuals into several categories. Each category selects a number of individuals with greater fitness as excellent representatives of a category to form a population, and then crosses and mutates in the population and between different populations. Generate a new generation of individual groups, and use the pre-selection mechanism to complete the selection operation. The genetic algorithm based on this niche technology can better maintain the diversity of solutions, and at the same time has a high global optimization ability and convergence speed.

In the pre-selection mechanism, only when the fitness of the substring exceeds its parent string, the substring can replace its parent string and enter the next generation group. This approach tends to replace individuals that are similar to themselves (inherited traits between father and son), and thus can better maintain the distribution characteristics of the population, even in the case of relatively small population size, it can still maintain a high Group distribution characteristics. The specific algorithm implementation steps are as follows:

(1) Initialization (establish initial population and determine genetic parameters);

(2) Calculate the fitness of individuals;

(3) Genetic operations (selection, crossover, mutation);

(4) Compare the fitness of the substring and the parent string. If the fitness of the substring is higher than that of the parent string, replace the parent string; otherwise, keep the parent string unchanged;

(5) If the termination condition of the algorithm is not met, return to step (2); otherwise, the algorithm terminates.

1.2 Path coding

The encoding method of the gene determines the form of the problem in the genetic algorithm and also determines the genetic evolution operation used. Each chromosome is represented as a string of characters in a given symbol set. In the early genetic algorithms, the symbol set was limited to binary numbers, so the genetic genotype was a binary symbol string. Its advantages are that the operations of encoding and decoding are simple, and genetic operations such as crossover and mutation are easy to implement; the disadvantage is that it is inconvenient to reflect the requirements. Specific knowledge of the problem, and optimization problems for some continuous functions. Due to the random nature of the genetic algorithm, its local search ability is poor. For some continuous functions that require multi-dimensional and high-precision optimization, the binary code has a mapping error when the continuous function is discretized. When the individual code string is short, it may not be reached Accuracy requirements; when the individual code string is long, although the accuracy can be improved, the search space of the algorithm will increase dramatically.

Real number coding is suitable for representing numbers with a large range and high precision. It can effectively overcome the shortcomings of the Hamming cliff of binary coding, and can directly use truth coding to facilitate the heuristic knowledge related to the problem and improve the search efficiency of the algorithm. The path of the mobile robot can be regarded as a line segment connected by a series of coordinate points. The path planning of the mobile robot is to perform various operations on these coordinate points to make them meet the needs of the mobile robot walking. Considering the characteristics of the mobile robot itself (not only need to avoid obstacles, but also to ensure the smoothness of the path), and the uncertainty of the number of turning points in the path of the mobile robot, a real-length coding method of variable-length chromosomes is used. Directly encode the path coordinate points to facilitate the flexible operation of the path points, thereby avoiding the tedious operation of conversion between the binary bit string and the rectangular coordinate points when using binary encoding, and easy to perform genetic operator operations.

1.3 Population initialization

To perform the optimal path design of genetic algorithm, the population must be initialized. Because the initial path is randomly generated, the coordinates of each turning point may be distributed throughout the planning area, including feasible and unfeasible, which increases the search range. Here, the initial turning point is restricted within the feasible region to accelerate the convergence speed of the genetic algorithm. The specific method is: determine whether the turning point is within the feasible area, if not, then re-select until the coordinate point meets the conditions.

According to the complexity of the planning environment, the number of turning points in the optimal path is also uncertain. Generally speaking, the more complex the environment, the more turning points. Therefore, the algorithm uses variable-length coding technology, by deleting chromosomes, Operations such as insertion can determine the appropriate number of turning points to optimize the path. However, if there are too many turning points, the occupied resources will be too large, which will slow down the calculation speed. Therefore, in the calculation process, the maximum turning point is set to Nmax, and the length n of each individual in the population satisfies 2≤n≤Nmax.

Using the niche principle, each generation of individuals is divided into several categories, and several individuals with greater fitness are selected from each category as an excellent representative of a category to form a population.

1.4 Fitness function

The so-called mobile robot path planning refers to finding a shortest feasible path between the start point and the end point. The constraint is that it does not intersect with obstacles, and the turning angle of the mobile robot during walking should not be too large. The algorithm takes two conditions as the feasibility evaluation function of the planned path, namely the total length of the path and the average size of the corners of each turning point. For the infeasible path, its fitness is punished so that its fitness is worse than the feasible path .

(1) The total length of the path. In order to prevent the mobile robot from colliding with the obstacle, it should try to keep a certain safe distance from the obstacle. Assuming that the safety radius of the mobile robot is r; the distance between the mobile robot and the obstacle is d, then the total path length Len is calculated by equation (1):

Where: d (pi-1, pi) is the length between the turning points pi-1 and pi. If the path between pi-1 and pi is not feasible, the penalty function method is used to punish its fitness. The penalty function is defined as follows:



Where: ε is the penalty factor. The evaluation function of the path can be written as:


To determine whether the path between the two points is feasible, you only need to determine whether the connection between the two points and the sides of the obstacle intersect. According to the principle of geometry, judging whether two line segments intersect can be determined by the following two steps: rapid rejection test; straddle test. In view of the length of the article, the two experiments will not be elaborated here.

The evaluation path is the problem of finding the shortest path length. Through the penalty factor, the infeasible path can be made longer, thereby reducing its adaptation value.

(2) Path smoothness. The characteristics of the mobile robot determine that it should not be turned with too large a corner during walking, so the entire walking path should tend to be smooth and smooth, that is, the corner value at each turning point should be as small as possible. It is assumed here that the maximum value of the corner cannot exceed π / 2, and the smoothness can be calculated using the average corner value of the path:


Where: ξ is a constant that tends to zero (ξ> 0); αi (0≤αi≤π, i = 2, 3, ..., n-1) represents the angle between the two vectors AC, CB, B , The coordinates of point C are (xi-2, yi-1), (xi, yi), (xi-1, yi-1); k is the number of αi that is greater than or equal to π / 2, that is, when a certain When an angle is greater than or equal to π / 2, the fitness is punished. When n = 2, the path is the connection between the start point and the end point. If it is feasible, the value of M tends to 0. It can be seen that the smaller the M value, the better the smoothness of the path.

With the evaluation function of the above two conditions, the fitness function of the entire path can be obtained. The weighted sum of various evaluation functions is a commonly used method to determine the fitness function. Because each weighting coefficient is not constant, but changes with the path and obstacles, it is difficult to adjust and determine the weighting coefficients in this case. Therefore, when determining the fitness function, try to minimize the number of terms of the fitness function, but it is necessary to integrate the two conditions of path planning in the process of genetic optimization. Here, the evaluation function is multiplied, as shown in equation (6).

f = 1 / (ML) (6)

With f as the basis for the selection operation, the smaller the length of the path and the average corner, the better the fitness.

1.5 Genetic operators

(1) Select the operator. Use a selection strategy that combines the championship selection method and the elite retention method. When selecting in the championship selection method, K individuals are randomly selected from the group for comparison. The individual with the best fitness will be selected as the parent to generate the next generation. The parameter K is called the competition scale. This selection method can make individuals with good fitness in the population have a greater chance of "survival". At the same time, because it only uses the relative value of fitness as the selection criterion, it is not directly proportional to the value of fitness, thus avoiding the influence of super individuals and to a certain extent avoiding the occurrence of premature convergence and stagnation. The elite retention method is the best adaptable individual in the current population. It does not participate in genetic operations and can be directly copied to the next generation. It replaces the least adaptable individuals in the subpopulations generated by crossover and mutation operations. In this way, the best individual in a certain generation can not be destroyed by genetic operations, which can ensure that the genetic algorithm converges to the optimal solution with probability. Experience has shown that keeping the number of individuals accounting for 2% to 5% of the population as a whole is the most effective.

(2) Crossover operator. Using the single-point cross method, randomly select a cross point (except the start point and end point) on the two parents, and exchange the chromosomes of the two individuals after their respective cross points. Considering that the length of the planned path is variable, in order to prevent excessively cumbersome or simple paths after the cross operation, the length of the new individual generated is limited, that is, the maximum length cannot exceed Nmax, and no loop can be generated. If it does not meet the requirements, Reacquire the intersection of two parent individuals.

(3) Insert an operator. Two insertion operators are designed. The first is targeted, that is, insert one or more turning points between the two turning points connecting the line through the obstacle, so that the resulting path avoids the obstacle, as shown in Figure 1 (a); The second type is insertion in a general sense, with a certain probability to insert a randomly generated turning point, as shown in Figure 1 (b).

(4) Perturbation operator. Two perturbation operators are also designed. The first one only selects the turning points where the path is not feasible to make small-scale adjustments to make the path feasible, as shown in Figure 1 (c); the second is regardless of whether the path is feasible, Pick a position arbitrarily and adjust the coordinates of its turning point with probability pm. In the early stages of evolution, there were a large number of infeasible solutions, and the adjustment range was larger. The adjustment range gradually narrowed in the late evolution, as shown in Figure 1 (d).



(5) Delete the operator. Create a storage space REC. In a path, if the connection between point (xi-1, yi-1) and point (xi, yi) passes through an obstacle, but (xi-1, yi-1) and (xi + 1. The line of yi-1) does not pass through the obstacle, then the point (xi, yi) is added to the REC. If the REC is not empty, then randomly select a point to delete (see Figure 1 (e)); otherwise, randomly select a path point in the path and delete it with probability pd, as shown in Figure 1 (f).

(6) Smoothing operator. The smoothing operator only operates on the largest corner in the feasible path, as shown in Figure 1 (g). The apex pj of the corner α is deleted, and the points pj-1, p1, p2, and pj + 1 are connected in sequence to form a feasible path segment sequence pj-1p1 → p1p2 → p2pj + 1.

(7) Inversion operator. Randomly select two intermediate turning points in the path and reverse the turning points between them. The inversion operator can make the path change drastically, which has a positive meaning for the path with more turning points. The usual crossover and mutation operators are not easy to achieve this effect, and the inversion operator can correct the genetic errors that may occur during genetic evolution, as shown in Figure 1 (h).

1.6 Probability selection of genetic operators

Choosing the appropriate genetic operator execution probability is one of the keys to whether the genetic algorithm can converge to the optimal solution. In the early stage of the evolutionary process, there are a large number of infeasible solutions in the group, so the probability of the crossover operator and the perturbation operator should be greater, and the smoother operator should take the smaller probability; as the evolutionary process progresses, the feasible solution Increase, the probability of smoothing operator should be properly increased to improve the smoothing performance of feasible solutions. At the same time, in order to prevent the crossover operator and the perturbation operator from destroying the feasible solution, it is necessary to reduce its execution probability, and take a smaller disturbance probability to fine-tune the shape of the feasible solution. Among them, the perturbation operator (1) and the insertion operator (1) are heuristic operations on the path turning point, and they are both optimized and adjusted for infeasible paths. For these operators, a higher probability should always be selected. Inserting operator (2) will increase the number of turning points of the path, and should take a smaller probability.

1.7 Termination conditions

Generally, in the case of ignorance of the problem, the algorithm can be terminated after the objective function reaches a tolerable range. In addition, the maximum evolutionary algebra can also be set, and the algorithm is forcibly terminated within a given evolutionary algebra, so as to ensure the calculation time requirements. For practical purposes, the maximum evolution algebra termination criterion is adopted here, and the feasible path with the best fitness is selected.

1.8 Algorithm flow

The improved genetic algorithm based on niche is shown in Figure 2. The specific algorithm is described as follows:

(1) Initialize the population, select N points equidistantly along the connecting direction of the starting point and the end point, randomly select the ordinate of the turning point on the vertical line of these points, and make these turning points not within the obstacle;

(2) Divide each generation of individuals into n categories, and select a number of individuals with greater fitness in each category as an excellent representative of a category to form a population. Population size Gi (i = 1, 2, ..., n + 1);

(3) Calculate the fitness of all individuals in the population, keep the best individual, and then use the championship selection method to select the parent individuals to perform the crossover operation, and check whether the chromosome length of the obtained offspring individual exceeds N, if not If it exceeds, keep it, otherwise discard it.

(4) Perform mutation, insertion, perturbation, deletion, and smoothing operations on the newly generated offspring individuals with a set probability. In this process, a pre-selection mechanism is adopted to compare the fitness of the substring and the parent string. If the fitness of the substring is higher than that of the parent string, the parent string is replaced; otherwise, the parent string is kept unchanged;

(5) Repeat steps (3) and (4) until the number of new individuals obtained is equal to the number of parent groups;

(6) Replace the least adaptable individuals in the new population with the best individuals from the previous generation;

(7) Check the algorithm stop condition. If it meets, it is aborted, otherwise it jumps to step (3) and the algorithm continues.

2 Simulation

The environment information of the optimal path planning and design of the mobile robot mainly includes the recognition of various obstacle information in the mobile robot's active area. In this paper, various obstacles are regarded as infeasible areas, and are represented by polygons of arbitrary shapes. In the VC 2005 environment, the above algorithm is simulated. The algorithm parameters are selected as the maximum turning point of the path is 30, the initial turning point is 20, the population size is 100, the size of the championship is 5, and the maximum evolutionary generation is G = 80. In the first 20 generations of the algorithm, the cross probability pc = 0.6, the disturbance probability pm = 0.6, the insertion operator 2pi = 0.6, the smoothing operator probability ps = 0.1; after the 20th generation, pc = 0.1, pm = 0.2, pi = 0.01 , Ps = 0.7.

In the initial stage of the algorithm, because there are many turning points, the deletion probability should be larger, so that the number of turning points can be reduced, thereby reducing the length of the path; but in the later stage of the algorithm, there are already fewer path points, and then use a larger The deletion probability is easy to make the algorithm fall into the local solution, and the probability of converging to the optimal solution is greatly reduced, so the deletion probability in the late evolution should be reduced to ensure the diversity of paths. The initial deletion probability is 0.8, and after about 20 generations, 0.1 is selected, while the probability of perturbation operator 1 and insertion operator 1 is always 0.8. Select two different environments (see Figure 3), run the above algorithm 10 times each, and select the path with the best effect shown in Figure 3 (a) and Figure 3 (b). It can be seen from Figure 3 that the improved genetic algorithm has good adaptability to various environments. Among them, the situation in Figure 3 (a) is the simplest, and the optimal result is obtained after only 19 generations; Figure 3 (b) has evolved after 36 generations; it has converged to the optimal solution.



In order to compare with the performance of the standard genetic algorithm, we use the algorithm of this paper and the standard genetic operator to experiment with environment one and two respectively. The selection of the standard genetic algorithm adopts the championship selection method, and its cross probability and mutation probability are the same as the algorithm in this paper. The running results are shown in Table 1 and Table 2.



From the data in Table 1 and Table 2, it can be seen that the algorithm in this paper is superior to the standard genetic algorithm regardless of the running time or the path length of convergence. The main reason is that the algorithm in this paper designs new genetic operators for the planned path, which accelerates the speed of evolution and makes it easier to converge to the optimal solution.

3 Conclusion

Using niche technology based on pre-selection mechanism and designing genetic operators based on heuristic knowledge. The standard genetic algorithm is improved and expanded, and applied to the path planning of mobile robot walking. The algorithm takes into account both the rapidity of genetic evolution and the diversity of the population, effectively suppresses the occurrence of "premature" phenomenon, and can search for the local optimal solution and the global optimal solution well. Experiments show that the algorithm can converge to the optimal solution in a smaller evolutionary algebra in different environments, and the execution speed and success rate of the algorithm are significantly higher than the standard genetic algorithm. In addition, choosing the appropriate crossover and mutation probabilities at different stages of evolution has a critical impact on the evolutionary results. This paper divides the algorithm into two stages and sets different genetic operation probabilities, which is relatively simple and cannot be Fully adapt to the changing situation of the population. How to make the algorithm automatically adjust and optimize these parameters according to the evolution of the population needs further research and improvement.

Wire Harness

Feyvan electronics offers a wide variety of cable assemblies including Servo Motor, Sensor, Automotive, Medical and other custom wire harness to help you prepare for installation. Whether you need cables, connectors, electrical components, tapes or heat shrink tubes, we have the products for you.

Our cable parts and accessories offer safe and efficient ways to get the job well done, all of which are RoHS, UL and CSA compliant. More than 10 years experiences of professional engineers ensure that your custom cables, assemblies, connectors and harnesses are perfectly suited to meet your exact requirements.



Wire Harness

Wire Harness,Cable Assembly,Cable Harness,Wire Assembly

Feyvan Electronics Technology Co., Ltd. , http://www.fv-cable-assembly.com

Posted on