With the removal of built-in project deployment in SysId, what is the best way to characterize a swerve drivetrain? We know that we can use CTRE’s SignalLogger to collect the necessary data, but we don’t know what program to run to generate the correct data. We checked the SysId section of the WPILib docs but it doesn’t seem clear on how to characterize a drivetrain specifically. We are using Mk4i with Falcon 500s.
I think the easiest way is to use the SysIdRoutine
class to create a simple custom routine. Did you look at the example project. For swerve you’ll want to apply the voltage to all 4 drive motors, and either mechanically or programmatically (via PID, for example) keep the angle of the modules linear so you get accurate numbers.
We’re using an all CTRE swerve setup, and I recently took inspiration from @jdaming’s additions to the template generated by Tuner X and implemented SysID data collection in our code, but I haven’t had a chance to test it yet. Here is Jason’s repo.
How did you do the analysis in SysID? Because there is no option for a drivetrain. Therefore it seems you can only analyze each motor.
Maybe I’m wrong
This is all you need to do.
Do you only analyze one motor? Or how do the constants differ from an individual motor to the entire robot. How do you integrate each of the motor’s constants into the final robot constants?
Take a look and see. Typically they’re close but not identical, due to physical differences in construction and wiring of the modules and motors.
Whether it’s worth using separate control gains for each motor is something you have to decide.
Oh okay. So I can just log all 4 motors, and simply analyze one of them and use those constants for the entire robot (if it works for use).
That’s what I did originally, but I still had some doubts about wether or not the method was correct.
Thanks for the response!