|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Desensitizing Joysticks
My fellow programmers and I have tried many different ways to desensitize our joysticks, but none of ways work very well. Does anyone know a good way to desensitize them?
|
|
#2
|
||||
|
||||
|
Re: Desensitizing Joysticks
Quote:
Why dont you just get new joysticks. very good ones can be found for cheep |
|
#3
|
||||
|
||||
|
Re: Desensitizing Joysticks
Quote:
You could make a slightly non-linear lookup table to de-sensitize the joystick in whatever region of deflection you want. This is actually what I use this lookup table generator for - to rapidly prototype and test new transfer functions for the joystick. If you want some help, let me know... |
|
#4
|
||||
|
||||
|
Re: Desensitizing Joysticks
how much do you want to back them down?
lots of teams just divide the joystick variable by 2, then add 64 to make 127= center again or divide it by 4 and add 96 to make 127 = center you can have this as optional code, with a button or operator switch that lets you switch between normal and "fine tuning" mode of driving. |
|
#5
|
|||
|
|||
|
Re: Desensitizing Joysticks
We played around with joysticks for a while trying to desensitize and the only way that we found effective is to just state something like the following
if (p1_y <= 135 && p1_y >= 127) { p1_y = 127; } if (p1_y >= 119 && p1_y <127) { p1_y = 127; } We tried this but just decided to buy new ones or use last years. Last edited by Gusman1188 : 31-01-2004 at 20:50. |
|
#6
|
|||
|
|||
|
Re: Desensitizing Joysticks
Here's how I'd do it... first psuedocode for understanding:
Code:
x1 = p1_x; // get an axis, store it in temp variable x1 = x1-127; // make 0 = neutral x2 = abs(x1); // find magnitude from center x3 = (x2/127) * x1; // create harshly curved value x4 = (x3+x1)/2; // average curve with real to lessen curve p1_x = x4+127; // restore neutral to 127 and replace value Code:
p1_x-=127; p1_x = ((p1_x*abs(p1_x)/127)+p1_x)/2+127; -Sean |
|
#7
|
||||
|
||||
|
Re: Desensitizing Joysticks
Hmmm... I'm not a programmer, but I think a large hammer would do it!
![]() |
|
#8
|
||||
|
||||
|
Re: Desensitizing Joysticks
Quote:
if ((p1_y <= 135 && p1_y >= 127) || (p1_y >= 119 && p1_y <= 127)) p1_y = 127; |
|
#9
|
||||
|
||||
|
Re: Desensitizing Joysticks
and heck, if readability is your issue, just include the 127 case as well:
Code:
if(p1_y >= 119 && p1_y <= 135) p1_y = 127; |
|
#10
|
||||
|
||||
|
Re: Desensitizing Joysticks
Quote:
![]() |
|
#11
|
||||
|
||||
|
Re: Desensitizing Joysticks
I dont understand how putting a deadband around 127 will make the joystick less sensitive
in fact, your bot is going to lurch when the joystick is moved just outside the deadband dividing the joystick variable by two, and then correcting the zero point by adding 64 - makes the full forward or full right... positions of the joystick equal to half forward, or half right... making the entire motion of the joystick less sensitive and making it easier to make fine control adjustments to the motion of the machine while driving - ie when you want to manuver to capture a ball, or position the robot precisely on the field. |
|
#12
|
||||
|
||||
|
Re: Desensitizing Joysticks
Quote:
Ken's solution sounds good, and is obviously more efficient than what I'm about to suggest here. I haven't tried my idea on the bot yet, and I'm a little sketchy about putting a lookup table of any size into the user routine because I don't want to slow it down too much. But here's the principle: make a slightly non-linear lookup table to de-emphasize the stick input near neutral, but not near the max/min. I've attached an example of the kind of curve I'm thinking of. Notice that near 127, it "dumbs down" the stick input to drive the motors slower and make the sticks less sensitive, but near the high or low end of the input it looks almost linear to make the driveability at high speeds feel pretty normal. Try it out and let me know what you think! Like I said, I haven't tried this on the bot yet... EDIT: I just changed the .xls to a zipped up .xls. Last edited by WillyC : 01-02-2004 at 13:00. Reason: .xls viewing troubles |
|
#13
|
||||
|
||||
|
Re: Desensitizing Joysticks
That is very helpful file.
What i was thinking is, have a max change function in real-time like you mentioned. Basically you jus need a variable that holds the current joystick input. For example if your joystick was at 135 and you pushed it to 250 all of a sudden, You can check you current motor output which was 135 and then current joystick input which is 250, now you keep adding a certain number lets say 10 to the motor output untill it reaches 250. This is one way to do it, the other way is to subtract 250-135, you get 115 devide it by a number lets say 10 so you get 11.5 , now ur max change is 11.5 , add that 10 times to your motor output or until it reaches desired position, this way you will have variable max change function. Last edited by thoughtful : 01-02-2004 at 13:29. |
|
#14
|
||||
|
||||
|
Re: Desensitizing Joysticks
You could use low pass filter. I'm at school right now and don't have access to what I've written, but I'll try to post it when I get home.
|
|
#15
|
||||
|
||||
|
Re: Desensitizing Joysticks
This is what I love about programming...there are so many different ways to solve the same problem. All of these are nest ideas. Good luck everyone!
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Programming joysticks | NoRemorse | Programming | 29 | 24-02-2004 20:26 |
| number of joysticks | doy | Rules/Strategy | 5 | 01-02-2004 00:05 |
| Team 524 has Team 362's spare joysticks from last year. | archiver | 2001 | 0 | 24-06-2002 02:36 |
| Could use some help with joysticks . . . | archiver | 2001 | 5 | 23-06-2002 23:36 |
| Calibrating speed controllers and joysticks | thedillybar | Technical Discussion | 4 | 11-02-2002 13:24 |