← Back
Home › Systems › Energy, industry and public infrastructure

precision-agriculture

Guides tractors and sprayers by field maps so seed, fertilizer, and spray are applied at the right place and rate.

John Deere

Open the precision-agriculture pageprecision-agriculture Can bus framingembedded: CAN / CAN FD frames, bitwise arbitration, bit stuffing, CRC and error confinementGeodesic distance (haversine,Vincenty, Karney)geometry: Shortest-path distance between two lat/lon points on the Earth: haversine on a sphere (about 0.5% error), Vincenty or Karney on the WGS84 ellipsoid (sub-millimetre).›Kriging spatial interpolationgeometry: Variogram-based kriging and IDW to interpolate sampled field values onto gridsPoint in polygongeometry: Ray-casting/winding tests and indexed polygon lookup for reverse geocodingR-treegeometry: A balanced tree of nested bounding boxes that indexes rectangles and points, answering window and nearest-neighbour queries by pruning whole subtrees.›Image warping remapgraphics: Resampling with lookup maps: resize, lens undistortion, homographies, bilinear/bicubicObject detectionmachine-learning: A network turns an image into scored, classified boxes in one pass; anchor-based, anchor-free and set-prediction heads differ in how they assign labels and remove duplicates.›Convolutional networksml-training: Layers that slide a small shared kernel over a grid, giving translation equivariance and few parameters; still the most compute-efficient choice for many vision tasks.›Weight quantizationml-training: Store weights as 8/4-bit integers with per-group scales; decode is memory-bound, so 4-bit weights give about 3-4x tokens/s and fit 4x larger models.›Coverage path planningrobotics: Boustrophedon and cell-decomposition paths that cover a field or area with minimal overlapExtended Kalman filterrobotics: Kalman filter for nonlinear motion and measurement models: linearize f and h with Jacobians at the current estimate each step. The default estimator in robot navigation.›Model predictive controlrobotics: Each tick, solve a small optimization over a predicted horizon, apply only the first input, repeat. Handles constraints and multiple inputs that a PID loop cannot.›Pure pursuit path trackingrobotics: Geometric path following by steering to a look-ahead point (pure pursuit, L1, Stanley)Rtk ambiguity resolutionsignal-processing: RTK carrier-phase differencing and integer ambiguity resolution (LAMBDA) for cm positioningNewton root findingnumerics: Linearize at the guess and jump to the tangent root; quadratic convergence near a simple root, made robust by brackets (1D) or line search.›k-d treegeometry: A binary tree that splits k-dimensional points by one coordinate per level, giving fast nearest-neighbour and box queries on static low-dimensional data.›Gaussian processesmachine-learning: GP regression with kernels: posterior mean/variance via Cholesky, hyperparameters by marginal likelihoodData augmentationmachine-learning: Generate label-preserving variants of each training example on the fly to enlarge the effective dataset and bake in invariances.›Loss functionsmachine-learning: The scalar a model minimizes: cross-entropy for classes and tokens, MSE or Huber for values, each with a stable form and simple gradient.›Non-maximum suppressionmachine-learning: Keep the best-scoring candidate in each neighbourhood and drop the rest; greedy NMS, Soft-NMS and 1-D peak picking share one loop.›Low precision number formatsnumerics: Bf16, fp16, fp8 (E4M3, E5M2), MX block formats and int4: ranges, rounding, scalingLU and Cholesky factorizationnumerics: Factor A = PLU (any square matrix, partial pivoting) or A = LLᵀ (SPD) once in O(n³), then solve each right-hand side in O(n²).›Polygon clippinggeometry: Polygon intersection/union/difference (Weiler-Atherton, Martinez) for spatial predicatesA* searchgraphs: Dijkstra ordered by cost-so-far plus an admissible estimate of the remaining cost; optimal paths while exploring far fewer nodes toward the goal.›Occupancy gridrobotics: Probabilistic grid map updated with log-odds from range sensorsFinite differencesnumerics: Replace derivatives with weighted differences of grid values; simple stencils plus a stability condition (CFL) turn PDEs like heat, advection and waves into array loops.›+ 5 moreExact geometric predicatesgeometry: Robust orient and incircle tests with adaptive-precision floats (Shewchuk) or exact arithmeticd-ary heapdata-structures: Array heap with d children per node (d = 4 typical): half the binary heap's depth, siblings in one cache line, faster priority queues.›Dijkstra's algorithmgraphs: Single-source shortest paths with non-negative edge weights by settling vertices in order of distance with a priority queue.›Explicit Eulernumerics: Step an ODE forward by its current slope, y += h·f(t, y); first-order, one evaluation per step, the baseline every other integrator is measured against.›Thomas tridiagonal solvernumerics: O(n) tridiagonal linear solve used in implicit finite-difference and spline schemes+ 5 more+ 1 more+ 1 more+ 1 more+ 1 more

