We want to try implementing a swerve drive for next year, and we need a rotational sensor to have precise control over how much each of the wheel modules rotates.
We’re planning to use BaneBots motors to drive the pivot, and at first I thought that we could use encoders on them, but I’m not sure how to mount encoders on a BaneBots motor. Is there a way to do that? And if not, what sensor would I use to measure the rotation of the wheels?
They will give you your position using an analog voltage from 0V to 5V, they allow roll over, and they work straight from an analog pin (5V supply). You also have the choice to use a digital mode which produces a pulse width based on the current angle.
Look for a potentiometer or absolute encoder with analog output.
We’ve used standard 1,3,5,10 turn pots for things like this (anything 10k to 100k will work). We’ve also used US Digital MA3 magnetic absolute encoders, those are nice as well.
Relative encoders (such as the quadrature encoders in the kit) are not absolute. They can tell you how far you have gone, and how fast you are going, and what direction, but cannot give you any zero position reference. For a swerve, since you don’t know where the pods are when you boot up or if they ever move when you are powered off or reboot, you would like an absolute sensor like a potentiometer.
Building a swerve is hard. Don’t underestimate how hard it is. Also don’t overestimate how much benefit you will get. Mounting a sensor to the swerve pods is part of the many mechanical design challanges you will encounter while building a swerve drive. One method of mounting the sensor is to make it inline with the steering chain.
For our swerve drive encoders we use the 1/8" shaft Ball-bearing version of the Analog MA3 encoders from US Digital. To hook the shaft to the Banebots output we used surgical tubing. We ziptied one end to the encoder shaft and the other end we ziptied to a piece of #10 all thread screwed into the banebots P60 shaft. In general surgical tubing works very well as a low-load flexible shaft adapter.