Mk4i Swerve Drive with SparkMax Encoder Issues

Hey Chief Delphi,

Our team is diving into swerve drive development for the first time this year, and we’re hitting a snag with getting the motors to respond correctly to controller inputs. We’re coding in Python 3, utilizing robotpy, and incorporating brushless Neos and SparkMax motor controllers, alongside CAN Coders and Mk4i modules. Currently, we’re encountering an issue where we expect turn values of pi/2 radians, but we are getting values of pi/4 radians. This issue leads us to suspect that there’s a miscommunication between the CANCoders and the SparkMaxes. Has anyone else faced a similar problem? We’ve shared our code on GitHub for reference: GitHub - BC-Robotics-4504/2024-Season.

Thanks for any insights you can provide!

I would try to isolate it to a simple program with a single motor and encoder to see if it’s a bug with the hw, software, or an error in your code.

Also, looking at your README, recommend you move to the pyproject.toml stuff for 2024. See pyproject.toml usage — FIRST Robotics Competition documentation

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