View Single Post
  #5   Spotlight this post!  
Unread 22-03-2013, 21:06
BradenWatling BradenWatling is offline
Registered User
no team
 
Join Date: Mar 2011
Rookie Year: 2009
Location: Toronto, ON
Posts: 8
BradenWatling is an unknown quantity at this point
Re: Automatic 2 Speed Drivetrain Shifting Code

Quote:
Originally Posted by joelg236 View Post
How did you determine Constants.AUTO_SHIFT_UP_THRESHOLD to be 0.9 and Constants.AUTO_SHIFT_DOWN_THRESHOLD to be 0.5? Just trial and error?

Also why did you multiply Constants.AUTO_SHIFT_DOWN_THRESHOLD.get() * Constants.CHASSIS_MAX_LOW_ENCODER_RATE.get() ?

The code makes sense, but I don't think it does exactly what we'd like. Thanks for sharing though.
Yeah just trial and error. We have the ability to change variables without downloading code so that would help tweaking that. We never spent much time with the auto shift so we never got around to actually tweaking the 0.5 and 0.9 values.

We did that second part because our AUTO_SHIFT_THRESHOLD variables are meant to be percentages of our max low speed.

No problem. The way that we were able to distinguish between driving straight and rotating was by taking the average encoder rate. This way when you turn, rate will be around 0 and would shift to low gear.