MK4i NEO Swerve Drive Help (specifics below)

Hi everyone,
We have an issue with our swerve code. Whenever we point the swerve drive joystick almost all are not aligned. For example, when pointing the joystick forward, front right is driving straight; front left and back right are pointing north west and back left is pointing eastward. When rotating the joystick 720 degrees, front left is driving north east; front right is going East; back right is driving South South West and back left is going straight.

Apologies for the poor video quality but appreciate any help

Our swerve base is in the comments.

Again, thank you for your help

Our Swerve Drive Code Base: GitHub - gryphonmachine/SwerveDrivePowerTrain: 2024 swerve drivebase mark-1 / in work

Did you zero your steering encoders?

If you command the robot to drive in a lazy circle via the joystick, does each wheel work it’s way through 360°?

I ask this because if the encoder offsets are not being applied (or zeroed) then this is probably the issue.

Sorry for the late replies as we’re a school team but how do we check if they are zeroed?

Like @Skyehawk mentioned above. You will need to reset the zero / offset angle for your encoders in the forward facing position. One way to do this is using the phoenix tuner, as shown in this video.

You can also zero the encoders inside the Phoenix Tuner instead of in your code by clicking the button that says something like “zero encoder”. One thing to note, the new zero will not take effect until your entire robot is power cycled.

We tried to do it in our code. Is that ok?

Actually, I remember watching the video you sent previously. The motors should all be zeroed

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