Go to Post FIRST is supposed to be a learning experience. Learn first, win awards later. - evulish [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 01-23-2008, 03:57 PM
Philz20 Philz20 is offline
MGSH Coder
FRC #2526 (Team 2526)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Maple Grove, MN
Posts: 6
Philz20 is an unknown quantity at this point
Joystick sensitivity

Hey guys, I'm having trouble with the sensitivity of my joystick. We are running a 4-motor setup and the joystick causes the robot to speed up and turn too quick with the slightest movement of the joystick. Turning the robot causes a quick jerk which is giving us control issues. Are there any block functions in easyC to adjust the sensitivity? This is my team's first year in FIRST and the first time I'm doing C programming, so my understanding of the code is basic at best. Any help will be much appreciated.
__________________
Philip Kirshbaum
Maple Grove Senior High
Head of Programming and Control Systems, Team 2526
  #2   Spotlight this post!  
Unread 01-23-2008, 04:29 PM
angelc24's Avatar
angelc24 angelc24 is offline
A Pirate's Life For Me...
AKA: Christina
FRC #0467 (Duct Tape Bandits)
Team Role: Alumni
 
Join Date: Jan 2005
Rookie Year: 2005
Location: MA
Posts: 45
angelc24 has a spectacular aura aboutangelc24 has a spectacular aura aboutangelc24 has a spectacular aura about
Send a message via AIM to angelc24
Re: Joystick sensitivity

This is what we have used for the past few years as ramping code :

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;
}


We've never used EasyC, so I don't know if there's anything there to help you...
__________________
"You need people of intelligence on this sort of mission....quest.....thing."
"Where did all the food go?"
"Ask the programmers."

"Whether a bot is made of new parts, old parts or spare parts, you can shine no matter what you're made of"
2005 Delphi Driving Tomorrow's Technology Award
2006 Xerox Creativity Award
2006 Delphi Driving Tomorrow's Technology Award
2007 Johnson and Johnson Sportsmanship Award
2008 Judges' Award
  #3   Spotlight this post!  
Unread 01-23-2008, 04:36 PM
windell747 windell747 is offline
Registered User
FRC #2477
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2001
Location: Hawaii
Posts: 158
windell747 will become famous soon enoughwindell747 will become famous soon enough
Re: Joystick sensitivity

Hi, I really like the idea of your ramping function. I was wondering if you could provide some reasoning behind your calculations. I would like to know the thought procedure behind the steps.
  #4   Spotlight this post!  
Unread 01-23-2008, 04:38 PM
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: Joystick sensitivity

That code above should produce a curve that reduces the motor outputs when the joystick is at a low level, but still maintain a max speed. (See attachment.) Of course, you could just multiply by some fraction, but that decreases your top speed. Or maybe reduce speed when motors are turning in opposite directions, (turning?)

The reason it's cubed is to get that sort of curve for the entire function. The random huge number in there is 128, (the maximum value) squared. It's basically to center the cubic equation on 128,128. (I believe I came up with it with experimentation on a graphing calculator, I really forget why it works)
Attached Images
File Type: bmp ramping.bmp (48.1 KB, 310 views)

Last edited by psy_wombats : 01-23-2008 at 04:40 PM.
  #5   Spotlight this post!  
Unread 01-23-2008, 04:40 PM
Unsung FIRST Hero
Al Skierkiewicz Al Skierkiewicz is offline
Chief Robot Inspector
AKA: Big Al WFFA 2005
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1996
Location: Wheeling, IL
Posts: 11,087
Al Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond repute
Re: Joystick sensitivity

Let us not forget that the speed controllers have a calibrate function. If you do not provide for one in your code then follow the calibrate procedure in the 884 manual available on the IFI website. This insures that the controller learns the full travel of your joystick, the end points of travel and the center rest position.
__________________
Good Luck All. Learn something new, everyday!
Al
WB9UVJ
www.wildstang.org
________________________
Knowledge is power. Power UP!
  #6   Spotlight this post!  
Unread 01-23-2008, 05:27 PM
MiniNerd24's Avatar
MiniNerd24 MiniNerd24 is offline
Are you going to eat that?
FRC #2039 (Rockford Robotics)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2006
Location: Illinois
Posts: 375
MiniNerd24 is a jewel in the roughMiniNerd24 is a jewel in the roughMiniNerd24 is a jewel in the roughMiniNerd24 is a jewel in the rough
Re: Joystick sensitivity

