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:
- Satellite positioning — pseudorange and carrier-phase solutions with integer ambiguity resolution — RTK ambiguity resolution (no page yet), Pseudorange least-squares positioning (no page yet), Extended Kalman filter, LU and Cholesky
- Path following and control — steer the tractor on the planned line — Pure-pursuit path tracking (no page yet), Model predictive control, Runge-Kutta 4, Fixed-rate control loop, Kalman filter, Quadratic programming (no page yet)
- Field coverage planning — the passes that cover a field with little overlap — Coverage path planning (no page yet), Occupancy grid (no page yet), Polygon clipping (no page yet), A* search
- Machine bus — talk to the implement — CAN bus framing (no page yet)
- Geometry — distances, boundaries, covered area — Geodesic distance, Newton root finding, Point-in-polygon (no page yet), R-tree
- Prescription maps — interpolate samples into a dose map — Kriging spatial interpolation (no page yet), k-d tree, Gaussian processes (no page yet)
- Crop and weed vision — find plants and weeds in camera frames — Object detection, Convolutional networks, Non-maximum suppression, Loss functions, Data augmentation, Image warping and remap (no page yet)
- Edge inference — fit the model on a low-power machine computer — Weight quantization, Low-precision number formats (no page yet)
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.
- The farm system exports field boundary, A-B line or planned passes, and a prescription map as task data to the tractor's terminal.
- The operator selects the task; the guidance computer receives RTK corrections and reaches a fixed solution.
- At the fixed rate the EKF produces a pose; the path controller computes steering; the steering valve responds.
- 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).
- For each section, the task controller looks up the dose in the prescription map at the section's cell and sends it over ISOBUS.
- The implement reports the applied amount per cell; the terminal records it into the as-applied map and the covered-area polygons.
- After the job the as-applied map and totals go back to the farm system.
Spot spraying.
- A frame is captured; the detector returns boxes; they are mapped to the ground plane.
- Each box is assigned to a nozzle and a delay; the nozzle opens for the box length plus a margin.
- The event is logged with position, giving a weed map for the next season.
Planning a field.
- The boundary is clipped inwards by headland width and obstacles are removed.
- The coverage planner generates the pass sequence; the route planner orders cells and connections.
- The operator reviews it on the map; it becomes a task.
Scaling
- 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.
- Control timing. Latencies from sensor to valve. Levers: fixed-rate loops, a dedicated real-time core, measuring and compensating the actuator delay.
- Spatial query cost. Covered area grows through the day. Levers: R-tree with merged polygons or a raster mask at the working resolution.
- Vision throughput. Frames per second per boom. Levers: smaller or quantized models, region-of-interest crops, lower resolution at the speed that matters.
- 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
| Failure | Symptom | Cause | Fix |
|---|---|---|---|
| Float solution used as fixed | lines drift by decimetres between passes | correction age, poor sky view, wrong ambiguity acceptance | require a fixed state for work, show the state, stop or slow when lost |
| Slope error | passes shift on hillsides | antenna offset not corrected for roll and pitch | IMU tilt compensation, calibrated antenna height |
| Latency not compensated | skips and overlaps at section edges | actuator delay ignored | look-ahead by delay × speed, calibrate per implement |
| Control oscillation | snaking on the line | look-ahead too short, variable dt, steering lag | speed-dependent look-ahead, fixed-rate loop, model the lag |
| Boundary error | spraying outside the field | boundary survey error, wrong projection | verified boundaries, exclusion buffers near water |
| Map misregistration | wrong dose in the wrong place | prescription map in another datum or frame | explicit coordinate reference in the task data, check on load |
| Detector fails in new conditions | misses or false sprays | lighting, growth stage, unseen weed species | augmentation, field-collected data, conservative defaults, operator override |
| Bus errors | implement ignores commands | CAN bus load, bad termination, missing ECU | bus monitoring, heartbeat checks, safe state on timeout |
| Data loss | no record for compliance | cable pulled, terminal restarted | log locally, flush periodically, resume the job |
Real implementations
| name | what it is | repo | licence | notes |
|---|---|---|---|---|
| AgOpenGPS | open-source guidance, section control and mapping software | AgOpenGPS-Official/AgOpenGPS | Apache-2.0 | community project; hardware from hobbyist boards |
| RTKLIB | open-source GNSS positioning library and tools (RTK, PPP, NTRIP, RTCM) | tomojitakasu/RTKLIB | BSD-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-plus | MIT | virtual terminal, task controller, CAN layer |
| farmOS | farm management and record keeping | farmOS/farmOS | GPL-2.0 | fields, logs, assets; API for equipment data |
| OpenWeedLocator | camera-based weed detection with relay output for spot spraying | geezacoleman/OpenWeedLocator | MIT | low-cost, colour-based detection and ML options |
| OpenDroneMap (ODM) | drone image processing into orthophotos and maps | OpenDroneMap/ODM | AGPL-3.0 | source 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.