Novel obstacle-avoiding path planning for crop protection UAV using optimized Dubins curve

In recent years, the crop protection unmanned aerial vehicle (UAV) has been raised great attention around the world due to the advantages of more efficient operation and lower requirement of special landing airport. However, there are few researches on obstacle-avoiding path planning for crop protection UAV. In this study, an improved Dubins curve algorithm was proposed for path planning with multiple obstacle constraints. First, according to the flight parameters of UAV and the types of obstacles in the field, the obstacle circle model and the small obstacle model were established. Second, after selecting the appropriate Dubins curve to generate the obstacle-avoiding path for multiple obstacles, the genetic algorithm (GA) was used to search the optimal obstacle-avoiding path. Third, for turning in the path planning, a strategy considering the size of the spray width and the UAV’s minimum turning radius was presented, which could decrease the speed change times. The results showed that the proposed algorithm can decrease the area of overlap and skip to 205.1%, while the path length increased by only 1.6% in comparison with the traditional Dubins obstacle-avoiding algorithm under the same conditions. With the increase of obstacle radius, the area of overlap and skip reduced effectively with no significant increase in path length. Therefore, the algorithm can efficiently improve the validity of path planning with multiple obstacle constraints and ensure the safety of flight.


Introduction
With the rapid development of the Internet of Things, artificial intelligence and big data technology [1][2][3] , the intelligent level of crop protection UAV is getting higher and higher. Crop protection UAV has the advantages of high operating efficiency, small dosage of unit area, no need for special take-off and landing airport, and good maneuverability. Therefore, it is of great significance to improve the mechanization level of crop pest control and enhance the control ability of sudden large area pests [4][5][6][7] .
In order to improve spraying operation effect and ensure the safety of flight operations in the constraints of obstacles, it is necessary to seek an algorithm that can both reduce the area of overlap and skip spray and take into account the route planning of path length. The obstacle-avoiding algorithms commonly used for UAV include A* algorithm, Dijkstra algorithm, artificial potential field method, neural network method, simulated annealing method, ant colony algorithm and chaos algorithm [8][9][10][11][12][13] . However, most of the above algorithms just take the UAV as the particle, the influence of UAV on the route planning due to the existence of the minimum turning radius did not be considered.
The Dubins path is commonly used in the fields of robotics and control theory as a way to paths for wheeled robots, airplanes and underwater vehicles. There are simple geometric and analytical methods to compute the optimal path. Dubins considered the influence of turning radius on vehicle motion and proposed the shortest curve method between the starting point and the end point. Ny et al. [14] applied the Dubins path to solving the path planning of the traveling salesman problem (TSP). Yeol et al. [15] gave a shortest trajectory planning algorithm based on the Dubins curve and suitable for aircraft or mobile robots. Dubins path was applied to UAV obstacle avoidance and multi-UAV collaborative operations [16] . Zhu et al. [17] considered the kinematic constraints of UAV and the Dubins curve was introduced to fit the shortest flyable path for each UAV that meets the maximum curvature constraint. While there are few studies on reducing the area of overlap and skip spray from the aspect of UAV path planning. The overlap and skip spray may lead to pesticide overdose or inadequate which have a great impact on the normal growth of crops, so the overlap and skip spray should be minimized or avoided.
Aiming at the UAV spraying operation, an improved Dubins path of overall situation obstacle-avoiding path planning strategy was proposed in this paper. In the case of more obstacles, a genetic algorithm was introduced to quickly search the best flight path. In order to reduce times of change speed in the process of spraying, a turning strategy in the overall situation environment was proposed. Finally, the feasibility of the method was verified in MATLAB.

Problem description
In general, the path of spraying operation of crop protection UAV is planned as "Π" shape [18] , as shown in Figure 1. The path planning does not take into account the following two issues: first, Vol. 13 No.4 173 in the operating environment, there are relatively small and scattered obstacles, such as poles, water towers, trees, and so on. In the off-line path planning time, such obstacles are difficult to exclude from the path. Secondly, UAV turning the path planning problem from the current path to the next path.
Assuming that there is a single obstacle in the spraying route, generally, the goal of the obstacle-avoiding path generated by the Dubins path method is to search the shortest path, as shown in Figure 2. This kind of algorithm is applied to the path planning of the crop protection unmanned aerial vehicle (UAV), however, it does not consider the operation background of crop protection UAV which can lead to a large area of overlap and skip spray.  The modeling process of the improved Dubins path planning is as follows, suppose the working area, length a and width b of the rectangle, the starting point S, the end of T, the speed v, the minimum turning radius is r z at the speed v, spraying radius r p , the distance from the center of the obstacle circle to the farthest edge is r d , and the safe distance between the UAV and the obstacle is r l , so the radius of the obstacle area is r=r l +r d , as shown in Figure 3a.
When r<r z , because the curvature of the obstacle circle is

