Go to Post Nothing worth gaining was ever obtained without effort. - Jaine Perotti [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-03-2005, 00:17
robotaddict's Avatar
robotaddict robotaddict is offline
Registered User
FRC #1294 (Screws Loose (hopefully going to be changed soon))
Team Role: Programmer
 
Join Date: Mar 2005
Location: Sammamish, Washington
Posts: 11
robotaddict is on a distinguished road
Holonomic Drive Mathmatics Discussion

Have we all heard of holomonic drives here? If not let me expound... A holomonic drive uses things called "omniwheels" which are sort of like normal wheels, but with rollers mounted along the wheel which allow it to move perpendicular to the plane of the wheel. If you mount four of these with one pair perpendicular to the other. This allows motion in any direction from any starting position.

Now comes the interesting part, how on earth do you control this darn thing?! Sure you can move in any direction, but this would confuse any mortal driver. So I had the "brilliant" idea of using a gyro to give the robot absolute direction, that is when you push the stick away and it goes away, and vice versa, but in uncomplicating the drivers' job I have complicated my own. Now not only must the joystick inputs be scaled and realigned, but now they must be modified by the gyro's output, too. Oi. So here are some rudimentary equations...

true y input = (cos(angle from origin) * original y input) + (sin(angle from origin + 90) * original x input)

true x input = (cos(angle from origin + 90) * original x input) + (sin(angle from origin) * original y input)

You can see my dillema, especially after you add the z axis, though it should be a good deal simpler... PLEASE ADVISE!
  #2   Spotlight this post!  
Unread 15-03-2005, 01:25
The Lucas's Avatar
The Lucas The Lucas is offline
CaMOElot, it is a silly place
AKA: My First Name is really "The" (or Brian)
FRC #0365 (The Miracle Workerz); FRC#1495 (AGR); FRC#4342 (Demon)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Dela-Where?
Posts: 1,564
The Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond repute
Send a message via AIM to The Lucas
Re: Holomonic Drive mathmatics discussion

I developed a simple kiwi drive (wheels mounted at 45 degree angles) code for a prototype; let’s see if I remember it correctly. I used code very similar to the default 1 joystick code for translational (no spinning) movement. You can put your angle adjusted p1_x and p1_y axis into the translational code. Obviously, the motors have to be linked diagonally.

LF/---\RF
....| |
LR\---/RR

LF - left front motor
LR - left rear motor
RF - right front motor
RR - right rear motor

Code:
RF = LR = Limit_Mix(2000 + p1_y + p1_x - 127);
LF = RR = Limit_Mix(2000 + p1_y - p1_x + 127);
Now for spin:
Still it is pretty simple and much like the default code. You need a spin joystick (p2_x). Now left and right sides are pretty much linked.

Code:
RF = Limit_Mix(2000 + RF + p2_x - 127);
RR = Limit_Mix(2000 + RR + p2_x - 127);
LF = Limit_Mix(2000 + LF - p2_x + 127);
LR = Limit_Mix(2000 + LR - p2_x + 127);
As I remember, this works pretty well. Now just keep track of your gyro. Watch out for drift over time, as the error compounds. I would put some filter caps in the gyro to reduce the error. Also make sure your motors are all running in the same direction. GOOD LUCK!
__________________
Electrical & Programming Mentor ---Team #365 "The Miracle Workerz"
Programming Mentor ---Team #4342 "Demon Robotics"
Founding Mentor --- Team #1495 Avon Grove High School
2007 CMP Chairman's Award - Thanks to all MOE members (and others) past and present who made it a reality.
Robot Inspector
"I don't think I'm ever more ''aware'' than I am right after I burn my thumb with a soldering iron"

Last edited by The Lucas : 15-03-2005 at 01:44.
  #3   Spotlight this post!  
Unread 15-03-2005, 06:26
Don Wright's Avatar
Don Wright Don Wright is offline
Registered User
FRC #0469
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Livonia, MI
Posts: 683
Don Wright has a reputation beyond reputeDon Wright has a reputation beyond reputeDon Wright has a reputation beyond reputeDon Wright has a reputation beyond reputeDon Wright has a reputation beyond reputeDon Wright has a reputation beyond reputeDon Wright has a reputation beyond reputeDon Wright has a reputation beyond reputeDon Wright has a reputation beyond reputeDon Wright has a reputation beyond reputeDon Wright has a reputation beyond repute
Send a message via MSN to Don Wright Send a message via Yahoo to Don Wright
Re: Holomonic Drive mathmatics discussion

Another thought I had when thinking about controlling this type of drive system using a gyro to note rotation would be a button on the OI to "Reset" the gyro to zero or something if it got out of whack.

You drive the robot so it faces the correct rotation for zero, for example, and the hit the "Reset" button and it knows that is supposed to be zero again.

Also, I was thinking that if you just used a pot for rotation and a joystick for movement, and instead of using gyros for absolute movement, you still have a front, you could do really cool thinks like effortlessly drive in a perfect circle. You would just turn the pot to rotate a little, and then drive left or right. As the robot drives left or right, it will rotate and cause you to drive in a circle. Thought that might be kind've cool. We would also have a foot switch or something to "Disable Rotation" so you could quickly stop the rotation and drive normally.

Good luck.
__________________
Donald F. Wright Jr.
Product Manager
AVL Instrumentation & Test Systems, Inc.
  #4   Spotlight this post!  
Unread 15-03-2005, 08:07
Adam Y.'s Avatar
Adam Y. Adam Y. is offline
Adam Y.
no team (?????)
 
Join Date: Mar 2002
Location: Long Island
Posts: 1,979
Adam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to behold
Send a message via AIM to Adam Y.
Re: Holomonic Drive mathmatics discussion

Quote:
You can see my dillema, especially after you add the z axis, though it should be a good deal simpler... PLEASE ADVISE!
Why do you need to be able to control the robot in the z axis? If x and y are on the ground then that would the z axis pointing up in the air.
__________________
If either a public officer or any one else saw a person attempting to cross a bridge which had been ascertained to be unsafe, and there were no time to warn him of his danger, they might seize him and turn him back without any real infringement of his liberty; for liberty consists in doing what one desires, and he does not desire to fall into the river. -Mill
  #5   Spotlight this post!  
Unread 15-03-2005, 09:27
seanwitte seanwitte is offline
Registered User
None #0116
Team Role: Engineer
 
Join Date: Nov 2002
Location: Herndon, VA
Posts: 378
seanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant future
Send a message via AIM to seanwitte
Re: Holomonic Drive mathmatics discussion

A pretty good decription is available in the article titled "Closed Loop Motion Control for Mobile Robots" by Rich LeGrand. You can buy it for $1.50 here:

http://www.circuitcellar.com/magazine/169toc.htm

Includes all of the kinematics equations you need for a four-wheel holonomic robot.
  #6   Spotlight this post!  
Unread 15-03-2005, 10:10
Rick TYler Rick TYler is offline
A VEX GUy WIth A STicky SHift KEy
VRC #0010 (Exothermic Robotics)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Redmond, Washington
Posts: 2,000
Rick TYler has a reputation beyond reputeRick TYler has a reputation beyond reputeRick TYler has a reputation beyond reputeRick TYler has a reputation beyond reputeRick TYler has a reputation beyond reputeRick TYler has a reputation beyond reputeRick TYler has a reputation beyond reputeRick TYler has a reputation beyond reputeRick TYler has a reputation beyond reputeRick TYler has a reputation beyond reputeRick TYler has a reputation beyond repute
Re: Holomonic Drive mathmatics discussion

Quote:
Originally Posted by Adam Y.
Why do you need to be able to control the robot in the z axis? If x and y are on the ground then that would the z axis pointing up in the air.
I believe John meant x and y to be movement in the horizontal plane and z to be rotation of orientation. Unless he wanted the robot to fly, which, knowing John, might be his intention...
__________________
Exothermic Robotics Club, Venturing Crew 2036
VRC 10A, 10B, 10D, 10Q, 10V, 10X, 10Z, and 575
  #7   Spotlight this post!  
Unread 15-03-2005, 20:29
Andrew Rudolph's Avatar
Andrew Rudolph Andrew Rudolph is offline
Git 'em!
no team (Robot in 3 Days)
Team Role: Mentor
 
Join Date: May 2001
Rookie Year: 2000
Location: Orlando, FL
Posts: 921
Andrew Rudolph has a reputation beyond reputeAndrew Rudolph has a reputation beyond reputeAndrew Rudolph has a reputation beyond reputeAndrew Rudolph has a reputation beyond reputeAndrew Rudolph has a reputation beyond reputeAndrew Rudolph has a reputation beyond reputeAndrew Rudolph has a reputation beyond reputeAndrew Rudolph has a reputation beyond reputeAndrew Rudolph has a reputation beyond reputeAndrew Rudolph has a reputation beyond reputeAndrew Rudolph has a reputation beyond repute
Send a message via AIM to Andrew Rudolph
Re: Holomonic Drive mathmatics discussion

Im not the programmer for our team, but we have had holonomic robots the last 2 years. We have found the best way is to have one joystick sort of the strafe joystick. push the stick forward and it makes the bot drive to the front, and pretty much it goes where ever you move the stick. Then another stick the controls the rotation. We have been devolping a system using a gyro to help correct for slippage. SPAM had a system last year that they could push the stick away from the driver and tbe bot would go away from you.
__________________
iR3 Creative Engineering
Robot in 3 Days

FTC 6323 The Pink TeamMentor
FTC 8996 Pink Fluffy BunniesMentor
FRC 233 The Pink Team Mentor
FRC 1902 Exploding Bacon Mentor
  #8   Spotlight this post!  
Unread 15-03-2005, 20:38
KTorak's Avatar
KTorak KTorak is offline
Fire Rescue 47
AKA: Kyle Dersch
FRC #1023 (Bedford Express)
Team Role: Driver
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Montgomery Village, MD
Posts: 899
KTorak has a reputation beyond reputeKTorak has a reputation beyond reputeKTorak has a reputation beyond reputeKTorak has a reputation beyond reputeKTorak has a reputation beyond reputeKTorak has a reputation beyond reputeKTorak has a reputation beyond reputeKTorak has a reputation beyond reputeKTorak has a reputation beyond reputeKTorak has a reputation beyond reputeKTorak has a reputation beyond repute
Send a message via AIM to KTorak
Re: Holomonic Drive mathmatics discussion

wow. I wanted to know how teams did this as I saw a few at GLR with 4 omni wheels that rotated...We used them on the front of the robot and 2 drive wheels in the back and it works out well..except omni wheels crack and break after rough use (competition)...so to anyone who uses them, watch them closely for cracking and sperating...and good luck
__________________
Kyle D- Myspace - Facebook
2008 Bedford Express Driver & Build & Design (Team) Co-Leader
2007 Bedford Express Driver & Build & Design (Team) Leader
2006 Bedford Express Driver, Build Team Member, & Board of Directors
2005 Bedford Express Rookie, Build Team Member & Robot Operator
-
2008 - GLR Quarter Finalist
2007 - GLR Finalist & Boilermaker Finalist & MARC Off Season Event Winner
2006 - GLR Johnson & Johnson Sportsmanship Award & Archimedes 7th Seed Quarter Finalist
2005 - GLR Finalist & Judges Award.
2004 - GLR Semi Finalist.
2003 - GLR/DTR Quarter Finalist & GLR/NAT'L Rookie All Star.
  #9   Spotlight this post!  
Unread 15-03-2005, 22:28
EricS-Team180's Avatar
EricS-Team180 EricS-Team180 is offline
SPAM, the lunchmeat of superheroes!
AKA: Eric Schreffler
FRC #0180 (SPAM)
Team Role: Engineer
 
Join Date: Apr 2002
Rookie Year: 2001
Location: Stuart, Florida
Posts: 561
EricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond repute
Re: Holomonic Drive mathmatics discussion

Quote:
Originally Posted by Andrew Rudolph
SPAM had a system last year that they could push the stick away from the driver and tbe bot would go away from you.
yep...
That was what we called "steadySPAM", here's how it worked:

steadySPAM:
Given the joystick X and Y,
1) find the joystick angle of rotation, theta
2) find the joystick magnitude

