Go to Post If you have a problem with a team, go to that team and address it with them. Don't air your slanderous opinions here for all to see. - Andy Baker [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
  #16   Spotlight this post!  
Unread 13-06-2007, 15:47
seanl's Avatar
seanl seanl is offline
"The Everything person"
FRC #0867 (Absolute Value)
Team Role: Leadership
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Arcadia, CA
Posts: 267
seanl will become famous soon enoughseanl will become famous soon enough
Re: Thanks for all your help...and a question

Quote:
Originally Posted by fimmel View Post
that would work for "tank style" drive, i think he meant using a single stick drive.
oh.. i dont really have experience with single. personally i prefer tank.
although reducing speed with a button is a nice idea. i might try that out.
__________________
, Sean

TEAM 867
-electrical
-pneumatics
-programming



2008 Autodesk Visualization Grand Prize Winner
  #17   Spotlight this post!  
Unread 13-06-2007, 18:01
fimmel's Avatar
fimmel fimmel is offline
Founding Mentor, Team 2370
AKA: Forest Immel
FRC #2370 (iBots 2370)
Team Role: Mentor
 
Join Date: Dec 2005
Rookie Year: 2005
Location: Castleton, Vermont
Posts: 325
fimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond repute
Re: Thanks for all your help...and a question

just make sure to test the code with the robot up on blocks or something. just to make sure it wont do any damage
...forest
__________________



  #18   Spotlight this post!  
Unread 13-06-2007, 20:39
Quzarx Quzarx is offline
Electrical/Programming
AKA: Kyle
FRC #1718 (The Fighting Pi)
Team Role: Electrical
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Richmond, Michigan
Posts: 4
Quzarx is an unknown quantity at this point
Re: Thanks for all your help...and a question

Another way to do it would be to make a few lookup tables. We set up custom curves, so we had a large area that was slow for fine adjustments, and an area of full speed. This also makes so no calculations are needed on the fly, you just load them into the ram.

You would toss something like this (what we used) under the #include's in user_routines.c
Code:
rom unsigned short int Joystick_Array[] = {0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,61,62,63,63,64,65,66,67,68,69,69,70,71,72,73,74,75,75,
76,77,78,79,80,81,81,82,83,84,85,86,87,87,88,89,90,90,91,91,92,92,93,93,94,94,94,95,95,96,96,97,97,98,98,99,99,99,100,100,101,101,102,102,103,
103,103,104,104,105,105,106,106,107,107,107,108,108,109,109,110,110,111,111,111,112,112,113,113,114,114,115,115,116,116,116,117,117,118,
118,119,119,120,120,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,135,135,136,136,136,136,137,137,137,138,
138,138,139,139,139,139,140,140,140,141,141,141,141,142,142,142,143,143,143,144,144,144,144,145,145,145,146,146,146,146,147,147,147,148,
148,148,149,149,149,149,150,150,150,151,151,151,151,152,152,152,153,153,153,154,154,154,154,155,155,156,157,158,158,159,160,161,162,163,
164,164,165,166,167,168,169,170,170,171,172,173,174,175,176,176,177,178,179,180,181,182,182,183,184,185,190,194,199,204,208,213,218,222,
227,232,236,241,246,250,255,};
Then to call it:
Code:
Left_Drive = Joystick_Array[p1_y];
Right_Drive = Joystick_Array[p3_y];
(Again, here we use tank style, and used p1 and p3 due to custom control systems (p2 and p4 have all of the button outputs)

That makes so the variable "Left_Drive" and "Right_Drive" are modified pwm values, but not assigned to the pwm yet.

To go with one joystick:
Code:
if (p1_sw_trig == 0)
{
pwm13 = pwm14 = Limit_Mix(2000 + p1_y + p1_x - 127);
pwm15 = pwm16 = Limit_Mix(2000 + p1_y - p1_x + 127);
}
else
{
pwm13 = pwm14 = Limit_Mix(2000 + Joystick_Array[p1_y] + Joystick_Array[p1_x] - 127);
pwm15 = pwm16 = Limit_Mix(2000 + Joystick_Array[p1_y] - Joystick_Array[p1_x + 127);
}
In this case, you would make an array with new values (halves if you want). the joystick gives a value of 0 to 255, so it looks in spot 0, if full reverse in the array, and in this example, would grab a value of 0. 127 points to the 127th. Remember, the first one is spot 0, not 1 in the array. Doing it this way allows you to have multiple curves for drivers, or just change the values completely so you have a larger slow area so you do not need to cut it in half at all.
  #19   Spotlight this post!  
Unread 13-06-2007, 21:31
lukevanoort lukevanoort is offline
in between teams
AKA: Luke Van Oort
no team
 
Join Date: Oct 2005
Rookie Year: 2005
Location: Waterloo, ON, Canada
Posts: 1,873
lukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond repute
Send a message via AIM to lukevanoort
Re: Thanks for all your help...and a question

(This is in regard to the post above mine, which I will not quote, for space considerations)

We do essentially the same thing, the only differences are, we use a slightly different equation, and our lookup table uses unsigned chars instead of short ints (although, in theory both should work, unsigned chars just take up less space). However, instead of just using ours for only our drive system, ours is used for every single joystick controlled movement on our robot. We have found that this greatly increases usability and driveability of our robot and its mechaisms by allowing fine control when necessary (like positioning the wrist for a ringer) and fast control when you need the speed (like driving across the field to a ringer). I would highly recommend at least trying exponential lookup tables, you may be amazed by the improvement such a small change can make.
__________________
Team 1219: 2009 - Mentor
Team 587: 2005 - Animator, 2006-2008 - Team Captain
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
Thanks J&J :O (And of course, all sponsors) JC-75 Thanks and/or Congrats 0 05-04-2006 12:32
Thanks for the help and parts, 340! Joe Ross Thanks and/or Congrats 1 22-02-2004 00:09
'So Long, and Thanks for All the Fish' Ashley Weed Math and Science 4 07-06-2003 13:43
Thanks for the fun all... archiver 2001 0 24-06-2002 03:23
Thanks for all your help! archiver 2000 0 23-06-2002 22:01


All times are GMT -5. The time now is 02:07.

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