Motors make weird noise with AdvantageKit, but not with Phoenix Tuner X

We’re experiencing some weird behavior with our Kraken X60 motors when using the AdvantageKit template. After we stop driving the motors, it makes a “stuttering” noise for 1-2 seconds. This noise is not isolated to one module. Looking at the motor LEDs, it’s making that noise with no driver input.

Video: https://photos.app.goo.gl/sLL3kDQQByUeKwwM7

But, when we use Phoenix Tuner X swerve generated code, it doesn’t make that sound at all. So, it’s not a mechanical issue. We also checked each module by rotating the wheels, and there’s no abnormal resistance.

We were wondering if this is something to do with AdvantageKit or if there is something wrong with our code.

Code: GitHub - sean-zhen/1468-2025-Beta-Robot-Code at To-Be-Tested-on-Robot
We are testing code on the “To-Be-Tested-on-Robot” branch.

It sounds to me like this is probably a tuning issue with the drive velocity control loop. You should be able to see oscillation in the measured velocity or applied output when looking at the log file. Note that the AdvantageKit template requires different feedforward and PID gains than CTRE’s default swerve code, because it applies the swerve gear ratio using the TalonFX firmware and not on the RIO. I would start by taking a look at the documentation sections for feedforward characterization and PID tuning if you haven’t already.

Thank you, we will take a look at that and update if we need any more help.