Given the robot angular orientation psi, subtract it from theta.

From this new theta' and the magnitude,
find a new joystick X and Y

Use the new joystick X and Y to determine the inputs
for the motors.

so:
...given joyx, joyy and robot angular orientation wrt the field, theta.

1) First, I'd flip the joystick x-axis, since it hurts my head to have values
increasing to the left, then, move the origin to 0,0:

joyy1 = joyy-127
joyx1 = (255-joyxx)-127

Next, get the joystick angle of rotation:
note: ...must trap divide by zero
if joyy = 127 and joyx = 127, then
joytheta = 0 // neutral
else if joyy = 127, then
if joyx <= 127, then
joytheta = 90 // right
else
joytheta = -90 // left
else
joytheta = arctan(joyx1/joyy1)

and the magnitude:
joyspeed = sqrt(joyy1*joyy1 + joyx1*joyx1)

You can get the robot psi by using a yaw rate sensor and integrating. We defined theta and psi similar to, but not quite like a compass. Straight up field is 0deg. Rotating to the right the angle changes from 0 to 180 deg. Rotating to the left the angle changes from 0 to -180deg.

Subtract psi from theta,
joytheta' = joytheta - psi

The new joystick x and y are:
joyx' = 255 - (joyspeed*sin(joytheta')+127)
joyy' = joyspeed*cos(joytheta')+127

