-
Notifications
You must be signed in to change notification settings - Fork 7
Swerve Module Characterization Notes
These were the steps we took to characterize the swerve modules using the frc-characterization tool.
Since the frc-characterization tool does not currently have a swerve drive mode, you need to do a few manual modifications in order to characterize the modules effectively. To characterize the swerve module to get the appropriate gains from the frc-characterization tool, you need to treat the steering motor as a simple motor. The throttle motors can be characterized together as a drivetrain to match the entire robot.
You will need to modify the generated drivetrain project in order to characterize it properly. To make the steering motors hold their angle, you need to initialize them in the code and set them to position control with their initial orientation as a target (essentially, set the current position to zero and then set them to target a setpoint of 0 in autonomous/teleop periodic).
For the PID values, you just need to set a P value. We determined this by starting at 0.001 and enabled the robot in teleop mode when it was on its side. We then tried manually rotating the module. If the Motor has a slack before it starts correcting, increase the P value until it reacts instantly when trying to turn it manually without any oscillations. With an SDS MK III with Falcons, we used a P value of 0.1, which seemed good enough.
For the steering motors, we didn’t do any modifications to the generated project and just treated it as a simple motor and left the robot on the ground.