Go to Post Please share your opinion and post whatever you want, I wouldn’t mind. Because I may be wrong. - Arefin Bari [more]
Home
Go Back   Chief Delphi > Other > FIRST Tech Challenge
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #8   Spotlight this post!  
Unread 14-04-2006, 16:50
billbo911's Avatar
billbo911 billbo911 is online now
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,353
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: pic: kiwi vex robot

Quote:
Originally Posted by Tom Bottiglieri
Well credit needs to be given where it's deserved. I got the equations for my kiwi code from the living genious, Joel Johnson.

Anyway, here's what you need to do to make it work:

PHP Code:
//Make sure variables are unsigned ints... rollovers WILL occur with signed ints
unsigned int trans_xtrans_yrot;

//Grab inputs (x,y coords in rectangular coordinates and rotation rate)
trans_x 254 PWM_in1
trans_y 254 PWM_in2
rot 254 PWM_in4;      

//Limit vector length to 127
trans_x = (unsigned int)(37+(254*trans_x)/359);
trans_y = (unsigned int)(37+(254*trans_y)/359);

//Assign and limit wheel outputs
wheel_1  = (unsigned char)limit( (((2*trans_x) + rot) / 3), 0254); 
wheel_2 = (unsigned char)limit( ((601 rot trans_x - (168*trans_y/97)) / 3), 0254); 
wheel_3 = (unsigned char)limit( ((161 rot trans_x + (168*trans_y/97)) / 3) , 0254); 
This assumes you have a limit function, which limits an input value to upper and lower bounds.

PHP Code:
signed int limit(signed int valuesigned int minsigned int max
 { 
      if (
value min
      { 
           
value min
      } else if (
value max
      { 
           
value max
      } 
  
      return 
value
 } 
That should be all you need, and it should work. (It took me about 2 hours to figure out the variables needed to be unsigned. )
Now I know why I like Tom (oh yeah, and Joe too ) so much!!

The problem is, now I have to go buy some omni wheels for this weekends project

BTW. Do you know how the constant values were determined (ie. 37, 359, 601, 168, 97, 161)? Also, I see you are using PWM_in4 for the rotation value. I assume this is off the left stick X-axis. Knowing these can help me modify this stuff for future projects.

Thanks again!!!!
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
Reply With Quote
 


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
Using WPILib on a Vex robot koenig3456 Programming 2 02-05-2006 14:56
pic: Robot? What Robot? CD47-Bot Robot Showcase 13 10-04-2004 07:08
pic: 294's First Inventor Robot (pic 1)... CD47-Bot Robot Showcase 4 10-03-2004 19:34
pic: Closeup of the robot hanging on robot CD47-Bot Extra Discussion 16 09-03-2004 18:27
XCats - robot pic on our website archiver 2001 0 24-06-2002 01:06


All times are GMT -5. The time now is 16:31.

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