Exploring the Possibilities of Multispectral Vision for the Autonomous Robot-Based Detection of Plant Diseases
A camera that spots Esca, a grapevine disease, and a field robot that drives the vineyard by itself. Supervised by Prof. Rainer Herrler. in progress
Esca is a fungal disease that slowly kills grapevines and has no cure. Growers have to walk the rows to find sick vines. This thesis asks whether a robot with a multispectral camera can do that survey by itself.
I worked on both halves: a neural network that spots Esca on leaf photos, and the Field Friend robot, which could not drive when I took it over and now drives itself by GPS and LiDAR.
What’s inside
Where it stands
- Both motors running, speed control tuned
- Drives to GPS waypoints by itself
- 3D LiDAR running at 10 Hz
- Esca detection: 0.953, and 0.807 on a new day
- Driving a whole vineyard, row by row
- Stopping for people and obstacles
- Coping with broken sensors
- Infection map (test labels)
- Fix the restarts and WiFi drop-outs
- RTK GPS, then the vineyard on the real robot
- Mount the camera and survey a vineyard
- A real infection map
Timeline
Leaf photos in the vineyard
Two capture days with the multispectral camera.
Thesis starts
Detection pipeline and results through October.
The robot drives again
Motors fixed; first GPS field test.
Motor fixes, tuning, simulator
Driver rewritten, speed control tuned, navigation built in simulation.
LiDAR and first autonomous tests
LiDAR on the robot; camera mount designed; vineyard mode in the app.
Navigation on the real robot
Planned: RTK, then the vineyard survey with the camera.
Submission
Thesis handed in.
Can a camera see the disease?
Esca kills the leaf between the veins, leaving a “tiger stripe”. Dying tissue reflects red and near-infrared (NIR) light differently, and a multispectral camera can measure that.
The data
169 leaves from two days in one vineyard (54 Esca, 115 healthy), one photo per vine.
The model
A ResNet-18 network, pre-trained on everyday photos and fine-tuned on the red, green and NIR bands. Compared with four simpler methods.
Fair scoring
5-fold cross-validation, never the same vine in training and test. Balanced accuracy, so always guessing “healthy” scores 0.5.
No shortcuts
Each photo is cropped to the leaf and divided by its total brightness, so the model cannot use the sky or the sunlight.
Two weeks later, autumn had reddened the healthy leaves. A fixed cut-off now called 14 of 22 healthy leaves sick.
The network looks at the pattern of the damage, not one colour value, so the season does not fool it. Nobody has to re-tune it every fortnight, which is what a robot needs.
Limits: 169 leaves, two days, one vineyard. Uneven light is the main remaining source of errors.
What is on the robot
A Zauberzeug Field Friend: 100 kg, two tracks, ROS 2 on a Jetson Nano, driven from a web app on a phone or laptop. It came from an earlier thesis and could not drive when I took it over.
Software I wrote for it
- Motor driver: speed commands to the motors, odometry, battery, e-stop.
- GPS waypoints: record points, then drive to them.
- Vineyard navigation: LiDAR scan, row following, turns.
- Web app: live motor plots, sensors and a tuning page.
Built-in safety
- Top speed 0.41 m/s, every change ramped.
- Stops if commands stop for 0.5 s, on e-stop, or if one motor faults.
- The motor controller stops on its own if the computer goes silent.
What went wrong, and how I found it
Eight problems, each traced to a measurable cause. Click one to open it.
20–21 OctThe “broken” motor that wasn’t
The left motor was thought dead. It had the wrong settings.
solved
The “broken” motor that wasn’t
The left motor was thought dead. It had the wrong settings.
The robot could not drive. The left motor had been switched to a workaround mode because its sensor was believed broken.
I pushed the robot by hand with the motors off and logged the sensor. It cycled through six states, 1-3-2-6-4-5: the signature of Hall sensors, not the encoder it was set up as.
Hall mode with 67 pole pairs, both motors calibrated. Also fixed: “forward” drove backwards, and the wheel size was wrong (15 → 8.1 cm).
Both motors run properly. Odometry matches a tape measure to the millimetre over 25 cm.
Hall states measured on the left motor while pushing the robot by hand.
27–30 OctOne motor suddenly stopped
Right after raising the current limit, the right track stopped with an error.
solved
One motor suddenly stopped
Right after raising the current limit, the right track stopped with an error.
After raising the limit from 10 to 20 A, the right motor reported a current-measurement error and refused to run.
The motor itself tested fine. The fault was in the controller’s driver chip, most likely from braking: with no brake resistor, a rolling robot pushes energy back into the board.
Switching main power off for 30 s clears it. Speed changes are now ramped. A brake resistor is planned.
Drives at 20 A with both motors healthy.
2–3 NovThe robot reacted a second late
It kept turning after the button was released.
solved
The robot reacted a second late
It kept turning after the button was released.
Slow, unpredictable response to the app.
Commands piled up in a queue of 10 behind slow USB calls.
The driver keeps only the newest command and sends it 20 times a second.
Immediate response.
3–5 NovA motor tripped, and the other kept driving
Caught by the live plot I had just built.
solved
A motor tripped, and the other kept driving
Caught by the live plot I had just built.
On rough ground the right motor spiked to −27.7 A and shut off while the left kept driving. The robot lurched about 0.6 m.
The current limit only caps what the controller asks for. When a track is suddenly blocked, the real current overshoots, and the inner current loop was too slow to catch it.
Current loop made 10× faster, more safety margin, and if one motor stops, both stop.
No more trips on rough ground.
3–5 NovCurrent kept flowing after stopping
Up to 20 A with the robot standing still.
solved
Current kept flowing after stopping
Up to 20 A with the robot standing still.
The motors heated up and jerked while standing still.
Integrator windup: the controller kept the extra push it had built up while a track was blocked.
Reset that stored push whenever the robot comes to a stop.
The current drops from 20 A to 3–4 A at once.
26 Oct–16 NovNot enough torque to turn on grass
The first GPS test, a square, failed at the corners.
worked around
Not enough torque to turn on grass
The first GPS test, a square, failed at the corners.
Turning on the spot on grass reached only a tenth of the commanded speed.
Driving straight needs 3–8 A; spinning sat at the 20 A limit. The motor datasheet confirmed 20 A is too little torque to turn on the spot.
Turn in gentle arcs and never spin too slowly.
Test higher current limits in short pushes.
19–20 NovThe LiDAR scan came out at 1.6 Hz
Getting a 3D LiDAR running on a Jetson Nano.
solved
The LiDAR scan came out at 1.6 Hz
Getting a 3D LiDAR running on a Jetson Nano.
The LiDAR’s old software would not build. Once it did, the scan came out 6× too slow.
Fixed the build one error at a time, then timed each step: a Python loop over 10,000 points per frame.
Rewrote it with numpy, with a test that both give the identical scan.
A steady 10 Hz.
20–23 NovRestarts and WiFi drop-outs
What the first autonomous tests turned up.
open
Restarts and WiFi drop-outs
What the first autonomous tests turned up.
The Jetson rebooted at least 12 times without shutting down: it is losing power, probably when the motors draw high current.
The robot stops by design when commands stop for 0.5 s, so every WiFi hiccup stops it.
Log the battery voltage, try a lower power mode, steadier WiFi.
Tuning the motors
The speed kept swinging fast and slow. I tuned the motor’s speed controller with step tests on a live tuning page I built.
Method
Raise the gain Kp in steps until the motors buzz, back off, then add the integral part Ki. Each test is a 3 s step to 0.15 m/s.
Ziegler–Nichols was ruled out: it needs the drive to oscillate at its limit.
What I found
- Kp 1.12 buzzed: the speed sensor is coarse, and a high gain amplifies its jitter.
- Chose Kp 0.8 and raised Ki to 2.5, five times the usual rule of thumb, because track friction needs a strong integral part.
| Kp / Ki | 90 % reached | Overshoot | After 1.5 s |
|---|---|---|---|
| 0.3 / 1.0 (before) | 1.0–1.4 s | +17 % | 94–95 % |
| 0.3 / 0 (P only) | never | – | 0 % |
| 1.12 / 0 (P only) | never | – | ≈ 65 % |
| 0.8 / 0.8 | 1.2–1.9 s | +8 % | 85–87 % |
| 0.8 / 1.8 | 0.75–0.9 s | +11.5 % | 94–95 % |
| 0.8 / 2.5 (chosen) | 0.75–0.84 s | +10.8 % | 95–100 % |
A vineyard on a laptop
With no RTK, no LiDAR and no vineyard in reach, I built a simulator and developed the whole navigation in it. It uses the robot’s exact ROS 2 topics, so the same code runs on the real robot.
Sensors that make mistakes
- LiDAR: noise, lost rays, leaves only sometimes hit.
- Wheels: skid when turning.
- GPS: 2 cm with RTK, 1–3 m and wandering without it.
How the robot drives
- Fits two lines to the vines and drives down the middle.
- Slows for obstacles, stops at 0.6 m.
- Plans each row-end turn with A*.
- GPS and the rows correct its position.
| Test | Result |
|---|---|
| Whole vineyard, many starts | 15 / 15 with no collision |
| Going around a blocked alley | 19 / 20; the other stopped safely |
| Broken sensors (GPS, LiDAR, wheels) | no collision |
| Automated tests | 129 |
Bugs the tests caught
- A 3 m GPS jump sent the robot into the wrong alley. Such jumps are now ignored.
- The forward-only LiDAR forgot the vines beside it at every row end. It now remembers them.
Designing the hardware
Two 3D-printed parts, modelled in OpenSCAD: a mast that holds the multispectral camera at a fixed height and angle, and a cover for the electronics bay.
Camera mast
- One printed part, camera tilted 10° up. It replaced my earlier four-part design.
- Bolts to an existing hole on the robot; a lip stops it turning.
- Prints without supports: 2 h 50 min, 98 g of PLA.
Back cover
Too big for the printer, so the model splits it into 6 tiles that lock together like a jigsaw.
What the camera sees
Each photo covers about 1.4 m of the leaf wall, from 0.54 to 1.63 m high. Because the mount is fixed, the automatic crop always lands on the leaves.