Go to Post (We're going to get a team going up here, I have faith. And nerds.) - ScoutingNerd175 [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 15-01-2003, 20:34
Adam Collet Adam Collet is offline
Registered User
#0159 (Alpine Robotics)
 
Join Date: Nov 2002
Location: Ft. Collins, Colorado
Posts: 25
Adam Collet is an unknown quantity at this point
Question Translational Drive Code

How can we code translational drive off of one joystick? Right now all I can think of is to use and inverse tangent, which obviously isn't possible. Using inverse tanget it would be (for the first quadrant):

tan-1 (p1_y/p1_x) 'then code torotate it using timing or rotation sensor
pwm1=p1_y
pwm2=p1_y
pwm2=p1_y
pwm4=p1_y 'all the motors go forward/backward now that the angle is set, based on how far the drive moved p1_y


Any ideas?
__________________
"Without the wind, the grass does not move. Without software, hardware is useless.''

Thus spake the Master Programmer

The Tao of Programming
Translated by: Geoffrey James
  #2   Spotlight this post!  
Unread 15-01-2003, 22:38
Gobiner Gobiner is offline
Registered User
#0753 (High Desert Droids)
 
Join Date: Nov 2002
Location: Bend, Oregon
Posts: 54
Gobiner is an unknown quantity at this point
Send a message via ICQ to Gobiner Send a message via AIM to Gobiner
If you don't need the code to cycle really fast, you might try something that will do a select (100 * p1_y / p1_x) and try 0 to 10 and 10 to 20 etc. Negatives will hurt, though. Just a whole lot of ifs to approximate a function.
__________________
0N3 1337 PR0G|24MM1N6 N1NJ4
  #3   Spotlight this post!  
Unread 15-01-2003, 23:12
Don's Avatar
Don Don is offline
Registered User
#0288 (the RoboDawgs)
 
Join Date: Jun 2001
Location: Grandville, Michigan
Posts: 92
Don is an unknown quantity at this point
Send a message via AIM to Don
For the ignorant.....what's translational drive?
  #4   Spotlight this post!  
Unread 15-01-2003, 23:26
Damian Manda's Avatar
Damian Manda Damian Manda is offline
The Damian
no team
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Fort Collins, CO
Posts: 154
Damian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud of
Send a message via AIM to Damian Manda
Tranlational drive is when all the wheels on your robot turn towards the same direction, instead of turning the whole robot. If you do not need to rotate the robot, this makes changing direction much faster. Unless you build in a way to turn, the robot will always stay facing the same direction unless it is bumped.

-Damian Manda
  #5   Spotlight this post!  
Unread 16-01-2003, 01:06
Jeff_Rice's Avatar
Jeff_Rice Jeff_Rice is offline
ElementisRegamusProelium
#1359
Team Role: Programmer
 
Join Date: Dec 2002
Location: Linn County
Posts: 283
Jeff_Rice will become famous soon enoughJeff_Rice will become famous soon enough
Use your trig identities, friend.
__________________
"He said my name is Private Andrew Malone
If you're reading this then I didn't make it home
But for every dream that's shattered another one comes true
This car was once a dream of mine now it belongs to you
And though you may take her and make her your own
You'll always be riding with Private Malone" David Ball, "Private Malone"
  #6   Spotlight this post!  
Unread 16-01-2003, 01:10
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
It's taken me awhile, but I finally found the link I was looking for. There's some example swerve-drive code over at http://www.first-codex.net, under 2002 code in the Repository. It's called something like "Pegasus". Should be a good starting point, even if it is the old 2.0 syntax.

--Rob
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
  #7   Spotlight this post!  
Unread 16-01-2003, 07:05
Matt Reiland's Avatar
Matt Reiland Matt Reiland is offline
'The' drive behind the drive
None #0226 (TEC CReW Hammerheads)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1999
Location: Troy Michigan
Posts: 712
Matt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond repute
Adam, we (226) created the pegasus code last year using some inverse trig approximations to get the vector of the joystick which I think you were looking for, if you can't find it on the Codex PM me and I will send it to. It is posted to give other teams a start
  #8   Spotlight this post!  
Unread 20-01-2003, 15:58
Adam Collet Adam Collet is offline
Registered User
#0159 (Alpine Robotics)
 
Join Date: Nov 2002
Location: Ft. Collins, Colorado
Posts: 25
Adam Collet is an unknown quantity at this point
YEA!

OK, we figured it out - and far more acurately than the pegasus code (natururally, there is the trade off of program space, but it actually takes up less variable space than their's).

Basically, we devided the joystick up into octants, than used a taylor approximation on the inverse sine, and decided the power and direction by quadrant using some modified x>y if statements.

If you would like the code, e-mail me.
__________________
"Without the wind, the grass does not move. Without software, hardware is useless.''

Thus spake the Master Programmer

The Tao of Programming
Translated by: Geoffrey James
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
What is your most prefered programming language? Hailfire Programming 156 19-01-2005 21:42
1 stick drive to 2 stick drive wayne 05 Programming 18 01-04-2004 16:41
Direct drive or Chain? Suneet Technical Discussion 32 27-03-2003 23:00
TechnoKats Automated Test Drive Code Greg McCoy Programming 1 16-01-2003 17:45
"Motors and Drive train edition" of Fresh From the Forum Ken Leung CD Forum Support 6 29-01-2002 12:32


All times are GMT -5. The time now is 04:27.

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