Go to Post FIRST encourages us to innovate and try new things, lets do the same for them. - Katie_UPS [more]
Home
Go Back   Chief Delphi > Technical > Control System
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 21-12-2004, 22:18
archimedes archimedes is offline
Registered User
#1303
 
Join Date: Dec 2004
Location: Wyoming
Posts: 4
archimedes is an unknown quantity at this point
Adjusting Sensitivity/Scale of Controls

Last year was the first year for our team. Due to this, we are not completely familiar with the code. Our robot is very sensitive to the joysticks that came with the kit and is hard to control in a productive manner. Very little changes have been made to the default code. We are wondering if anyone would be able to help us solve this sensitiviy problem. Is there a way to do this in the code? Is there a way to change the scale on the joystick so all the way forward isn't something like 255 but instead 100? We have been looking mostly at user_routines.c near lines 224 in the default code for a possible solution. Is this the right place to start or is there a different place? Any help would be appreciated.

Wyoming Aftershock
  #2   Spotlight this post!  
Unread 21-12-2004, 22:24
Billfred's Avatar
Billfred Billfred is offline
...and you can't! teach! that!
FRC #5402 (Iron Kings); no team (AndyMark)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: The Land of the Kokomese, IN
Posts: 8,483
Billfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond repute
Re: Adjusting Sensitivity/Scale of Controls

I was searching for information on the IFI system over the summer, and I found this link: http://qin.laya.com/first/joystick.html

That code is in PBASIC (as used on the previous generation of controllers), but you probably should be able to rewrite it. (Chalk it up as a learning experience. ) Basically, that link teaches you how to set up the motor to speed up on an exponential curve, instead of linear. Slow when you start, but still full power when you push it all the way up.

Hope it helps!
__________________
William "Billfred" Leverette - Gamecock/Jessica Boucher victim/Marketing & Sales Specialist at AndyMark

2004-2006: FRC 1293 (D5 Robotics) - Student, Mentor, Coach
2007-2009: FRC 1618 (Capital Robotics) - Mentor, Coach
2009-2013: FRC 2815 (Los Pollos Locos) - Mentor, Coach - Palmetto '09, Peachtree '11, Palmetto '11, Palmetto '12
2010: FRC 1398 (Keenan Robo-Raiders) - Mentor - Palmetto '10
2014-2016: FRC 4901 (Garnet Squadron) - Co-Founder and Head Bot Coach - Orlando '14, SCRIW '16
2017-: FRC 5402 (Iron Kings) - Mentor

93 events (more than will fit in a ChiefDelphi signature), 13 seasons, over 60,000 miles, and still on a mission from Bob.

Rule #1: Do not die. Rule #2: Be respectful. Rule #3: Be safe. Rule #4: Follow the handbook.
  #3   Spotlight this post!  
Unread 21-12-2004, 22:30
archimedes archimedes is offline
Registered User
#1303
 
Join Date: Dec 2004
Location: Wyoming
Posts: 4
archimedes is an unknown quantity at this point
Re: Adjusting Sensitivity/Scale of Controls

Is there any way to adjust the scale also?
  #4   Spotlight this post!  
Unread 21-12-2004, 22:37
MikeDubreuil's Avatar
MikeDubreuil MikeDubreuil is offline
Carpe diem
FRC #0125 (Nu-Trons)
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 1999
Location: Boston, MA
Posts: 967
MikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond repute
Send a message via AIM to MikeDubreuil
Re: Adjusting Sensitivity/Scale of Controls

Quote:
Originally Posted by archimedes
Is there a way to do this in the code? Is there a way to change the scale on the joystick so all the way forward isn't something like 255 but instead 100?
Step number one is to understand what the output is expecting. 255 is arguably an illegal output and 100 would not cause your robot to go forward, but actually go reverse. A good start would be to read the Programmer Reference Guide from Innovation FIRST.

Let us know if you need any help after that
__________________
"FIRST is like bling bling for the brain." - Woodie Flowers
  #5   Spotlight this post!  
Unread 21-12-2004, 22:52
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,125
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
Re: Adjusting Sensitivity/Scale of Controls

There is a lengthy thread about this in the Programming Forum:

