MK3 Swerve - Issues with wheel alignment

We are using MK3 Swerve this year, and we’ve been able to get it mostly functional. However, when we set the offsets for the front left or front right modules individually, the other module rotates as well. All of our CAN IDs are correct and we’ve gone through our wiring many times, it is all correct. The alignment of our front left module seems to also change its own offset at random each time the robot is powered on. Has anybody experienced this issue with the MK3s?

1 Like

Did you glue the encoder magnets in place?

Hey we had this same issue with our MK4s. Are you using the example code on Swerve Drive Specialties? If so, the thig we were ding wrong was trying to set one wheel at a time. In their instructions, it states to download the code with the offsets set to 0.0. Now, turn the robot on set each wheel straight read those numbers and use those as your offsets.

Setting up module offsets

Now that we have code running on the robot, we can set up our module steering offsets. In order to do this we must have our encoder values displayed to the dashboard.

Before setting up module offsets ensure each offset is set to -Math.toRadians(0.0) and that code is deployed to the robot. This must be done each time offsets are determined.

  1. Turn the robot on its side, so it is easy to move each module by hand.

By default, module sensor information is displayed in the Drivetrain tab on ShuffleBoard.

  1. Rotate each module so the bevel gear on the sides of each wheel are pointing to the robot’s left.

When aligning the wheels they must be as straight as possible. It is recommended to use a long straight edge such as a piece of 2x1 in order to make the wheels straight.

  1. Record the angles of each module using the reading displayed on the dashboard.
  2. Set the values of the *_MODULE_STEER_OFFSET constants in Constants to -Math.toRadians(<the angle you recorded>)
  3. Re-deploy and try to drive the robot forwards. All wheels should stay parallel to each other.
  4. Make sure all the wheels are spinning in the correct direction. If not, add 180 degrees to the offset of each wheel that is spinning in the incorrect direction. (I.e. -Math.toRadians(<angle> + 180.0)))

I’d second @juniormunk suggestion. When we used MK3s in 2021 (our first attempt at swerve), we had glued the magnets in place, but there was some concern about using too much glue. What we found was that the magnets worked themselves loose. When we discovered this we had one module moving a lot and 2 others starting to move. Given it was our first time trying swerve, we thought it was the software, but when we reglued the magnets. the chassis started moving as we expected. By the way we were using MK3s.

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