Go to Post Gotta love those free-range robots! Yum! - petek [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 06-02-2008, 15:41
kDude kDude is offline
Registered User
FRC #2450 (RaiderBots)
Team Role: Leadership
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Minnesota
Posts: 37
kDude is an unknown quantity at this point
controller sensitivity

Our team is using the Xbox 360 controller to drive the robot, but the analog sticks are very sensitive, like when we barely press it it'll take off. Is there any way to lower the sensitivity of the controller?
  #2   Spotlight this post!  
Unread 06-02-2008, 15:43
kevin.li.rit's Avatar
kevin.li.rit kevin.li.rit is offline
Imaginary Friend
AKA: Kevin Li
FRC #0596 (SciClones)
Team Role: Student
 
Join Date: Jan 2003
Rookie Year: 2001
Location: Hopkinton, Massachusetts
Posts: 936
kevin.li.rit has a reputation beyond reputekevin.li.rit has a reputation beyond reputekevin.li.rit has a reputation beyond reputekevin.li.rit has a reputation beyond reputekevin.li.rit has a reputation beyond reputekevin.li.rit has a reputation beyond reputekevin.li.rit has a reputation beyond reputekevin.li.rit has a reputation beyond reputekevin.li.rit has a reputation beyond reputekevin.li.rit has a reputation beyond reputekevin.li.rit has a reputation beyond repute
Send a message via Yahoo to kevin.li.rit
Re: controller sensitivity

You can add some acceleration/deceleration code to slowly ramp up the output of the PWM. You could also increase what the neutral value of the PWM is. I.E. if you push it your joystick full foward, then it goes to 255 in some amount of time instead of instantly.
__________________
Kevin Li

596 - Sciclones
1405 - Finney Falcons
2262 - Holliston Panthers
  #3   Spotlight this post!  
Unread 06-02-2008, 15:55
psy_wombats's Avatar
psy_wombats psy_wombats is offline
Registered User
AKA: A. King
FRC #0467 (Duct Tape Bandits)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Shrewsbury MA
Posts: 95
psy_wombats has a spectacular aura aboutpsy_wombats has a spectacular aura aboutpsy_wombats has a spectacular aura about
Re: controller sensitivity

As far as joystick sensitivity goes, our team has been using this:

Code:
long ramping (unsigned char ramp)
{
    long answer = 0;
    answer =  ((long)ramp - 127);
    answer = ((answer) * (answer) * (answer));
    answer = ((answer) / (128 * 128));
    answer = (answer) + (127);
    return answer;
}
It's cubic function. You should be able to have max speed at full forward, but also have better control with lower values. Something like:

http://www.chiefdelphi.com/forums/at...9&d=1201127844

Hope that helps.

Last edited by psy_wombats : 06-02-2008 at 16:16. Reason: Fixed the link
  #4   Spotlight this post!  
Unread 06-02-2008, 16:05
kDude kDude is offline
Registered User
FRC #2450 (RaiderBots)
Team Role: Leadership
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Minnesota
Posts: 37
kDude is an unknown quantity at this point
Re: controller sensitivity

Quote:
Originally Posted by psy_wombats View Post
As far as joystick sensitivity goes, our team has been using this:

Code:
long ramping (unsigned char ramp)
{
    long answer = 0;
    answer =  ((long)ramp - 127);
    answer = ((answer) * (answer) * (answer));
    answer = ((answer) / (128 * 128));
    answer = (answer) + (127);
    return answer;
}
It's not a cubic function. You should be able to have max speed at full forward, but also have better control with lower values. Something like:

http://www.chiefdelphi.com/forums/at...9&d=1201127844

Hope that helps.
Care to explain more? Sorry, I'm just very confused as to what exactly that does. And the link doesn't work.
  #5   Spotlight this post!  
Unread 06-02-2008, 16:09
psy_wombats's Avatar
psy_wombats psy_wombats is offline
Registered User
AKA: A. King
FRC #0467 (Duct Tape Bandits)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Shrewsbury MA
Posts: 95
psy_wombats has a spectacular aura aboutpsy_wombats has a spectacular aura aboutpsy_wombats has a spectacular aura about
Re: controller sensitivity

Sorry, this is the working link:
http://www.chiefdelphi.com/forums/at...9&d=1201127844

So, this a cubic function. It sort of is like an exponential growth, but even in the negative region. What it's doing is taking the cube and then dividing by the square of neutral. It results in this: When the joystick is at half forward, the speed is cut in four. However, at full forward, it produces the full speed. With normal division, your max speed is cut. This eliminates the issue.
  #6   Spotlight this post!  
Unread 06-02-2008, 16:22
Jon Stratis's Avatar
Jon Stratis Jon Stratis is offline
Mentor, LRI, MN RPC
FRC #2177 (The Robettes)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Minnesota
Posts: 3,815
Jon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond repute
Re: controller sensitivity

We're using a very similar function in our code, and an x-box controller and it works great... the best way to look at it's capabilities is to run some numbers through it:
Code:
in	out
-127	-127
-120	-107
-110	-83
-100	-62
-90	-45
-80	-32
-70	-21
-60	-13
-50	-8
-40	-4
-30	-2
-20	0
-10	0
0	0
10	0
20	0
30	2
40	4
50	8
60	13
70	21
80	32
90	45
100	62
110	83
120	107
127	127
So it reduces sensitivity at the center (ie your robot doesn't move at all when you aren't touching the controller), and it increases the range at which your robot is manageable (ie doesn't have a huge speed), but it gives you the maximum speed when you really need it.
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
Joystick sensitivity Philz20 Programming 10 24-01-2008 08:34
joystick sensitivity hanan Control System 4 19-01-2007 05:36
Accelerometer Sensitivity zachriggle Programming 0 27-01-2006 23:16
joystick sensitivity Team 668 Programming 11 16-02-2005 18:45


All times are GMT -5. The time now is 19:10.

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