# Simulation Study on Coverage Path Planning of Autonomous Tasks in Hilly Farmland Based on Energy Consumption Model

Authors: Mengwei Shen; Suzhen Wang; Shuang Wang; Yan Su
Journal: Mathematical Problems in Engineering
 (2020)

---

## Abstract

The hilly farmland in China is characterized by small farmland areas and dense farmland distribution, and the working environment is three-dimensional topographic farmland, so the working conditions in the field are relatively complex. In this working environment, the coverage path planning technique of a farmland autonomous task is harder than that of 2D farmland autonomous task. Generally, the path planning problem of 2D farmland is to construct the path cost model to realize the planning of agricultural machinery driving route, while for the path planning problem of three-dimensional terrain farmland in the hilly region, this paper proposes a covering path planning scheme that meets the requirements of autonomous work. Based on the energy consumption model, the scheme searches the optimal driving angle of agricultural machinery, prioritizes solutions to the problem of covering path planning within the scattered fields in the working area, and then searches through the genetic algorithm for the optimal order of traversing the paths of each field to complete the coverage path planning in the working area. On the one hand, the scheme optimizes the planning route in the fields from the angle of optimal energy consumption; on the other hand, through the genetic algorithm, the fields are connected in an orderly manner, which solves the comprehensive problems brought by the unique agricultural environment and farming system in China’s hilly areas to the agricultural machinery operation. The algorithm program is developed according to the research content, and a series of simulation experiments are carried out based on the program using actual farmland data and agricultural machinery parameters. The results show that the planned path obtained at the cost of energy consumption has a total energy consumption of 4771897.17J, which is 17.4% less energy consumption than the optimal path found by the path cost search; the optimization effect is evident.


---

## Body

## 1. Introduction

Coverage path planning (CPP) refers to a kind of static global path planning in which a robot can completely cover the entire work area through autonomous tasks [1]. Compared with dynamic, real-time path planning, the environmental conditions of the covered path planning are known, and the algorithm design of the path planning covering the entire operation area is completed. CPP has high practical application value in many fields, such as indoor area cleaning operations, unknown area coverage detection operations, and hazardous area operations [2–4]. Different areas have different requirements for coverage tasks, which makes CPP pertinent and unique in algorithm design. In the agricultural production field, CPP schemes are mainly to solve actual field production needs: on the one hand, demand is the result of agricultural machinery modernization; on the other hand, it is a combination of problems arising from the natural environment and agricultural system. Thus, the CPP technology in the field of agriculture has particularity and complexity.Path planning is of great significance in the field of unmanned driving in the concept of future smart agriculture, so it has attracted widespread attention. In field operations, the application of path planning technology is mainly composed of two parts. First, path planning technology is used to statically plan the operation path from a global perspective; second, for emergency events such as small obstacles, dynamic, real-time local path planning can be achieved based on sensor technology, automatic control technology, and other technologies. At present, much research focuses on the latter, but there are few studies on CPP, and the research depth is insufficient. In the agricultural system, environmental factors and agronomic requirements are necessary factors for agricultural machinery operations, so the application of CPP in agricultural field production is targeted, practical, and complex. In order to complete an agricultural field operation, finding the optimal path to cover the entire field is a very difficult mathematical or algorithmic problem. According to current research, there is no exact evaluation standard to measure the advantages and disadvantages of the coverage path planning algorithm [5]. For example, in the study of two-dimensional farmland CPP, Oksanen and Visala [6], Zuo et al. [7], and Jin and Tang [8] all used the unit decomposition method to study the CPP problem of complex farmland in Finland, China, and the United States. Jensen et al. [9] studied the cooperative operation mode of transport units and harvesting units in the process of combined harvesting and studied the planning of internal field coverage path and the scheduling between different fields under this mode. Hameed [10–12] engaged in optimization research of CPP problems from the perspective of minimum overlap of operating area, minimum cost of nonworking path, and the presence of obstacles in the field, and developed specific and feasible planning algorithms. In addition, in terms of the details of the two-dimensional farmland CPP algorithm, Jin and Tang [8] and Meng et al. [13], respectively, analysed the cost of various headland turning methods and turning type decisions. Therefore, considering the actual operation situation and operation requirements from different perspectives, the planning results obtained are only a certain aspect of field operations to achieve the optimization of the two-dimensional farmland CPP scheme. Compared with 2D plane farmland, 3D terrain farmland has a more complex field operation environment, and it has become a major difficulty in agricultural CPP research. Different scholars have in-depth thoughts on the problem of 3D terrain CPP from different angles. Hameed et al. [14, 15] first studied the problem of large-scale farmland CPP with three-dimensional terrain based on a genetic algorithm from the perspective of energy consumption and then proposed a “side-to-side,” three-dimensional coverage method for the problem of skips/overlaps of the operating area by agricultural machinery. Both Jin’s team and Dogru’s team [16, 17] divided the three-dimensional farmland into plane areas and slope areas for zoning research. The difference is that Jin et al. analysed the optimal angle of the path covered in the field from the three perspectives of the cost of headland turning, the cost of soil flow, and the cost of the missing area, while Dogru et al. studied the optimal driving angle of the planned path based on energy consumption cost.Field environment and terrain are the main influencing factors of field CPP. The farmland environment in hilly areas of China is unique: the fields are small and concentrated, and the fields are connected by field roads. Obviously, the 3D terrain farmland CPP scheme proposed by researchers in other regions is difficult to use in China, and the research on the 3D terrain CPP field in China is still in a nascent stage. Based on the background, the paper aims to develop a three-dimensional coverage path planning scheme that is compatible with the characteristics of farmland in hilly areas of China to meet the needs of autonomous operation of agricultural machinery in hilly fields. The contributions of this research mainly include the following three contents:(1)
A mathematical model between the energy consumption of agricultural machinery and the driving direction angle on the three-dimensional terrain is constructed, and an exhaustive algorithm is used to search for the driving angle with the best energy consumption. Compared with the driving angle with the optimal path cost, the CPP obtained with the driving angle with the lowest energy consumption has little difference in path cost, but the energy consumption is significantly reduced.(2)
The positions of the entrance and export nodes of each field are known, and the linear distance between the export node of any field and the entrance node of another field is taken as the heuristic function. The traversal sequence among fields was analysed by the genetic algorithm, and the connection between fields was realized.(3)
Realized the visualization of the planned path and provided specific algorithms to realize the simulation of CPP scheme for specific farmland, which proved the feasibility and effectiveness of the scheme.


