Swerve drive wheels don't stay correct direction

hello, I am having a issue with the wheels on our swerve drive scattering. I had all the wheels facing the same direction then after we changed the battery the wheels all moved in different directions. I was wondering if I was possibly missing something in the code?
This is our team’s code.

I haven’t gone thru your code (not really my area) but this sounds like an azimuth angles encoder operating in relative move vs absolute.

Could you elaborate on “scattering” a little more? As in they keep changing angle (in motion) or the go to a seemingly random angle and then stop? Something in between?

It moves from one point to another and doesn’t stay in one place after you deploy the same code. They are currently set to be at a absolute point in the angle but it still moves.

The usual question - assuming these are SDS modules - did you loctite the magnets in with green loctite?

I believe it has blue but it might have standard red loctite.

Gotcha. The reason I ask is because if the magnet is slipping around within the housing, it can cause the same symptom you described. That’s not to say to not continue the software search - but might be worthwhile to do a bit of hardware investigation as well to make sure they’re not moving relative to the shaft that contains them.

“Always check layer 1”

One thing i have noticed is that the CANCoders are within 10 degrees of the absolute degree almost all the time that it is enabled.

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