View Single Post
  #6   Spotlight this post!  
Unread 21-02-2011, 09:48
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: Jaguar Issues...

Running it in a slower loop won't necessarily flatten out the spike. I see other teams talking about "ramping their Jag inputs". That is more like what I am suggesting. I dug up an older example of doing just that with an analog joystick and Vic. It should be pretty easy to adapt it to the digital flightsticks and a Jag. Also, I re-checked last years code base. We rate-limited the swerve position to 20hz....not 20msec. So, more like 50msec. ...sorry 'bout that

A rate limiter for pwm / vic voltage:

Here's an older thread:

http://www.chiefdelphi.com/forums/sh...ot+of+pwm+data



Code:
//
//
// a joy stick rate limiter for an IFI controller
//
// joy is the current joystick reading
// LPjoy is the last pass joystick reading
// RateLimit is the allowed change in joystick value / pass
//    
//
// set LPjoy to joy after calling this
//
unsigned char RateLImitJoyStick(unsigned char* joy, 
                                unsigned char* LPjoy,
                                int            RateLimit)
{
   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{} 

   return(limited) ;
}
__________________

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

Last edited by EricS-Team180 : 21-02-2011 at 10:02. Reason: fixed some typo's. Guess I never compiled this =0