## 2. Actual Needs and Specific Issues

The farmland area of hilly and mountainous areas in China accounts for a large proportion of the total cultivated land area. In view of the fact that domestic agriculture is subject to objective factors, such as the agricultural system and environmental conditions, farmland in China’s hilly areas has gradually developed the characteristics of small field areas and densely distributed fields. These characteristics bring challenges to intelligent operations and even mechanized operations. Therefore, in order to introduce the concept of autonomous driving in field operations in hilly and mountainous areas, 3D terrain static CPP technology is essential, and the technology is more difficult to implement than planar farmland CPP technology. The main difficulties include: (1) a series of problems caused by elevation in 3D terrain farmland to path planning technology need to be considered and (2) the obvious characteristics of farmland in hilly areas in China make it difficult for mechanized and intelligent operations.Our research plan mainly considers the application of CPP technology from the perspective of energy consumption. At present, energy consumption in many fields has become a crucial factor that must be considered in research and development work [18, 19], and agricultural production is even more focused on energy consumption. Agricultural mechanization in China follows the development direction of green agriculture and precision agriculture. However, when working in three-dimensional terrain, it is inevitable to have to consider energy consumption because whether driving uphill or downhill, machinery will consume additional energy. If we ignore this aspect, it will cause the decrease of mechanical operation efficiency and the increase of energy consumption, which will increase the cost of mechanized operation for farmers. Therefore, it is reasonable and positive to evaluate the planned path in the field from the perspective of energy consumption.


## 3. Methods

### 3.1. Principle

In order to better describe the proposed scheme, we herein will make a series of reasonable idealization assumptions based on the characteristics of the operation: (1) assume that the farmland is located on a hilly slope with a slope of15°∼25°. (2) The plan will build a working area, which contains a number of irregularly distributed, small field blocks, and the field blocks are connected by field roads. (3) The surface of the farmland is linear; that is, the edge of the cross section at any angle is linear. (4) The contact between the surface of the field block and the wheel surface remains stable—that is, the rolling friction coefficient remains constant, and f=0.1. (5) In the process of constructing the energy cost function, the energy consumption of the agricultural machinery in the headland turning area was ignored.The specific algorithm process of farmland coverage path planning is shown in Figure1. First, the obtained field boundary data and DEM data are visualized, and, at the same time, the selection of the headland turning type is performed according to the headland width information provided by the data. Then, the energy evaluation model is built and the optimal driving angle is searched based on the model. Then, the path is visualized and the planned path is analysed. Finally, the operation path planning in each field is completed in turn. After the internal path planning of each field block is completed, the traversal order of each field block operation is sorted, and a genetic algorithm is used to search the traversal order with the lowest path cost. Therefore, the scheme mainly solves three problems:(1)
Farmland traversal sequence planning composed of multifield blocks(2)
Single-field CPP(3)
Visualizing the path of planningFigure 1
Flowchart depicting the farmland coverage path planning process.


### 3.2. Single-Field Coverage Path Planning Based on Energy Consumption Model

#### 3.2.1. Explanation of Angle Relationship

The first parameter to deal with when building a three-dimensional terrain energy model is slope. The reason why three-dimensional terrain farmland is more difficult to design a path planning algorithm forthan two-dimensional farmland is the existence of slope. The inclination of agricultural equipment in the direction of field operation is different from the slope of 3D terrain. In actual operation, the relationship between the inclination and the slope of the driving direction can be known from(1)tanθ=zx,tanα−δ=xy,ψ=α−δ,tanβ=zx2+y2.The sloping angle of the driving direction is simplified to obtain(2)β=arctantanθsinφ,whereθ = the slope angle; α = the driving direction angle; δ=the angle between the farmland boundary and the horizontal direction; ψ = the angle between the working direction and the farmland boundary; and β = the inclination angle of the working direction (Figure 2).Figure 2
Theoretical model of the relationship between slope angle and inclination of driving direction.


#### 3.2.2. Analysis of Unit Path Energy Model in Straight Line Sections