Obstacle-avoiding route planning algorithm
The pre-planned path according to the spray radius r p is shown in Figure 4. Because of D 1 , D 2 , D 3 , D 4 obstacles in Figure 4 hinder the normal operation of the UAV. In this study, taking into account the non-particle characteristics of UAV, the Dubins path is used to plan the obstacle-avoiding route. Figure 4 Pre-planned flight route The algorithm is as follows, Step 1: According to the sprayed area and spraying radius r p , the pre-planned path is generated; to determine the turning strategy based on the size relation of r p and r z (turning strategy see Section 3.3); Step 2: If the pre-planned path intersects with the obstacle circle, it will be obstacles, otherwise, it is a non-obstacle; Step 3: Determine the radius size of the hiding obstacle in step 2, if radius r of all obstacles is greater than r z , then skip to step 5; if there is obstacle radius r less than r z , go to step; Step 4: To establish the small obstacle model O i1 , O i2 ; Step 5: Take r z as the radius, generating n pieces minimum rounded circles tangent to the obstacle circle and the pre-planned path at the same time; Step 6: Generate m sets flyable paths, and calculate the path length and the overlap and skip spray area one by one; Step 7: (see Equation 3) Normalize the data of obstacle-avoiding path length (see Equation 1) and the overlap and skip spray area (see Equation 2), according to the emphasis on the shortest path and minimum the overlap and skip spray area, the different coefficients β 1 , β 2 of the path length and the overlap and skip spray are respectively given, and the two values are added. Finally, the best path is obtained by the evaluation function value (see Equation (4)).
The calculation formula of obstacle-avoiding path length L, Calculation formula S of the overlap and skip spray area, r r r l r l r r l r r l r l r r r r r r r l r l R r r l r r r r l r r r where, n is the number of obstacle-avoiding; n 1 is the number of obstacles on the opposite side of barrier circle and minimum turning circle; n 2 is the number of obstacles on the same side of the barrier circle and the minimum turning circle, and n 1 +n 2 =n; r i is the radius of i-th obstacle circle; l i is the distance from the center of i-th obstacle circle to the pre-planning path; m is the number of spraying path of reciprocating back and forth. In step 7, when the data of the obstacle-avoiding path length and the overlap and skip spray area are normalized, unable to determine the maximum value and the minimum value or the mean and variance, so the min-max standard and Z-score standard cannot be used for data normalization. In this study, the normalization method of arctangent function is as follows, where, x * is the normalized data; x is the data before normalization, this method can be used to scale the obstacle-avoiding path length and the overlap and skip spray area to the range of [0,1]. So as to remove the unit limit of the data and convert, it into a non-dimensional pure value, so that it facilitates weighting processing of area and length. The evaluation function formula in step 7 is as follows, is the evaluation value of the i-th path; D(x i ) is the normalized data of the i-th path length; S(x i ) is the normalized data of the overlap and skip spray area of the i-th path; β 1 is the weight of path length; β 2 is the weight of the overlap and skip spray area.

Obstacle-avoiding path planning in multi-obstacles
Mentioned above the spraying area, there are only three obstacles that must avoid. When the number of obstacles increases, the obstacle-avoiding path number will sharply increase and the amount of calculation will be increased. In order to find the best obstacle-avoiding path as quickly as possible, this study uses the genetic algorithm [19][20][21][22][23] to search for the best obstacle-avoiding path.
The problem of path planning can be described as the obstacle-avoiding problem that the UAV starts from the starting point S and avoids the multiple obstacles to reach the end point T.
Suppose the obstacle circle model is D k (k = 0, 1, 2, 3, ···, n), that is to find a suitable spraying work path: S-obstacle circle 1-obstacle circle 2-···-obstacle circle n-T. Over obstacles circle center as the vertical line for pre-planning path, the straight line has two intersection points of left and right with the obstacle circle, a directed graph G=(V, A) can be constructed by taking these two intersection points as the vertices of the directed graphs (if the small obstacles, the tangent point of two inscribed circles would be the vertex), plus the starting and ending points, where V is the vertex set with the number 2k+2 (k = 0, 1, 2, 3,···, n), A is a set of directed paths. Thus, the o obstacle-avoiding problem is converted into the problem of finding the directed path (S, T) = (S, W, T), where W is the set of points of the directed curve. The genetic algorithm can be used to solve the problem.
Following in Figure 4 as an example, there are four obstacles, excluding obstacles that do not affect spray operations, the remaining three obstacles will constitute vertex set that the vertex number is 8, the encoding is shown in Table 1.
One obstacle-avoiding path in Figure 4 can be described as, 1-3-4-6-8. The fitness function takes the reciprocal of the evaluation function. The larger the fitness value is, the better the fitness is. The shorter the selected path is, the smaller the area of the overlap and skip spray is.
Among them, fitness (x i ) is the fitness value of the i-th path, and f(x i ) is the evaluation function in Section 3.1.
To sum up, bring the Equations (1) and (2) into Equation (3), and apply the fitness function of Equation (5), the global obstacle-avoiding path can quickly be obtained using the genetic algorithm. The flow is shown in Figure 5.

