An introduction to creating an autonomous lawnmower.
Jesse Brockmann is a senior software engineer with over 20 years of experience. Jesse works for a large corporation designing real-time simulation software, started programming on an Apple IIe at the age of six and has won several AVC event over the years. Jesse is also a SparkFun Ambassador. Make sure your read today's post to find out where he'll be next!
I recently met a gentleman at a STEM event who wanted to make his John Deere riding mower remote-controlled. He is just interested in driving around, not actually mowing. I've been thinking about making an autonomous lawnmower for years and thought this was a great opportunity to get started on the bigger project. Phase one of the full project is a remote-controlled lawnmower, and I'm going to split this phase into the following sub-components: braking, throttle, steering, kill switch and controller.
The mower has a rotating brake pedal with a place to rest your foot. The amount of force required to stop the mower is honestly not very much - maybe 10 pounds max - but I want to be safe so I've decided to go with a 35-pound actuator. I think I only need an inch of travel but I'm going to go with four or six inches just to make mounting easier. I'm going to use an actuator with a built-in potentiometer for feedback. This allows me to set the start/endpoints and adds safety to know if the actuator is actually moving.
Next is steering. When stationary, the steering does require a reasonable amount of force and I had the mechanical advantage of the steering wheel when I tested, so the force on the steering shaft will be higher. When moving, the force will be much less. The plan right now is to have the ability to do a full turn in a second. I'm looking at a motor with a 680 ounce/inch rating and 160 rpm rating. I'll include a gear ratio of 1:3 between the motor and steering shaft. I will have a potentiometer for position feedback on the front steering knuckle.
The throttle is pretty easy. In the stock configuration, the throttle stays at whatever position you set it. This is done by friction, and for my purpose, this friction can be removed. Once that is done I can hopefully use a standard RC car servo to move the throttle. I plan to attach a wire to the potentiometer signal in order again to get feedback on the throttle value; this adds an extra level of safety for autonomous operation.
The kill switch will be a relay across the ignition switch wires. The relay has to be powered or ignition will be off. The ignition switch must be on as well. I'm not currently planning on automatic starting for the remote control mower.
For the controller, I'm going to use one of my first-generation rover boards with a Teensy 3.2 but I can always switch to a Teensy 4.0 if the extra power is needed for the autonomous version. For control, all that is left is the transmitter and receiver. I'm going to use a car-style transmitter at the request of the client.
Then it's time for phase two, which will be in two parts. Phase 2A will use my existing 1/10th scale rover or 1/5th scale rover with u-blox ZED-F9P RTK GPS, with a second u-blox ZED-F9P RTK GPS as a base station and for correction data. I could also use a NTRIP app on my cell phone and Bluetooth for sending correction data. Starting with a smaller rover allows me to test autonomous functionality in a safer way than a riding lawnmower. For sensors, I'll still include an encoder and a BNO-080 or similar IMU like my previous rovers, and I'll also include a LIDAR-Lite v3 and TFMini Plus for safety. For mower testing, this only needs to work at 5-7 mph maximum. However, I hope eventually to run at much higher speeds; this will end up as a separate project named JRover Racer that will be version two of my JRover project I used to compete at the Sparkfun AVC.
Phase 2B is the fully autonomous riding mower. This will be project “JRover Mower.” First, I’m going to make the above John Deere 110 Mower remote-controlled, and use the control hardware and software from phase 2A. I will use a higher-end 1 Watt radio to deliver the correction data for more range. The RC controller will be used to control options/failsafe, but a second, longer-range kill option will also be available. I'm planning to have multiple sensors to detect obstacles for all safety issues. I’ll include everything from low-tech bumper sensors to an RPLidar or similar, and maybe an Intel Realsense D435 as well. This will be powered by an Nvidia Jetson Nano or a Raspberry PI v4 4GB. The low level/real-time controller will use the same style baseboard as the remote control mower, or I may move to a version two rover board due to the higher demands. Eventually, I would like to allow full unattended running, but that will be a long time in the future.
So, am I crazy for attempting this? I see thousands of ways this can go wrong, and many of those I hope I never encounter. I’m seeing this project used at larger properties or farms and not general yard use. It should be in a more controlled environment with lots of room and a minimal number of obstacles to contend with.