How it is built

Architecture overview

Precision agriculture treats a field as a map, not as a unit. A tractor or sprayer knows its position to a few centimetres, follows planned paths without a driver's hands on the wheel, and changes what it does (seed rate, fertiliser dose, spray on or off) from place to place according to a map or a camera. Three layers do this. A positioning layer fuses satellite measurements with inertial sensors into a pose at tens of hertz. A guidance and implement-control layer turns paths and prescription maps into steering and into commands for the implement over the machine's CAN network (ISOBUS). A farm-data layer plans the field work, builds the maps (soil samples, yield, imagery) and receives the record of what was done.

The idea that makes it work is that centimetre positioning and a shared machine bus make everything else a lookup: "where am I, what is the dose here, which boom section is over already-treated ground". Each of those questions is a fast spatial query on a map held on the machine, and the work log is the same map written back.

Parts:

 GNSS antenna ─┐                       ┌──── NTRIP corrections (base station / network)
 IMU, wheel ───┼─► EKF pose (50 Hz) ◄──┘                         farm management system
 steering angle┘        │                                         ┌─────────────────────────┐
                        ▼                                         │ field boundary, A-B line│
 planned path ─► pure pursuit / MPC ─► steering valve (CAN)       │ prescription map ───────┼──┐
                        │                                         │ as-applied map ◄────────┼──┼─┐
                        ▼ pose + implement geometry               └─────────────────────────┘  │ │
 coverage map (polygons, R-tree) ─► section control ─► ISOBUS implement ECU ◄── task data ◄─────┘ │
 camera ─► detector (quantized) ─► nozzle on/off (spot spraying) ──────────────────────────────────┘

How the parts fit together

Positioning

A GNSS receiver measures pseudoranges (distance plus clock error) to at least four satellites; Pseudorange least-squares positioning (no page yet) iterates a linearised least-squares solution for position and receiver clock bias, solved with LU and Cholesky. That gives metres. For centimetres the receiver uses the carrier phase, which is millimetre-precise but ambiguous by an unknown whole number of cycles. RTK ambiguity resolution (no page yet) differences the observations against a nearby base station (or a network of them) so common errors cancel, then searches for the integer ambiguities that fit; the search is decorrelated first and then tested by a ratio test (the LAMBDA method). A fixed solution (integers accepted) is cm-level, a float one is decimetres, and the receiver reports which it has: guidance must treat them differently. Corrections reach the tractor over a cellular link, commonly in the NTRIP protocol carrying RTCM messages.

The receiver's output is not used raw. An Extended Kalman filter fuses GNSS position at a few Hz to 20 Hz with inertial measurements at hundreds of Hz and wheel speed, so the pose is smooth and keeps running through short outages (a tree line, a missing correction). The IMU also provides roll and pitch, which correct the antenna's position to the ground point under the implement on a slope: an antenna 3 m above the ground at 5 degrees of roll is 26 cm off laterally (derived: 3 m × sin 5°), far more than the target accuracy.

Guidance and steering

The planned path is a sequence of lines and curves; the controller steers the machine to follow it. Pure-pursuit path tracking (no page yet) picks a look-ahead point on the path and computes the steering angle that arcs to it; it is simple, robust and has one main parameter (look-ahead distance, grown with speed). When the machine pulls a trailed implement or must respect steering-rate and angle limits, Model predictive control predicts over a short horizon with a kinematic model (integrated with Runge-Kutta 4) and solves a small Quadratic programming (no page yet) each step; heading and slip are estimated with a Kalman filter. Whichever controller is used, it runs as a Fixed-rate control loop (order of 10 to 100 Hz): a constant dt and absolute deadlines so latency does not wander. Output goes to the steering valve through the machine bus, with limits in a separate safe layer.

Field coverage and planning

