View Single Post
  #4   Spotlight this post!  
Unread 12-02-2005, 18:59
AIBob's Avatar
AIBob AIBob is offline
AI Programmer
AKA: Bob Frank DOT org
FRC #0358 (Hauppauge Robotic Eagles)
Team Role: Alumni
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Long Island, NY (in Binghamton now)
Posts: 297
AIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to behold
Send a message via ICQ to AIBob Send a message via AIM to AIBob Send a message via MSN to AIBob Send a message via Yahoo to AIBob
Re: speed controller max speed

You could one of three basic things:
You could use a formula to squish things in, which may take longer, but consume less space
or you could use a lookup table, which would take less time, but consume more space.
Or you could just cut everything off after 200, which is small and takes little time.
Here is a an example fomula one:
Code:
unsigned int Limit(unsigned int pwmin)
{
unsigned int tmppwm = 0;
tmppwm = (unsigned int)(((pwmin-127)*72)/127) + 127);
return (tmppwm+127);
}
__________________
- from B B frank


Last edited by AIBob : 12-02-2005 at 19:06. Reason: typo