View Single Post
  Spotlight this post!  
Unread 24-01-2005, 22:01
jgannon's Avatar
jgannon jgannon is offline
I ᐸ3 Robots
AKA: Joey Gannon
no team
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Pittsburgh, PA
Posts: 1,467
jgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond repute
Re: Slowing Down Drive Motors

Instantiate two ints named temp15 and temp16. After the limit mixing functions have run, do this:
Code:
temp15=(int)pwm15-127;
temp16=(int)pwm16-127;
pwm15=(int)(.007874*pow(temp15,3)/fabs(temp15)+127);
pwm16=(int)(.007874*pow(temp16,3)/fabs(temp16)+127);
My real code is structured a little differently, but it works the same. 0 still outputs 0. 127 still outputs 127. 254 still outputs 254. Everything else in between is much less touchy, and it gives the driver a lot more control. It's also much simpler than making a lookup table, and won't eat up all your memory. (Yes, this is how I actually code. No, nobody else can ever figure out what I'm doing.)
__________________
Team 1743 - The Short Circuits
2010 Pittsburgh Excellence in Design & Team Spirit Awards
2009 Pittsburgh Regional Champions (thanks to 222 and 1218)
2007 Pittsburgh Website Award
2006 Pittsburgh Regional Champions (thanks to 395 and 1038)
2006 Pittsburgh Rookie Inspiration & Highest Rookie Seed

Team 1388 - Eagle Robotics
2005 Sacramento Engineering Inspiration
2004 Curie Division Champions (thanks to 1038 and 175)
2004 Sacramento Rookie All-Star

_