SDS MK4 L2 Swerve Modules changing offsets mid driving

We changed out one of our swerve modules recently because we bent the plate of one of our modules. The code I was using was working perfectly without any issues when It came to driving. Once we replaced the back right module, both the back modules started to twitch once and a while. every time it did, it seemed the offset changed. Any idea if it’s my code or the hardware.

We had twitchy modules early in testing, and the cause ended up being flipped CANIDs on the CANCoders.
One thing you could double-check is that the back right has correct CANIDs (and isn’t overlapping/conflicting with the back left in some way)

Have you guys made sure that all encoder magnets are properly glued down

Just to state the obvious, changing a swerve module typically requires working out a new offset for the corner in question.

1 Like

no as in I change the offsets. and when I initialize, they run fine for about 30 seconds and then twitch. then they don’t run straight. I have no idea what is going on

Not sure but one of our old ones that were working are doing it now too

1 Like

There are some other CD threads which could apply, but it depends on the sensor you are using for the modules steering angle – CANcoders? Something else?

CANCoder

This was mostly my bad. I somehow labled the encoders wrong on the drivetrain and it ended up switching two of the CANCoders that were sensing the steering angle. whoops

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.