Computation of optimized agricultural machinery tracks during field work

Analysis of various approaches to optimizing the trajectories of agricultural machinery across the field made it possible to determine the main points that have reserves for optimization. Algorithms were obtained to optimize tracks at this stage of research, on fields with small slopes. The construction of tracks is implemented in software both for a given entry point and direction of movement, as well as a choice of entry points and directions that optimize the time and fuel costs. Variants of building tracks for vehicles with different grip widths, as well as for cases of movement of several pieces of equipment in various kinds of combined versions, have been implemented. The software implementation was carried out using the JAVA 8 and GeoTools 19 technology stack.


Introduction
Automatic machine trajectory calculation is a promising solution for digital farming. There is no longer any doubt -it is becoming an integral part of the future production of agricultural products. In modern conditions, through the use of digitized agronomic characteristics of fields, it makes possible to collect detailed information in a timely manner before performing complex nonlinear tasks of controlling equipment. Automation of calculations of the optimized trajectory of the machine movement brings the practice of farming to a new stage, due to the consideration of the spatial heterogeneity of the field properties. It allows you to effectively adjust the modes of fulfilling the conditions of the mission card. At this stage of the development of the agro-industrial complex, it is necessary to develop a new generation that will allow preserving soil fertility while simultaneously reducing the technogenic impact, which is a serious threat to agro-industrial production.
Research work on the introduction of modern technologies in agricultural production covers a wide range of applications: from coordinating automated harvesting to attempts to optimize the logistics of processes [1]. The use of automation in agriculture in recent years has reduced production costs, reduced dependence on manual labor and improved product quality [2]. The results of the development motivated the automatic control of agricultural machinery (for example, tractors, combines, sprayers and spreaders) [3,4]. The work [5] shows the developed algorithm for dynamic path search, which makes it possible to guide the agricultural tractor along the desired path and make efficient turns at the ends of the field. The work [6] describes an algorithm for following waypoints, which guided the technician along a course determined by GPS waypoints. A simulator was also developed based on a vehicle dynamics model with three degrees of freedom. There are quite a few software tools that allow you to  figure 1), but in all cases we are talking only about drawing tracks and by no means always talking about optimization. Path planning algorithms calculate target points for a vehicle based on field coverage, vehicle minimum turning radius, and other constraints [8]. The trip planner determines the position of the desired vehicle and then the desired position is compared with the position measured with the position sensor. The steering angle is calculated from the difference between the desired and measured waypoints and then a command signal is sent to the controller to activate the steering drive [9]. Almost all of the above studies were aimed at • creation of a path model of a route point with different types of turns; • development of driving programs; • assessment of technical and economic efficiency.
The following processes are not implemented at the moment: automatic calculation of the trajectory of a machine and a group of machines in the field, taking into account the processing patterns; calculation of the trajectory of movement of a machine and a group of machines in the field, taking into account the strategies of the work of agricultural machinery; taking into account the number of units of equipment; taking into account the peculiarities of work on slope lands; calculation of places of unloading \ loading; calculation of the optimal parameters of the job assignment, taking into account the optimal logistics; recalculation of the trajectory or places of unloading / loading, depending on the change in speed and / or the number of cars; the choice of trailed / mounted implements; the ability to work with various transfer machines -the choice of the volume of the bodies, the volume of the seed hopper, the tank of the working solution; visualization and calculation of the processed area, taking into account the working width of the unit and overlaps.
Based on the analysis of various methods and approaches to optimize the trajectories of agricultural machinery across the field, the main points have been identified that have reserves for optimization. In accordance with the current state of the available software, the implementation of the developed algorithms, in the form of software tools, can be carried out using the JAVA 8 and GeoTools 19 technology stack. This choice is also due to the fact that GeoTools is a Java library (LGPL) that provides standard methods for working with geospatial data and has built-in support for geometry through the JTS Topology Suite (JTS); filters using the OGC Filter Encoding specification; allows one to access GIS data; has support for coordinate systems and transformations between them.