The field is a polygon with obstacles and headlands (the turning strips at the ends). Coverage path planning (no page yet) generates parallel passes (boustrophedon) at the implement width with the shortest total turning and least overlap; for irregular fields it decomposes the polygon into cells that are each covered by parallel passes. Inset boundaries and exclusion zones come from Polygon clipping (no page yet), and the sequence of cells and the connecting routes come from A* search over a graph of passes and headland links. Occupancy grid (no page yet) is the probabilistic map for what the machine learns while driving (rocks, ditches, a standing obstacle detected by a sensor) and is updated with log-odds.

Machine bus

An implement is a set of ECUs on a CAN network; ISOBUS (ISO 11783) defines how tractor and implement talk: it builds on SAE J1939, runs at 250 kbit/s, and covers a virtual terminal (the implement's UI shown on the tractor's display), a task controller (the tractor tells the implement where it is and what dose to apply, and the implement reports what it did) and the exchange of task data (ISO 11783-10). CAN bus framing (no page yet) is the layer beneath: frames with identifiers that double as priorities (bitwise arbitration), bit stuffing, CRC and error confinement. The practical consequence is that the tractor's guidance computer and a sprayer from another manufacturer share one language, and a missing or slow ECU can be detected by its heartbeat.

Geometry on the machine

Distances between lat/lon points use Geodesic distance (haversine is about 0.5 % off on a sphere; an ellipsoidal method is exact to millimetres, per that block), but for field work the pose is usually converted once into a local planar frame (a map projection around the field), where passes and boundaries are plain geometry; the projection's inverse sometimes needs Newton root finding. Section control needs two spatial questions per cycle: is the boom section's centre inside the field boundary and outside exclusion zones (Point-in-polygon (no page yet)), and is it over ground already covered. The covered area is a set of polygons that grows with every pass, so a bounding-box index, the R-tree, answers "which covered polygons touch this section's footprint" in logarithmic time. The machine looks ahead by the actuator delay: valve opening takes tens to hundreds of milliseconds, and at 10 km/h (2.8 m/s) a 200 ms delay is 56 cm.

Prescription maps

Soil samples and yield data are points; a variable-rate applicator needs a continuous map. Kriging spatial interpolation (no page yet) fits a variogram (how similar two samples are as a function of distance) and gives, at each grid cell, the best linear estimate with its variance; inverse distance weighting is a cheaper alternative. Gaussian processes (no page yet) are the same idea with learned kernels and a posterior uncertainty, which also suggests where to sample next. The nearest-sample lookup behind these uses a k-d tree. The output is a grid or polygon map with one value per cell (dose, seed rate), which the task controller serves to the implement as the machine moves.

Crop and weed vision

For targeted spraying a camera looks ahead of the boom and a detector decides per nozzle whether a weed is in its footprint. A Convolutional networks backbone in a one-pass Object detection model outputs scored boxes, and Non-maximum suppression keeps one per object. Training uses Loss functions suited to the imbalance (many soil pixels, few weeds) and heavy Data augmentation (lighting, blur, growth stage) because the field changes by hour and by season. Image warping and remap (no page yet) removes lens distortion and projects pixels onto the ground plane so the box position becomes a nozzle number and a time (distance divided by speed).

Edge inference

The computer on a sprayer has a power and thermal budget, and the latency budget is the sum of exposure, inference, nozzle logic and valve opening. At 15 km/h (4.2 m/s) every 50 ms of latency is 21 cm of position error, so the model must be fast, not just accurate. Weight quantization cuts memory traffic (int8 or 4-bit weights), and Low-precision number formats (no page yet) explain the range and rounding behaviour of fp16 and int8 so accuracy loss is checked, not assumed.

Data and control flow

A pass with variable-rate application.

  1. The farm system exports field boundary, A-B line or planned passes, and a prescription map as task data to the tractor's terminal.
  2. The operator selects the task; the guidance computer receives RTK corrections and reaches a fixed solution.
  3. At the fixed rate the EKF produces a pose; the path controller computes steering; the steering valve responds.
  4. The pose and implement geometry give the position of each boom section; the section controller looks up the covered-area index and the boundary; sections turn off over covered or outside ground (with look-ahead for valve delay).
  5. For each section, the task controller looks up the dose in the prescription map at the section's cell and sends it over ISOBUS.
  6. The implement reports the applied amount per cell; the terminal records it into the as-applied map and the covered-area polygons.
  7. After the job the as-applied map and totals go back to the farm system.

Spot spraying.

  1. A frame is captured; the detector returns boxes; they are mapped to the ground plane.
  2. Each box is assigned to a nozzle and a delay; the nozzle opens for the box length plus a margin.
  3. The event is logged with position, giving a weed map for the next season.