In the existing hypothesis, the surface of the farmland is linear. That is, the edge of the cross section at any angle is linear. The linearity of the field surface does not mean that the working inclination angleβ remains unchanged during the up-/down-slope movement, but the working inclination angle β changes with the change of the slope angle θ. The farmland three-dimensional structure model constructed by DEM data has been linearized on the farmland surface. Therefore, a section of the path surface driven at an angle in simulation research is shown in Figure 3. When describing a path, the unit path is taken as the research object, and each unit path is assigned three parameters: the operation angle βi of the unit section, the path length Δli of the unit section, and the driving force Fi of the unit section. According to these three parameters, the energy consumption Wi of each cell path is obtained.Figure 3
A path based on a cross-sectional view of a driving angle of farmland.Assuming that the two nodes of a unit pathi are Nixi,yi,zi and Ni+1xi+1,yi+1,zi+1, respectively, the slope angle of the unit section of the unit path i is calculated by the following formula:(3)θi=z2−z1y2−y12+x2−x12=ΔzΔx2+Δy2.Therefore, the working inclinationβi of the unit path is(4)βi=arctantanΔzΔx2+Δy2sinψ.Euclidean distance is used to calculate the length of the unit path, which is formula (6):(5)Δli=xi+1−xi2+yi+1−yi2+zi+1−zi2=Δx2+Δy2+Δz21/2.When equipment is operating in the actual operating area, it can be divided into an up-slope operation stage (β≥0) and a down-slope operation stage (β<0) according to the slope. When β≥0, the mobile device keeps moving uphill. The driving force of mobile devices in the uphill process is calculated as formula (4) [20]:(6)Ftup=Ff+Fw+Fi+Fj,where Ft = driving force; Ff = rolling friction; Fw = air resistance; Fi = slope resistance; and Fj = acceleration resistance.In formula (6), due to the low speed of field operation in hilly fields, air resistance is negligible, making Fw=0. In addition, the operating equipment completes the working process and the turning process at two different speed values, so there is an acceleration/deceleration transition stage between the working process and the turning process, but this stage can be completed in a short time, so this stage is incorporated into the uniform speed operation stage, making Fj=0. Therefore, the force exerted on the mobile device during the uphill movement can be simplified as follows:(7)Ftup=Ff+Fi.The specific force analysis can be seen in Figure4, where(8)Ff=fMgcosβ,where f = rolling friction coefficient; f=0.1 (new tire) or (old tire); and M= total mass of mobile device.Figure 4
Force analysis of the slope stage on a mobile device.Slope resistance is derived from the component of the mobile device’s gravity on the slope, so(9)Fi=Mgsinβ.According to equations (4), (7), (8), and (9), it can be obtained that(10)Ftup=mgfcosarctantanθsinφ+sinarctantanθsinφ.Similarly, in the process of downhill, the driving force of mobile devices is expressed as(11)Ftd=mgsinarctantanθsinφ−fcosarctantanθsinφ.Then, the unit segment driving force is(12)Fi=mgfcosarctantanθsinφ+sinarctantanθsinφ,β≥0,mgsinarctantanθsinφ−fcosarctantanθsinφ,β<0.The power consumption of each unit path is calculated according toWi=FiΔli, and the energy consumption model of the unit path is(13)Wi=mgΔx2+Δy2+Δz21/2fcosarctantanθsinψ+sinarctantanθsinψ,β≥0,mgΔx2+Δy2+Δz21/2sinarctantanθsinψ−fcosarctantanθsinψ,β<0.The example given in Figure3 shows a complete path in the actual operation area of the field. Every two adjacent nodes are connected into a unit path, and several unit paths are connected to obtain a path. Several paths are connected through the turn of the ground to obtain complete coverage planning paths in the field. There are several paths in the actual operation area of the field block, so the energy consumption model based on the unit path can obtain the total power consumption W of all paths in the actual operation area of the field block:(14)W=∑Wi.


### 3.3. Selection of Headland Turn Mode

The headland turning method is determined by the two parameters of the headland width and the minimum turning radius of the agricultural machine. There has been much research on the selection method of the headland turn, the path cost calculation method, and the path generation method [8, 13, 21, 22]. Jin and Tang [8] studied the decision-making and path cost calculation of several common ground turning modes, including “flat,” “U,” “light bulb,” and ”fishtail.” Figure 5 shows the decision-making model of headland turning based on our research results. The path costs of different turning methods are different. In [8, 13], the calculation method of the path costs of the turning process was proposed. Based on many studies, formula (15) can be obtained, which is the path cost of a single turning process:(15)ST=πω2+ωtanψ,UTurn,ω−π−2r+ωtanψ,Flat Turn,π+4arccosω+2r4r+ωtanψ,Bulb Turn,π+2r−ω+ωtanψ,Fishtail Turn,where ω = operating width; ψ = angle between operating direction and farmland boundary; r= minimum turning radius; ST= single turning path length; and Wh= headland width.Figure 5
Headland turning decision diagram per [8].


### 3.4. Research on Field Traversal Sequence Based on Genetic Algorithm

When the internal CPP of each field block is completed, the location of the entrance and export nodes of each field block are known, and the optimal path that traverses each field block without duplication is searched based on the known condition of the entrance and export node locations. At this time, the problem can be regarded as a traditional TSP problem, and GA is an ideal way to solve the TSP problem [23], in which the selection of heuristic function is crucial [24]. The positions of the entrance and export nodes of each field are known, and the linear distance between the export node of any field and the entrance node of another field is taken as the cost to calculate the total cost required to traverse each plot, so as to optimize the traversal order. The steps to solve this problem with the GA algorithm are as follows:Step 1: encode genes (field block number and entrance and exit number) and initialize required parameters, where the population number is set to 100, the number of chromosome genes (field number) is 9, crossover probability is 0.9, and mutation probability is 0.1.Step 2: select the fitness function and judge the fitness of each chromosome. Because the import and export nodes of any field block have been determined, each chromosome (random arrangement of fields based on known import and export locations) can calculate the total cost based on the straight line distance between the exit of the front field block and the entrance of the back field block, and take the inverse of the total cost as the fitness function.Step 3: according to the fitness, the Roulette method is used to select the chromosomes, and the selected chromosomes are crossed and mutated to generate a new population.Step 4: continue evolution of new populations according to Step 2.Step 5: iteration termination principle. When the maximum number of iterations is reached or the fitness no longer changes, the algorithm terminates.The process of the genetic algorithm is shown in Figure6.Figure 6
Flowchart of genetic algorithm.


