sonic-howl / frc2024

LCCHS' repository for the FRC 2024 season
1 stars 0 forks source link

Traction control #48

Closed NeilTheFisher closed 3 months ago

NeilTheFisher commented 7 months ago

depends on #47

🚀 Summary: Traction control is useful when moving in a straight line. Depending on inconsistencies with the robot, it may not follow a straight path without correction. Using the angle snapping from #47, this is trivial. While turning, record the angle set by the gyro into a variable. When NOT turning, using the PID controller from #47, calculate the turn speed required to maintain that angle. If the angle passes a certain threshold like 25deg, that could mean another robot is pushing this one and we should not correct the angle, so record the new gyro angle into the variable once that threshold has been passed.

It might be a good idea to keep recording the gyro angle ~100ms after turning has completed so that the robot doesn't snap back. There is a delay between the driver actually stops turning to when the robot does.

Portnord commented 3 months ago

Not done. Use case did not come up.