Thread: Deadband Help
View Single Post
  #10   Spotlight this post!  
Unread 17-02-2013, 09:36
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,043
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Deadband Help

Quote:
Originally Posted by Ether View Post

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:
Attached Thumbnails
Click image for larger version

Name:	deadband.png
Views:	13
Size:	4.7 KB
ID:	14060  
Reply With Quote