From 88e76ee2e67fe8356e9c489789e7d48d206bf6a8 Mon Sep 17 00:00:00 2001 From: Tyler-J42 Date: Wed, 27 Mar 2024 19:32:25 -0400 Subject: [PATCH] thing probably won't fix the swerve code --- src/main/java/frc/robot/utilities/MAXSwerveModule.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/frc/robot/utilities/MAXSwerveModule.java b/src/main/java/frc/robot/utilities/MAXSwerveModule.java index eab9fe7..8c50dbf 100644 --- a/src/main/java/frc/robot/utilities/MAXSwerveModule.java +++ b/src/main/java/frc/robot/utilities/MAXSwerveModule.java @@ -37,6 +37,10 @@ public class MAXSwerveModule { m_drivingSparkMax = new CANSparkMax(drivingCANId, MotorType.kBrushless); m_turningSparkMax = new CANSparkMax(turningCANId, MotorType.kBrushless); + // The periodic frame update rate for the absolute encoders for position is available to be changed at Status 5 + // The update rate for absolute encoder velocity is on Status 6. + // The default update rate for the absolute encoder on both of those status frames is only 200ms which might be causing the swerve jitter + // TODO: test if these changes break the swerve drive or fix the jitter. m_turningSparkMax.setPeriodicFramePeriod(PeriodicFrame.kStatus5, 20); m_turningSparkMax.setPeriodicFramePeriod(PeriodicFrame.kStatus6, 20);