View Single Post
  #2   Spotlight this post!  
Unread 13-02-2007, 12:39
EricS-Team180's Avatar
EricS-Team180 EricS-Team180 is offline
SPAM, the lunchmeat of superheroes!
AKA: Eric Schreffler
FRC #0180 (SPAM)
Team Role: Engineer
 
Join Date: Apr 2002
Rookie Year: 2001
Location: Stuart, Florida
Posts: 561
EricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond repute
Re: Moderating Acceleration / Deceleration

Hi Tom, It's a be-deviling problem, isn't it

Here's a thread with a plot (from last year) that may shed some light on what you are dealing with:

pwm / voltage dat

and just a day or 2 ago, I saw a plot of a team's wheel speeds vs joystick input that is also good data....but I'll be darned if I can find it again

Anyway, you might try something like a rate limiter. We've done this in the past, but just ended up in an argument among team members on robot handling qualities. You can also search on something like "exponential drivetrain" to see how some teams re-map the joystick to motor relationship.

Here's a shot at some rate limit code that shows the general idea ... it ain't tested, so caveat cursor

Code:
//
// a joy stick rate limiter
//
unsigned char RateLImitJoyStick(unsigned char* joy,   // current joystick
                                unsigned char* LPjoy,           // LastPass joystick
                                int            RateLimit)            // rate of change limit
{
   int speed ;
   unsigned char limited = 0;

   speed = (int)*joy - (int)*LPjoy ;
   if(speed > RateLimit)
   {
       speed = RateLImit;
       *joy = speed + (int)*LPjoy ;
       limited = 1 ;
   }
   else if(speed < -RateLImit)
   {
       speed = -RateLImit;
       *joy = speed + (int)*LPjoy ;
       limited = 1 ;
   }
   else{} 
   *LPjoy = *joy
   return(limited) ;
}

I'm sure there are others on this forum that can improve on these ideas.

Good Luck!
(not quite in panic mode)Eric


PS the fighting pi's is a great name! Ha!
__________________

Don't PANIC!
S. P. A. M.

Last edited by EricS-Team180 : 13-02-2007 at 12:51. Reason: forgot a line...yikes!