View Single Post
  #4   Spotlight this post!  
Unread 13-03-2013, 08:00
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,535
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
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.