(Use these to calculate the motor outputs. You can use the default code mixing equation, but we included an additional 45deg rotation on top of that.)

However, using robotaddicts equations, you can do something similar and avoid an arctan and a square root:

...given joyx, joyy and robot angular orientation wrt the field, theta.

1) First, adjust the joystick axes:

joyy1 = joyy-127
joyx1 = (255-joyxx)-127

2) Next rotate the joystick axes into the orientation of the robot.

joyy2 = joyy1*cos(theta) + joyx1*sin(theta)
joyx2 = joyx1*cos(theta) - joyy1*sin(theta)

Now, get back to a typical joystick set of axes:

joyy' = joyy2+127
joyx' = 255- (joyx2+127)


This took care of translation. For rotation, we had a separate stick and applied it similar to "The Lucas"

Thanks,
Eric
__________________

Don't PANIC!
S. P. A. M.
  #10   Spotlight this post!  
Unread 15-03-2005, 22:38
probizzle's Avatar
probizzle probizzle is offline
Registered User
AKA: Prabhas Pokharel
#0639 (Code Red)
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2003
Location: Ithaca
Posts: 78
probizzle will become famous soon enoughprobizzle will become famous soon enough
Send a message via AIM to probizzle
Re: Holomonic Drive mathmatics discussion

One quick comment that I would have is to also make a back-up drive system, which drives whatso-ever direction from the point of view of the robot. Your drivers I hope played enough video games to get this figured out (easily).

