Closed Liam-Stow closed 2 years ago
When we setup the swerve drive we kinda just plucked some PID and FeedForward constants out of nowhere and it worked alright.
However actually driving the robot is pretty hard, and one thing that might help is properly tuning the drive PIDF constants in SwerveModule.h here https://github.com/icrobotics-team5584/FRC-2022-Sumsy/blob/main/src/main/include/utilities/SwerveModule.h
This can be done by making a couple of commands that attempt to move the drivebase at constant speeds and then playing with the PIDF constants until it the robot moves at the correct speeds. OR A more in-depth option is to use the sysid tool to characterise the drivebase mechanism following these instructions: https://docs.wpilib.org/en/stable/docs/software/pathplanning/trajectory-tutorial/characterizing-drive.html Note that when using sysid we will need to lock the rotation of the swerve modules mechanically somehow since sysid is built for differential (tank) drives. OR Steal the Drop bears values. PID: https://github.com/thedropbears/pyrapidreact/blob/48508348c01b5768ff6670f78fa7ca0096ea846b/components/chassis.py#L87 FF: https://github.com/thedropbears/pyrapidreact/blob/48508348c01b5768ff6670f78fa7ca0096ea846b/components/chassis.py#L81 and https://github.com/thedropbears/pyrapidreact/blob/48508348c01b5768ff6670f78fa7ca0096ea846b/components/chassis.py#L125
Option chosen: Run in-depth characterisation with sysid. (done) Still todo: Test to make sure we are driving at the speed we expect
When we setup the swerve drive we kinda just plucked some PID and FeedForward constants out of nowhere and it worked alright.
However actually driving the robot is pretty hard, and one thing that might help is properly tuning the drive PIDF constants in SwerveModule.h here https://github.com/icrobotics-team5584/FRC-2022-Sumsy/blob/main/src/main/include/utilities/SwerveModule.h
This can be done by making a couple of commands that attempt to move the drivebase at constant speeds and then playing with the PIDF constants until it the robot moves at the correct speeds. OR A more in-depth option is to use the sysid tool to characterise the drivebase mechanism following these instructions: https://docs.wpilib.org/en/stable/docs/software/pathplanning/trajectory-tutorial/characterizing-drive.html Note that when using sysid we will need to lock the rotation of the swerve modules mechanically somehow since sysid is built for differential (tank) drives. OR Steal the Drop bears values. PID: https://github.com/thedropbears/pyrapidreact/blob/48508348c01b5768ff6670f78fa7ca0096ea846b/components/chassis.py#L87 FF: https://github.com/thedropbears/pyrapidreact/blob/48508348c01b5768ff6670f78fa7ca0096ea846b/components/chassis.py#L81 and https://github.com/thedropbears/pyrapidreact/blob/48508348c01b5768ff6670f78fa7ca0096ea846b/components/chassis.py#L125