Go to Post I like how the photo is of John Neun, and everyone is still making fun of John V-Neun - Jay Trzaskos [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 13-02-2005, 14:06
Team 668 Team 668 is offline
Registered User
#0668 (The Apes of Wrath)
 
Join Date: Jul 2004
Location: San Jose, CA
Posts: 14
Team 668 is an unknown quantity at this point
joystick sensitivity

i have been tampering with the code to make joysticks less sensitive. i cannot figure it out. it either has an error or nothing responds. does any1 kniw the code to make tha joystick less sensitive
  #2   Spotlight this post!  
Unread 13-02-2005, 14:17
Jeff K.'s Avatar
Jeff K. Jeff K. is offline
Hmm..now what?
FRC #1138 (Eagle Engineering)
Team Role: Alumni
 
Join Date: Nov 2004
Rookie Year: 2005
Location: Chatsworth, California
Posts: 706
Jeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond repute
Send a message via AIM to Jeff K. Send a message via MSN to Jeff K.
Re: joystick sensitivity

I'm not really into programming, but I do know from driving the robot that our controls are also really sensitive and sometimes do get stuck so the robot moves by itself after someone has driven it. If you want to make a makeshift fix on your joystick, you can probably take apart the joystick and play around with the springs in the joystick and see if they are better or not after doing that. It might work...it might not...but good luck writing the program...




...Actually...once I think of my method...it seems really stupid...sorry.
  #3   Spotlight this post!  
Unread 13-02-2005, 14:22
Xufer's Avatar
Xufer Xufer is offline
8 Seasons and as stable as ever
AKA: Working, 2/4 degrees complete still schooling...
FRC #1740 (The Cyber Colonels)
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 1999
Location: Waterford, CT
Posts: 231
Xufer is a splendid one to beholdXufer is a splendid one to beholdXufer is a splendid one to beholdXufer is a splendid one to beholdXufer is a splendid one to beholdXufer is a splendid one to behold
Send a message via AIM to Xufer Send a message via MSN to Xufer Send a message via Yahoo to Xufer
Re: joystick sensitivity

Are you working with the white joysticks ? If so the best thing you could do is throw them away and get some new ones. We used 1 of them last year to control our arm and i wished we hadn't. I happen to be both the programmer and the arm operator and i did the best i could to get them some what usable. Anyway here are some possibilities.

What you can do to fix this problem is put a parabola in your joystick code, this makes the beginning movements less sensitive. I think if you look through the white papers, in the programing section you'll find one on adding a parabola.

Other teams have replaced the springs to make the movement less "floppy", in return making them easier to control.
__________________


If saftey is first and i put FIRST ahead of everything, then i must be the safest guy in the world.

Team 521 Alumni -- Team 1740 Mentor-- Go Go 1740!
Sometimes I think I've been doing this too long and other times I think I haven't done this enough... but all the times I'm sure I'm crazy
Photonics, It's Your Future
  #4   Spotlight this post!  
Unread 13-02-2005, 14:38
Joshua May's Avatar
Joshua May Joshua May is offline
Go Bears!
FRC #1110 (Binary Bulldogs)
Team Role: College Student
 
Join Date: Nov 2003
Rookie Year: 2003
Location: Berkeley, CA
Posts: 1,306
Joshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond repute
Send a message via AIM to Joshua May
Re: joystick sensitivity

One thing we did was add in a "deadband" to the center of the joysticks, which has really helped. The code makes use of an absolute value function that we created. Today, we'll also be adding a ramping function to the joysticks just like what was described above, I can get you that code too if you need it.

Code:
#define DEADBAND 10

int abs(int x)
{
  if (x >= 0)
    return x;
  else
    return -x;
}

if (abs((p1_y - 127)) < DEADBAND)
  p1_y = 127;

if (abs((p1_x - 127)) < DEADBAND)
  p1_x = 127;
__________________
The FIRST Wiki - openFIRST - Ultimate Robot Challenge - URC Wiki
I currently have 50 GMail invites, PM or email me for one.
UC Berkeley Class of 2009

2005 Las Vegas Regional Autodesk Visualization Award
2005 Las Vegas Regional #8 Seeded Alliance with 988 and 1505
2006 Southern California Regional #15 seed
  #5   Spotlight this post!  
Unread 13-02-2005, 14:51
AIBob's Avatar
AIBob AIBob is offline
AI Programmer
AKA: Bob Frank DOT org
FRC #0358 (Hauppauge Robotic Eagles)
Team Role: Alumni
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Long Island, NY (in Binghamton now)
Posts: 297
AIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to behold
Send a message via ICQ to AIBob Send a message via AIM to AIBob Send a message via MSN to AIBob Send a message via Yahoo to AIBob
Re: joystick sensitivity

Quote:
Originally Posted by Joshua May
One thing we did was add in a "deadband" to the center of the joysticks, which has really helped. The code makes use of an absolute value function that we created. Today, we'll also be adding a ramping function to the joysticks just like what was described above, I can get you that code too if you need it.

Code:
#define DEADBAND 10
 
int abs(int x)
{
if (x >= 0)
return x;
else
return -x;
}
 
if (abs((p1_y - 127)) < DEADBAND)
p1_y = 127;
 
if (abs((p1_x - 127)) < DEADBAND)
p1_x = 127;
Here is something similar, only you do not need a seperate function... abs(p1_x) can be replaced with (p1_x && 0x7F), because the last bit is the sign, like so:
Code:
#define DEADBAND 10
if (((((signed int)p1_x-127) && 0x7f) < DEADBAND) p1_x=127;
if (((((signed int)p1_y-127) && 0x7f) < DEADBAND) p1_y=127;
__________________
- from B B frank

  #6   Spotlight this post!  
Unread 13-02-2005, 16:35
sirbleedsalot's Avatar
sirbleedsalot sirbleedsalot is offline
Registered User
FRC #0939
Team Role: Student
 
Join Date: Feb 2004
Location: New Effington South Dakota
Posts: 178
sirbleedsalot has a spectacular aura aboutsirbleedsalot has a spectacular aura aboutsirbleedsalot has a spectacular aura about
Re: joystick sensitivity

OK where does this code go into the rest of the default program. Can I put it anywhere in user routines.c or does it have a special place?
__________________
our web site
  #7   Spotlight this post!  
Unread 13-02-2005, 16:39
AIBob's Avatar
AIBob AIBob is offline
AI Programmer
AKA: Bob Frank DOT org
FRC #0358 (Hauppauge Robotic Eagles)
Team Role: Alumni
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Long Island, NY (in Binghamton now)
Posts: 297
AIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to behold
Send a message via ICQ to AIBob Send a message via AIM to AIBob Send a message via MSN to AIBob Send a message via Yahoo to AIBob
Re: joystick sensitivity

Quote:
Originally Posted by sirbleedsalot
OK where does this code go into the rest of the default program. Can I put it anywhere in user routines.c or does it have a special place?
You would place this code right after you read the input data from the operator interface like so:
top of the page, or in an included file:
Code:
#define DEADBAND 10
you may place this in "Default_Routine()" if it is called, right at the beginning:
Code:
if (((((signed int)p1_x-127) && 0x7f) < DEADBAND) p1_x=127;
if (((((signed int)p1_y-127) && 0x7f) < DEADBAND) p1_y=127;
or if you do not call "Default_Routine()", then place the code right after "Getdata(&rxdata);" is called
__________________
- from B B frank

  #8   Spotlight this post!  
Unread 13-02-2005, 17:02
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: joystick sensitivity

Quote:
Originally Posted by Stonefan5271138
I'm not really into programming, but I do know from driving the robot that our controls are also really sensitive and sometimes do get stuck so the robot moves by itself after someone has driven it. If you want to make a makeshift fix on your joystick, you can probably take apart the joystick and play around with the springs in the joystick and see if they are better or not after doing that. It might work...it might not...but good luck writing the program...

...Actually...once I think of my method...it seems really stupid...sorry.
Actually, your idea is a very good one. We did it last year and this year with great success.

The deadband will solve your problem of the robot not stopping when you let the joysticks return to "center," but it doesn't help with your sensitivity problem. You can go for a full PID controller, but a low pass filter, which is basically just the P of a PID, will probably do the trick. I can get you our code from this year in an hour or two.
__________________

  #9   Spotlight this post!  
Unread 13-02-2005, 20:38
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: joystick sensitivity

Quote:
Originally Posted by AIBob
abs(p1_x) can be replaced with (p1_x && 0x7F), because the last bit is the sign,...
Not so. For two reasons, the first of which is very important:

Negative numbers are not stored in sign-magnitude form. They are in "two's-complement" form. The value -1 masked with 0x7F yields a value of 127, a far cry from the expected 1.

(The second reason is that && is a logical operator, giving a true or false result. The arithmetic and is represented by a single &.)

The simplest syntax I know of for an absolute value function uses the ternary if operator. It's cryptic, but effective:
Code:
(value<0?-value:value)
  #10   Spotlight this post!  
Unread 13-02-2005, 20:44
AIBob's Avatar
AIBob AIBob is offline
AI Programmer
AKA: Bob Frank DOT org
FRC #0358 (Hauppauge Robotic Eagles)
Team Role: Alumni
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Long Island, NY (in Binghamton now)
Posts: 297
AIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to behold
Send a message via ICQ to AIBob Send a message via AIM to AIBob Send a message via MSN to AIBob Send a message via Yahoo to AIBob
Re: joystick sensitivity

Quote:
Originally Posted by Alan Anderson
Not so. For two reasons, the first of which is very important:

Negative numbers are not stored in sign-magnitude form. They are in "two's-complement" form. The value -1 masked with 0x7F yields a value of 127, a far cry from the expected 1.

(The second reason is that && is a logical operator, giving a true or false result. The arithmetic and is represented by a single &.)

The simplest syntax I know of for an absolute value function uses the ternary if operator. It's cryptic, but effective:
Code:
(value<0?-value:value)
Ok.... for some reason it worked for me in my code though.... but I suppose it will not work for absolute values...
Thanks for letting me know.
__________________
- from B B frank


Last edited by AIBob : 13-02-2005 at 21:58.
  #11   Spotlight this post!  
Unread 13-02-2005, 21:01
probizzle's Avatar
probizzle probizzle is offline
Registered User
AKA: Prabhas Pokharel
#0639 (Code Red)
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2003
Location: Ithaca
Posts: 78
probizzle will become famous soon enoughprobizzle will become famous soon enough
Send a message via AIM to probizzle
Re: joystick sensitivity

Quote:
Originally Posted by Alan Anderson
Negative numbers are not stored in sign-magnitude form. They are in "two's-complement" form. The value -1 masked with 0x7F yields a value of 127, a far cry from the expected 1.
For more information:
http://en.wikipedia.org/wiki/Negativ...tive_in_binary
http://en.wikipedia.org/wiki/Two%27s_complement
__________________
Code Red Team 639 Winners of the 2005 FingerLakes Regional with 191 and 494.
--
http://pset.deu83.com << my baby
http://www.setgame.com/set/ << it's mother
  #12   Spotlight this post!  
Unread 16-02-2005, 18:45
h0x4r h0x4r is offline
Registered User
#1544
Team Role: Programmer
 
Join Date: Jan 2005
Location: bartlett
Posts: 21
h0x4r has a little shameless behaviour in the past
Thumbs up Re: joystick sensitivity

i just decreased the limit mix to the joystick drive, which should be at 2000 when to begin with, so it will move less when u move the joystick, using the normal white joysticks
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
Negative numbers? Calvin Programming 6 09-02-2005 10:46
Help with Joystick Axes and Sensitivity bglass Programming 6 06-02-2005 14:01
Changing 1 joystick code to 2 (rookie team) Brawler006 Programming 5 20-02-2004 17:00
robot goes haywire with the one joystick default code Miles Programming 7 24-01-2003 14:58
joystick problem archiver 2000 12 23-06-2002 23:08


All times are GMT -5. The time now is 09:26.

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