Programming CTRE Swerve Generator

My team recently bought our first swerve drive. SDS MK4i with Kraken x60 for drive and steer. After some research and help from other teams we used CTRE Swerve Generator and got to a pretty good point in the programming. What are some practices or tips we should follow to tune and fix issues that might happen?

Congrats on the swerve!! What issues are you having or you think you will have?

Currently we are having a lot of brown outs on acceleration. I have tried limiting it with a slew rate but it still persists.

Current limits are your friend.

1 Like

Is their any docs of sorts for me to look at to understand how to utilize current limits?

I highly recommend figuring out the basics of using advantage scope. It was very helpful for us understanding both odometer and what our swerve was doing. its not too hard either.

Brownouts are due to too much current drawn from the battery. You might want to check the current of each port on the PDP from your logs, maybe some ports using more current than it should. Also, how old is your battery and how well is it charged?

We have documentation on stator vs supply current limits and how you can determine what to use for your robot: Improving Performance with Current Limits. Note that in 2025, the Talon FX will have a 120 A stator current limit and a 70 A supply current limit enabled by default.

If you’re seeing brownouts, I would first make sure your slip current limit is reasonable in TunerConstants; it should be around 120 A (+/- 40 A). From there I would also check your wiring and battery (as explained in the “Preventing Brownouts” section), and then consider stronger current limits.

1 Like

Battery is from 2023 it gets charged everytime its not on a robot or plugged into something else

Thank you for this. I will look into this.