Inspiration

Harvest looks simple from the outside: the crop's ready, so you go and cut it. In practice it's a scramble. Grain has to be dry enough to combine and dry enough to store, the weather keeps changing its mind, and every day you wait the crop loses value. US extension trials found wheat yields drop somewhere between 0.5% and 2.5% for every day harvest is delayed once the grain hits 18% moisture. Now multiply that across dozens of fields, three crops and a handful of combines, on margins that are already thin.

We wanted to know how real farms actually deal with this, so we rang Ed at Apsley Farms. They run about 9,000 acres of arable land and cut up to 300 acres a day at peak. Their system is someone driving from field to field with a hand-held moisture meter, then sending the combines out based on those readings. The trouble is that moisture isn't the same across a field, or across a day. Sometimes they're halfway through a field, it turns out to be too wet, and the whole fleet has to go back to the yard. Ed told us a delay can cost them tens to hundreds of thousands of pounds, and that he'd "pay good money" for something that sorted out the routing for him.

That conversation is really where the project came from. Autonomous combines are coming, but somebody (or something) still has to decide where they go and when.

What it does

Time to Harvest is a planning layer for a harvest fleet. It decides which field each combine should be in, hour by hour, and keeps changing its mind as new information comes in.

  • It pulls in an ensemble weather forecast (Met Office MOGREPS-UK at 2 km for live runs: rain, temperature and humidity, about 5 days ahead).
  • For each field it estimates how the grain moisture will change, and turns that into a value in £ per hectare for cutting that field in each hour. That value accounts for the crop price, the drying charges and weight deductions at the grain store, and the slow loss from leaving the crop standing.
  • A planner then works out a route for every combine at once to make the most money overall, including the cost of diesel, operators, road escorts and wear on the machines.
  • Every time a new forecast or moisture reading arrives (every 6 hours in our setup), it replans from where the machines actually are.

It isn't tied to any particular machine. The idea is that it sits on top of whatever autonomy stack a combine already has and acts as the brain for the whole fleet.

We built two front ends for it: a control panel that shows the plan, the fields and why each combine is going where it is, and a simpler farmer-facing site with real weather maps that shows what using it day to day might look like.

To test it properly we replayed the whole of the 2024 summer (9 June to 10 September) on a 10,000-acre farm around Elveden in Suffolk, using the forecasts that were actually issued at the time and the weather that actually happened. Our planner finished the farm on 29 July and ended the season £502k (12%) ahead of a model of how a farmer runs harvest today.

How we built it

Everything is in Python with numpy, kept deliberately plain so anyone on the team could pick up any piece.

The farm. We traced 312 real fields around Elveden by hand from satellite imagery, skipping woodland, heath and built-up land, until we had 10,000 acres. These are grouped into 20 blocks of wheat, barley and oilseed rape, with road travel times between them and the yard. The three combines have realistic work rates and fuel tanks, and they have to go back to the yard to refuel.

Real numbers. We tried hard to make every number something we could point to: grain prices from Farmers Weekly and AHDB, yields from the AHDB harvest report, drying charges and moisture targets from Camgrain's published tariff, diesel use and repair costs from the literature. Every value lives in one params.yaml with a comment saying where it came from.

The value function. Grain dries in dry air and picks moisture back up when it rains. We step that forward for every forecast member separately and only average at the end, so the planner sees the real spread of outcomes and not just one middle-of-the-road guess.

The planner. The main one is a cooperative model predictive controller. Each combine takes a turn re-planning its own route (an exact dynamic programme over hour, location and progress through the field) while the others stay fixed, and a change is kept only if the farm as a whole makes more money. It scores each plan against up to 50 forecast members, so it's choosing routes that hold up across the possible weather and not just the most likely one. There's also a terminal value on any crop still standing, so it doesn't rush to cut everything early. We built greedy and Lagrangian planners along the way too.

The baseline. To have something fair to compare against we wrote a "farmer" planner: one moisture reading in the morning, stay home if the forecast looks wet, otherwise send each combine to the driest fit field nearby, work a 12-hour day and come home.

Replay. For past seasons we fetch the archived ECMWF ensemble forecasts from dynamical.org and the observed weather from Open-Meteo, so the planner only ever sees what it would have seen on the day.

Challenges we ran into

  • Getting old forecasts. Testing against what actually happened is easy. Testing against what was forecast at the time is much harder, because most weather APIs only give you today's forecast. Finding an archive of past ensemble runs, and then lining up its publication delay so we weren't accidentally peeking at the future, took a lot longer than expected.
  • The MPC getting stuck. Starting from an empty plan, the combine-by-combine updates would settle on a plan no single combine could improve, but which was clearly bad. Warm-starting it from the Lagrangian planner fixed most of that.
  • Harvesting too early. Without a value on unharvested crop at the end of the planning window, the controller would happily cut wet grain just because it was "now". Getting the terminal value right was fiddly.
  • Being fair to the farmer. It's very easy to build a strawman baseline and claim a huge win. We went back and forth on the farmer model a lot so that it behaves like a sensible person would, based on what Ed told us.
  • Finding real figures. Some things just aren't published, like ex-farm oilseed rape prices or field loss rates for oilseed. Where we had to guess, we wrote down that it was a guess.

Accomplishments that we're proud of

  • On a replay of a real summer with real forecasts, our planner cleared a 10,000-acre farm six weeks before the baseline and finished £502k ahead.
  • The farm itself is real: real fields, real distances, real prices, and the numbers are sourced rather than made up.
  • We talked to an actual farmer early on, and it changed what we built.
  • The planner handles uncertainty properly, by planning across many possible weather outcomes, instead of planning against one forecast and hoping.
  • We kept the code simple enough that four people could work on different parts at the same time without stepping on each other.

What we learned

  • Harvest isn't really a crop science problem or a routing problem on its own. The interesting part is where the two meet, and the weather is the thing tying them together.
  • Speed matters more than squeezing every pound out of each field. A lot of our gain came from simply getting the crop in before it sat in the field losing value, and from using dry windows that a 12-hour working day misses.
  • Ensemble forecasts are hugely underused. The spread between members tells you how much to trust the forecast, and a planner can actually use that.
  • Talking to the people who'd use the thing saves you from building the wrong thing.

What's next for Time to Harvest

  • Field sensors. Right now moisture is modelled from the weather. In-field sensors for grain moisture, rainfall and wind would let us correct the model with real readings as they come in.
  • More of the farm calendar. The same planning approach works for drilling, ploughing, spraying and anything else where timing and weather matter.
  • A fuller digital twin. Adding growing degree days and NDVI from satellite imagery would let us predict when each field will be ready weeks ahead, and spot pest or disease problems early.
  • Grain carts and the store. Planning trailers and drying capacity alongside the combines, since those are often the real bottleneck at peak harvest.
  • Trying it on a real farm. The next step is running it alongside a farm like Apsley's for a season, first as advice to the farm manager and then driving autonomous machines directly.

Built With

Share this project:

Updates

Submission history