TalonFX Swerve Angle Motor Not Turning

I am a rookie writing swerve for my frc team. The swerve has talonfx motors as both the turning motors and drive motors. But the angle motors won’t turn at all even when using a extremely high kP of 24. The swerve is mk4i and the link to the code is here: https://github.com/boyu0802/talon-swerve

Couldn’t find a specific problem, but here are some things to mention:

  1. Using a kP of 24 isn’t that high. Remeber that the unit is rotations, so numbers can seem very high while actually being low due to a very small unit.
  2. I would recommend using the CANcoder as a remote encoder for the motor. This is configureable in the Feedback configs.
  3. You shouldn’t do %360 as the CTRE unit is rotations, so you should do %1. (Lines 82 and 90)
  4. Does the motor work and PID to a position using phoenix tuner?
  5. I would recommend checking our YAGSL. It’s a great swerve library and pretty optimized swerve wise. If you want a quick way to use swerve (especially in the middle of the season) YAGSL seems pretty touch-and-go.

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