A Co-Simulation Virtual Reality Machinery Simulator for Advanced Precision Agriculture Applications

.


Introduction
Modern digital technologies in agricultural systems foster advancing beyond the limitations of traditional farming practices [1]. In this regard, precision agriculture (PA), also called precision farming, emerged in the mid-1980s [2,3] in several domains of agricultural production systems [1,4]. Seeding, fertilization, herbicide application, and harvesting can be carried out by linking the mapped variables to farming decisions. The Global Navigation Satellite System technology (GNSS) and sensors development allow improved accuracy, reduced energy needs, and better timeliness. PA principles consider the cultivation's variability to increase farmers' profitability and environmental stewardship [5][6][7]. The acquisition of farm imagery increases farm efficiency using georeferenced data to set up management plans. Soil heterogeneity and topography affect plants' production dynamics, making prescription mapping essential [8].
However, transitioning towards precision agriculture and digital practices requires farmers to adopt specific technology [9], making a comprehensive view of the new available To assess the core focus of research with applications and trends of agricultural digital twins [28,29], studies have focused on the examination of technology solutions across the investigated farming operation and the considered farming type. The thematic application area resulted: crops; urban and controlled environment farming; livestock farming; product design, smart services, and machinery management; supply and value chains; and policy, environment, and infrastructure.
Following the national public consultation on precision farming set up by the Italian Ministry of Agriculture [30] to increase overall farming sustainability, the present research aims to realize a tractor driving simulator intended to recreate the process innovation introduced by PA and quantify the relevant benefits, if any.
The expected benefits are [31]: • Energy consumption analysis: analyze the energy consumption of the physical system; • Optimization/update: allows to find the optimal parameters for the operation of a system; • Behavior analysis user operation guide: analyze human-fabricated operations and provide feedback; • Technology integration: bring together different already deployed technologies under the same umbrella to control and visualize operations more easily.
Therefore, the simulator focuses on the management of agricultural machines with autoguiding, geolocation, and ISOBUS and on the adoption of implements able to manage prescription maps, section control, and variable rate (Table 1). A digital twin of both the tractor and implement has been used. The simulator is the platform that includes both the digital twin and the physical actuators. The digital twin communicates with the tractor physical actuators: the steering wheel, the pedals, and the command console. The driver acts on the physical actuators and closes the loop with the digital twin during the tests.
The project originates from the complexity of studying and appreciating, in real and comparable conditions, the working flow of digital agricultural machinery technologies in an identified environment. As a matter of fact, it is not easy, or impossible, to replicate experiences with different forward speed, working width, number of variable section, number of cluster in the prescription maps, tractor engine power, tractor's path, traffic control, field shape and size, product capacity of the implement, etc., as it is not allowed to fertilize or weeding or seeding two or more times the same field or to have hundreds of hectares or several different implement available, or for seasonal and weather conditions. For these reasons, the simulator developed in this research represents a key tool to predict the management of farms in terms of machineries alternatives and under different scenarios considering the possible interaction as well, with particular attention on the designing of hardware and software to enhance training operators in the use of this PA process.
The paper describes the simulator design process, including the digital environment and the digital vehicles and implements developed.
The output of the simulator has been compared with the results carried out with an agricultural tractor both during handling maneuvers and with three different PA tasks.

Materials and Methods
The topics covered by the simulator development are described in detail below:

•
The main requirements of the simulation; • Virtual tractor design; • Virtual implements; • Simulation platform; • Experimental test.

The Main Requirements of the Simulation
The main simulation topics concern: 1.
Dynamics of the vehicle similar to an agricultural tractor; 2.
Monitoring tractor forces exchanged with the ground; 3.
Replication of engine behavior and related fuel consumption; 4.
Simulation of the main pillars of precision agriculture (PA); 5.
Operating conditions.

Dynamics of the Vehicle
The system is required to be able to simulate: • The dynamic behavior of the agricultural tractor as it is subjected to linear and angular accelerations; • The lateral and longitudinal stability of the vehicle when working on slopes or with drawbar force; • The vertical, lateral, and longitudinal forces that each tire exchanges with the ground.
The simulator shall reproduce the vehicle's response to varying tire characteristics. The model has been developed, simulating one specific tractor fitted with a set of tires. However, the simulator allows changing the elastic and geometric parameters of the system to evaluate the different responses. It is possible to acquire the input data (steering, speed) and the linear and angular accelerations of the vehicle during the test at an acquisition frequency of at least 50 Hz.
CREA carried out the measures on a real tractor (John Deere 6920S, John Deere GmbH & Co.KG, John Deere-Str. 70, Mann, similar to the virtual tractor developed of (i) the main geometries of the vehicle; (ii) the position of the tractor's center of gravity [32], Figure 1; (iii) and the characterization of the longitudinal and lateral dynamic response on a tractor by the main handling maneuver on the CREA-IT test track, Figure 1.
The model has been developed, simulating one specific tractor fitted with a set o However, the simulator allows changing the elastic and geometric parameters of t tem to evaluate the different responses. It is possible to acquire the input data (st speed) and the linear and angular accelerations of the vehicle during the test at an sition frequency of at least 50 Hz.
CREA carried out the measures on a real tractor (John Deere 6920S, John GmbH & Co.KG, John Deere-Str. 70, Mann, similar to the virtual tractor develope the main geometries of the vehicle; (ii) the position of the tractor's center of gravi Figure 1; (iii) and the characterization of the longitudinal and lateral dynamic respo a tractor by the main handling maneuver on the CREA-IT test track, Figure 1. The software simulates and acquires the contextual data of:

•
Traction force of an agricultural tractor on agricultural land [33]; • Weight on each single wheel during working and forwarding; • Relative load on the engine [32].
The model has been developed on the following input: • The algorithms representing the exchange of forces between agricultural ti agricultural soil, both as resistance to forward movement and as traction force of an agricultural tractor; these last were obtained by tests performed at CR lowing ASABE standards; • The algorithms relating to the forward resistance of an implement [33], i.e., t tion force at the drawbar.

Monitoring Tractor Forces Exchanged with the Ground
The software simulates and acquires the contextual data of: • Traction force of an agricultural tractor on agricultural land [33]; • Weight on each single wheel during working and forwarding; • Relative load on the engine [32].
The model has been developed on the following input: • The algorithms representing the exchange of forces between agricultural tires and agricultural soil, both as resistance to forward movement and as traction force [32,33], of an agricultural tractor; these last were obtained by tests performed at CREA following ASABE standards; • The algorithms relating to the forward resistance of an implement [33], i.e., the traction force at the drawbar.

Replication of Engine Behavior and Related Fuel Consumption
The software simulates the load on the engine due to the sum of the forward resistance, the power required in traction, the power required at the power take-off (PTO), the power required by the hydraulic system and the fuel consumption (hourly in kg h −1 or l h −1 and specific in g kWh −1 ) and the engine speed.
The values adopted to identify these contributions on the engine load and the representative curves of the tractor engine to be simulated (power, torque, and consumption) were acquired by test at the CREA engine room [32], Figure 1, with a real tractor while drawbar force and tire slippage was based on ASABE standard [33].

Simulation of the Main Pillars of Precision Agriculture
The aim is to simulate the systems and constraints characteristic of precision agriculture which are based on:

•
Calculation of guidelines for the tractor, automatic guidance; • Actuation signal to the operators based on a position in the field provided by the GNSS signal; Consequently, it is crucial to develop a virtual world with GNSS signal. In this regard, the simulated positioning system can use position correction systems that guarantee different degrees of precision (for example EGNOS, 20-30 cm, RTK, 2-3 cm) providing a certain degree of error and/or oscillation around the correct value. It must also be possible for one of our operators to modify the agricultural operating scenario (i.e., the size of the farm, the shape of the field, slopes, obstacles such as rocks or poles, etc.) Basically, after having defined the boundaries of the field and the main guidelines, the software elaborates parallel guidelines at a distance that depends on the working width of the implement; these are the "paths" that the operator or the simulated tractor's automated guide will have to follow. Apart from the classic manual driving mode, assisted and automatic driving modes can be used. The first mode consists of using a display which indicates to the operator the path to follow. For the second mode, it is necessary to equip the simulator with an automatic system that simulates the effect of an electric motor on the steering wheel or hydraulic cylinders on the steering and a monitor on which the route to be followed in the field will be graphically represented. For this, autonomous driving provides an error algorithm, i.e., oscillation around the ideal trajectory, which can be modified in terms of value and response times. A Proportional Integrative Derivative (PID) control has been used with a preview in front of the vehicle. The error is the lateral deviation from the ideal trajectory and the output of the control is the steering wheel angle required to follow the trajectory. An empirical strategy has been adopted to identify the values of the control parameters.
The execution of some operations (e.g., fertilizing) requires the driver not only to follow the pre-set routes but, on the basis of the actual position of the vehicle, which the GNNS antenna communicates with in real-time, the management software allows varying the settings of the implements connected to the tractor (on-off; partial opening or closing of a valve; modification of the setting of some tools; all these actions are called "section control" of the implement) to comply with the indications received from prescription maps (previously loaded into the software itself) or from "on-the-go" sensors.
So, the simulator has been developed to replicate the management of the contents of prescription maps to simulate, for example, a precision distribution (seed, fertilizer, and crop protection products). Figure 2 shows an example of a prescription map in which 3 different field zones are combined with three different doses of fertilizer.

Driving Position Layout
The simulator is static. The driving position is representative of that of a modern agricultural tractor, generic and not attributable to a precise brand, on which the interfaces with the operator is positioned (seat, steering wheel, pedals, a dashboard similar to that of cars, a monitor armrest with primary controls, and a console with secondary controls).

Driving Position Layout
The simulator is static. The driving position is representative of that of a modern agricultural tractor, generic and not attributable to a precise brand, on which the interfaces with the operator is positioned (seat, steering wheel, pedals, a dashboard similar to that of cars, a monitor armrest with primary controls, and a console with secondary controls).
The video system of the simulator is equipped with 4 screens of at least 42": front, left front, right front, and rear to simulate a field of view of a tractor's cab.
In a modern agricultural tractor, the manual controls are positioned on two supports: the armrest and the console. The first, located next to the seat on the right side, houses the primary controls used during work. In addition to the armrest, on the right side of the driver's seat, there is the console on which the secondary controls are placed, relating to the adjustments to be set before starting work, but which are not used during processing.
A touch monitor represents the following functions: • Engine data: power, torque, fuel consumption; Torque to the wheels and adherent weight; • GPS data and view of the auto guidance tractor guidelines; • Implement settings (type, width, sections, etc.); • Prescription maps to verify the work performed by the operator.
Furthermore, two cameras are present to record the driver's behavior during the training/test.

Operating Conditions
The required scenarios are: 1. The simulation of transfer or transport on paved roads in a mainly suburban road environment; 2. Transfer or processing on agricultural land: the environment will be brown-colored land with borders represented by farm roads, country roads ("white") or ditches. 3. The ability to simulate nighttime or poor visibility environments.
In the case of towing a trailer, the effect of the longitudinal traction force on the hook due to the rolling resistance of the tires is considered. The dynamic behavior of the trailer is not simulated. The video system of the simulator is equipped with 4 screens of at least 42 : front, left front, right front, and rear to simulate a field of view of a tractor's cab.
In a modern agricultural tractor, the manual controls are positioned on two supports: the armrest and the console. The first, located next to the seat on the right side, houses the primary controls used during work. In addition to the armrest, on the right side of the driver's seat, there is the console on which the secondary controls are placed, relating to the adjustments to be set before starting work, but which are not used during processing.
A touch monitor represents the following functions: • Engine data: power, torque, fuel consumption; • PTO settings; • Torque to the wheels and adherent weight; • GPS data and view of the auto guidance tractor guidelines; • Implement settings (type, width, sections, etc.); • Prescription maps to verify the work performed by the operator.
Furthermore, two cameras are present to record the driver's behavior during the training/test.

Operating Conditions
The required scenarios are: The simulation of transfer or transport on paved roads in a mainly suburban road environment; 2.
Transfer or processing on agricultural land: the environment will be brown-colored land with borders represented by farm roads, country roads ("white") or ditches.

3.
The ability to simulate nighttime or poor visibility environments.
In the case of towing a trailer, the effect of the longitudinal traction force on the hook due to the rolling resistance of the tires is considered. The dynamic behavior of the trailer is not simulated.
In the case of agricultural land, it is possible to vary the size of the land and its shape, for example not only rectangular but also triangular, irregular shapes, or curvilinear sides, or acquire them from geographic internet services (SAS Planet or others).
It is possible to model sloping terrain to provide the simulation of workings with a tilted tractor.
An audio system that reproduces the sound of the tractor engine will be present. There is the possibility of an outside view of the tractor (i.e., aerial) and of the environment during the execution of the tasks.

Virtual Tractor Design
The tractor model selected for the driving simulation is a commercial tractor. It is a four-wheel drive (mechanical front wheel drive axle type (MFWD)) open-field-type tractor.
A complete three-dimensional tractor design of a commercial tractor was executed in .obj format. The key components of the tractor were modelled, assembled, and parameterized according to the technical specifications supplied by the manufacturer and tested at the CREA-IT facilities as mass, center of gravity, engine characteristics, dynamic behavior ( Figure 1), and soil-tire interface to ensure the real behavior of the model. The adopted tractor had the following main characteristics: Brakes: there are two brake pedals (one for the right and one for the left wheels only), close and connectable. The two pedals can be connected mechanically. When connected, the force measurement on the pedal is required (max. 60 kg). The CREA has provided the correlation curves between the load on the pedal and the tractor's deceleration [32].

The Seeder
The virtual seeder is a six-row corn planter. There are six maize seed distributors, 70 cm apart transversally, capable of distributing one seed at a time, and that can vary the number of seeds placed per square meter by modifying the longitudinal distance between the seeds themselves. The precision required for this operation is 3 cm. Furthermore, during turns, the edges of the field and in some irregularly shaped fields, it must be possible to stop these discs from sowing outside the field or where it has already been sown.
For comparison, with real experimentation the virtual seeder was adapted and designed to distribute on 24 rows over 3 m as the farm was sowing the barley (the .obj file was not modified and appeared as a six-row).

The Fertilizer
The chosen implement distributes the fertilizer placed in a hopper, broadcast through two rotors side by side. The gradual opening of a flap for each rotor allows dose adjustment of fertilizer to be distributed; and the distance at which to distribute the product which can be 0, 8, 16, or 24 m. Furthermore, it is possible to set and monitor the quantity distributed.

The Sprayer
The sprayer is a 1000 L tank and 15 m in width using ISO standard nozzles (for spray angle, maximum flow rate and pressure range). The 15 m width is divided into 5 3 m sections. Each section has 5 nozzles controlled by solenoid valves which can be activated independently and establish the quantity of product to be distributed. The tractor's PTO Agriculture 2023, 13, 1603 9 of 21 moves the pump of the implement, which puts the circuit under pressure. A main valve on the recirculation loop sets the distribution loop pressure.

Vehicle Dynamics Simulation Platform
The CarMaker ® (IPG Automotive GmbH, Karlshrue, Germany) platform is a fullfledged virtual driving environment which offers a wide range of applications from offline operation to hardware-in-the-loop (HIL) tests. CarMaker was designed to support the development process from an early conceptual stage to hardware prototype testing. Therefore, the CarMaker suite is composed of two main components, the CarMaker Interface Toolbox (CIT) and the Virtual Vehicle Environment (VVE). The CIT contains a collection of tools for simulation control, parameterization, analysis, visualization, and file management. The VVE represents the computer-modeled composition of the vehicle with all its components, such as the powertrain, tires, brakes, and chassis, and road and driver. Vehicle components may be implemented by default generic models, custom code such as MATLAB/Simulink controller models or even real hardware on a test rig. Depending on the desired task, the VVE can be operated on a regular office computer or on a real-time system. Real-time operation allows investigation of deterministic behavior; office operation might lack realtime capabilities but is therefore applicable on almost any host computer and allows the simulation to run slower or faster than real-time depending on system performance and model complexity and does not require special hardware.
The generality of the CarMaker VVE allows for the modifications of the vehicle models in an almost arbitrary number of ways. Generic vehicle components such as powertrain, steering, tires, brake system, and the complete propulsion system might be configured. Replacing single vehicle components with so-called custom code is easily performed by dynamically linking executable code and registering variables, parameters, and their dimensions and types within the VVE.
The used platform allows to generate realistic environments, either in field or on public road to properly enable scenarios perception. It is possible to include objects, plants, pedestrians, and animals wherever located in the scenarios and, referring to mobile ones, to attribute a deterministic motion law. Moreover, each element can be associated to reflectivity properties, visible by virtual sensors, such as cameras, ultrasonic, lidar, and radar ( Figure 3). Different environmental conditions can be implemented as well as for day or night operations.

Precision Farming Simulation Platform
The tractor model generated using the CarMaker platform must be equipped with a whole series of features that allow it to be able to perform agricultural operations within a simulated scenario.
To ensure this is a Co-simulation with AgriSI 1.1.2 (Soluzioni Ingegneria, Lecco, Italy) software for the management of the precision farming, Python language is used.
These farming features are not included in the CarMaker 7.0 software. AgriSI communicates with CarMaker and exchange information via a TCP/IP con-

Precision Farming Simulation Platform
The tractor model generated using the CarMaker platform must be equipped with a whole series of features that allow it to be able to perform agricultural operations within a simulated scenario.
To ensure this is a Co-simulation with AgriSI 1.1.2 (Soluzioni Ingegneria, Lecco, Italy) software for the management of the precision farming, Python language is used.
These farming features are not included in the CarMaker 7.0 software. AgriSI communicates with CarMaker and exchange information via a TCP/IP connection. The proposed platforms execute time integration cycles at 1 ms (1 kHz), allowing real time simulations usable for hardware-in-the-loop (HIL) applications.
This software contains all the farming features, and it is composed of three parts: 1. Simulation setting; 2.
Data post-processing.
The first part allows to setup the simulation, giving the possibility to choose the tractor model, the implement model (and so the operation type), and the scenario in which the simulation must be performed. At this stage, the software leads the import of georeferenced scenarios of real fields. It is also possible to select the precision of the position system to see how the control system behaves in case of a noisy or inaccurate GNSS signal.
The second part is to perform the simulation with the chosen setup. The implement should be controlled manually or automatically (in this second case, a prescription map provides the target of the operation). An optimal trajectory for the operation is imported and the tractor should follow it thanks to an automatic steering control.
The third part permits the analysis of the simulation's data and obtains results. Both vehicle dynamics and farming data should be analyzed. Concerning the farming part, it is possible to obtain, for example:

•
Actual distribution map (which should be compared with the prescription map, if any, to obtain the distribution error); • Actual trajectory followed by the tractor; • Time history of the flow rate of each implement distributor; • Time history of the total mass of product spread on the field.

Vehicle Dynamics
The performed test resulted: • Characterization Maneuver on the tarmac: Acceleration and brake, useful to collect tire data and compare numerical and experimental results in longitudinal dynamics; Coast down, useful to characterize both the aerodynamic and rolling resistance on the tarmac; Steering pad, useful to compare numerical and experimental results in lateral dynamics.
• Characterization Maneuver on the field: Acceleration and brake, useful to collect tire data and compare numerical and experimental results in longitudinal dynamics; Coast down, useful to characterize the rolling resistance on the field.

Precision Agriculture
Evaluating the reproducibility of agricultural operations on the simulator entails choosing three field tasks, i.e., sowing, fertilizing and spraying, and performing them on the fields of the province of Bergamo, Italy, dedicated to cultivating extensive crops. The adopted tractor is a CVT with auto guidance system and the three implements were all ISOBUS.
In detail, the sowing operation ( Figure 4) resulted in the distribution of barley adopting a seeder 3 m in width, two sections, and 24 rows (Agromasz Aquila 3000, Agro-Masz Agriculture, Strzelce Małe 78, 97-515, Polland). The chosen field was 4.5 hectares; the target speed was 5 km h −1 and the target dose was 80 kg ha −1 .
experimental results in longitudinal dynamics; o Coast down, useful to characterize the rolling resistance on the field.

Precision Agriculture
Evaluating the reproducibility of agricultural operations on the simulator entails choosing three field tasks, i.e., sowing, fertilizing and spraying, and performing them on the fields of the province of Bergamo, Italy, dedicated to cultivating extensive crops. The adopted tractor is a CVT with auto guidance system and the three implements were all ISOBUS.
In detail, the sowing operation ( Figure 4) resulted in the distribution of barley adopting a seeder 3 m in width, two sections, and 24 rows (Agromasz Aquila 3000, Agro-Masz Agriculture, Strzelce Małe 78, 97-515, Polland). The chosen field was 4.5 hectares; the target speed was 5 km h −1 and the target dose was 80 kg ha −1 .    Coast down, useful to characterize the rolling resistance on the field.

Precision Agriculture
Evaluating the reproducibility of agricultural operations on the simulator entails choosing three field tasks, i.e., sowing, fertilizing and spraying, and performing them on the fields of the province of Bergamo, Italy, dedicated to cultivating extensive crops. The adopted tractor is a CVT with auto guidance system and the three implements were all ISOBUS.
In detail, the sowing operation ( Figure 4) resulted in the distribution of barley adopting a seeder 3 m in width, two sections, and 24 rows (Agromasz Aquila 3000, Agro-Masz Agriculture, Strzelce Małe 78, 97-515, Polland). The chosen field was 4.5 hectares; the target speed was 5 km h −1 and the target dose was 80 kg ha −1 .        The three experiences described were acquired by the MyJohnDeere© system (John Deere World Headquarters One John Deere Place Moline, Illinois 61265) and reproduced on the simulator.

The Driving Position Layout
The driving position consists of an agricultural tractor seat positioned between 4 × 42" screens. The screens simulate the tractor's four windows: front, right, left, and rear ( Figure 7). The controls are on the right, on a console derived from video games. This choice was made in order not to imitate any brands. The controls are necessary for the management of the tractor: PTO, rear lift, hydraulic distributors, the gearbox, manual accelerator, etc.
A tablet manages the specifications of the workings, as well as the interface of the virtual terminal during the working (Figure 8). The controls are on the right, on a console derived from video games. This choice was made in order not to imitate any brands. The controls are necessary for the management of the tractor: PTO, rear lift, hydraulic distributors, the gearbox, manual accelerator, etc.
A tablet manages the specifications of the workings, as well as the interface of the virtual terminal during the working (Figure 8). The system is equipped with a special generation of tractor noise and a camera in case the software is used to monitor operator fatigue. Figure 9 reports an example of the effective view during task performance. Figure 9 shows an example of an operator engaged in carrying out a task, the guidelines and the prescription map are visible. Figure 9 shows a second virtual terminal, on the right, which is also georeferenced, whose task is more aimed at training. The system is equipped with a special generation of tractor noise and a camera in case the software is used to monitor operator fatigue. Figure 9 reports an example of the effective view during task performance. Figure 9 shows an example of an operator engaged in carrying out a task, the guidelines and the prescription map are visible. Figure 9 shows a second virtual terminal, on the right, which is also georeferenced, whose task is more aimed at training.
The system is equipped with a special generation of tractor noise and a camera in case the software is used to monitor operator fatigue. Figure 9 reports an example of the effective view during task performance. Figure 9 shows an example of an operator engaged in carrying out a task, the guidelines and the prescription map are visible. Figure 9 shows a second virtual terminal, on the right, which is also georeferenced, whose task is more aimed at training.

The Virtual Machines
The virtual tractor was realized with the characteristics detailed above (Section 3), starting from the simulation base of a vehicle of the truck type and adapted in the setup to obtain the layout of the tractor, for example the rigid rear axle and the front axle-pivoting. The engine speed and the load are functional to the work that is taking place and, consequently, fuel consumption.
The tractor can be changed as wheelbase, width track and mass distribution directly on the software and the same power can be modified either as a simple gain of the torque curve, or by re-entering a new power curve as a look-up table.
The three implements adopted appear as a rendering as described in materials and methods, can be changed in terms of working width, number of distributors, and distribution width of each single distributor, obviously considering the class of the tractor selected. The implements have been modeled as added masses in case they are mounted or as a trailer in the case of towed or semi-towed. The interface translated from the aerial view looks like Figure 10.

The Virtual Machines
The virtual tractor was realized with the characteristics detailed above (Section 3), starting from the simulation base of a vehicle of the truck type and adapted in the setup to obtain the layout of the tractor, for example the rigid rear axle and the front axlepivoting. The engine speed and the load are functional to the work that is taking place and, consequently, fuel consumption.
The tractor can be changed as wheelbase, width track and mass distribution directly on the software and the same power can be modified either as a simple gain of the torque curve, or by re-entering a new power curve as a look-up table.
The three implements adopted appear as a rendering as described in materials and methods, can be changed in terms of working width, number of distributors, and distribution width of each single distributor, obviously considering the class of the tractor selected. The implements have been modeled as added masses in case they are mounted or as a trailer in the case of towed or semi-towed. The interface translated from the aerial view looks like Figure 10. The power absorbed by the implement is entered manually and is based on CREA experience or on the basis of the ASABE tables [33].
During the experimental test, the fuel consumption of the tractor was acquired from Figure 10. The aerial view of the adopted OBJ of the tractor and of the implements during working.
The power absorbed by the implement is entered manually and is based on CREA experience or on the basis of the ASABE tables [33].
During the experimental test, the fuel consumption of the tractor was acquired from the ECU to evaluate the adsorption power of the implement. The fuel consumption was acquired with the implement switched on and off, in case the seeder also lifted, and the difference of fuel consumption was adopted. The fuel consumption of the sprayer and of the fertilizer resulted in 600 g h −1 indicating about 2 kW h −1 of power requirement. The seeder resulted requiring 30 kW h −1 in the performed work conditions (3 m width; 5 km h −1 ). These values were adopted as engine load at the PTO at the simulator.

The Operating Conditions
Once the characteristics of the machines have been defined, the software application allows the choice between tractors with manual transmission, power shift or continuously variable (simulated by an automatic with 99 gears); two-or four-wheel drive tractor; rural or city environment; night or day working conditions; auto-guidance or manual; agricultural task; and level of technology of the implement (Figure 11). Figure 10. The aerial view of the adopted OBJ of the tractor and of the implements during working.
The power absorbed by the implement is entered manually and is based on CREA experience or on the basis of the ASABE tables [33].
During the experimental test, the fuel consumption of the tractor was acquired from the ECU to evaluate the adsorption power of the implement. The fuel consumption was acquired with the implement switched on and off, in case the seeder also lifted, and the difference of fuel consumption was adopted. The fuel consumption of the sprayer and of the fertilizer resulted in 600 g h −1 indicating about 2 kW h −1 of power requirement. The seeder resulted requiring 30 kW h −1 in the performed work conditions (3 m width; 5 km h −1 ). These values were adopted as engine load at the PTO at the simulator.

The Operating Conditions
Once the characteristics of the machines have been defined, the software application allows the choice between tractors with manual transmission, power shift or continuously variable (simulated by an automatic with 99 gears); two-or four-wheel drive tractor; rural or city environment; night or day working conditions; auto-guidance or manual; agricultural task; and level of technology of the implement (Figure 11). The scenario was prepared by choosing the fields worked at the CREA ( Figure 12) also for the purpose of validating the simulator to compare the simulated and real data. The scenario was prepared by choosing the fields worked at the CREA ( Figure 12) also for the purpose of validating the simulator to compare the simulated and real data.

The Co-Simulation Software
As described in materials and methods, two aspects of the tractor must be considered during the simulations: the vehicle dynamics and the farming operation. A software able to co-simulate these two aspects has been developed, obtaining as a result, a co-simulation platform called AgriSI.

The Co-Simulation Software
As described in materials and methods, two aspects of the tractor must be considered during the simulations: the vehicle dynamics and the farming operation. A software able to co-simulate these two aspects has been developed, obtaining as a result, a co-simulation platform called AgriSI.
Regarding vehicle dynamics, AgriSI relies on the CarMaker platform already described in materials and method.
Concerning farming operations, the platform allows to perform virtual operations in georeferenced scenarios, creating and importing real fields, up to obtaining the digital twin of an entire real farm. It is, therefore, possible to carry out agricultural operations on these fields, define vehicles, implement borders, trajectories, and prescription maps, and everything needed to create the virtual environment to simulate the farming operation.
The platform offers a library of tractor models (built starting from experimental tests carried out on real tractors) equipped with a tire model that considers the contact with elasto-plastic soil. All models are fully parameterizable and customizable. The platform follows a hardware-in-the-loop (HIL) approach by including real vehicle ECUs within the simulation.
The included implements are of three types: seeder, sprayer, and centrifugal fertilizer. For each, geometry, number of distributors and sections, power requests from the PTO and resistant forces due to contact with the ground, can be defined. The control logic for the distribution can be imported and tested in both software-in-the-loop (SIL) and HIL approaches. In this case, the models are fully parameterizable and customizable.
The platform also includes a tool to analyze the data acquired during the virtual operation. It is therefore possible to study and evaluate the data generated by the simulation (Figure 13), both for the part relating to vehicle dynamics (speed, accelerations, torques, forces, fuel consumption, etc.) and for the agricultural part (work times, trajectories, quantities of a distributed product, distribution quality as uniformity or as error with respect to the prescription, etc.) Agriculture 2023, 13, x FOR PEER REVIEW 16 of 21 Figure 13. Examples of screenshots taken from the AgriSI application. The red line shows the trajectory to be followed during the operation and the cyan line highlights the field boundaries. The image on the left is monitoring of the tractor behavior, showing some parameters regarding powertrain, wheel torques, and vertical forces. On the right is the considered prescription map with some information on the implement behavior: flow rate of the distributors, geometrical parameters, and type and remaining quantity of product.
The correctness of the results obtained from the AgriSI simulations has been checked by performing an experimental vs. numerical comparison, as shown in Section 3.3.

Vehicle Dynamics
The target was to use a reliable vehicle dynamic model for the operation on-field. To ensure this, an agricultural tractor numerical model has been implemented, and results are verified with respect to experimental tests. Particular attention is provided to tire characterization in both longitudinal and lateral dynamics and for different soils, such as asphalt and field, which are characterized by different properties that affect the vehicle performances. An agricultural tractor must be suitable for working in a field and running on asphalt while reaching the workplace. For this reason, longitudinal and lateral dynamics maneuvers are identified for analyzing the agricultural tractor numerical model: traction on the field (i.e., longitudinal dynamics maneuver representing tractor working conditions) and steering pad on asphalt (i.e., lateral Figure 13. Examples of screenshots taken from the AgriSI application. The red line shows the trajectory to be followed during the operation and the cyan line highlights the field boundaries. The image on the left is monitoring of the tractor behavior, showing some parameters regarding powertrain, wheel torques, and vertical forces. On the right is the considered prescription map with some information on the implement behavior: flow rate of the distributors, geometrical parameters, and type and remaining quantity of product.
The correctness of the results obtained from the AgriSI simulations has been checked by performing an experimental vs. numerical comparison, as shown in Section 3.3.

Vehicle Dynamics
The target was to use a reliable vehicle dynamic model for the operation on-field. To ensure this, an agricultural tractor numerical model has been implemented, and results are verified with respect to experimental tests. Particular attention is provided to tire characterization in both longitudinal and lateral dynamics and for different soils, such as asphalt and field, which are characterized by different properties that affect the vehicle performances. An agricultural tractor must be suitable for working in a field and running on asphalt while reaching the workplace. For this reason, longitudinal and lateral dynamics maneuvers are identified for analyzing the agricultural tractor numerical model: traction on the field (i.e., longitudinal dynamics maneuver representing tractor working conditions) and steering pad on asphalt (i.e., lateral dynamics maneuver representing tractor transportation conditions). Additionally, a coastdown maneuver characterizes tire rolling resistance [34,35]. A detailed description of the methodology and the achieved results have been presented and discussed [36]. Figure 14 collects the results regarding speed, longitudinal acceleration, and front and rear longitudinal loads for traction on field maneuver from standstill to 22 km h −1 in AWD traction mode. This maneuver simulates the tractor working on the field. Numerical curves lay on experimental curves. Low-frequency oscillations are not present in experimental profiles due to signal filtering.
The target was to use a reliable vehicle dynamic model for the operation on-field. To ensure this, an agricultural tractor numerical model has been implemented, and results are verified with respect to experimental tests. Particular attention is provided to tire characterization in both longitudinal and lateral dynamics and for different soils, such as asphalt and field, which are characterized by different properties that affect the vehicle performances. An agricultural tractor must be suitable for working in a field and running on asphalt while reaching the workplace. For this reason, longitudinal and lateral dynamics maneuvers are identified for analyzing the agricultural tractor numerical model: traction on the field (i.e., longitudinal dynamics maneuver representing tractor working conditions) and steering pad on asphalt (i.e., lateral dynamics maneuver representing tractor transportation conditions). Additionally, a coast-down maneuver characterizes tire rolling resistance [34,35]. A detailed description of the methodology and the achieved results have been presented and discussed [36]. Figure 14 collects the results regarding speed, longitudinal acceleration, and front and rear longitudinal loads for traction on field maneuver from standstill to 22 km h −1 in AWD traction mode. This maneuver simulates the tractor working on the field. Numerical curves lay on experimental curves. Low-frequency oscillations are not present in experimental profiles due to signal filtering.  Figure 15 collects the results in terms of speed, imposed trajectory, lateral acceleration, and rear vertical loads for a steering pad maneuver on asphalt from stand still to 30 km h −1 in RWD traction mode. This maneuver simulates the tractor transportation on the road for reaching the working field. Numerical curves lay on experimental curves. Experimental curves oscillations are due to real tractor steering angle correction and not present in numerical profiles since in this last case a trajectory is imposed rather than a steering wheel angle trend to be followed.  Figure 15 collects the results in terms of speed, imposed trajectory, lateral acceleration, and rear vertical loads for a steering pad maneuver on asphalt from stand still to 30 km h −1 in RWD traction mode. This maneuver simulates the tractor transportation on the road for reaching the working field. Numerical curves lay on experimental curves. Experimental curves oscillations are due to real tractor steering angle correction and not present in numerical profiles since in this last case a trajectory is imposed rather than a steering wheel angle trend to be followed. Figure 15 collects the results in terms of speed, imposed trajectory, lateral acceleration, and rear vertical loads for a steering pad maneuver on asphalt from stand still to 30 km h −1 in RWD traction mode. This maneuver simulates the tractor transportation on the road for reaching the working field. Numerical curves lay on experimental curves. Experimental curves oscillations are due to real tractor steering angle correction and not present in numerical profiles since in this last case a trajectory is imposed rather than a steering wheel angle trend to be followed.

The Experimental Test
The three operations carried out were successfully reproduced on the simulator. The results are reported graphically for immediate reading as distribution maps in Figures 16-18. On the left are the maps generated by the MyJohnDeere © system, and on the right are the simulation results.

The Experimental Test
The three operations carried out were successfully reproduced on the simulator. The results are reported graphically for immediate reading as distribution maps in Figures 16-18. On the left are the maps generated by the MyJohnDeere © system, and on the right are the simulation results.     The results are reported in terms of worked area (ha), distributed dose (kg ha −1 ), mean forward speed (km h −1 ), productivity (ha h −1 ), and fuel consumption (l h −1 ) and are reported in Table 2 for the sowing, Table 3 for the fertilizing, and in Table 4 for the spraying.     The results are reported in terms of worked area (ha), distributed dose (kg ha −1 ), mean forward speed (km h −1 ), productivity (ha h −1 ), and fuel consumption (l h −1 ) and are reported in Table 2 for the sowing, Table 3 for the fertilizing, and in Table 4 for the spraying.  The results are reported in terms of worked area (ha), distributed dose (kg ha −1 ), mean forward speed (km h −1 ), productivity (ha h −1 ), and fuel consumption (l h −1 ) and are reported in Table 2 for the sowing, Table 3 for the fertilizing, and in Table 4 for the spraying.  Although the experience was conducted in only one task for each implement and in the future they may require adjustments in the parameters of the vehicles, they confirm the success in the development of a simulator for precision agriculture 4.0. In the specifics of fuel consumption, it should be considered that, apart the different layout of the machines as shown in Table 4 for the sprayer, the tractor adopted for the power curve in the simulator is not the same tractor with which the operations in the field have been performed.

Discussion
A human-in-the-loop approach was evaluated in the development of a simulator for precision agriculture. A static simulator (SimAgri) was purpose designed realized reproducing an agricultural tractor driving environment and used to emulate in-field operations. Vehicle and implement dynamics models have been implemented and correlated with experimental data. A software developed for PA simulation (AgriSI © ) was used to quantify and rank operations' results between several variants. The tool has been demonstrated to be effective in reproducing real tests and will be adopted for training tasks and to investigate the advantages of digital agriculture.