Slipping Encoders on SDS MK4

I have noticed some odd behavior trying to bring our MK4 modules online. I am an the determine encoder offsets.
I read the absolutes encoder value set it in my code then run. Now the fun happens. I can turn the wheels though they don’t seem properly synched. I can try a bunch of different angles. Then when I go back and point my wheels forward with the bevel to the left again, the absolute encoder angles have changed. The values on the dashboard agree with the values on phoenix.
For instance between check I went from
LF 172 - 192
RF 1.4 - 178
BL 21- 178
BR 338 - 163

What type of encoders? How are they connected? Code that’s reading them?

1 Like

Running Cancoders. And the code reading them are Phoenix Tuner and the SDS Drivetrain tab in Shuffleboard . Running their Java code library which puts module state to Shuffleboard. The values in phoenix and Shuffleboard drivetrain tab agree on the values so I don’t think it is the code.

1 Like

I’d make sure the magnet in your encoder is properly seated. I think the SDS modules require a little retaining compound to hold the magnets in (I could be mistaken though).

2 Likes

It does indeed:

Courtesy of their assembly guide.

2 Likes

What are the CANcoder LEDs doing (color, blink)?

I get the magnet green light. Maybe they did miss the loctite, I lost a drive gear that didn’t have loctite so the magnets could be in question.

Just FYI, Loctite 609 is not standard loctite for bolts and stuff (it’s not threadlocker). It’s special for for retaining things like this magnet.

Just thought I would mention that, just in case.

5 Likes

A little bit off topic but would it also be possible to fix the magnets using a set screw? We are building our own swerve and i dont really want to glue all magnets in the shafts because we might change some parts later.

1 Like

I’ve not personally used this module, so that’s probably more of a question for @PatrickW. I’ve only been browsing the instructions of a few popular modules.

My gut would say that’s “probably” okay, but I would feel really weird modifying a module that so many other teams use successfully in the standard config. The magnets are fairly cheap to buy, so I would think glueing them is a bad idea, but that’s just my opinion.

1 Like

I’m sorry i didn’t really clarify, but we designed our own swerve (it looks like a mk2 swerve, but we changed most dimensions to metric). We are also planning on using cheaper encoders later, that’s why the question came in to try it first with the magnets fixed using setscrews. But i guess we’ll just figure it out by testing. Thanks

1 Like

Got it.
I think that the TTB mag encoders use the same magnets, so if those are the encoders you are looking at, you will probably fine to glue.

Obviously if you are running something like a Rev hex-encoder or something, you will need to adjust.

A set screw is always an option for custom things like that. Make sure you have the proper tools to drill it. Id also highly recommend a good thread locker, just to make sure that doesn’t come loose. With custom swerves (or any mechanism) testing will verify everything works.

2 Likes

So does anyone have guidance on how to remove the magnet from the hole to apply loctite. @PatrickW

A bigger/stronger magnet?

1 Like

This runs a high risk of cracking the magnet or the set screw slipping. I would definitely avoid this. You can buy diametrically polarized magnets in bulk on AliExpress or EU-based magnet suppliers for like $0.50 each.
The same magnets will work with AS5600 encoders, which are incredibly cheap for zeroing modules.

1 Like

We’ve been using these magnets as spares, seem to work well enough.

https://www.kjmagnetics.com/proddetail.asp?prod=D48DIA

7 Likes

I have a spare magnet if it breaks. I just need to get it out and not sure how to do it.

What are they being held in with current? If it is some sort of adhesive you could soak them with acetone. If you can’t pull the magnets out with a larger magnet you could drill a through hole from the other side of the shaft on a lathe and then push them out. Worst case you can buy new shafts.

That was a fun throwback to spending waaaaaay too much time on the K&J Magnetics website in 2011 and 2013.

6 Likes

I used to work up the street from their shop at a CNC job shop and never realized it until after ordering a bunch from their site. Ended up being able to walk over and pick them up after work. It’s a really cool place.

2 Likes