### 3.5. Algorithm Implementation

The above content describes the core content of the scheme, including energy consumption cost function, optimization of the field traversal order, and decision of the headland turning method. The research program was to design a complete path planning in an operation area from the perspective of energy consumption. For a given operation area, the specific algorithm flow is as follows:Input:FF (boundary of each subfield and internal node DEM data file), Wh (headland width), r (minimum turning radius),ω (operating width), m(total agricultural machinery mass),Δ (driving angle search step), and origin(reference coordinate origin).Output: the resultant data and correlation graph of the optimal driving angle, energy consumption cost, and path cost of each field.Step 1: input the data file FF, set working parameters, and complete the visualization of farmland data.Step 2: the reference origin,origin, is selected, and the collected boundary data points and elevation data points within the field block are converted from latitude and longitude coordinates to rectangular coordinates.Step 3: according to the functionget_single, each field is optimized to obtain the driving angle with the energy optimal. Set the driving direction angle, start from 0∘, search 360∘ in order according to the step size Δ, calculate the energy cost Cei and path cost Cli of each angle according to the cost model, store them in the variable history, and search for the most based on the energy cost Cei search optimal driving angle αo.Step 4: according to the two parameters of the width of the headlandWh and the minimum turning radius r, the function turn is called to select the turning mode of the headland inside the field.Step 5: the functionmain_plot is used to complete the visualization of the internal planning path results of each field block, and the entrance and export position data of each field block are recorded, and the data are stored in two variables, export, and entrance.Step 6: based on the method described in Section3, calculate the path cost value CAB between any two fields A and B, search for the optimal traversal order of the path cost by genetic algorithm, and finally output the search result, that is, the traversal order number.Step 7: visualize the traversal path, complete the overall path planning, and the algorithm ends.


## 3.1. Principle

In order to better describe the proposed scheme, we herein will make a series of reasonable idealization assumptions based on the characteristics of the operation: (1) assume that the farmland is located on a hilly slope with a slope of15°∼25°. (2) The plan will build a working area, which contains a number of irregularly distributed, small field blocks, and the field blocks are connected by field roads. (3) The surface of the farmland is linear; that is, the edge of the cross section at any angle is linear. (4) The contact between the surface of the field block and the wheel surface remains stable—that is, the rolling friction coefficient remains constant, and f=0.1. (5) In the process of constructing the energy cost function, the energy consumption of the agricultural machinery in the headland turning area was ignored.The specific algorithm process of farmland coverage path planning is shown in Figure1. First, the obtained field boundary data and DEM data are visualized, and, at the same time, the selection of the headland turning type is performed according to the headland width information provided by the data. Then, the energy evaluation model is built and the optimal driving angle is searched based on the model. Then, the path is visualized and the planned path is analysed. Finally, the operation path planning in each field is completed in turn. After the internal path planning of each field block is completed, the traversal order of each field block operation is sorted, and a genetic algorithm is used to search the traversal order with the lowest path cost. Therefore, the scheme mainly solves three problems:(1)
Farmland traversal sequence planning composed of multifield blocks(2)
Single-field CPP(3)
Visualizing the path of planningFigure 1
Flowchart depicting the farmland coverage path planning process.


## 3.2. Single-Field Coverage Path Planning Based on Energy Consumption Model

### 3.2.1. Explanation of Angle Relationship

The first parameter to deal with when building a three-dimensional terrain energy model is slope. The reason why three-dimensional terrain farmland is more difficult to design a path planning algorithm forthan two-dimensional farmland is the existence of slope. The inclination of agricultural equipment in the direction of field operation is different from the slope of 3D terrain. In actual operation, the relationship between the inclination and the slope of the driving direction can be known from(1)tanθ=zx,tanα−δ=xy,ψ=α−δ,tanβ=zx2+y2.The sloping angle of the driving direction is simplified to obtain(2)β=arctantanθsinφ,whereθ = the slope angle; α = the driving direction angle; δ=the angle between the farmland boundary and the horizontal direction; ψ = the angle between the working direction and the farmland boundary; and β = the inclination angle of the working direction (Figure 2).Figure 2
Theoretical model of the relationship between slope angle and inclination of driving direction.


### 3.2.2. Analysis of Unit Path Energy Model in Straight Line Sections