Planning a field.

  1. The boundary is clipped inwards by headland width and obstacles are removed.
  2. The coverage planner generates the pass sequence; the route planner orders cells and connections.
  3. The operator reviews it on the map; it becomes a task.

Scaling

  1. Position quality. The first limit is correction availability and satellite visibility. Levers: network RTK with a fallback source, multi-constellation receivers, inertial fusion for outages.
  2. Control timing. Latencies from sensor to valve. Levers: fixed-rate loops, a dedicated real-time core, measuring and compensating the actuator delay.
  3. Spatial query cost. Covered area grows through the day. Levers: R-tree with merged polygons or a raster mask at the working resolution.
  4. Vision throughput. Frames per second per boom. Levers: smaller or quantized models, region-of-interest crops, lower resolution at the speed that matters.
  5. Fleet and farm data. Many machines, many seasons. Lever: standard task-data exchange and a farm system as the single store, with machines holding only the current jobs.

Failure modes

FailureSymptomCauseFix
Float solution used as fixedlines drift by decimetres between passescorrection age, poor sky view, wrong ambiguity acceptancerequire a fixed state for work, show the state, stop or slow when lost
Slope errorpasses shift on hillsidesantenna offset not corrected for roll and pitchIMU tilt compensation, calibrated antenna height
Latency not compensatedskips and overlaps at section edgesactuator delay ignoredlook-ahead by delay × speed, calibrate per implement
Control oscillationsnaking on the linelook-ahead too short, variable dt, steering lagspeed-dependent look-ahead, fixed-rate loop, model the lag
Boundary errorspraying outside the fieldboundary survey error, wrong projectionverified boundaries, exclusion buffers near water
Map misregistrationwrong dose in the wrong placeprescription map in another datum or frameexplicit coordinate reference in the task data, check on load
Detector fails in new conditionsmisses or false sprayslighting, growth stage, unseen weed speciesaugmentation, field-collected data, conservative defaults, operator override
Bus errorsimplement ignores commandsCAN bus load, bad termination, missing ECUbus monitoring, heartbeat checks, safe state on timeout
Data lossno record for compliancecable pulled, terminal restartedlog locally, flush periodically, resume the job

Real implementations

namewhat it isrepolicencenotes
AgOpenGPSopen-source guidance, section control and mapping softwareAgOpenGPS-Official/AgOpenGPSApache-2.0community project; hardware from hobbyist boards
RTKLIBopen-source GNSS positioning library and tools (RTK, PPP, NTRIP, RTCM)tomojitakasu/RTKLIBBSD-2-Clause with additional terms (see readme)contains the LAMBDA search (lambda.c); last push 2024-05
AgIsoStack++ISOBUS (ISO 11783) stack in C++Open-Agriculture/AgIsoStack-plus-plusMITvirtual terminal, task controller, CAN layer
farmOSfarm management and record keepingfarmOS/farmOSGPL-2.0fields, logs, assets; API for equipment data
OpenWeedLocatorcamera-based weed detection with relay output for spot sprayinggeezacoleman/OpenWeedLocatorMITlow-cost, colour-based detection and ML options
OpenDroneMap (ODM)drone image processing into orthophotos and mapsOpenDroneMap/ODMAGPL-3.0source of NDVI-type field maps

Commercial guidance and implement-control systems from the large machinery makers follow the same split but are closed.

Sources

  • P. J. G. Teunissen, The least-squares ambiguity decorrelation adjustment: a method for fast GPS integer ambiguity estimation, Journal of Geodesy, 1995. doi
  • ISO 11783 Tractors and machinery for agriculture and forestry - Serial control and communications data network (ISOBUS), parts 1 to 14, as summarised in BSI catalogue and the Sontheim ISOBUS note (250 kbit/s CAN, based on SAE J1939).
  • RTKLIB readme: tomojitakasu/RTKLIB (supported formats include RTCM 2.3 and 3.x and NTRIP).
  • Repositories above (licences from the GitHub API or the readme, 2026-10-21).
  • Look-ahead and tilt examples are derived arithmetic (marked in the text); the NTRIP, ISOBUS virtual terminal and task controller roles are from the public ISOBUS descriptions and not re-checked against the standard text.

Similar systems

Share the most building blocks with this one.

In-house systems

Named systems of this kind at large companies, with their paper or write-up.