I’m planning to build and program a swerve drive for my own personal use. I am mostly interested in programming it, and plan to purchase and add additional sensors and possibly some servos later.
I plan to wire everything using 18 AWG wire, or PWM cables. The + power will not be routed through the PWM HAT as it probably won’t take the current I will be using.
I am considering purchasing or creating a second AA Battery holder which I would wire in parallel with the existing holder to achieve a longer battery life and alleviate potential voltage drops.
Any suggestions to lower the cost of the project would be greatly appreciated. My initial target was under $100, but that clearly isn’t happening. If I am missing anything which is vital to creating a swerve drive, I would also accept suggestions. In particular, I am trying to find an acceptably low-cost gyro and/or thrust bearings. I may try to make do with sanded down PVC & fittings which would allow me to pass the motor wires through so they don’t get twisted.
Low-budget swerve is fairly difficult to do. What’s your reasoning behind not using mecanum or another type of holonomic system?
What kind of machine tools are available to you? CNC milling would make this much easier; even a lathe would help you deal with bearing setups. 3D printing or laser cutting is great for small scale as well.
There are some fairly good lego coaxial swerve modules out there, very compact as well. If you can rig non-lego motors to those then you would be able to save a bit of money there.
rPi will have a hard time interfacing with everything, but if you are confident in it go for it.
I also recommend investing in some Li-ion batteries or something else rechargeable, especially if you’ll be testing a lot. Saves money in the long run.
My reasoning behind not using mecanum or holonomic is: I’ve done it. It’s not a challenge for me from a programming standpoint.
I am hoping my team will allow me to use our 3d printer. Other than that I have access to a lot of woodworking tools. I’m trying to keep the manufacturing to a minimum, without resorting to overpriced kit parts (ei Tetrix).
LEGO anything is rather expensive, I tend to avoid looking at it. I’d probably spend quite a bit on that. I’ll look into it, but I think it’ll end up being cost-prohibitive unless I can get everything for all four in a single kit. The interfacing thing is also a concern; you’ll note that I currently plan to use a kit which has wheels directly mounted to the motors, which is very nice.
I am aware of the limitations of a Pi, but that’s what hats are for. And I’m confident it will work for this with the Adafruit PWM hat.
I have a bunch of rechargeable AA batteries that we used to use in Wiimotes. Since we no longer use those, I’ll be re-purposing them.
Does it have to be coaxial? If you can deal with having to unwind the wires, you could still mount wheels directly to the motors.
I have thought about doing something similar to this, maybe using servos to rotate the modules.
I’ve built a few robots with those motors (no encoders) and, while they work well, I have had some problems where the white plastic pieces that transfer power to the wheels have stripped so the axle they’re attached to doesn’t cause them to spin. I think that is only with an overly large high traction wheels, which probably isn’t what you’re using for swerve.
I’m also going to work on something similar someday. Is there any reason you can’t use Vex parts? Vex sells a Swerve Drive kit, features low power motors that can be driven over PWM, and doesn’t cost a fortune either.
The Vex Swerve Drive kit looks promising. However, the motors are rather pricey ($15 for the motor + $10 for the controller).
The DFRobot motors are $8 with included encoders, and the motor controller is another $5, but can be used for two. $21 for two, vs. $25 for one. If I get the Integrated Encoder Module to match the hardware from DFRobot, the price jumps to $40 per motor. That’s ridiculously high for a project using 8 motors.
It does not have to be coaxial. It’d be nice, as it would simplify some things, but it’s not really necessary. I can always untwist wires.
Non-coaxial swerve complicates things programming-wise, but simplifies things parts-wise, which means cheaper (less) parts. If the point of this is to be a programming excercise, I would think adding the challenge of untangling wires would be a good thing. As long as you have a few wraps of wires, you should be able to tune it like a coaxial swerve first without worrying about unwrapping in code and then add in the automatic unwrapping later.
You bring up a good point - I think non-coaxial is probably the way to go. Programming the robot to unwind wires is a nontrivial exercise which would be rather interesting to approach.
There are definitely some Vex teams who have posted their swerve designs, so I would take a look at those, I would imagine they are on the cheaper side, but probably more than $100.
I imagine, based on the size of your robot, many of the parts for your swerve could be 3d printed which can be cost effective if you have access to a 3d printer.
This is a project that I’ve considered tackling before, and I even got a fair ways through the CAD. I was mainly focused on making it really, really cheap, so your requirements may be different. Here are the design choices that I made:
1.) Do tricycle swerve. You’ll use 75% of the motors and encoders, and you won’t have to worry nearly as much about weight distribution.
2.) If you want really cheap speed control, you can get away with just using an H-Bridge. This does some weird things controls wise, but if you’re just doing PID you won’t notice it. (If someone has a source for cheap brushed DC speed controllers, let me know!)
3.) Custom encoders are very doable (although probably lower resolution than you want). Use a LED + photoresistor and with a large enough disc diameter you can probably get enough resolution to make a swerve that drives well (especially if you use a cheap gyro + accelerometer as well - I’ve used the MPU-6050 in the past, which is dirt cheap and good enough for most things that you’d want to do with it).
4.) I was looking at 130 size motors for my build, mostly because they’re so incredibly cheap (<$1/motor). My plan was to 3d print a 3x130 motor gearbox for each wheel. Again, I didn’t get any further than CAD, so I don’t know how well this would have worked, but I’d expect it would be fine. The downsides of these motors are many - they vary wildly in quality and characteristics (even in the same batch), and stalling them will almost instantly start to change their already questionable specs (the spec sheets for these, if you can even find them, are usually complete lies). However, motors were probably going to be the main cost, and these were the cheapest options that I could find.
5.) If you can, 3d printing is great for a project like this. I designed almost all of the parts as either 3d printed or CNC routed (because that’s what I have easy access to), but design for whatever tooling you have available.
6.) Think about how you want to control it - I was going to use a HC-05 bluetooth module and a smartphone to control it (I was thinking about using the accelerometer and gyro in the phone to represent the robot, which I think would have been fun.)
Your goals are probably going to be different from mine, so I don’t know how useful this is - hopefully there’s some useful info though. I think that you should definitely consider tricycle swerve - I think that it’s actually a much better design choice for a robot of this size, since it significantly reduces concerns about weight distribution, not to mention cutting the motor, encoder, and speed controller cost down by 25%.
I’m planning to control it using a wiimote & nunchuck, since I have a couple laying around. Since the Pi 3 has built-in bluetooth, this is rather easy :). I’ve already had success connected the wiimote to the pi, now I just have to figure out how to use the input in a program.