http://www.chiefdelphi.com/forums/sh...722#post301722

The link I've included jumps directly to some code from Team 188 that you can try.

Good Luck!
  #6   Spotlight this post!  
Unread 13-01-2005, 23:19
ConKbot of Doom ConKbot of Doom is offline
Team Alumni
FRC #1184 (Cobra Robotics)
Team Role: Leadership
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Maryland
Posts: 153
ConKbot of Doom has a spectacular aura aboutConKbot of Doom has a spectacular aura aboutConKbot of Doom has a spectacular aura about
Re: Adjusting Sensitivity/Scale of Controls

Ive been looking at this problem, but rather than a software solution, I would be interested in a hardware solution. Ive been looking at using a potentiometer as a solution.

I would set up a resistor divider to get .5vcc from the OI and send that to pin 1 on the pot, the signal from the joystick would go to pin 3 and pin 2 would go to the input on the OI. That way the driver could adjust the scale quickly, from no scaling to locked at 127

I know the rules prohibit messing around inside joystick, but allow a custom control box, so I would think that a box in the middle would be in a bit of a grey area. Can anyone lend any clarification to this? I just think that why should we devote processor cycles to something that can be done in hardware so simply. Plus I'm more comfortable with electronics than coding, so I'm sure that plays a role in it too.
  #7   Spotlight this post!  
Unread 14-01-2005, 10:30
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,125
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
Re: Adjusting Sensitivity/Scale of Controls

Quote:
Originally Posted by ConKbot of Doom
Ive been looking at this problem, but rather than a software solution, I would be interested in a hardware solution. Ive been looking at using a potentiometer as a solution.

I would set up a resistor divider to get .5vcc from the OI and send that to pin 1 on the pot, the signal from the joystick would go to pin 3 and pin 2 would go to the input on the OI. That way the driver could adjust the scale quickly, from no scaling to locked at 127

I know the rules prohibit messing around inside joystick, but allow a custom control box, so I would think that a box in the middle would be in a bit of a grey area. Can anyone lend any clarification to this? I just think that why should we devote processor cycles to something that can be done in hardware so simply. Plus I'm more comfortable with electronics than coding, so I'm sure that plays a role in it too.
Tristan Lall did this to our robot last year using software. We use the older black Flightsticks which have a wheel on them. In fact, the default code still shows variables like "p1_wheel" from these old joysticks =).

The wheel worked as a speed limiter which would scale the total range of the joystick down. Our reason for this was to demo the robot to children, and allow them to drive without fear of breaking things.

I believe this code is UNTESTED, so programmer beware. However the concept alone should prove useful:
Code:
temp_scale_long = (unsigned long) (p1_wheel * 3) >> 2 + 64; //So what if it's stepwise? (Just say no to floats.)
  temp_tankx_long = (signed long)p1_x - 128;
  temp_tankx_char = (unsigned char)(((temp_tankx_long * temp_tankx_long * temp_tankx_long * temp_scale_long)  >> 22) + 128);
  temp_tanky_long = (signed long)p1_y - 128;
  temp_tanky_char = (unsigned char)(((temp_tanky_long * temp_tanky_long * temp_tanky_long * temp_scale_long)  >> 22) + 128);
  pwm01 = pwm03 = pwm05 = Limit_Mix(2000 + temp_tanky_char + temp_tankx_char - 127);
  pwm02= pwm04 = pwm06 = Limit_Mix(2000 + temp_tanky_char - temp_tankx_char + 127);
FYI, we did this in ADDITION to our cubic transfer function, and here Tristan (who once was a driver for Team188) has modified our tank drive code for his preferred one-stick drive.

Hope this helps!

-SlimBoJones...
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
Controls for a Crab Drive Ein Control System 22 26-01-2005 20:31
1992 Controls Venkatesh Electrical 6 03-10-2004 22:04
[FVG]: Controls Round C1 Mike Ciance FIRST-related Organizations 18 29-07-2004 20:44
[FVG]: Controls Round B1 Mike Ciance FIRST-related Organizations 18 08-07-2004 09:32
Monkey controls robot with thoughts Jeff Rodriguez Math and Science 7 13-10-2003 14:29


All times are GMT -5. The time now is 03:38.

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