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) ;
}