Quote:
Originally Posted by Jared341
Another way to do this is:
Code:
motor_value = k*joystick_reading + (1-k)*motor_value
k is between 0 and 1.
Large k values make the motor very responsive, and a value of 1 means no filtering is actually happening. Small values make the output move slowly from the old value to the joystick value.
This is an Infinite Impulse Response (IIR) low pass filter, whereas the moving average is a Finite Impulse Response (FIR) filter. Which of these to choose (or using a rate limiter like Ether suggested) depends on what exactly you are trying to accomplish.
My experience with using any sort of filtering in the drive train (other than traction control in 2009) is that drivers usually hate it because if the effect is significant it feels "sluggish".
|
We're using a moving average this year and chose our value based on if it felt laggy to the driver or not. We're only storing 10 values, but we figured something is better than nothing. We'll see how this season goes and decide if it is something that we'll continue to use.