top of page

Project Date: 

June 1, 2020

A self-driving zero turn lawnmower

Equipment Used

Troy Bilt Mustang 50 XP - Zero turn lawnmower

Arduino Uno - Main controller

MPU-9250 - Inertial measurement unit for compass heading guidance

DROK 200206 2-channel motor controller - Used to position the linear actuators

PMW3901 Optical Flow Sensor

U-Blox M8 GNSS Receiver - Location from GPS and GLONASS satellites

Progressive Automations linear actuators - Used to control handlebars on the lawnmower


General Theory

Steering is controlled almost entirely by the inertial compass.  A nice stable heading can be achieved by using a built-in fusion filter to combine data from the accelerometer, gyroscope, and magnetic compass.  Location is from the GNSS receiver.  The current receiver supplies latitude and longitude every 100ms in NMEA format over TTL serial.


Actuator control is achieved with a 2-channel PWM servo controller.  Each actuator has position feedback using a 10 kOhm potentiometer.  The resistance signal is configured as a voltage divider and connected to one of the AI pins on the Uno.  A small capacitor was added to help filter some high-frequency noise on this pin.  Positioning of the actuators is via a simple PID loop.  During startup, the actuators are driven all the way retracted to record the minimum position feedback voltage, then driven all the way extended to record the maximum position feedback voltage and the range is divided as 0-100%.  Then a position command is compared to the current position and a PID loop controls the PWM output to the motor driver.  The can achieve the position in the shortest amount of time with minimal overshoot.


The "position command" to the actuators is a combination of the desired bearing, current bearing, and desired forward or reverse speed.


What is working now

  • NMEA (location) messages are received, validated, and interpreted from the GNSS unit at 10 Hz

  • The IMU data is being filtered and interpreted

  • The position control of the actuators works very well

  • The optical flow sensor is able to see the ground and calculate very stable yaw and distance values in real units (degrees and mm, respectively)

What still needs work

  • The IMU suffers from magnetic interference and simple calibration does not seem to be able to remove it

  • The optical flow sensor is very easily "distracted" by light and shadows - it really only works well on cloudy days

  • The GNSS data is not doing anything yet

  • There is basically no obstacle avoidance!

What about safety, you say?

Good question!


For the purpose of this project, a risk assessment was performed involving the entire engineering team.  Based on the current use case (no unsupervised operation), we decided to add an emergency pull cord around the mower (see photos) that kills the engine and a remove kill switch that can operate up to 1500m away.  We also added remote start capability and remote mower blade engagement via one of these clever little things.

bottom of page