A three-dimensional trajectory planning method for unmanned aerial vehicles based on improved butterfly optimization algorithm
By improving the butterfly optimization algorithm, combining the peak simulation function and cubic spline interpolation function, the problem of low track generation rate and easy to fall into local optimality in the three-dimensional track planning of the UAV is solved, and efficient and stable track planning is achieved.
Patent Information
- Application Number
- CN202210816456.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-12
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2042-07-12
AI Technical Summary
The existing butterfly optimization algorithm has problems such as low effective track generation rate, easy to fall into local optimality and sudden change in track angle in the three-dimensional track planning of drones, affecting the effective flight of drones.
By improving the butterfly optimization algorithm, the three-dimensional space threat of the drone is equivalently simulated by the peak simulation function, and the location update mechanism and search strategy are improved to increase the global search capability, avoid local optimization, and finally the cubic spline interpolation function is used to smooth the track.
It improves the effectiveness and global search capabilities of the drone's track, avoids local optimality and angle changes in the track, achieves smoothness and stability of the track, and is suitable for the three-dimensional track planning of the drone.
Smart Images

Figure CN115342812B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of three-dimensional trajectory planning of unmanned aerial vehicles, and particularly to a three-dimensional trajectory planning method for unmanned aerial vehicles based on an improved butterfly optimization algorithm. Background Art
[0002] As is known, with the development of communication and navigation technologies, unmanned aerial vehicles are increasingly widely used in life, and trajectory planning technology is particularly important in the field of unmanned aerial vehicles, which mainly solves the problem of planning an obstacle avoidance path from a starting point to an end point in a known or unknown environment. Currently, the commonly used trajectory planning methods mainly include global planning and local planning. Global planning is mainly to find a trajectory with the shortest voyage, the least fuel consumption, and the shortest time in the current planning space. The main implementation algorithms include the A* algorithm, the Dijkstra algorithm, and some heuristic intelligent swarm algorithms, such as the genetic algorithm, the particle swarm algorithm, etc. Local planning is mainly to make the minimum turning radius meet the specified requirements and obtain a smooth trajectory path. Common algorithms include the artificial potential field algorithm, etc.
[0003] The butterfly optimization algorithm (BOA) is a new type of nature-inspired algorithm proposed by scholars such as Sankalap Arora in 2018 according to the foraging process of butterflies. It has the advantages of simple algorithm and fast convergence speed. However, there are still some problems when the basic butterfly optimization algorithm is directly applied to trajectory planning: the effective trajectory generation rate is low, it is easy to fall into local optimum, and there are angle mutations in the generated trajectory, etc., which is not conducive to the effective flight of unmanned aerial vehicles. Summary of the Invention
[0004] In order to overcome the deficiencies in the background art, the present invention discloses a three-dimensional trajectory planning method for unmanned aerial vehicles based on an improved butterfly optimization algorithm.
[0005] In order to achieve the above-mentioned invention purpose, the present invention adopts the following technical solutions:
[0006] A three-dimensional trajectory planning method for unmanned aerial vehicles based on an improved butterfly optimization algorithm uses a mountain peak simulation function to equivalently simulate the spatial threats faced by the unmanned aerial vehicle, sets the search boundary of the three-dimensional environment of the unmanned aerial vehicle, and sets the starting coordinate startPos of the unmanned aerial vehicle flight and the target coordinate goalPos of the unmanned aerial vehicle flight; the specific operation steps are as follows:
[0007] Step 1: Initialize the parameters of the improved butterfly optimization algorithm, calculate the fitness values of the randomly initialized butterfly population and record the current optimal individual and position, and calculate the fragrance concentration of each butterfly individual; generate a uniform random number r between [0, 1], compare it with the transition probability p, if r < p, then jump to the global search stage, otherwise jump to the local search stage;
[0008] Step 2: Continuing from Step 1, when r < p, jump to the global search phase and calculate the adaptive weight coefficient ω and the dynamic adjustment factor ε in the global search phase:
[0009]
[0010] where: α is a random number between [0, 1]; β is a uniformly distributed random number between [-1, 1]; t is the t-th iteration number; Maxiter is the maximum number of iterations; log 2 is the logarithmic function with base 2;
[0011]
[0012] where: betarnd is a random number following a beta distribution;
[0013] Step 3: Continuing from the previous step, to improve the global search ability, a transition probability p is used in the position update process to select between global search and local search. The global search position update expression is as follows:
[0014]
[0015]
[0016] where: g best is the global optimal position; and are the position vectors of butterfly j and butterfly k in the t-th iteration process; is the position of butterfly i in the t-th iteration process; rand 2 represents the square of a random number uniformly distributed between [0, 1], and ρ represents the random position difference; both represent the positions of the butterfly in the (t + 1)-th iteration;
[0017] Step 4: Continuing from Step 1, when r ≥ p, jump to the local search phase and calculate the dynamic transition probability pi in the local search phase. To improve the local search ability during the butterfly foraging process and avoid falling into local optima, a dynamic local search strategy is adopted. The expression for the dynamic transition probability pi of the local search strategy is:
[0018]
[0019] where μ is a decimal less than 1, taking values from 0.85 to 0.95; rand represents a random number uniformly distributed between [0, 1];
[0020] Step 5: Continuing from the previous step, the random number ri generated before the search strategy selection in the local search phase is compared with the generated dynamic conversion probability pi. If ri>pi, jump to the first local search strategy, otherwise jump to the second local search strategy:
[0021] When ri>pi, the position update expression for jumping to the first local search strategy is:
[0022]
[0023] When ri≤pi, jump to the second search strategy, and the position update expression at this time is:
[0024]
[0025] φ=1+gamrnd*tan(π·(rand-0.5))
[0026] Where: gamrnd is a random number with Γ distribution; θ is the golden ratio coefficient; Both represent the position of the butterfly in the t+1 iteration;
[0027] Step 6: Following the previous step, determine whether the updated butterfly position exceeds the specified search boundary, calculate the fitness value of the current iteration number, update the global optimal position of the butterfly, and update the sensory modality factor c. The update expression is:
[0028]
[0029] Among them, C t represents the sensory modal factor value at the tth iteration, that is, the sensory modal factor at the last iteration, C t+1 represents the sensory modality factor value at the t+1th iteration, that is, the updated value of the sensory modality factor at the current iteration number;
[0030] Step 7, following the previous step, determine whether the maximum number of iterations has been reached. If so, exit the loop and output the optimal butterfly individual, i.e., the optimal trajectory of the drone. If the maximum number of iterations has not been reached, continue to execute steps 1-7;
[0031] Step 8: Continuing from the previous step, after reaching the maximum number of iterations, use the cubic spline interpolation function to smooth the planned trajectory:
[0032] In each subinterval x∈[x i ,x i+1 ] to create the equation:
[0033] g i (x) = a i +b i ·(xx i)+c i ·(xx i ) 2 +d i ·(xx i ) 3
[0034] where a i =y i ; h i =x i+1 -x i , m i is the quadratic differential of the matrix equation; a i , b i 、c i d i are interpolation coefficients, h i It is expressed as the difference between the current position and the previous position.
[0035] The three-dimensional trajectory planning method of the UAV based on the improved butterfly optimization algorithm uses the mountain function to simulate the three-dimensional space threat expression of the UAV:
[0036]
[0037] Where: n is the total number of peaks; (x i ,y i ) represents the center coordinate of the i-th peak; h i is the terrain control parameter, which controls the terrain height; x si and si are the attenuation of the i-th peak along the x-axis and y-axis, respectively, which control the slope.
[0038] The three-dimensional trajectory planning method for unmanned aerial vehicle based on the improved butterfly optimization algorithm, the butterfly optimization algorithm parameters include sensory modal factor c, power index α, global search and local search conversion probability p, and maximum number of iterations Maxiter.
[0039] The three-dimensional trajectory planning method of UAV based on the improved butterfly optimization algorithm, the fragrance concentration f of each butterfly individual i The calculation method is as follows:
[0040] f i =cI α
[0041]
[0042] I=β 1 L+β 2 F uel
[0043] β 1 +β 2 =1
[0044] Where: f i is the fragrance concentration of the ith butterfly; c is the sensory modal factor of the butterfly; α is the power index of the butterfly; I is the stimulus intensity of the butterfly; F uel is the fuel consumption cost; 1 and β 2 are the proportion coefficients of the voyage and fuel consumption costs respectively; L is the shortest voyage constraint, (xp i 、xp i 、zp i ) is the coordinate of the track point, and ni is the number of track points.
[0045] Due to the adoption of the above technical solution, the present invention has the following beneficial effects:
[0046] The three-dimensional trajectory planning method for unmanned aerial vehicles based on the improved butterfly optimization algorithm described in the present invention simulates the three-dimensional space threats faced by the unmanned aerial vehicle through a mountain simulation function, improves the position update mechanism and update strategy on the basis of the basic butterfly optimization algorithm to improve the global search capability, increase sample diversity, avoid falling into the local optimum, and introduces a cubic spline interpolation function to smooth the three-dimensional trajectory to avoid track mutation; the trajectory of the present invention has high track validity, strong global search capability, fast search speed and stable track, which provides feasibility for unmanned aerial vehicle track planning. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 It is a schematic diagram of the process of the present invention.
[0048] Figure 2 The simulation results of the basic butterfly algorithm BOA and the improved butterfly optimization algorithm IBOA of the present invention in UAV trajectory planning in a three-dimensional environment with 10 mountain threats.
[0049] Figure 3 Iterative curve diagram showing the optimal trajectory planned by the two algorithms in a three-dimensional environment with 10 mountain threats as the number of iterations increases.
[0050] Figure 4 The simulation results of the basic algorithm and the improved optimization algorithm of the present invention in UAV trajectory planning in a three-dimensional environment with 15 mountain threats.
[0051] Figure 5 Iterative curve diagram showing the optimal trajectory planned by the two algorithms in a three-dimensional environment with 15 mountain threats as the number of iterations increases.
[0052] Figure 6The simulation results of the basic algorithm and the improved optimization algorithm of the present invention in UAV trajectory planning in a three-dimensional environment with 20 mountain threats.
[0053] Figure 7 Iterative curve diagram showing the optimal trajectory planned by the two algorithms in a three-dimensional environment with 20 mountain threats as the number of iterations increases. DETAILED DESCRIPTION
[0054] The present invention can be explained in detail by the following examples, and the purpose of disclosing the present invention is to protect all technical improvements within the scope of the present invention.
[0055] Combined with Figure 1 The three-dimensional trajectory planning method for unmanned aerial vehicle based on the improved butterfly optimization algorithm comprises the following steps:
[0056] The mountain simulation function is used to simulate the spatial threat faced by the UAV, and the three-dimensional environment search boundary of the UAV is set. The expression of the mountain function simulating the three-dimensional spatial threat of the UAV is:
[0057]
[0058] Where: n is the total number of peaks; (x i ,yi) represents the center coordinates of the ith peak; h i is the terrain control parameter, which controls the terrain height; x si and si are the attenuation of the i-th peak along the x-axis and y-axis, respectively, which control the slope.
[0059] Set the coordinates of the starting point of the UAV flight, startPos, and the coordinates of the target point of the UAV flight, goalPos;
[0060] Step 1, initialize the parameters of the improved butterfly optimization algorithm, including the sensory modality factor c, the power index α, the probability of switching between global search and local search p, and the maximum number of iterations Maxiter;
[0061] Calculate the fitness value of the randomly initialized butterfly population and record the current optimal individual and position;
[0062] Calculate the fragrance concentration of each butterfly individual, the fragrance concentration f produced by the butterfly individual during foraging i The calculation method is as follows:
[0063] f i =cI α
[0064] I=β 1 L+β 2 F uel
[0065] β 1 +β 2 =1
[0066]
[0067] where: f i is the fragrance concentration of the i-th butterfly; c is the sensory modality factor of the butterfly; α is the power exponent of the butterfly; I is the stimulation intensity of the butterfly; F uel is the fuel consumption cost; β 1 and β 2 are the proportionality coefficients of the range and the fuel consumption cost respectively; L is the shortest range constraint, (xp i , yp i , zp i ) are the coordinates of the waypoint, and ni is the number of waypoints;
[0068] Generate a uniform random number r between [0,1] and compare it with the transition probability p;
[0069] Step 2: If r < p, jump to the global search phase, otherwise jump to the local search phase;
[0070] Calculate the adaptive weight coefficient ω and the dynamic adjustment factor ε in the global search phase. Their calculation methods are as follows:
[0071] The expression of the adaptive weight coefficient ω in the global search phase is:
[0072]
[0073] where: τ is a random number between [0,1]. After multiple tests, the best effect is obtained when τ takes 0.75; β is a uniform random number between [-1,1]; log 2 is the logarithmic function with base 2; t is the t-th iteration number; Maxiter is the maximum number of iterations.
[0074] The expression of the dynamic adjustment factor ε in the global search phase is:
[0075]
[0076] where: betarnd is a random number with a beta distribution.
[0077] Step 3: During the butterfly foraging process, in order to improve the global search ability, the transition probability p is used to select between global search and local search during the position update process. The global search position update expression is as follows:
[0078]
[0079]
[0080] Where: g best is the global optimal position; and is the position vector of butterfly j and butterfly k in the t-th iteration; is the position of butterfly i in the tth iteration; rand 2 represents the square of a random number uniformly distributed between [0,1], and ρ represents the random position difference; Both represent the position of the butterfly in the t+1 iteration.
[0081] Step 4: Calculate the dynamic conversion probability pi in the local search phase, regenerate a uniform random number ri between [0,1], if ri>pi, jump to the first local search strategy, otherwise jump to the second local search strategy;
[0082] In order to improve the local search ability of butterflies during foraging and avoid falling into local optimality, a dynamic local search strategy is adopted. The expression of the dynamic selection probability pi of the local search strategy is:
[0083]
[0084] Among them, μ is a decimal less than 1, ranging from 0.85 to 0.95, and rand represents a random number uniformly distributed between [0,1];
[0085] Step 5: Local search phase: The random number ri generated before the search strategy selection is compared with the strategy selection probability pi generated above. If ri>pi, the first local search strategy is executed. The position update expression at this time is:
[0086]
[0087] If ri≤pi, the second search strategy is executed, and the position update expression at this time is:
[0088]
[0089] φ=1+gamrnd*tan(π·(rand-0.5))
[0090] Where: gamrnd is a random number with Γ distribution; θ is the golden ratio coefficient, Both represent the position of the butterfly in the t+1 iteration;.
[0091] Step 6: Determine whether the updated butterfly position exceeds the specified search boundary, calculate the fitness value of the current iteration number, update the global optimal position of the butterfly, and update the sensory modality factor c. The update method is:
[0092]
[0093] Among them, C t represents the sensory modal factor value at the tth iteration, that is, the sensory modal factor at the last iteration, C t+1 represents the sensory modality factor value at the t+1th iteration, that is, the updated value of the sensory modality factor at the current iteration number;
[0094] Step 7: Determine whether the maximum number of iterations has been reached. If so, exit the loop and output the optimal butterfly individual (i.e., the optimal trajectory of the drone). If the maximum number of iterations has not been reached, continue to execute steps 5 to 12.
[0095] Step 8: Use the cubic spline interpolation function to smooth the planned trajectory:
[0096] In each subinterval x∈[x i ,x i+1 ] to create the equation:
[0097] g i (x) = a i +b i ·(xx i )+c i ·(xx i ) 2 +d i ·(xx i ) 3
[0098] where a i =y i ; h i =x i+1 -x i , m i is the quadratic differential of the matrix equation, a i , b i 、c i d i are interpolation coefficients, h i It is expressed as the difference between the current position and the previous position.
[0099] In order to verify the effectiveness and feasibility of the present invention, the mountain simulation function is used to simulate the space threat of UAVs, and a 100×100×100 three-dimensional planning environment is constructed. The path searched by the improved butterfly optimization algorithm (IBOA) of the present invention and the basic butterfly optimization algorithm are simulated under the same conditions. The experimental results are as follows: Figure 2-Figure 7As shown; through comparison and analysis of simulation experiments, it can be seen that the present invention can effectively solve the problem of UAV trajectory planning, and compared with the basic butterfly optimization algorithm, it has the advantages of high trajectory validity, strong global search capability, fast search speed and stable trajectory.
[0100] Parts of the present invention not described in detail are prior art.
[0101] The embodiments selected herein for the purpose of disclosing the invention are currently considered to be suitable, but it should be understood that the invention is intended to include all changes and modifications of the embodiments that fall within the scope of the concept and invention.
Claims
1. A three-dimensional flight path planning method for unmanned aerial vehicles (UAVs) based on an improved butterfly optimization algorithm, which uses a mountain peak simulation function to equivalently simulate the spatial threats faced by the UAV, sets the search boundary of the UAV's three-dimensional environment, and sets the starting coordinate startPos of the UAV's flight and the target coordinate goalPos of the UAV's flight. Characterized in that: The specific operation steps are as follows: Step 1: Initialize the parameters of the improved butterfly optimization algorithm, calculate the fitness values of the randomly initialized butterfly population and record the current optimal individual and position, and calculate the fragrance concentration of each butterfly individual; generate a uniform random number r between [0, 1], compare it with the transition probability p, if r < p, then jump to the global search stage, otherwise jump to the local search stage; Step 2: Following Step 1, when r < p, jump to the global search stage, and calculate the adaptive weight coefficient ω and the dynamic adjustment factor ε in the global search stage: Where: α 1 is a random number between [0,1]; β is a uniform random number between [-1,1]; t is the tth iteration number; Maxiter is the maximum number of iterations; log 2 is a logarithmic function with base 2; Where: betarnd is a random number with a beta distribution; Step 3: Continuing from the previous step, in order to improve the global search ability, the transition probability p is used to select between global search and local search during the position update process. The global search position update expression is as follows: Where: g best is the global optimal position; and is the position vector of butterfly j and butterfly k in the t-th iteration; is the position of butterfly i in the tth iteration; rand 2 represents the square of a random number uniformly distributed between [0,1], and ρ represents the random position difference; represents the position of the butterfly in iteration t+1; Step 4: Following Step 1, when r ≥ p, jump to the local search stage, and calculate the dynamic transition probability pi in the local search stage. To improve the local search ability during the butterfly foraging process and avoid falling into local optima, a dynamic local search strategy is adopted. The expression for the dynamic transition probability pi of the local search strategy is: Where μ is a decimal less than 1, taking 0.85 - 0.95; rand represents a random number between the uniform distribution [0, 1]; Step 5: Continuing from the previous step, compare the random number ri generated before the search strategy selection in the local search stage with the generated dynamic transition probability pi. If ri > pi, then jump to the first local search strategy, otherwise jump to the second local search strategy: When ri > pi, the position update expression for jumping to the first local search strategy is: When ri ≤ pi, jump to the second search strategy, and the position update expression at this time is: Where: gamrnd is a random number with Γ distribution; θ is the golden ratio coefficient; represents the position of the butterfly in iteration t+1; Step 6: Continuing from the previous step, determine whether the updated butterfly position exceeds the specified search boundary, calculate the fitness value of the current iteration number, and update the global optimal position of the butterfly. Update the sensory modality factor c of the butterfly, and its update expression is Among them, c t represents the sensory modal factor value at the tth iteration, that is, the sensory modal factor at the last iteration, c t+1 represents the sensory modality factor value at the t+1th iteration, that is, the updated value of the sensory modality factor at the current iteration number; Step 7: Continuing from the previous step, determine whether the maximum number of iterations is reached. If it is reached, then jump out of the loop and output the optimal butterfly individual, that is, the optimal flight path of the UAV. If the maximum number of iterations is not reached, continue to execute Steps 1 - 7; Step 8: Continuing from the previous step, after reaching the maximum number of iterations, use a cubic spline interpolation function to smooth the planned flight path: In each subinterval x∈[x i ,x i+1 ] to create the equation: g i (x)=a i +b i ·(x-x i )+c i ·(x-x i ) 2 +d i ·(x-x i ) 3 in h i =x i+1 -x i , m i is the quadratic differential of the matrix equation; a i 、b i 、c i ,d i are interpolation coefficients, h i It is expressed as the difference between the current position and the previous position.
2. The three-dimensional flight path planning method for unmanned aerial vehicles based on an improved butterfly optimization algorithm according to claim 1, Characterized in that: The expression for simulating the three-dimensional space threat of the UAV using the mountain peak function is: Where: n is the total number of peaks; (x i ,y i ) represents the center coordinate of the ith peak; h is the terrain control parameter, which controls the terrain height; x si and si are the attenuation of the i-th peak along the x-axis and y-axis, respectively, which control the slope.
3. The three-dimensional flight path planning method for unmanned aerial vehicles based on an improved butterfly optimization algorithm according to claim 1, Characterized in that: The parameters of the butterfly optimization algorithm include the sensory modal factor c of the butterfly, the power index α of the butterfly, the probability of switching between global search and local search p, and the maximum number of iterations Maxiter.
4. The method for three-dimensional trajectory planning of unmanned aerial vehicle based on improved butterfly optimization algorithm according to claim 1, Its characteristics are: The fragrance concentration of each butterfly is f i The calculation method is as follows: f i =cI α I=β 1 L+β 2 F uel β 1 +β 2 =1 Where: f i is the fragrance concentration of the ith butterfly; c is the sensory modal factor of the butterfly; α is the power index of the butterfly; I is the stimulus intensity of the butterfly; F uel is the fuel consumption cost; 1 and β 2 are the proportion coefficients of the voyage and fuel consumption costs respectively; L is the shortest voyage constraint, (xp i 、yp i 、zp i ) is the coordinate of the track point, and ni is the number of track points.
Citation Information
Patent Citations
Optimization implementation method of butterfly algorithm
CN111814947A
Mobile robot path planning method based on improved butterfly optimization algorithm
CN113219989A