View Single Post
  #14   Spotlight this post!  
Unread 12-03-2015, 17:43
Skyehawk's Avatar
Skyehawk Skyehawk is offline
Nuts N' Bolts
AKA: Skye Leake
FRC #0876 (Thunder Robotics)
Team Role: Mentor
 
Join Date: Nov 2012
Rookie Year: 2011
Location: Northwood, ND
Posts: 228
Skyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to all
Re: Driving Straight With Encoders

I have not have time to read this entire thread, my apologies it I am being redundant:
My team has a method for making a "perfectly" straight line while driving forward in auto.

The method:
1) Reset both the left and right encoders.
2) Running in a ~20ms while loop:
...A) some form of counter, timer, or interrupt to stop the loop
...B) some form of comparison between the two encoders
3) Start off the while loop by driving at a certain speed
4) Check if Right>Left, if so speed up Left
5) Check if Left>Right, if so speed up Right
6) Stop loop when the control condition is met.

We sped up the side that was going slower when we reached a tolerance of + or - 1/8 inch. This gave us a drift of 2 inch over a 500 inch forward run.

Last edited by Skyehawk : 12-03-2015 at 17:45.