Turning strategy in path planning
In order to make the UAV to minimize times of variable speed when turning, so that UAV flight rate V maximum possible remain unchanged. This paper presented a new turning strategy based on Vol. 13 No.4 175 Dubins for UAV maneuverability. First, to judge the size relationship of r p , r z , and determine the first, second, or third turning, then according to the result to adjust UAV flight parameters and control the UAV turning process. Three types of turning process are shown in Figures 6-8. As shown in Figures 6, 7, turning strategy spraying radius r z ≤r p , the UAV can fly to the next spray path by turning at the minimum turning radius. When r z >r p , the UAV cannot switch to the next spray path if the speed remains constant. The turning strategy adopted in this paper is not to traverse each path in turn but to directly turn from the first flight path to the third flight path until the paths such as 1, 3, 5, 7, ···, 2k+1 are completed. After a variable speed, fly to the 2k spraying path, and then repeat the above method. Figure 8a shows the turning strategy with the even number of back and forth spraying path; Figure 8b shows the turning strategy with the odd number of back and forth spraying path.

Simulation analysis
This simulation makes a numerical setting integrated the parameters of TY-R30, TY-D10 and MG-1. The corresponding parameters of each model as shown in Table 2, take UAV spraying radius r p =2 m, v=4 m/s, at the speed the minimum turning radius r z =2 m in this simulation. Global obstacle-avoiding path planning is discussed when obstacle radius r ≤4 m.

Simulation of global obstacle-avoiding path planning
It is assumed that the UAV is spraying in the area of a = 30 m and b = 20 m. The location and size of the obstacles in the spraying area are: D 1 coordinates (3, 10), r 1 =2; D 2 coordinates (4, 25), r 2 =1.5; D 3 coordinates (14,8), r 3 =1; D 4 coordinates of (14.5, 21), r 4 =3. First of all, to determine the turning strategy according to the relationship between r p and r z ; because the obstacle 2 is not an obstacle-avoiding, it is not considered in the path planning, so only for the remaining three obstacles; by comparing the relationship between r 3 and r z , D 3 is defined as a small obstacle, modeling small obstacles according to Figure 3b method. The resulting global obstacle-avoiding path planning is shown in Figure  9. In the genetic algorithm, the initial population size is 100, the generation is 200, the crossover probability is 0.9, and the mutation probability is 0.01. The length of the obstacle-avoiding path is calculated as L=152.79 m, and the path length is increased by 1.9% compared with that without obstacle, and the area of the overlap and skip spray is S=17.02 m 2 .

Contrast with other path planning algorithms
Under the same simulation conditions, the obstacle-avoiding path planning of traditional Dubins path shown in Figure 10. By calculation, the path length of L=150.56 m and the overlap and skip spray area of S=51.94 m 2 are generated by this method. The obstacle-avoiding path length increased by 0.3% than the original path. Compared with the obstacle-avoiding path in Figure 8, the proposed algorithm has a 1.6% increase in the path length, but the area of overlap and skip spray is reduced by 205.1%. Therefore, the algorithm of the obstacle-avoiding path planning based on the improved Dubins path can effectively reduce the area of the overlap and skip spray.

Effect of Obstacle Size for Route Planning
In the following, analyzing the influence of the size of the obstacle on the single spraying path for the length of the path and the area of overlap and skip spray is presented. Assuming that a, r p , v, r z are the same as Section 3.1 to set, and when there is a single obstacle in the spraying path and this obstacle satisfies: 1) the center of the circle is on the pre-planned path; 2) the center of the circle is at the midpoint of a. In the environment by changing the size of obstacles, the data obtained by applying the two algorithms is shown in Figure 11. It can be seen from Figure 11a that the obstacle-avoiding path length using two algorithms increases with the increase of the obstacles. In this paper, the path length of the algorithm is slightly larger than that of the traditional algorithm (the shortest obstacle avoidance route (SOAR)), but the increase ratio is relatively small compared with the pre-planned plan length a, and there is no phenomenon that the path length increases abruptly as the obstacle becomes large. Figure 11b shows the area of the overlap and skip spray of the traditional algorithm obviously increases and speeds up with the increase of the single obstacle. The proposed algorithm not only increases the area is small, and the area of the increase in speed is relatively slow.

Conclusions
This study proposed an obstacle-avoiding path planning method based on improved Dubins path, which effectively improved the speed of the search path by using the genetic algorithm. And a new turning strategy based on Dubins for UAV maneuverability was obtained, which reduced the number of variable speed of the UAV turning process. Simulation analysis showed that the path planning method proposed in this paper has a 1.9% increase in path length and less obstacle-avoiding path, compared with the spraying path in the environment without obstacles. Under the same obstacle-avoiding environment, the path length is slightly larger than that of the traditional obstacle-avoiding algorithm, but it significantly reduces the area of the overlap and skips spray in the spraying process of UAV obstacle-avoiding.
Therefore, the proposed algorithm can effectively improve the effect of the UAV spraying operation in the obstacle environment and ensure the safety of flight operations.