Our team is using a swerve drive train this year. We are working on a turntable style mode where the rotation of the turntable (or a joystick) directly maps to the orientation of the robot, but we are having an issue where as the robot is slowing down to a stop, the robot does a “hockey stop” and turns all the wheels diagonally as if it were rotating, causing it to stop extremely quickly. This issue is caused by the fact that the direction is constantly trying to correct itself using the information from the gyro and the turntable, meaning that there will always be some rotational component to our movement. When we are stopping, the strafe component to our movement (calculated from our controller) is zero. This means that the rotation entirely controls the position of each of the wheels, causing it to lock the wheels into the rotation position and “hockey stop” every time.
We have tried several solutions to fix this problem. First, we added a tolerance that told the robot to ignore rotation if it was slowing down and if it was within a certain distance from our target angle. This proved to be mostly ineffective because the robot would rotate a very large amount as it was slowing down, however it will require more testing on our competition robot. The other solution we tried was to add an acceleration/velocity curve that would add in a movement component to our joystick input that is slightly smaller than the robot’s current movement, causing it to slow down over time while maintaining our direction. In practice, this never worked very well, but with some tuning it might work.
We are curious if there are any threads that already exist on this topic and if any other teams have run into this issue.