Issues with Swerve Drive Implementation - Seeking Advice!

Hello everyone! I’m Ömer from Team 6431. This year, we’re implementing a swerve drive system for the first time, but we’re encountering some challenges with the coding aspect. When we command the modules to move straight in the XY plane, applying a theta (rotation) causes the drives at two corners to reverse direction. However, when we invert the drive motors to correct this, it messes up the translational movement. Has anyone experienced something similar or knows how to resolve this issue?

We’re using the following setup: MK4i modules, CANCoders for absolute positioning, SparkMax motor controllers, Neo motors, and a Pigeon 2.0 for gyroscopic data. Any guidance or suggestions would be greatly appreciated! Our code is here: GitHub - Omer-Tuna-Cavdar/SwerveL3-master

Can you rotate while stationary?

No It can’t rotate around its self at any given moment. If i invert the drive motors then it can although that way my xy translation doesn’t work

Could you attach a video of the wheels when this happens?

To me this sounds like the bevels on the gears on the 2 corners were zeroed with the beveled gear on a different side than the other 2 modules. Try adding pi to the 2 modules in the offsets.

Is your SwerveDriveKinematics object configured correctly (i.e. correct bot length and width)? My team had a similar issue and that was what caused it. Please do send a video if you have time.

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