Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualHodgman

Posted 23 September 2013 - 08:39 PM

You could just search sequentially, trying each gear until the RPMs get close enough to where they should be. e.g.
if RPM < optimal_RPM-threshold and gear > 1
  gear --
 
if RPM > optimal_RPM+threshold and gear < max_gear
  gear ++

wait half a second for the engine to respond to new gear
repeat

#1Hodgman

Posted 23 September 2013 - 08:38 PM

You could just search sequentially, trying each gear until the RPMs get close enough to where they should be. e.g.

while RPM < optimal_RPM-threshold and gear > 1
  gear --
 
while RPM > optimal_RPM+threshold and gear < max_gear
  gear ++

PARTNERS