Go to Post 5:20 - Lots of discussion about how FIRST pretty much wipes out the world of at least one object every year. - Andy Grady [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 31-01-2004, 19:20
bob1million's Avatar
bob1million bob1million is offline
Registered User
#0825 (Swivvey-gus Maximus)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Pearisburg
Posts: 7
bob1million is an unknown quantity at this point
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?
__________________
"Death smiles at us all, all a robot can do is smile back."
  #2   Spotlight this post!  
Unread 31-01-2004, 19:47
edomus's Avatar
edomus edomus is offline
Registered User
AKA: Evan
FLL #1218 (CHAbots)
Team Role: Driver
 
Join Date: Feb 2003
Location: the east
Posts: 325
edomus is on a distinguished road
Send a message via AIM to edomus
Re: Desensitizing Joysticks

Quote:
Originally Posted by bob1million
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?

Why dont you just get new joysticks. very good ones can be found for cheep
__________________
2004 National Finalists with 469 and 868

2004 Gallileo champions and #1 seed
  • Delphi "Driving tommarows technology" -philly 2004
  • 8th seed philly 2004
  • 58/58 at annapolis 2004 (like the improvement?)
  • Philadelphia Alliance Regional Winner!-2003
  • 7th seed Philly 2003
  • Rookie all star philly 2003
  • semi finalist Pitt 2003
  • picked 3rd in pitt 2003
  • Seeded 17(curie) at nats 2003
  #3   Spotlight this post!  
Unread 31-01-2004, 20:14
WillyC's Avatar
WillyC WillyC is offline
"handy"
#1347
Team Role: Engineer
 
Join Date: Jan 2004
Location: Ottawa, Canada
Posts: 29
WillyC is on a distinguished road
Re: Desensitizing Joysticks

Quote:
Originally Posted by bob1million
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?
You could make a different "transfer function" for the joystick in the form of a lookup table. For instance, right now the transfer function for joystick input to motor output is purely linear (not including the x and y axis mixing). It's linear in the sense that the motor output is linearly proportional to the joystick deflection from neutral.

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   Spotlight this post!  
Unread 31-01-2004, 20:35
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
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   Spotlight this post!  
Unread 31-01-2004, 20:47
Gusman1188 Gusman1188 is offline
Registered User
FRC #0870
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 1930
Location: S
Posts: 43
Gusman1188 will become famous soon enoughGusman1188 will become famous soon enough
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.
__________________
Team R.I.C.E. 870

2006 SBPLI Regional Winner
2006 SBPLI Imagery Award
2005 SBPLI Regional Winner
2004 SBPLI Xerox Creativity
2003 SBPLI Regional Winner
2003 CT J&J Sportsmanship
2003 SBPLI KPC&B Entrepenuership
2002 SBPLI Rookie All-Star

Last edited by Gusman1188 : 31-01-2004 at 20:50.
  #6   Spotlight this post!  
Unread 31-01-2004, 21:11
Vladimir Vladimir is offline
the Impaler
#1064 (Wild Beast)
Team Role: Programmer
 
Join Date: Mar 2003
Location: South Milwaukee, WI
Posts: 6
Vladimir is an unknown quantity at this point
Send a message via ICQ to Vladimir Send a message via AIM to Vladimir Send a message via Yahoo to Vladimir
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
then this should actually work and is a lot more concise... it assumes you have an abs( function available, either include a math library or make your own with something like if (x<0) x*=-1; -- I haven't tested this so don't run me over with your robot if it doesn't work off the first try, there may be some casting or something required with this compiler, but it'll at least be close.

Code:
p1_x-=127;
p1_x = ((p1_x*abs(p1_x)/127)+p1_x)/2+127;
Hope this helps some!

-Sean
__________________
B.R.E.W. (Better Robots Engineered Wisely)
  #7   Spotlight this post!  
Unread 31-01-2004, 22:20
fox46's Avatar
fox46 fox46 is offline
Registered User
FRC #2013 (Cybergnomes)
Team Role: Mentor
 
Join Date: Feb 2003
Rookie Year: 2000
Location: Toronto, ON, Canada
Posts: 400
fox46 has a reputation beyond reputefox46 has a reputation beyond reputefox46 has a reputation beyond reputefox46 has a reputation beyond reputefox46 has a reputation beyond reputefox46 has a reputation beyond reputefox46 has a reputation beyond reputefox46 has a reputation beyond reputefox46 has a reputation beyond reputefox46 has a reputation beyond reputefox46 has a reputation beyond repute
Re: Desensitizing Joysticks

Hmmm... I'm not a programmer, but I think a large hammer would do it!
__________________
Mentor, Team 2013 Cybergnomes 2010 - 2014, 2016
Mentor, Team 3756 RamFerno 2011 - 2013
Mentor, Team 854 Iron Bears 2005-2007
Founding member, Team 854 Iron Bears 2000-2005

Mech.Eng.+Mgt University of Ontario 2009
B.Ed OCT Trent University 2015
Professional Education and Product Knowledge Consultant - Toyota Canada Inc.
  #8   Spotlight this post!  
Unread 01-02-2004, 00:47
KevinB's Avatar
KevinB KevinB is offline
Registered User
AKA: Alum
no team
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2001
Location: AL
Posts: 188
KevinB will become famous soon enoughKevinB will become famous soon enough
Send a message via ICQ to KevinB
Re: Desensitizing Joysticks

Quote:
Originally Posted by Gusman1188
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;
}
All this could be rewritten as one line:

if ((p1_y <= 135 && p1_y >= 127) || (p1_y >= 119 && p1_y <= 127)) p1_y = 127;
  #9   Spotlight this post!  
Unread 01-02-2004, 02:55
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
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;
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)
  #10   Spotlight this post!  
