FruitBot Story, 2022

FruitBot, a powerful, autonomous, indoor delivery robot.

Also see the photo gallery, part list and interface.

My mother has degenerative arthritis that has made walking more and more difficult over the years. In 2019 she was using a wheeled garbage can to move things from room to room, and I felt I could improve that. This started my pursuit to build a personal delivery robot for the home.

Basic Parameters for FruitBot:
  1. Capable of carrying loads of at least 100 pounds.
  2. Navigating a known space (house).
  3. Narrow enough to fit through tight spaces (1' wide).
  4. Use existing EGO batteries as power source.
  5. Easy to control from an iPad.
  6. Don't touch the walls or scuff up the floor.

I have wanted to build a robot since I was 5 years old. I see a lot of Arduino robot tutorials online, so technology seems to have advanced enough to make building one an elementary school project. Most of the designs I find are small scale or proof-of-concept, and not really capable of doing useful work. I wanted something more powerful and practical.

Follow Me Cooler Follow Me Cooler

The Autonomous Follow Me Cooler from 2017 was the first design I started to consider. It is a simple platform with motors inside and a camping cooler on top. The main board ties to your iPhone using Bluetooth. The iPhone uses its GPS and the Blynk app to tell platform Arduino where to go, and the platform GPS guides it there. I liked the simple design and the capacity to move things with the trunk concept. Further research shows GPS is not very reliable indoors, nor is it accurate enough to navigate rooms in a house. The Starship delivery robots that were running around Washington DC in 2016 are the next generation for that design, but they are proprietary.

Design & Basics

To start the build, I used a 12" x 36" shelf from Ace Hardware ($20) and cut it in half. This became the main platform (bottom) and top of the robot. The robot had to be capable of carrying at least 100 pounds of vacuum cleaner, luggage, or whatever was set on top. This got me thinking about Power Wheels, the ride-on vehicles for little kids. If the Dune Racer can carry 130 lbs. of child, it should be good for this project. I found the popular Power Wheels 7R gearbox (football shape, not teardrop shape) with RS-550 12V motor was only $25 on Amazon. I got a pair of gearboxes and some 6" non-marking rubber wheels.

The robot had to be as narrow as possible to fit through some tight spaces in the house. After some fiddling with the gearboxes and wheels, I found a configuration that would keep the robot at 12" wide. I cut two notches out of the bottom platform, 8" long and 3.5" wide, 2" back from the front of the robot. Concerned about the stability of the thin part of the platform, I took one of the pieces I cut from the side and sandwiched it under the center part, securing it with two 7" metal tie plates and some long, thin nuts and bolts.

                 _________
                |__     __|
                   |   |
                   |   |
                 __|   |__
                |         |
                |   TOP   |
                |   VIEW  |
                |_________|
    

Time to make room for the 8mm x 300mm steel axle. The rod needed to pass right through the center of the wood sandwich pieces. Using a 230mm long 22mm auger drill bit, I slowly tunneled through the particleboard.

               ____________________
              |_____⬤_____________|  SIDE VIEW
                 |______|
    

Once the drilling was done, the axle fit through the gearboxes, and through the wheels. The five black spokes of the wheels just happened to match up nicely with the white slots in the gearbox. Some shaving of the spokes was required. One of the wheels had arrived with a crushed bearing housing. Rather than dealing with a return, I bought more bearings for $5. This worked out quite well because the new bearings did fit the wheel, but also happened to be the right fit for the gearbox housing. Now everything moved smoothly together because they were properly aligned. Aluminum couplers on each end of the axle keep everything together. Two 2" caster wheels on the back keep it stable. I tried one caster, but heavy loads tended to wobble.

To secure the top and bottom platforms, I used two steel double L shelf brackets for $30. They are heavy and a bit pricey, but they were the best way I could find to support heavy loads and stay out of the way of the electronics. One bracket faced forward, so the center post was over the tie plates for a strong base. The other bracket faced sideways at the back so the top would not rock side-to-side. I don't know if this was the best arrangement, but it worked for me, and it seemed to stay out of the way of the compasses I would use for navigation.

Power

EGO Battery EGO Battery

Now to power. Let me start by saying a 12V rechargeable sealed lead acid battery works fine for this project, but... My father has been investing in the EGO lawn and garden equipment for some time. He has a set of batteries he uses for his leaf blower, edge trimmer, and more. This was a key factor in my plan for the robot. It meant he already had plenty of batteries, and was in the habit of keeping them charged and ready for activities around the house. At 56 volts and 5 amps for the medium size battery, these are very powerful and dangerous. I had to find a way to reliably connect and manage all that power. I found some peoples plans, and some expensive 3D printed connectors, but the best idea came from a person that repurposed an EGO battery charger from eBay. So I bought a cheap refurb charger for $27 on eBay, carefully opened the case, and threw the guts in the trash without touching anything. Now that the dangerous part was disposed of, it left me with tons of room to run wires and prototype my design.

Taming the battery beast was another matter. There are not many power converters available that can step down from 56V. After some trial and error, I settled on a 12V, 20A Pro Chaser regulator for $23 to handle the motors, and a 5V, 10A regulator for $16 to handle the rest of the electronics. The 5V regulator proved too weak to support the Raspberry Pi, so I supplemented the power with a 5V 3A UPS battery for $16 which has the added benefit of keeping the system happy when the main battery is being swapped out.

Now I need to control the 12V motors. I burned through several of the BTS7960 found all over Amazon. At about $12 each, they're cheap, and the specs say it can handle up to 43A of power. Regardless, I gave up on those, then I found the Sabertooth controller. It had great specs and features I hadn't even thought of. I went cheap and got the Sabertooth 2x12 R/C for $65, but I should have gotten the non-R/C version for $80 because it does offer better features for microcontrollers. This article just discusses the R/C version which worked great.

Electronics

Originally, I planned on running everything from a Raspberry Pi 4. But as I got into the project, I started to discover strengths and weaknesses that helped me understand the differences between and among microcontrollers like Arduino, and system on a chip (SoC) like Raspberry Pi. The RPi can act as a full-fledged computer, like your laptop. RPi has an operating system with features like wireless networking, power management, HDMI video output, audio controls, and more. Microcontrollers like Arduino just run one set of instructions all day long. But, where Arduinos shine are things like timing, interrupts, and reading analog signals. The wheel motors and Sabertooth driver are controlled by pulse width modulation (PWM), that means they have to receive a pulse command on time every time to work properly. Raspberry Pi is a busy computer and may not always send a pulse at the right time, but Arduinos have nothing better to do, so sending timed pulses works just fine. Another difference is interrupts. As the wheels of the robot turn, a perforated disk triggers an infrared sensor that lets the system know the wheel has moved X distance. When the infrared sensor fires, the system needs to read that immediately, otherwise when we're moving fast and get hundreds of signals per second, we might miss some and end up in the wrong room of the house. RPi computers are very fast, but software might miss some interrupt signals, where as Arduinos have hardware ready to handle an interrupt signal, so they are much better at reading the wheel encoders.

The Raspberry Pi 4 is the main computer for FruitBot and sits at the front. It is the server for the user web interface, runs the video camera, compasses, audio system, collects sensor data from the microcontrollers, and sends out commands when needed. An Adafruit Metro Mini (Arduino Uno) lives under the top platform to manage all 8 ultrasonic distance sensors (HC-SR04). Ultrasonic sensors need 5V power. Raspberry Pi is only 3.3V. Each distance sensor usually requires 2 GPIO pins, but I wanted to use the single pin configuration which works best with the NewPing Arduino library, which only works on certain boards like the Uno. An Adafruit ItsyBitsy M4 lives under the EGO battery at the back of FruitBot. The EGO battery charging box is like the central switching station for FruitBot. All wires lead there. To make disconnecting the battery box easier, I splurged on a 12 pin Molex connection for $12. Molex handles thicker wire and more power than the Dupont connections I used everywhere else. The ItsyBitsy controls the Sabertooth driver for the wheels, infrared wheel encoders, joystick, Adafruit NeoPixels for headlights and taillights, light sensor, temperature sensor, and 12V fan for the battery box. Because the joystick and motors are both connected to the ItsyBitsy, it means you can manually drive FruitBot around without help from RPi. Metro Mini and ItsyBitsy are connected to the Raspberry Pi 4 through the USB ports. That means there is no need for level shifting, and has the added benefit of allowing the Raspberry Pi to reprogram either of the Arduino boards using the arduino-cli (command line interface), great for remote support.

To make things more serviceable, I soldered header pins onto the Metro Mini and ItsyBitsy boards. For the Metro Mini, I soldered two rows of header connector strips onto a pinboard to make a socket for the Mini. Then soldered wires to a double row of L header pins, the first pin was the trigger. The second pin was connected to the first with a 2.2KΩ resistor. This configuration allowed the Metro Mini to control each HC-SR04 with a single GPIO pin. For ItsyBitsy, I took two mini-breadboards and stuck them back-to-back. The ItsyBitsy went on the bottom board, and I wrapped 22 awg solid core wire from the bottom pins to the outer edge of the top board. This allowed me to connect all of the modules controlled by ItsyBitsy to the inner part of the upper breadboard with Dupont pins I crimped onto the ends of each wire.

Web Interface & Navigation

For inspiration on how to setup the user interface, I found this delivery robot design from 2017 that used an office map on a web page to tell the robot where to go. The office map was setup as a grid. Users would touch the spot on the map where they wanted the robot to go, and the robot would plan a path to get to the destination. This would easily translate to an iPad or mobile device. The code was incomplete, but the concept gave me many of the building blocks I would use in the project. As I worked on the interface code for the map, I found a good demonstration of the A* or AStar search algorithm from 2010 by Brian Grinstead. It showed me how to plan the path, and deliver the path as a list of directions to follow.

The biggest and best solution to robot navigation was the discovery of the 'Control of Mobile Robots' Corsera class about PySimiam by Dr. Magnus Egerstedt and Jean Pierre de la Croix from 2013 (Original Link). Using the course material and 55 video lessons it had all the components needed to move around the house intelligently. Trying to figure out how to move along a path while at the same time avoiding obstacles was a big concern for me. PySimiam uses a 'state machine' (a clever group of if-then statements) in a constant loop to obstacles, walls, and general navigation. It can even blend behaviors, giving higher priority to whichever matter is most pressing.

PySimiam interface PySimiam interface

Getting the PySimiam software to run on my 2016 MacBook Pro (Intel CPU) in 2021 was not easy. The software was written for Python 2, which was sunset on 1/1/2020. Initially, I did not want to deal with a virtual environment, but it seems that was the only way to get it to work. The best way to run PySimiam is to download the full Anaconda 3 virtual environment and install it. You can remove some 'conda' lines from ~/.bash_profile to stop the default Terminal from using Anaconda. Create the new Python 2 environment.

conda create -n pysimiam python=2.7

Activate the new environment.

source activate pysimiam

And install the needed libraries.

conda install numpy sip pyqt=4 --use-local

The '--use-local' option should install the libraries that came with the Anaconda download. They should be the most compatible for that environment. Once installed it's time to test the simulator.

python qtsimiam_week1.py

I discovered you MUST change directories ('cd') into the folder of the script you run because it looks for all the supporting files relative to where you are, not where the script is running.

I studied the calculus and trigonometry of PySimiam for several months with help from other peoples course work like Delijati from 2014, BurakDmb from 2019, Rahul-Ratheesh from 2019 who actually updated the code for Python 3, and Sobot Rimulator by Nick McCrea from 2018 who also upgraded to Python 3, replaced the QtPy4 GUI with Gtk3, and uses a Khepera III robot instead of a QuickBot. But ultimately, I could not get my code to work on FruitBot and had to abandon the project to re-engage in gainful employment.



Note, I am not an Amazon affiliate and I do not make any money off any links. I just find it helpful when people point to specific products that helped them.

Thank you to Adafruit for lots of great parts, and so many helpful tutorials.

Special thanks to my husband for putting up with me, and my brother for all his support with this project.