Swerve Modules Spinning Uncontrollably

Swerve modules are spinning uncontrollably, they appear fine on Phoenix Tuner and the CAN is fine. All the LEDs are blinking green. When just driving forward, the swerves rotate as well. When you rotate, the swerves rotate uncontrollably.

sounds like it could be a PID tuning issue, do you have a way to verify the target module states are correct? then you can know if theres a code error thats commanding them incorrectly or if they are jittering around their target

The same pid values worked before, it just stopped working when we used parts of this drive base on another robot and then rebuilt this drive base

interesting, so you disassembled and reassembled the drive base? is it possible you swapped some turn and drive motors?

1 Like

We checked all sparkmax ids and they were right. DriveStation says Cancoder error, but the cancoders seem fine in phoenix tuner and we traced all the wiring and found no issue.

what is the cancoder error?

Something is off with the encoder for the swerve, but we can’t find the issue

Take a look

Likely something is inverted and you are running in the wrong direction to a setpoint you will never reach.

1 Like

One thing you can do is use Phoenix X to read each cancoder’s position, then turn the wheel manually and reread the cancoder position ( did it increase or decrease approximately the amount you turned the wheel and in the correct direction). I’d also reverify zero is correct . One thing we’ve had issues with is if the magnet isn’t super glued properly, it sometimes works its way loose which can really mess with driving.

1 Like

I think what @AvocadoPeel meant was “please post the exact error message that you are seeing on the DriverStation and include the surrounding messages for good context.”

1 Like