Swerve Drive Help

Our team is trying to implement swerve drive for the first time and we are having problems with oscillation on our steer motors and the steer motors not getting to the setpoints properly. The setpoints seem to be calculating just fine however. We are using MA3 absolute analog encoders and CANTalon motor controllers for all 8 of our motors. Our encoders are coupled directly to the shafts of the steer motors.

Here is our code for reference. It is a stripped down and simplified version of team 16 BombSquad’s code from last year:

Nevermind! We fixed it. It was all the build team’s fault. :stuck_out_tongue:

Can you explain what the root cause was, and how you figured it out? Might help another team.

Also I was curious…

I’ll let them explain it, but, given their code base, I was happy to hear it wasn’t code related. :smiley:

Thanks again Jefferson! So helpful! The leads to the steer motors were reversed. When we switched the leads or instead just put in a negative P value in our PID for the code, it worked. Not sure why it caused the motors to behave in the way they did. Someone more technically versed than I can probably explain it better.