If you're using ROBOTC after the [p1_y] statement in " motor[port1] = frcRF[p1_y] just add the division sign ( / ) and put a number down (we're using 5)
This is what it should look like.
motor[port1] = frcRF[p1_y/5];
and that's all.
hope this helps.
__________________
The system is down.


Rockford Robotics 2039: Think outside the bots.
  #7   Spotlight this post!  
Unread 01-23-2008, 05:32 PM
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: Joystick sensitivity

Only problem with actual division is the reduction of max speed. You can only go up to one fifth of your mechanical maximum with that code. Another thing we did last year was have a 'precision button,' that divided the value only when you pressed a certain button. That way you can limit responsiveness but not speed using true division.
  #8   Spotlight this post!  
Unread 01-23-2008, 05:36 PM
MiniNerd24's Avatar
MiniNerd24 MiniNerd24 is offline
Are you going to eat that?
FRC #2039 (Rockford Robotics)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2006
Location: Illinois
Posts: 375
MiniNerd24 is a jewel in the roughMiniNerd24 is a jewel in the roughMiniNerd24 is a jewel in the roughMiniNerd24 is a jewel in the rough
Re: Joystick sensitivity

You sure? We got max speed even when we divided directly but, hey, I'll take your word for it.
__________________
The system is down.


Rockford Robotics 2039: Think outside the bots.
  #9   Spotlight this post!  
Unread 01-23-2008, 07:08 PM
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: Joystick sensitivity

I'm fairly sure. Unless... What is your frcRF function? If that's a ramping function, I wouldn't think that's direct division. (I've never used RobotC anyway.)

If it's not, you might not be getting the max speed, as the maximum value you're getting from the joystick (256) divided by 5 is 51. That's less than your max of 127, (or 256 if that's how you're using the values.) Whatever works for you. (Though I'd check just in case you don't really know your max speed.) Good luck.
  #10   Spotlight this post!  
Unread 01-23-2008, 08:30 PM
MiniNerd24's Avatar
MiniNerd24 MiniNerd24 is offline
Are you going to eat that?
FRC #2039 (Rockford Robotics)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2006
Location: Illinois
Posts: 375
MiniNerd24 is a jewel in the roughMiniNerd24 is a jewel in the roughMiniNerd24 is a jewel in the roughMiniNerd24 is a jewel in the rough
Re: Joystick sensitivity

Thanks, looks like you're the one helping me instead.
(But just for a teaser, our robot moves (at max speed of course) at 10 ft.ps)
I don't know where the site is but it is in a thread called FREE ROBOTC FOR FIRST MEMBERS
__________________
The system is down.


Rockford Robotics 2039: Think outside the bots.
  #11   Spotlight this post!  
Unread 01-24-2008, 07:34 AM
jskene jskene is offline
Registered User
None #0612
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Chantilly Virginia
Posts: 153
jskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to beholdjskene is a splendid one to behold
Re: Joystick sensitivity

Here on Team 612 we've used the cube function for several years. It gives the drivers much better control at low speeds.

We also include an acceleration limiter, which eliminates any chance of tripping the circuit breakers. We do this by allowing the PWM signal sent to the drive motors to increase by only a certain amount on each pass through the user routine.

This reduces the maximum current sent to the motors. It also minimizes strain on the drive system (chains, belts, tread wear, etc.). The effect on the robot's performance on the field is barley noticeable.

This year, however, we are doing something completely different....

.
__________________
Jerry Skene, mentor OOO OOO 2010 - Chairman's Award- DC OOOOOOOOOOOOOOOOOOOOOOOOOOO
Chantilly Academy, Team 612 - 2009 - Engineering Inspiration Award; Finalist - New Jersey
-----------------------------------2008 - Chairman's Award; Kleiner Perkins Award -Buckeye ---| ---Team Spirit Award - NASA/VCU
-----------------------------------2007 - Chairman's Award - NASA/VCU ---| ---Finalist; Kleiner Perkins Award - Chesapeake
-----------------------------------2006 - Chairman's Award - Chesapeake ---| --- Engineering Inspiration Award - NASA/VCU --
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 hanan Control System 4 01-19-2007 04:36 AM
Accelerometer Sensitivity zachriggle Programming 0 01-27-2006 10:16 PM
White Paper Discuss: Joystick Sensitivity Demystified - Version 2 marccenter Extra Discussion 0 02-28-2005 03:54 PM
joystick sensitivity Team 668 Programming 11 02-16-2005 05:45 PM
Help with Joystick Axes and Sensitivity bglass Programming 6 02-06-2005 01:01 PM


All times are GMT -5. The time now is 06:36 AM.

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


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