In the existing hypothesis, the surface of the farmland is linear. That is, the edge of the cross section at any angle is linear. The linearity of the field surface does not mean that the working inclination angleβ remains unchanged during the up-/down-slope movement, but the working inclination angle β changes with the change of the slope angle θ. The farmland three-dimensional structure model constructed by DEM data has been linearized on the farmland surface. Therefore, a section of the path surface driven at an angle in simulation research is shown in Figure 3. When describing a path, the unit path is taken as the research object, and each unit path is assigned three parameters: the operation angle βi of the unit section, the path length Δli of the unit section, and the driving force Fi of the unit section. According to these three parameters, the energy consumption Wi of each cell path is obtained.Figure 3
A path based on a cross-sectional view of a driving angle of farmland.Assuming that the two nodes of a unit pathi are Nixi,yi,zi and Ni+1xi+1,yi+1,zi+1, respectively, the slope angle of the unit section of the unit path i is calculated by the following formula:(3)θi=z2−z1y2−y12+x2−x12=ΔzΔx2+Δy2.Therefore, the working inclinationβi of the unit path is(4)βi=arctantanΔzΔx2+Δy2sinψ.Euclidean distance is used to calculate the length of the unit path, which is formula (6):(5)Δli=xi+1−xi2+yi+1−yi2+zi+1−zi2=Δx2+Δy2+Δz21/2.When equipment is operating in the actual operating area, it can be divided into an up-slope operation stage (β≥0) and a down-slope operation stage (β<0) according to the slope. When β≥0, the mobile device keeps moving uphill. The driving force of mobile devices in the uphill process is calculated as formula (4) [20]:(6)Ftup=Ff+Fw+Fi+Fj,where Ft = driving force; Ff = rolling friction; Fw = air resistance; Fi = slope resistance; and Fj = acceleration resistance.In formula (6), due to the low speed of field operation in hilly fields, air resistance is negligible, making Fw=0. In addition, the operating equipment completes the working process and the turning process at two different speed values, so there is an acceleration/deceleration transition stage between the working process and the turning process, but this stage can be completed in a short time, so this stage is incorporated into the uniform speed operation stage, making Fj=0. Therefore, the force exerted on the mobile device during the uphill movement can be simplified as follows:(7)Ftup=Ff+Fi.The specific force analysis can be seen in Figure4, where(8)Ff=fMgcosβ,where f = rolling friction coefficient; f=0.1 (new tire) or (old tire); and M= total mass of mobile device.Figure 4
Force analysis of the slope stage on a mobile device.Slope resistance is derived from the component of the mobile device’s gravity on the slope, so(9)Fi=Mgsinβ.According to equations (4), (7), (8), and (9), it can be obtained that(10)Ftup=mgfcosarctantanθsinφ+sinarctantanθsinφ.Similarly, in the process of downhill, the driving force of mobile devices is expressed as(11)Ftd=mgsinarctantanθsinφ−fcosarctantanθsinφ.Then, the unit segment driving force is(12)Fi=mgfcosarctantanθsinφ+sinarctantanθsinφ,β≥0,mgsinarctantanθsinφ−fcosarctantanθsinφ,β<0.The power consumption of each unit path is calculated according toWi=FiΔli, and the energy consumption model of the unit path is(13)Wi=mgΔx2+Δy2+Δz21/2fcosarctantanθsinψ+sinarctantanθsinψ,β≥0,mgΔx2+Δy2+Δz21/2sinarctantanθsinψ−fcosarctantanθsinψ,β<0.The example given in Figure3 shows a complete path in the actual operation area of the field. Every two adjacent nodes are connected into a unit path, and several unit paths are connected to obtain a path. Several paths are connected through the turn of the ground to obtain complete coverage planning paths in the field. There are several paths in the actual operation area of the field block, so the energy consumption model based on the unit path can obtain the total power consumption W of all paths in the actual operation area of the field block:(14)W=∑Wi.


## 3.2.1. Explanation of Angle Relationship

The first parameter to deal with when building a three-dimensional terrain energy model is slope. The reason why three-dimensional terrain farmland is more difficult to design a path planning algorithm forthan two-dimensional farmland is the existence of slope. The inclination of agricultural equipment in the direction of field operation is different from the slope of 3D terrain. In actual operation, the relationship between the inclination and the slope of the driving direction can be known from(1)tanθ=zx,tanα−δ=xy,ψ=α−δ,tanβ=zx2+y2.The sloping angle of the driving direction is simplified to obtain(2)β=arctantanθsinφ,whereθ = the slope angle; α = the driving direction angle; δ=the angle between the farmland boundary and the horizontal direction; ψ = the angle between the working direction and the farmland boundary; and β = the inclination angle of the working direction (Figure 2).Figure 2
Theoretical model of the relationship between slope angle and inclination of driving direction.


## 3.2.2. Analysis of Unit Path Energy Model in Straight Line Sections

