View Single Post
  #5   Spotlight this post!  
Unread 01-12-2011, 20:52
LukeS LukeS is offline
4272 mentor, 1024 alumnus
AKA: Luke Shumaker
FRC #4272
Team Role: Mentor
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Indianapolis, IN
Posts: 60
LukeS is an unknown quantity at this point
Re: Shifting Transmission: Auto or Manual?

We (1024) used auto-shifting successfully this year.

We used super-shifters. I'm fairly certain that they were modified somehow, but I'm not sure.

Anyway, about the programming:

I set a threshold to shift up (4 ft/s), and a threshold to shift down (3 ft/s). The purpose of having 2 different thresholds was to avoid flickering if we were driving right about at the threshold.

To handle any static/outliers (which were a problem) I took an average of the last 10 readings on a 20ms interval.

Now, I was taking these readings on both the left and the right side. At different times I used either
  • abs((left+right)/2) (average)
  • max(abs(left),abs(right)) (maximum)

The average has the advantage that it implicitly handles the condition of turning; since the signs of each are switched they average to something close to 0.

However, early in the season we had problems with one of the encoders failing, dragging the average down, and keeping the bot in low gear. So I took the maximum of the two.

Now, I also had buttons for the driver to force low, or force high. They were used, but most of the time the autoshifter did the right thing.

Code: