Tuner X default swerve code has rotational motors struggling to center

Team 5016 working with Tuner X generated code. When we enable Teleop, the modules all seem to try and center, but keep overshooting the encoder. We thought it was due to the floor, so we added carpet. Same result.

Slow Motion video to get the idea here

We also tried to play with the SteerGains PID values. If we are on the right track, with this then we will keep working!

    private static final Slot0Configs steerGains = new Slot0Configs()
        .withKP(100).withKI(0).withKD(0.2)
        .withKS(0).withKV(1.5).withKA(0);

Source here

Make sure your joystick and/or velocity command deadzones are set properly. This was happening on ours until turning deadzones on. Xbox controllers need a 0.12 deadzone on the raw joystick values.

1 Like

When you ran the steer verification in Tuner X, did all the swerve modules spin counter-clockwise as seen from the top of the robot? It looks like you’re using inverted swerve modules, so there’s a chance that the steer motor invert should be true.

SOLVED It was the inverted swerve setting. I remember running it twice because the first time it was not right. Or so I thought. We will get the team to run it again and see if we come out with the same constants. Thanks so much for the help.