Best encoder for swerve

Are there and major advantages or disadvantages to the different swerve encoders? Is there one that is considered the best?
The three I can think of are the Thrifty Absolute Magnetic Encoder, The CANcoder, and the Rev through bore encoder, although if Im not mistaken that could only be used for the rev modules?

If you are using SDS swerve i highly rwccomend the CANCoder, even if it is a little expensive. While the thrifty mag encoder is essentially the same thing, it is technically just an infinite potentiometer which relies on the RoboRIO sending exactly 5V to the encoder. Ours was not sending exactly thst so we had some issues. Additionally, most swerve libraries dont support the Thrifty Mag Encoder right off the bat. If you do decide to use it, please reach out to me as we made our own class to use the Thifty Mag Encoder.

5 Likes

If you get the CANcoder, make sure to get the pre-wired version for $20 extra. It’s completely worth it to avoid soldering to those tiny pads.

4 Likes

To answer about the through bore encoder. I havent seen that used much and idk if its used on the MAX Swerve. I would steer away from it since i havent seen a lot of support for it in te libraries.

I dont have experience with any absolute encoder other than the REV through bore, however I’ll say that I loved our experience with them this year. We ran MAXSwerve which uses one per module for azimuth position, and also one on our robots wrist.

REV does need to do a better job getting documentation out for the software side of things, but we were able to look through the example swerve code for how to setup the encoder for our wrist.

Over-all we found they worked really well for us. The biggest thing I liked about them was how easy it was to zero the encoders if they’re hooked up to a spark. Connect to the spark through the hardware client, go to the absolute encoder tab, click zero and then burn the new zero to flash. Extremely straightforward and easy for us.

2 Likes

I heard that Spark MAX have trouble running onboard PID or motion profiling. What has your experience been with PID and Smart Motion? I’m wondering if it’s easier to connect the encoder to the RoboRIO.

We ran a positional PID loop onboard the spark for both our wrist and our swerve azimuth (controlType.kPosition). We didnt experience any issues (not that we noticed anyhow :woman_shrugging:) running them onboard the spark, even with the throughbore encoder.

We also ran SmartMotion onboard our spark controlling our shoulder joint using only the internal encoder on the NEO, and had great results with that too.


For those wondering why we ran Smart Motion on our shoulder, and a positional control loop on our wrist; We were experimenting with different control modes throughout the season, and started running out of time before our first competition. We just so happened to have Smart Motion working on the shoulder, and position working on the wrist. We didnt see a point in changing one to the other considering everything was working to our liking :woman_shrugging:.

1 Like

Cross posting here as it seems that this crowd may have the answers we are looking for

Best (easiest) way to connect (wire and program) Thrifty Absolute Magnetic Encoder to REV SPARK MAX Motor Controller? - Technical - Chief Delphi

Thanks!

Sorry, I have to step in here. It is not reliant on exactly 5V. The analog signal is relative to the RIO’s 5V rail. At 1/3 the price and with several hundred teams running them, the Thrifty Absolute Encoder is absolutely a viable option here. That’s what it was designed for. There was an issue with the case that was solved in season this year with no complaints since, maybe that is what you are referring to?

The code thing, sure. But this has been solved. Is there a good link we can include in the manual or on the site that would make this easier for teams in the future?

3 Likes

Thanks. Do teams typically wire the Thrifty Absolute Encoders to the Rio and just use them at startup to seed the encoders of the NEOs, or do they wire them to the SPARK MAX via a SPARK MAX Data Port Breakout Board so they can be used continuously?

Just seed them from the Rio, but it’s not a bad idea to re seed periodically, that’s what I would do. Mechanical systems can skip. It’s designed to plug directly into the Rio to be as straightforward as possible.

Thanks. I guess we will do that (connect the Thrifty to Rio) first.

I would be interested to know though if some teams have tried connecting them directly to the SPARK MAX to avoid the need to reseed periodically.

EDIT: changing the encoder to 3.3v mode fixes the whole reference voltage issue I describe below.

FWIW, I wouldn’t connect it directly to the SMAX. It only supports 3.3V input so you’d need to divide down the voltage, which will add a lot of inaccuracy as the reference voltage will be incorrect. As Sam said, the output is referenced “ratiometric” to the voltage supplying the encoder, so if you supply 5V and divide the output down from 5 to 3.3, the tolerances on your divider circuit and the 3.3V regulator on the SMAX will affect your result. Plus, the TTB encoder is analog, so it’ll be susceptible to noise caused by running motors near it. Better to just seed it once and leave it alone for 150 seconds.

This part can be solved by soldering a jumper on the encoder.

Source: Thrifty Encoder User Guide

3 Likes