I’m coaching my son’s middle school robotics team and the kit includes mecanum wheels which are a kind of omni-directional wheels. It’s very useful to be able to scoot the robot around in all directions when competing in a challenge. I had never used mecanum wheels so before showing the kids how to use them in their robot, I wanted to build myself a little platform to try out mecanum wheels for myself.
I found an awesome blog post on building a mecanum wheel robot by Dejan so I went to work building my own based on his plans. I’m really happy how it turned out.
I 3D printed and assembled the wheels. The body of the robot is thin plywood glued together. I used A4988 stepper drivers and Nema 17 stepper motors. I first prototyped the electronics on a breadboard, then wired everything point-to-point on a protoboard. Maybe I’ll do a PCB later to clean it up.
The circuit is meant to be powered by 12V so I dug around my house and found that the battery from my small Bosch drill was 12V! I downloaded a battery holder model from Thingiverse, cut off the wall mount portion using Tinkercad and epoxied 2 spade terminals to make a perfectly fitting battery connector.
For the control system, I used a wireless USB gamepad that I already had. It was easiest to read the USB gamepad with a simple Raspberry Pi program written in Node.js and send it over I2C to the Particle Photon. The Photon runs the control logic program to read the gamepad inputs from I2C, decide what direction to drive the robot, and accelerate the wheels to the target speed. I was able to quickly iterate by tweaking the program in Workbench, flashing the new version OTA and driving the robot around to try out the changes. I used the AccelStepperSpark library to generate the stepper outputs. The acceleration is not perfectly tuned as sometimes the steppers start skipping as you can see in the video, but it’s good enough for my purposes.
Here’s the robot in action!
The wheels work best on a slightly grippy surface, hence the foam tiles.
There were plenty of mistakes along the way. I’m very glad there were 5 stepper drivers in the pack because the first thing I did was plug one upside down and let the magic smoke out. It also took me a bit of trial an error to tweak the stepper motor current limiter, leading to a melted power cable.
As usual, a project like this seem like it will never work until it just does. I encourage you to go out and build cool things. Push your limits, persevere and you’ll achieve great things!