Unread 01-02-2004, 10:40
KevinB's Avatar
KevinB KevinB is offline
Registered User
AKA: Alum
no team
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2001
Location: AL
Posts: 188
KevinB will become famous soon enoughKevinB will become famous soon enough
Send a message via ICQ to KevinB
Re: Desensitizing Joysticks

Quote:
Originally Posted by deltacoder1020
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;
Looking back at my statement reminds me of why coding at midnight is bad.
  #11   Spotlight this post!  
Unread 01-02-2004, 10:55
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
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   Spotlight this post!  
Unread 01-02-2004, 11:08
IMDWalrus's Avatar
IMDWalrus IMDWalrus is offline
This is a line...
AKA: Paul
FRC #0818 (Genesis '02)
Team Role: Alumni
 
Join Date: Mar 2003
Rookie Year: 2003
Location: Michigan
Posts: 617
IMDWalrus is a splendid one to beholdIMDWalrus is a splendid one to beholdIMDWalrus is a splendid one to beholdIMDWalrus is a splendid one to beholdIMDWalrus is a splendid one to beholdIMDWalrus is a splendid one to beholdIMDWalrus is a splendid one to behold
Send a message via AIM to IMDWalrus
Re: Desensitizing Joysticks

Quote:
Originally Posted by bob1million
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?
Expose them to lots of violent movies and video games.
  #13   Spotlight this post!  
Unread 01-02-2004, 11:28
ginger ginger is offline
Registered User
no team
 
Join Date: Jan 2004
Location: Boothbay, ME
Posts: 3
ginger is an unknown quantity at this point
Re: Desensitizing Joysticks

I think this is related to the threads on PID and motor feedback. Id look there for the best solution.

I would try a simple average function- keep a bufer of the last 10 or so values, add each new one into the buffer, take the average, and send that value to the motor. Remove the oldest value from the buffer.

This should at least smooth out effects of noise and minor hand jiggles.
  #14   Spotlight this post!  
Unread 01-02-2004, 12:52
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: Desensitizing Joysticks

that, or ramp the output - put in a "max change per cycle" function. also, you might try an exponential function for the joystick, so that it really only opens up at full movement.
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)
  #15   Spotlight this post!  
Unread 01-02-2004, 12:59
WillyC's Avatar
WillyC WillyC is offline
"handy"
#1347
Team Role: Engineer
 
Join Date: Jan 2004
Location: Ottawa, Canada
Posts: 29
WillyC is on a distinguished road
Re: Desensitizing Joysticks

Quote:
Originally Posted by KenWittlief
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
I've got to agree with Ken on this one. This deadband approach will make the joysticks more sensitive, because the motor output is proportional to the joystick deflection. If you ignore the stick input unless it's greater than 135 or less than 119, then as the stick moves out of the deadband and starts the motor moving, the motor's smallest non-zero speed is even faster than without the deadband. The result will be jerkiness as the bot starts moving.

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.
Attached Files
File Type: zip ExampleJoystickTransferFunction.zip (2.6 KB, 197 views)

Last edited by WillyC : 01-02-2004 at 13:00. Reason: .xls viewing troubles
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 23:57.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi