By Sal1800
This is a simplified simulation of an agriculture GPS navigation system that allows you to generate navigation tracks over a field, spaced to cover the entire field using a pattern that is convenient to fly. When paired with a light bar, this system provides precision guidance to complete the job.
In free flight, you can select any area to plot a pattern. By marking a start and end point, you establish a prime swath line. Mark an additional position to specify the extents of the area and it will get filled with a flight pattern. The light bar will guide you to the track for each swath line.
You can use this by selecting the Ag Nav Mod variant of the Air Tractor 802.
The source files include a Microsoft Flight Simulator 2024 addon project that can be built with the sim into an addon community package.
To use the Sat Nav and Lightbar in your own MSFS aircraft projects, use the instrument files in the PackageSources/html_ui directory and the attachment files in the PackageSources\SimObjects\Airplanes\asobo_at802\attachments directory. Follow the pattern shown with the other aircraft to integrate these attachments into the aircraft of your choice.
This code is freely licensed for distribution in other MSFS addons, freeware or commercial. You can modify the instrument code to alter the lightbar behavior or to modify the interfaces to better suit your needs. I would appreciate sharing of any resulting modifications back to the community.
The lightbar can operate either with the sim's GPS track or from custom variables set by the Sat Nav instrument.
The Sat Nav system uses the simulation variables for latitude and longitude to plot the aircraft's position and waypoints. It then uses the vectors between the waypoints to plot the parallel swath lines. This works out to be very accurate for rectangular fields but some field shapes and orientations can produce incorrect plots. All the other parameters displayed are derived from simulation variables.
The map display area is drawn with a canvas element with a high frequency but less than the maximum animation frame rate. This may not be the most efficient method especially if the plot is very large. I used some LLM assistance in the prototyping stage, especially to derive the geographic calculation formulas and some of the plotting code. Other than that, I find the AI cumbersome to use when developing and refining the UI and interaction code.
Across the top are three indicators. From left to right: Active Job pattern Next line number to fly Cross track error in feet. Prefixed with "L" or "R" signifying the direction of the track.
The center area is the plotting area. Compass displays true North relative to the airplane's heading. Heading indicator in the top center Zoom controls on the right side Aircraft position indicator
The left side panel contains the following: Wind direction and speed A graphical indicator of the wind direction relative to the plane's heading Outside air temperature in fahrenheit (T) Barometric pressure in in/Hg. (B) Groundspeed in knots (GS) Length of the A-B line (L) Width of the area (W) Acres of the designated area (ACR) Current swath track (TK) Swath width in feet (SW) lines completed / total lines Sprayed area in acres (SA) Tank volume remaining in gallons (VOL)
The bottom bar contains buttons to interact with the system: Back: Selects the previous line New Area: Create a new area Mark: Mark a waypoint or a A, B, C point Next: Selects the next line
The 3-digit number on the left side shows the desired track to the next waypoint. In an actual Ag Nav system, this area would show the next line number to spray.
The 3-digit number on the right is the cross track error in feet. This is the lateral distance to the desired track. A number will appear when the cross track error is less than 90 degrees.
If a letter "R" preceeds this number, the desired track is to your right hand side. A letter "L" signifies the track is to your left. These letters indicate the direction to fly to reach the track.
The row of leds across the center top represents the cross track distance in graphical form. Each of the 12 LEDs per side follows a threshold curve described by this array: [1,3,5,7,10,15,20,25,30,40,50,60]
In this version, these thresholds are multiplied by 10 to reduce the sensitivity.
The amber centerline represents zero error when no LEDs are lit.
The bottom row of LEDs represents the Angle of Intercept or the track angle error in degrees. When no LEDs are lit on the bottom row, you are on the desired track heading. Each dot from the center out indicates a higher angle. These follow this curve: [0.5,1,1.5,2,3,4,5,10,20,30,45,60]
Amber arrows pointing either left or right will be lit when the cross track distance is greater than 60 feet in either direction.
Finally, there is a set of blue LEDs in the center that will light when the spray nozzles/doors are open.
Load some liquid in the drop system. This is done from the EFB screen where you set the aircraft weight. Fly to the field you wish to spray. Select "New Area". By default, the swath width is 75 ft. and a left turn racetrack pattern is selected. The patterns are explained below. Racetrack is a good general-purpose pattern. Click Start Area to arm the A point
For a left turn racetrack pattern, line up the first swath on the right edge of the field. At the startpoint, begin the spray. This will mark the 'A' point. When you reach the end of the swath and close the spray door, it will mark the 'B' point.
Ensure that your A-B line is straight because the rest of the pattern will follow this bearing. Make a left turn and fly to the other boundary of the field. Mark the 'C' point parallel to the 'B' point by starting to spray the far edge of the field. As soon as you mark the 'C' line, the field will be plotted. When you complete this line, it will automatically advance to the next line.
For a racetrack pattern, the next line will be number 2, near the starting point. Depending on the size of the field, you may need to turn to the right to create more room for the 180 degree turn. In the Air Tractor, give at least 1,500 feet away from the track to have enough room to turn comfortably. You can read the cross track distance from the top right of the sat nav display.
The extended blue line on your display indicates the track to follow. The light bar will show the cross track distance and angle of incidence error but only when you are within 60 feet of the track.
As you release the spray, a light green line will be drawn on the display to indicate the spray pattern. The cumulative area of these lines are shown in the display by the Spray Area (SA) in acres.
After completing line 2, the next swath will be in the center of the field. And next after that is back to line 3. This pattern continues as you spray each half of the field and progress until you reach the end.
If you start a new area, it will erase the current plot and sprayed area.
Back to Back This pattern only requires an A-B line and it will add new lines each time you press Next. This is the most straight forward pattern where you just fly back and forth on consecutive lines. The turns are very tight.
Racetrack The is a good general purpose pattern. You fly an A-B line and mark C on the opposite boundary. Then fly line 2 followed by the center line and then progress.
Quick Racetrack Similar pattern to Racetrack except that the C line is in the center of the field which saves you from flying all the way to the boundary.
Reverse Racetrack * The A-B line is in the center of the field and the C line is the boundary. The pattern moves in the opposite direction as Racetrack. Useful for circular fields.
Squeeze This pattern flies in loops from the outside to the center. This is suitable where the start of the job is more heavily loaded and the aircraft gets lighter as you progress making the tighter turns easier.
Expand * The A-B line is in the center of the field. Each line will be generated when you click Next. Fly swaths from the center outward. Useful for circular fields.
- For these patterns, mark the center first.