In the existing hypothesis, the surface of the farmland is linear. That is, the edge of the cross section at any angle is linear. The linearity of the field surface does not mean that the working inclination angleβ remains unchanged during the up-/down-slope movement, but the working inclination angle β changes with the change of the slope angle θ. The farmland three-dimensional structure model constructed by DEM data has been linearized on the farmland surface. Therefore, a section of the path surface driven at an angle in simulation research is shown in Figure 3. When describing a path, the unit path is taken as the research object, and each unit path is assigned three parameters: the operation angle βi of the unit section, the path length Δli of the unit section, and the driving force Fi of the unit section. According to these three parameters, the energy consumption Wi of each cell path is obtained.Figure 3
A path based on a cross-sectional view of a driving angle of farmland.Assuming that the two nodes of a unit pathi are Nixi,yi,zi and Ni+1xi+1,yi+1,zi+1, respectively, the slope angle of the unit section of the unit path i is calculated by the following formula:(3)θi=z2−z1y2−y12+x2−x12=ΔzΔx2+Δy2.Therefore, the working inclinationβi of the unit path is(4)βi=arctantanΔzΔx2+Δy2sinψ.Euclidean distance is used to calculate the length of the unit path, which is formula (6):(5)Δli=xi+1−xi2+yi+1−yi2+zi+1−zi2=Δx2+Δy2+Δz21/2.When equipment is operating in the actual operating area, it can be divided into an up-slope operation stage (β≥0) and a down-slope operation stage (β<0) according to the slope. When β≥0, the mobile device keeps moving uphill. The driving force of mobile devices in the uphill process is calculated as formula (4) [20]:(6)Ftup=Ff+Fw+Fi+Fj,where Ft = driving force; Ff = rolling friction; Fw = air resistance; Fi = slope resistance; and Fj = acceleration resistance.In formula (6), due to the low speed of field operation in hilly fields, air resistance is negligible, making Fw=0. In addition, the operating equipment completes the working process and the turning process at two different speed values, so there is an acceleration/deceleration transition stage between the working process and the turning process, but this stage can be completed in a short time, so this stage is incorporated into the uniform speed operation stage, making Fj=0. Therefore, the force exerted on the mobile device during the uphill movement can be simplified as follows:(7)Ftup=Ff+Fi.The specific force analysis can be seen in Figure4, where(8)Ff=fMgcosβ,where f = rolling friction coefficient; f=0.1 (new tire) or (old tire); and M= total mass of mobile device.Figure 4
Force analysis of the slope stage on a mobile device.Slope resistance is derived from the component of the mobile device’s gravity on the slope, so(9)Fi=Mgsinβ.According to equations (4), (7), (8), and (9), it can be obtained that(10)Ftup=mgfcosarctantanθsinφ+sinarctantanθsinφ.Similarly, in the process of downhill, the driving force of mobile devices is expressed as(11)Ftd=mgsinarctantanθsinφ−fcosarctantanθsinφ.Then, the unit segment driving force is(12)Fi=mgfcosarctantanθsinφ+sinarctantanθsinφ,β≥0,mgsinarctantanθsinφ−fcosarctantanθsinφ,β<0.The power consumption of each unit path is calculated according toWi=FiΔli, and the energy consumption model of the unit path is(13)Wi=mgΔx2+Δy2+Δz21/2fcosarctantanθsinψ+sinarctantanθsinψ,β≥0,mgΔx2+Δy2+Δz21/2sinarctantanθsinψ−fcosarctantanθsinψ,β<0.The example given in Figure3 shows a complete path in the actual operation area of the field. Every two adjacent nodes are connected into a unit path, and several unit paths are connected to obtain a path. Several paths are connected through the turn of the ground to obtain complete coverage planning paths in the field. There are several paths in the actual operation area of the field block, so the energy consumption model based on the unit path can obtain the total power consumption W of all paths in the actual operation area of the field block:(14)W=∑Wi.


## 3.3. Selection of Headland Turn Mode

The headland turning method is determined by the two parameters of the headland width and the minimum turning radius of the agricultural machine. There has been much research on the selection method of the headland turn, the path cost calculation method, and the path generation method [8, 13, 21, 22]. Jin and Tang [8] studied the decision-making and path cost calculation of several common ground turning modes, including “flat,” “U,” “light bulb,” and ”fishtail.” Figure 5 shows the decision-making model of headland turning based on our research results. The path costs of different turning methods are different. In [8, 13], the calculation method of the path costs of the turning process was proposed. Based on many studies, formula (15) can be obtained, which is the path cost of a single turning process:(15)ST=πω2+ωtanψ,UTurn,ω−π−2r+ωtanψ,Flat Turn,π+4arccosω+2r4r+ωtanψ,Bulb Turn,π+2r−ω+ωtanψ,Fishtail Turn,where ω = operating width; ψ = angle between operating direction and farmland boundary; r= minimum turning radius; ST= single turning path length; and Wh= headland width.Figure 5
Headland turning decision diagram per [8].


## 3.4. Research on Field Traversal Sequence Based on Genetic Algorithm

When the internal CPP of each field block is completed, the location of the entrance and export nodes of each field block are known, and the optimal path that traverses each field block without duplication is searched based on the known condition of the entrance and export node locations. At this time, the problem can be regarded as a traditional TSP problem, and GA is an ideal way to solve the TSP problem [23], in which the selection of heuristic function is crucial [24]. The positions of the entrance and export nodes of each field are known, and the linear distance between the export node of any field and the entrance node of another field is taken as the cost to calculate the total cost required to traverse each plot, so as to optimize the traversal order. The steps to solve this problem with the GA algorithm are as follows:Step 1: encode genes (field block number and entrance and exit number) and initialize required parameters, where the population number is set to 100, the number of chromosome genes (field number) is 9, crossover probability is 0.9, and mutation probability is 0.1.Step 2: select the fitness function and judge the fitness of each chromosome. Because the import and export nodes of any field block have been determined, each chromosome (random arrangement of fields based on known import and export locations) can calculate the total cost based on the straight line distance between the exit of the front field block and the entrance of the back field block, and take the inverse of the total cost as the fitness function.Step 3: according to the fitness, the Roulette method is used to select the chromosomes, and the selected chromosomes are crossed and mutated to generate a new population.Step 4: continue evolution of new populations according to Step 2.Step 5: iteration termination principle. When the maximum number of iterations is reached or the fitness no longer changes, the algorithm terminates.The process of the genetic algorithm is shown in Figure6.Figure 6
Flowchart of genetic algorithm.


## 3.5. Algorithm Implementation

