View Single Post
  #4   Spotlight this post!  
Unread 24-01-2005, 21:30
jacob_dilles's Avatar
jacob_dilles jacob_dilles is offline
Registered User
AKA: theshadow
FRC #0620 (WarBots)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Vienna, VA
Posts: 245
jacob_dilles will become famous soon enough
Send a message via AIM to jacob_dilles
Re: Slowing Down Drive Motors

Quote:
Originally Posted by ConKbot of Doom
Sounds like a lookup chart.
Exactly!

Although it could theoretically do it, the PIC in the RC isn’t exactly up for exponential equations.

What we have done every year is a lookup table... it takes more effort then writing an equation; you need to come up with a chart with 127 (or 256, depending on how you write your code) like this made up example:

Code:
int speed[] =  {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,8,9,10,11,12,13,14,15,17,19,21,24....
etc... i will try to find the exact code out of an old bot. the idea is that when you get the joystick value, you just take:
Code:
p1_y = speed[p1_y];
its that easy!

this also gives you a chance to tweak your robots response time and "aggressiveness"

best of luck -- jsd
__________________
--------------------------
"You're not a real programmer until all your sentences end with semicolons;"