SwerveGenerator
While using kraken swerve motors, we can use Phoenix Tuner X to generate swerve code. For that, there are specific requirements, steps for creating the project, steps for configuring the project, and steps for generating the project. This documentation is a simplified version of the actual CTRE code generator documentation, located here: https://v6.docs.ctr-electronics.com/en/latest/docs/tuner/tuner-swerve/index.html
Requirements: - The drivetrain should only use CTRE motors - all the Phoenix Tuner and CTRE firmware should be up to date - the bot needs to be connected to Phoenix Tuner
For creating the project: - Before configuring and generating the project, there are several other requirements that you'll need to know. The generator will ask for the wheel radius in inches, as well as the distance from the front wheels to the back wheels (also in inches). To measure that, you'll want to measure from the center of the front wheel to the center of the back wheel - The generator will also ask for the swerve module type and the swerve drive ratio
Configuring the project: - After all the requirements are set, the generator will have you configure all the motors. You will set the motor encoders, driving motors, and steering motors in these steps.
For the IDs, we have a standard for setting them. See below: - For the encoders, the Left Front should be 03, the Right Front should be 13, the Left Back should be 23, and the Right Back should be 33. - For the driving motors, the Left Front should be 01, the Right Front should be 11, the Left Back should be 21, and the Left Back should be 21, and the Right Back should be 31. - For the steering motors, the Left Front should be 02, the Right Front should be 12, Left Back should be 22, Right Back should be 32
While you're looking at these, you should see a pattern. When looking at the bot from the top, the front left swerve pod should be labeled as 0, the right front as 1, the back left as 2, and the back right as 3. These should correspond to the first numbers in each ID.
-
Then, after setting all the IDs, it'll have you test the drive motors, then the steering motors. After the tests, you will have to answer if it worked correctly. If it did not, correct it, and test it again.
-
After the tests, it should be ready for generating!
Generating the project: - If you've done all the previous steps correctly, this should be the easiest step. - There will be a box that says team number and you'll put in 1747, then generate the code. - You'll want to test the code on the bot, and make sure it runs in the way you want it to. If it doesn't, which has happened several times this year (2026), go back to the testing steps, and do it again. If it still doesn't work, you may have to change the code itself