CTRE Generated Swerve Drive With Jittering Steer Motor

I am the lead programmer for team 3767 TC Titans, and this year we made the decision to do a full CTRE swerve drive to utilize the generated swerve system. The swerve drive is made up of MK4n swerve modules with the L3+ gearing and Kraken X60’s for both drive and steer. After we got the swerve built and the new CTRE Swerve project generated, the robot seemed to drive fine, however the steering motors seemed to jitter along the path to their setpoint. We have chopped this up to a PID issue, however after spending several hours trying to tune it to stop doing this, I couldn’t figure out what is going wrong. even when everything other than P is set to zero, and P is incredibly low, the modules jitter along their path even when not making it to the setpoint.

The chassis drives fine, and after tuning the PID a little bit despite this issue, the modules snap right to place and haven’t yet had any issues with drift or other common swerve issues. The only problem is that the modules are incredibly noisy, and I am concerned for the lifespan of the gears.

For software we are using all of the most recent 2025 versions of the WPIlib, NI, and CTRE software suites. The only code changed from what is generated by Tuner X is the code for controller input, as we are using PS5 controllers rather than Xbox. However even when using an Xbox controller for input (using the controller code that is generated by Tuner X) the issue persists.

Any help would be greatly appreciated!

you’ll want to post a link to your GitHub so that folks can see your code.

also link to a video showing the problem.

it would also be good to show an example of the data produced: commanded steering angle, actual angle, motor output, etc, for one of the steering mechanisms.

I’ll have access to the robot in a couple hours, I’ll post a video and some data then

It sounds like the feed forward is too high with KS and KV.
Do you mean you have set the KI, KD, KS, KV, KA = 0?

https://firstinmichigan.us/FRC/frc-swerve-drive-build-series/

There is a video specifically on tuning the steering motors.

Yes, all the feed forwards had been set to zero along with kI and kD.

Here is a link to the code: github.com/jckitkat/2025-Robot

And here is a video IMG_8620.MOV - Google Drive

edit: this is with all the values in the current version of the github repo, this is just the result of trying a bunch of things

looks kinda normal to me. i would definitely put this issue at the bottom of your to-do list.

oh also, when the wheels are actually in contact with the carpet, they do this less, because there’s a ton of friction.