Just in case....
(and because your drivers actually might like this better, and because your absolute positioning system is going to drift, and it will be a hassle for drivers to figure out when to reset. etc.)
__________________
Code Red Team 639 Winners of the 2005 FingerLakes Regional with 191 and 494.
--
http://pset.deu83.com << my baby
http://www.setgame.com/set/ << it's mother
  #11   Spotlight this post!  
Unread 16-03-2005, 09:17
seanwitte seanwitte is offline
Registered User
None #0116
Team Role: Engineer
 
Join Date: Nov 2002
Location: Herndon, VA
Posts: 378
seanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant future
Send a message via AIM to seanwitte
Re: Holomonic Drive mathmatics discussion

Quote:
Originally Posted by probizzle
One quick comment that I would have is to also make a back-up drive system, which drives whatso-ever direction from the point of view of the robot. Your drivers I hope played enough video games to get this figured out (easily).

Just in case....
(and because your drivers actually might like this better, and because your absolute positioning system is going to drift, and it will be a hassle for drivers to figure out when to reset. etc.)
By using the driver's reference frame instead of the robots (move the joystick forward and the robot drives away from you, no matter which direction its facing) allows you to translate AND rotate at the same time. The other holonomic implementations don't allow you to have this "frisbee" motion. All you need is a pot or a set of buttons to adjust the robot's perceived heading if it drifts. It has the added bonus of making it easier to use the gyro as feedback to cancel unwanted rotation.
  #12   Spotlight this post!  
Unread 16-03-2005, 20:06
Donut Donut is offline
The Arizona Mentor
AKA: Andrew
FRC #2662 (RoboKrew)
Team Role: Engineer
 
