Quote:
Originally Posted by Ether
Let "J" be your joystick value, in the range -1 to +1.
Let "d" be your desired +/- deadband.
Let "out" be your modified joystick command (incorporating the deadband).
Then:
Code:
if (J>d) out = (J-d)/(1-d);
else if (J>-d) out = 0;
else out = (J+d)/(1-d);
"d" is the deadband tuning parameter in the range 0 <= d < 1
|
Attached is a graph of what the above code produces for d=0.2: