Jul 18, 2022
This week I have been working on the proof of concept utilizing a stepper motor drive train for our new power wheels cart system.
To start the main controller for this system is based around a raspberry pi 3B or 3B+, these little single board computers provide a cheap and easy way to run a python script that is the heart this system. In a perfect world we would be using a raspberry pi 4B and taking advantage of the extra speed and RAM to make dev work a little snappier, but we are currently in a global silicon shortage and as such getting a new raspberry pi is next to impossible right now and the resale value on one of these is currently between $100-$200 for something that has an MSRP of $35. With this in mind and knowing the only Pi 4B that the shop currently has is being used on the Octoprint hub that needs the extra speed; we will be using the Pi 3B and 3B+ because they are plenty powerful to run the python script and it doesn’t require paying scalper prices since we have them on hand.
But a raspberry pi on its own isn’t going to get us too far because it can’t even supply enough power to turn a single tiny stepper motor let alone 2-4 large ones capable of driving a cart with a person on top. This is where the stepper motor drivers from Stepper online come in taking the raspberry pi signal and relaying that information to the motor and making it move in a way we want. In this case we will be using the model DM542T driver to make a mini prototype with NEMA-17 stepper motors, if the prototype proves successful we will use the larger DM860T and NEMA-34 stepper motors to drive the full-scale cart.
To tell this python script and the Raspberry Pi just what to tell these controllers we will be using a wired xbox controller and the pygame library to take an input from that controller and have the Pi interpret it as high and low signals to send the GPIO pins. By doing this the goal is to have the cart be controllable in much the same way you would have in an online racing game and get rid of any mechanical steering linkages.
Now the reason we are starting with a scale model instead of jumping headfirst into the full size cart is because we honestly don’t know if this will work well for the intended use case. If we find out that it won’t steer quick enough or go fast enough to be useful then we have saved a bunch of time and money and still have a functional mini robot and can change gears instead of chasing something that is doomed from the start.