The above content describes the core content of the scheme, including energy consumption cost function, optimization of the field traversal order, and decision of the headland turning method. The research program was to design a complete path planning in an operation area from the perspective of energy consumption. For a given operation area, the specific algorithm flow is as follows:Input:FF (boundary of each subfield and internal node DEM data file), Wh (headland width), r (minimum turning radius),ω (operating width), m(total agricultural machinery mass),Δ (driving angle search step), and origin(reference coordinate origin).Output: the resultant data and correlation graph of the optimal driving angle, energy consumption cost, and path cost of each field.Step 1: input the data file FF, set working parameters, and complete the visualization of farmland data.Step 2: the reference origin,origin, is selected, and the collected boundary data points and elevation data points within the field block are converted from latitude and longitude coordinates to rectangular coordinates.Step 3: according to the functionget_single, each field is optimized to obtain the driving angle with the energy optimal. Set the driving direction angle, start from 0∘, search 360∘ in order according to the step size Δ, calculate the energy cost Cei and path cost Cli of each angle according to the cost model, store them in the variable history, and search for the most based on the energy cost Cei search optimal driving angle αo.Step 4: according to the two parameters of the width of the headlandWh and the minimum turning radius r, the function turn is called to select the turning mode of the headland inside the field.Step 5: the functionmain_plot is used to complete the visualization of the internal planning path results of each field block, and the entrance and export position data of each field block are recorded, and the data are stored in two variables, export, and entrance.Step 6: based on the method described in Section3, calculate the path cost value CAB between any two fields A and B, search for the optimal traversal order of the path cost by genetic algorithm, and finally output the search result, that is, the traversal order number.Step 7: visualize the traversal path, complete the overall path planning, and the algorithm ends.


## 4. Analysis of Simulation Results

In order to verify the feasibility and effectiveness of the studied algorithm, a series of simulation tests were conducted using real farmland data and field operation parameters. The simulation experiment was conducted in the MATLAB 2019a programming environment on a Windows 10 Intel (R) Core (TM) i5-1035 PC.In 2D farmland, the energy consumption of agricultural machinery operations is related to the length of the path that the job travels, so path cost is a common indicator to solve the CPP problem of two-dimensional farmland. However, in the 3D CPP, the energy consumption of operations is not only affected by the length of the path but also closely related to the slope and elevation. Therefore, it is necessary to construct an energy consumption model of agricultural machinery in the 3D farmland operation process, which will be used to solve the 3D CPP problem. In order to reflect the advantages of the energy consumption model in solving the 3D CPP problem, the path cost corresponding to each angle will be recorded in the variablehistory during the experiment. In this way, it is possible to evaluate the advantages of using energy consumption cost as an indicator to complete the CPP of 3D terrain farmland by comparing with the path cost.The simulation analysis experiment takes Farmland A as the object of simulation, the hillside where the farmland is located is facing80°, the satellite image of farmland is shown in Figure 7, and the farmland data parameters are shown in Table 1. Figure 7 shows the shape and location of the farmland, and the shape of each field is simple. The lengths of fields 2, 4, 8, and 9 are narrow. The long axis of field block 2 is perpendicular to the slope direction, whereas the long axes of fields 4, 8, and 9 are parallel to the slope direction. The remaining fields are not different in length and width. Farmland A consists of nine fields with an area of no more than 6000m2, and the sum of each field area is 20025.4467 m2, of which the largest elevation difference is in field block 8, reaching 43.7826m. The simulation test takes the developed hilly mountain tractor autonomous task equipment as the simulation operation vehicle, and the field operation parameters are shown in Table 2.Figure 7
Farmland A layout on satellite imagery.Table 1
Basic data for Farmland A.
Area (m2)Perimeter (m)Highest elevation (m)Lowest elevation (m)Elevation difference (m)Farmland A20025.44672275.83496.1892431.767464.4218Field 11555.4437160.77443.3279431.767411.5605Field 24508.0731288.85447.3155433.377313.9328Field 31800.8277171.87457.0597440.011117.0486Field 42718.6673244.15463.8280438.252125.5759Field 53692.1669252.02461.8444441.165920.6785Field 65750.2680305.90486.7960448.762538.0335Field 73041.5394216.28474.9210450.965723.9553Field 85638.7717371.49496.1892452.406643.7826Field 93639.0857264.50495.8732464.516931.3563Table 2
Field operation parameters.
Reference coordinate origin (longitude, latitude)Minimum turning radius (m)Working width (m)Headland width (m)Total quality (kg)Step size in search (°)127.1563,42.32302.41310008The simulation results of the CPP of fields 1∼9 are shown in Figure8, and the simulation data of each field are shown in Table 3. Figure 8 shows that the driving directions of the optimal energy consumption paths of each field tend to be similar, and a feature also reflected in the data (Table 3). The optimal driving angle for energy consumption is concentrated at 175° and 355°, which are opposite directions. It is known that the direction of the hillside where the farmland is located is 80°. The orientation of the hillside fields has an important influence on the optimal energy drive angle, and the two have a vertical relationship.Figure 8
Coverage path planning results of each field (1∼9) in Farmland A: (a) Field 1 result. (b) Field 2 result. (c) Field 3 result. (d) Field 4 result. (e) Field 5 result. (f) Field 6 result. (g) Field 7 result. (h) Field 8 result. (i) Field 9 result.
(a)(b)(c)(d)(e)(f)(g)(h)(i)Table 3
Simulation result data of each field in Farmland A.
In terms of energy costIn terms of path costEnergy consumption reduction ratio (J) (%)Optimal driving angle (°)Energy costs (Ee/J)Path cost (m)Optimal driving angle (°)Energy costs (Ee/J)Path cost (m)Ee−Ep/EpField 10211208.722111.91216265092.271903.61−20.33%Field 2176552092.345483.79352558791.625433.21−1.20%Field 3168241864.922201.58168241864.922201.580Field 4360440022.273917.41216552131.553265.85−20.30Field 5184490368.714695.80160499871.644578.61−1.90Field 6352867792.547798.57160905554.517511.14−4.17Field 7352446102.064092.76160468794.633797.19−3.56Field 8352938876.598154.102321631810.047145.43−42.46Field 9168583569.024707.71208918131.924677.94−36.44Total4771897.1743163.635776950.8340514.56−17.40When studying the path planning results of specific fields, some interesting phenomena will be found. Figures8(h) and 8(i) are the planning results of the field blocks 8 and 9, respectively. The two fields are narrow in shape, and their long axes are parallel to the slope. Their areas are 5638.7717m2 and 3639.0857m2, respectively, and the respective optimal energy consumption values are 938876.59J and 583569.02J. The areas of field blocks 6 and 5 are slightly larger than those of field blocks 8 and 9, respectively, and their optimal energy consumption values are 867792.54J and 490368.71J, respectively, a smaller values than those of field blocks 8 and 9. Therefore, the shape of a three-dimensional landform has a certain influence on the energy consumption: when the shape of the field is narrow and the long axis is parallel to the slope, the narrow terrain will cause more energy consumption.In the process of processing the variablehistory that stores the result data, the relationship between the route cost and the driving angle (Figure 9) and the relationship between the energy cost and the driving angle (Figure 9) can be obtained. It can be found from the resultant data of each field coverage path shown in Figure 9 that there is a sinusoidal relationship between energy consumption cost and driving angle for each field coverage path. The conclusions obtained are mutually verified with the correctness of the energy consumption model proposed in Section 3.Figure 9
The relationship between energy consumption cost, path cost, and driving angle of each field (1∼9) planning path: (a) Field 1. (b) Field 2. (c) Field 3. (d) Field 4. (e) Field 5. (f) Field 6. (g) Field 7. (h) Field 8. (i) Field 9.
(a)(b)(c)(d)(e)(f)(g)(h)(i)According to the information shown in Figure9 and the data in Table 3, in terms of energy consumption, the path obtained by searching energy consumption cost is better than the path obtained by searching energy consumption cost, among which Field 8 can reduce energy consumption by 42.46%. Overall, the energy consumption model can reduce energy consumption by 17.4%. Besides, as shown in Figure 9, it can be found that the path costs of the planned paths at different travel angles do not vary significantly, so it is more valuable to use energy consumption cost as the evaluation scale in 3D terrain.After the completion of the path planning results for each field, the complete CPP results in the operation area are shown in Figure10, in which the sequence of the fields obtained by genetic algorithm optimization is 1⟶3⟶4⟶6⟶8⟶9⟶7⟶5⟶2. The node coordinates of each field cover path planning for the field access are shown in Table 4 in which the coordinate data are transformed into coordinates of the rectangular coordinate system with 127.1563,42.3230 as the reference origin. In the test results, the optimal coverage path of energy consumption for nine fields was successfully planned, and the orderly connection of each field was realized. It can be considered that the proposed scheme is feasible, and the required operation target can be achieved under certain conditions.Figure 10
Coverage path planning results for the operation area.Table 4
Coordinates of the positions of the entrances and exits of each field.
Entrance (longitude, dimension)Export (longitude, dimension)Field 1[−14.3567, 65.3384][−16.9254, 111.3384]Field 2[21.3193, 83.3180][128.4827, 28.7094]Field 3[−52.1117, 65.8319][−47.3329, 22.9001]Field 4[−45.7909, −22.6901][2.7602, 63.3099]Field 5[41.1477, 34.7643][99.6282, −31.3173]Field 6[−93.7724, −69.1155][−95.3263, 29.0562]Field 7[64.7073, −86.2470][37.5971, −23.8669]Field 8[−54.1745, −146.9829][−4.2159, −10.6086]Field 9[9.0540, −75.5595][−2.7416, −158.9289]


