|
Re: Turning autonomously
We use what we call a PID-cheat.
First, we determine experimentally what input is required to the just barely turn the drivetrain consistently.
We then tune our PID proportional term to get us close at multiple angles (but never overshooting). We then put the PID cheat code after the PID, so that if the drivetrain is ever sent a drive value below the cheat, it will change it to the minimum value so that it will turn the robot.
For example:
Try to turn 30 degrees.
Robot turns 25 degrees. At this point the PID P term becomes small and can't turn the robot. The PID cheat sees the drive command that is too small, and coerces it to the minimum value to turn so that you reach the requested angle.
We've found this system to be much easier than trying to tune a perfect PID. It's much more forgiving of changes from robot to robot, match to match.
|