Materials and methods
With the chosen approach to optimization, it should be carried out along the given contour of the field and the selected strategy of work and the number of units of agricultural products; the values of the width of coverage and overlap for each unit of agricultural equipment, the assessment of the maximum length of the run, the average speed of movement, the time for one turn in the operating mode for each unit of agricultural equipment. This approach, in addition, allows you to create and analyze motion tracks for each unit of SHT in the form of arrays of points; points of entry of each unit of agricultural equipment on the field; the estimated time to complete each task and complete the entire operation. At the initial stage, when processing information, not the real form of the field is used, but its simplified (primitivized) version. This step is only necessary to simplify preliminary calculations. Then, in the final calculations, the field shape is fully consistent with the real one.
The first approximation is made for the condition of the placement of fields on those parts of the agricultural landscape that have relatively small slopes, and their values are not critical regarding the choice of the direction of movement of agricultural machinery. In this case, the main criteria may be the time of work or the cost of fuel. Therefore, when constructing algorithms for optimizing the trajectories of vehicle movement, we used the following: the total number of turns (it is minimized, as unproductive and leading to soil overconsolidation) or in a reciprocal task, the average length of the run (it is maximized, as it allows varying speed modes).
The algorithm consists in considering all possible directions of movement for shuttle processing of the field for a given point or points of entry x of the technique on the field. For each () direction (in the development process called "azimuth"), the average length of the run l and the number of revolutions of the vehicle n are calculated. Then the corresponding minimum and maximum values are selected:

n=n(, х) n→min, l=l(, х) l→max.
After that, the entry point (s) are moved along the field boundary with a predetermined step along the length, and the procedure is repeated again. As a result, after examining the entry points along the boundaries of the field, we get an array of data with solutions. The solutions to the minimum and maximum problems are compared with each other and, in case of significant differences, are analyzed in order to correct the initial conditions. In the absence of a pronounced extremum, the results are visualized as necessary.
Visualization is necessary in cases where there is not one global extremum, but several local ones. In this case, when there are extrema close in magnitude, and the solution of the reciprocal problem is used, in most of the options we have considered, which made it possible to make the final choice in favor of this or that solution. After the priority direction of movement is determined, the trajectories themselves are built directly, depending on the division of the field into sections, the number of equipment units, the type of movement, the working width, etc. (see figure 2).  In cases when the straightness of the movement of the technique is not mandatory or a priority, it is possible to build adaptive trajectories of movement. In this situation, the algorithm changes slightly.
The field is divided into a sufficiently large number of rectangular sections (from 500-1000 to 10000-15000), depending on the complexity of the shape and size of the field. A point is selected in the middle of each section. Through this point, with a given angular step, straight lines are drawn in all possible directions (in our work, the values of 0.5 and 1.0 were used for the step). Then, the coordinates of the intersection of the lines with the field boundaries were determined and the lengths of the corresponding segments were calculated. The length of the largest segment and the corresponding "azimuth" were determined. This procedure was repeated for all points corresponding to the centers of the plots. After that, depending on the situation and the complexity of the field contour, an adjustment was made and the required number of elementary areas was determined, into which it was necessary to split the field for a more accurate description. In this case, of course, it is necessary to observe a compromise between accuracy and the increasing total number of points. This step is due to the fact that when using the developed optimization algorithms, the computation time increases exponentially from their number. And although, with modern computing power (for 2021, computers with Ryzen 7 processors and 16 GB of RAM were used), this is not a problem, but if you need an express approach or a large number of areas to be optimized, saving time is a significant factor. In some cases, when the shape of the fields is geometrically relatively "simple" and in a simplified form can be replaced by a convex polygon, it is sufficient to map the field of a set of "azimuths". The resulting picture in such cases already determines the optimal options for the movement of equipment. In the case of more complex contours, depending on the initial conditions, either splitting into parts or taking into account additional restrictions is required.

Results
An example of building trajectories on a real field is shown in figure 4 below. In some cases, according to customer requests, it is necessary to build optimized trajectories on a field divided into sections. That is, after finding the optimizing "azimuth", you need to build trajectories on non-intersecting sections of the field with predetermined parameters. An example of such a construction is shown in figure 5.

Conclusions
Based on the analysis of various methods and approaches to optimize the trajectories of agricultural machinery across the field, the main points have been identified that have reserves for optimization. Algorithms have been obtained to optimize tracks, at this stage of research, without taking into account the slopes of the terrain. The construction of tracks according to the azimuth specified by the user is implemented in software; construction of tracks with the selection of the optimal azimuth of movement. Variants of building tracks for vehicles with different grip widths, as well as for cases of movement of several pieces of equipment in various kinds of combined versions, have been implemented. This software implementation was carried out using the JAVA 8 and GeoTools 19 technology stack. The following steps, taking into account the digital elevation model [10][11][12][13], will allow the calculation of optimized trajectories of agricultural machinery during field work on slope lands.