## 5. Conclusion and Future Research

The innovation of the scheme is mainly realized in the following three aspects: a path planning algorithm is developed to cover the operation area of nonstandard farmland in hilly areas of China, which are characterized by small areas, dense distributions, and irregular patterns. The algorithm uses the energy consumption model to plan the covering path of a single field. According to the characteristics of the irregular distribution of each field in the working area, based on the known location of entrance and exit of each field, the order of traversing each field was optimized by the genetic algorithm.The simulation experiment is carried out by selecting actual farmland and actual operation parameters, and the algorithm proposed in this paper is verified, and its performance is evaluated. The experimental results show that the developed algorithm can realize the coverage path planning of farmland with multiple subfields. The algorithm also records the path cost data of different driving angles. Compared with the path planned by the optimal energy consumption and path cost, the path obtained by the former is better in terms of energy consumption, while the path cost differs little. Therefore, taking energy consumption as an evaluation index is more suitable for path planning of 3D terrain. Besides, based on the optimal energy consumption of each field, the connection between multiple fields in the operation area was effectively completed.The research in this article has important guiding significance for agricultural machinery field operations in hilly areas of China. Also, with the Chinese government increasing policy investment in the agricultural mechanization transformation of hilly and mountainous districts, the research can contribute to the field of intelligence of hilly farm machinery. It can be seen from the selected simulated farmland that the current study has a better effect on dealing with farmland with a simpler field environment and shape. However, the farmland environment is complex, and the planning scheme still needs to be improved in detail when dealing with complex farmland (such as obstacles and complex shapes). The comprehensiveness and complexity of agriculture is a normal phenomenon. Besides, the effective coordination between the job requirements and the job environment is also one of the directions of CPP’s in-depth research. On the one hand, according to the actual power output of farm machinery in the field operation process, the energy consumption model is optimized to make the model more accurate and reliable; on the other hand, specific operational requirements (such as unloading of harvesting operations and loading of seeding/fertilization operations) will be considered in the CPP scheme, which will involve multimachine collaborative scheduling.



---

*Source: 4535734-2020-08-30.xml*