Need Help Shopping for Our First Swerve Drive

Hi CD,
This year, we are trying swerve for the first time. We have one chance to buy all the necessary components and modules, so I want to ask CD to make sure we aren’t missing anything. We currently have a navX2. Also, which encoder should we get?

Shopping list:

  • 4x Mk4i Modules
  • 8x Neo v1.1 motors (+4 backups)
  • 8x Spark MAX controllers (+4 backups)

Is there anything that needs to be added or changed?

1 Like

We use can coders from CTRE

Thanks, is there a REV equivalent? Or is that the best one to use?

If you’re using SPARK MAXes, there isn’t much point to using a CANCoder. You can use Thrifty Absolute Magnetic Encoder, or you can use REV’s Through Bore Encoder - REV Robotics and AM’s REV Through Bore Encoder to SDS MK4i Adapter - AndyMark, Inc, or Redux’s HELIUM Canandmag.

4 Likes

Thank you, if I buy the Thrifty Absolute Encoder do I need anything extra? Does that complete my shopping list?

I’d be cautious about starting this during build season. As a new team to swerve drive, you’ll have to spend a fairly significant amount of time learning how to build and program it. If you are going to order, it’s pretty critical you order as early as possible to make sure you get the parts early to give yourself as much time as possible to work with it.

14 Likes

To add to this, when we first decided we wanted to do swerve a few years back, every single swerve team we talked to said the same thing: “Do NOT try to build a swerve for the first time during build season, use the off-season”

We did our first test swerve chassis during COVID, spent 2 years working on it and we still didn’t have a robot that moved at our week 0 competition.

There are better resources now than there were back then, but I’d still be cautious. A tank drive that works well is better than a swerve that works poorly.

5 Likes

We won’t fully rely on swerve, we have our tank drive chassis ready to use. But having 35 students on technical side and swerve being their biggest dream, we will let some of them try to get it running. If they fail no problem, we have a working tank on hand.

7 Likes

We tried to build swerve in-season in 2024.

The result was that we were (probably?) the only team to switch from (not working) swerve drive to tank drive during quals at the week 1 event.

:100: do not recommend.

We did get swerve working using YAGSL (in about 1.5 weeks) for a fall off-season, so it’s absolutely doable, but you’ll want to have some kind of resources (ideally a swerve-experienced team to ask questions of, a decent programming team, a methodical approach, and the same hardware as another swerve team).

We use mk4i, Neo, Spark Max, CANCoder, and you’re welcome to my help and/or referencing our code. GitHub - jim-sokoloff/YAGSL-Example: Yet Another General Swerve Library Example Project

2 Likes

For that setup, I like the CTRE SRX Mag Encoder – it’s cheaper than CANcoder and works well (it has the same mounting pattern as CANcoder). Wiring is easier with CANcoder (especially if you get the pre-wired option for CANcoder). If your electrical team takes a careful look and thinks they can manage, you can save a little coin. The other part of this is picking the swerve code you are going to use.

The S/W side of swerve is potentially where thing go wrong. These days, there’s a lot less risk. But for sure, you do not want to try to do the S/W on your own, in season. Make sure whatever encoder you choose is supported in the S/W. It’s a bit like the wiring – if you know what you are doing, changing the S/W side of things for whatever encoder is easy to do. But, it can also bleed a lot of time and be a pain point. No matter what, you want to give the S/W folks plenty of time to get things working, after mechanical and electrical are solid.

Thanks everyone but I am now a little confused on what to choose. I can’t choose between mag encoder, cancoder and thrifty encoder. Which one should we get? As we have one shot at purchasing it, we want to get the best option. Soldering/wiring is not a problem.

Hello, I think max swerve absolutely could be done in season. The base code is really good. I did some other programming for swerve and it would have taken (at least me) months to get it to drive as well as a lightly tweaked maxswerve setup. Also price is down to $250 per corner and it comes with absolutely everything you need.

It all depends on which one works for you. But I like working with can coders even though we are running a rev motor severe this year. But if you are using yagsl we had a new local team use the SRX encoder form CTRE.

1 Like

Any of these will work. On the S/W side, YAGSL (as an example) says it supports any of these (I totally believe this, I just don’t have first-hand confirmation). I don’t think there is much performance difference, and any of these three should mount easily, so there shouldn’t be any mechanical issues (double check for yourself). This leaves electrical.

If you don’t go with CANcoder, your first decision is to connect to the SPARK MAX for the steering, or to the RIO. This could affect the S/W side of things. This makes for five wiring options (CAN + RIO/SPARK MAX analog/digital).

The Thrifty option is super-easy to connect to RIO, probably the easiest of the three. It uses an analog input, which is different from the other two options. I’m not sure SPARK MAX supports analog input for absolute encoder, so there may only be four wiring options – don’t go down the analog/SPARK MAX path without confirming SPARK MAX and S/W support (in your chosen swerve code).

CANcoder has to be wired into your CAN bus, plus it needs 12V power. If you have a busy CAN bus, that might be an issue, but this should be manageable (maybe tweak some CAN status frame rates). Some teams have had trouble soldering to CANcoder, so there is a pre-wired version available.

If you choose to wire a digital absolute encoder (SRX MAG) to SPARK MAX, you will need an adapter board from REV. They redid the motion planning this year, so the support (in S/W) may not be there yet. If not using CAN, I’d advise starting with encoder wired into RIO, then checking on changing to SPARK MAX later, if you want to do that.

SRX MAG is wired to a digital input on the RIO (or into the SPARK MAX). It’s not hard to wire up, but you need an adapter/breakout to use it with the RIO for sure, and I think you might also need one to work with SPARK MAX.

When we started with MK4, there were fewer options, and we went with SRX MAG – this worked well, so we just stuck with it. I like that it’s digital, and it can be nice to not have the extra CAN traffic, given you are not on the CANcoder-based CTRE CAN bus. But I really do think any of thee are very viable options that are probably going to perform indistinguishably. Unless you have wiring issues/failures, which could be a deciding factor in favor of the most robust wiring you can manage.

1 Like

At risk of sounding like self-promotion, I do want to mention the Helium Canandmag was specifically designed to be run off of Spark Max-like motor controllers with no adapter boards or wiring changes needed.

2 Likes