Skip to content

Commit b4ab244

Browse files
author
NoahAndrews
committed
Better document why the turning encoder is inverted
1 parent d458055 commit b4ab244

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/java/frc/robot/Constants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ public static final class DriveConstants {
6262
}
6363

6464
public static final class ModuleConstants {
65+
// Invert the turning encoder, since the output shaft rotates the opposite direction compared to
66+
// the steering motor in the MAXSwerve Module.
6567
public static final boolean kTurningEncoderInverted = true;
6668

6769
// Calculations required for driving motor conversion factors and feed forward

src/main/java/frc/robot/subsystems/MAXSwerveModule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ public MAXSwerveModule(int drivingCANId, int turningCANId, double chassisAngular
6565
m_turningEncoder.setPositionConversionFactor(ModuleConstants.kTurningEncoderPositionFactor);
6666
m_turningEncoder.setVelocityConversionFactor(ModuleConstants.kTurningEncoderVelocityFactor);
6767

68-
// Invert the turning encoder since the output shaft is inverse of the motor in
69-
// the MAXSwerve Module.
68+
// Invert the turning encoder, since the output shaft rotates the opposite direction compared to
69+
// the steering motor in the MAXSwerve Module.
7070
m_turningEncoder.setInverted(ModuleConstants.kTurningEncoderInverted);
7171

7272
// Enable PID wrap around for the turning motor. This will allow the PID

0 commit comments

Comments
 (0)