Join Date: Mar 2005
Rookie Year: 2004
Location: Goodyear, AZ
Posts: 1,302
Donut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond repute
Re: Holomonic Drive mathmatics discussion

This drive system is so weird to program. We tried it with a normal robot this year, but didn't have enough time to finish. If you write your own code for finding the magnitude and direction of the joystick, avoid using arctan and square root functions at all costs (or make your own versions of them). We wrote our own square root function, but found out a little too late that an arctan2() call chews up 12% of your code space.
  #13   Spotlight this post!  
Unread 17-03-2005, 08:34
EricS-Team180's Avatar
EricS-Team180 EricS-Team180 is offline
SPAM, the lunchmeat of superheroes!
AKA: Eric Schreffler
FRC #0180 (SPAM)
Team Role: Engineer
 
Join Date: Apr 2002
Rookie Year: 2001
Location: Stuart, Florida
Posts: 561
EricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond repute
Re: Holomonic Drive mathmatics discussion

Quote:
Originally Posted by Donut
If you write your own code for finding the magnitude and direction of the joystick, avoid using arctan and square root functions at all costs...
We decided at the outset to use integer math, so I don't have any data on using floating point. Your experience, however, is insightful. We wrote table lookups for sine/cosine and arctan, and, like you, wrote an integer square root. We had no timing problems with the main loop.

Eric
__________________

Don't PANIC!
S. P. A. M.
  #14   Spotlight this post!  
Unread 17-03-2005, 10:28
gc02 gc02 is offline
Registered User
no team
 
Join Date: Jan 2003
Location: Anaheim CA
Posts: 28
gc02 is on a distinguished road
Re: Holomonic Drive mathmatics discussion

Quote:
Originally Posted by robotaddict
You can see my dillema, especially after you add the z axis, though it should be a good deal simpler... PLEASE ADVISE!
Here's the equations for a three wheel holonomic base. Since you're using 4 wheels that are aligned on primary axises, you should be able to simplify it somewhat.

I tried simulating a 3 wheel holonomic base, and it was virtually (no pun intended) uncontrollable without some sort of PID. I guess 4 wheels shouldn't be quite as bad though.
__________________
Greg
Enigma Industries
  #15   Spotlight this post!  
Unread 17-03-2005, 13:08
The Lucas's Avatar
The Lucas The Lucas is offline
CaMOElot, it is a silly place
AKA: My First Name is really "The" (or Brian)
FRC #0365 (The Miracle Workerz); FRC#1495 (AGR); FRC#4342 (Demon)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Dela-Where?
Posts: 1,564
The Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond repute
Send a message via AIM to The Lucas
Re: Holomonic Drive mathmatics discussion

Quote:
Originally Posted by gc02
[url=http://www-2.cs.cmu.edu/~reshko/PILOT/physics.html]I tried simulating a 3 wheel holonomic base, and it was virtually (no pun intended) uncontrollable without some sort of PID. I guess 4 wheels shouldn't be quite as bad though.
I think Wildstang built a 3 wheel holonomic back in 2001 or 2002. They didn't use it in competition, they just distributed a really cool video (as Raul and those guys tend to do). If they got that thing to work on one of those old PBASIC Stamps, so it shouldn’t require to much processing. Of course they wrote StangPS on a Stamp, so it might require a lot of processing.
__________________
Electrical & Programming Mentor ---Team #365 "The Miracle Workerz"
Programming Mentor ---Team #4342 "Demon Robotics"
Founding Mentor --- Team #1495 Avon Grove High School
2007 CMP Chairman's Award - Thanks to all MOE members (and others) past and present who made it a reality.
Robot Inspector
"I don't think I'm ever more ''aware'' than I am right after I burn my thumb with a soldering iron"
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
Holonomic Drive Question Jeff Waegelin Technical Discussion 12 20-11-2005 21:23
If you could change one thing.... Koko Ed General Forum 48 31-03-2005 19:23
check out this lego Holonomic drive base Tytus Gerrish Technical Discussion 10 15-08-2004 17:47
Globe gear box Pat Roche Motors 9 25-05-2004 22:50
"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 20:43.

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