View Single Post
  #2   Spotlight this post!  
Unread 11-02-2005, 15:23
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Drive Straight C Code using Encoders without PID?

Quote:
Originally Posted by chakorules
Has anyone come up with some slick ways to monitor your encoders and balance your drive system?
Last year, we had a string of matches where the robot swerved badly to one side when it was being commanded to go straight. We thought we were having drivetrain balance or other drag issues. I whipped up a simple algorithm that compared the accumulated wheel counts on each side, and for each count they differed, it scaled up one side's motor control by a percentage while scaling down the other side by the same percentage. In bench testing it worked great, matching both side's wheel speeds regardless of how much drag was placed on either side.

On the field, it more often than not resulted in the robot lurching downfield briefly and coming to a complete halt, and we were very pressed for time, so rather than spend a lot of effort debugging the software we abandoned the scheme. It turns out the code was fine, and the problem was actually with the gearbox, where a poorly held bearing was letting the gears disengage whenever it tried to move suddenly in reverse. Our autonomous setup happened to involve starting the robot at full speed in reverse to "back up" down the field to a turning point. One side would fail to drive, and the algorithm dutifully increased power to the disengaged drivetrain while decreasing power to the working one. The error would quickly reach the point where the working side was being throttled all the way back to zero.