Go to Post I like to divide checklists like this into "stuff I have to do before applying power" and "stuff I'll find faster by watching it fail". - EricVanWyk [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 09-02-2010, 12:59
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,098
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
mecanum/holonomic/omni drive

This is what our team has learned so far. I'm posting it here for the benefit of any team still struggling with, or wanting to learn more, about holonomic drive.

You can use the holonomic drive VI provided in LabVIEW (which requires polar coordinate inputs),

OR

You can write your own omni code (as our team did), which uses -1 to +1 joystick output values, as follows:


Let x, y, and z be the rev/fwd, slide left/right, and spin CCW/CW axes, respectively, which each vary from -1 to +1.


So:

x= -1 corresponds to full speed reverse, x= +1 corresponds to full speed forward,

y= -1 corresponds to full speed slide left, y= +1 corresponds to full speed slide right,

z= -1 corresponds to full speed spin CCW, z= +1 corresponds to full speed spin CW


If your joystick outputs don't look like the above (eg the signs are reversed), simply convert them.


Let w1, w2, w3, and w4 be the commands to send to each of the 4 wheels, where w1 is front left, w2 is front right, w3 is rear left, w4 is rear right, as viewed from the top.

set the four wheel speed commands as follows:

w1 = x + y + z

w2 = x - y - z

w3 = x - y + z

w4 = x + y - z


You're almost done. All that remains is to normalize the above commands so that their range is -1 to +1. Proceed as follows:

- look at the magnitude (absolute value) of each of the four commands, and select the MAXIMUM. for sake of discussion, call this maximum value Wmax

- if Wmax is less than or equal to 1, no scaling is required. Just use the four w commands as-is

- if Wmax is greater than 1, then divide EACH of the four w values by Wmax.

That's all there is to it. Send each w command to the corresponding wheel.

One note of caution: make sure the polarity of the motors on each side of the bot is wired correctly (each wheel must be spinning in the "forward" direction when it gets a +1 command). The easier way to observe this is to elevate the bot and push the joystick forward; all four wheels should be spinning forward.



~
  #2   Spotlight this post!  
Unread 10-02-2010, 15:27
adamdb adamdb is offline
Registered User
#1583
 
Join Date: Feb 2005
Location: Parker, CO
Posts: 64
adamdb has a spectacular aura aboutadamdb has a spectacular aura aboutadamdb has a spectacular aura about
Re: mecanum/holonomic/omni drive

Is this designed for use with mechanum or omni wheels? I think the outputs to the motors are significantly different between the two.
__________________
Adam Bryant
Programming Mentor
Team 1583
Ridge View Academy Rambotics
  #3   Spotlight this post!  
Unread 10-02-2010, 16:08
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,098
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: mecanum/holonomic/omni drive

Quote:
Originally Posted by adamdb View Post
Is this designed for use with mechanum or omni wheels? I think the outputs to the motors are significantly different between the two.
I believe this algorithm will work equally well for:

- straight-mounted mecanum wheels arranged in an "O" pattern as viewed from the bottom (which is the same as an "X" pattern when viewed from the top)*

and

- omni wheels mounted at 45 degrees so as to form an "O" pattern (as viewed from either the top or the bottom)

The important point is that the axis of rotation of the roller which is in contact with the ground should be perpendicular (or nearly so) to a line drawn from the center of the bot out to the wheel in question (regardless of whether the wheel is omni or mecanum)


* see this post for an explanation of "X" and "O":
http://www.chiefdelphi.com/forums/showpost.php?p=907174




~
  #4   Spotlight this post!  
Unread 10-02-2010, 16:08
efoote868 efoote868 is offline
foote stepped in
AKA: E. Foote
FRC #0868
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2005
Location: Noblesville, IN
Posts: 1,416
efoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond repute
Re: mecanum/holonomic/omni drive

Quote:
Originally Posted by Ether View Post
This is what our team has learned so far. I'm posting it here for the benefit of any team still struggling with, or wanting to learn more, about holonomic drive.
I gave our programmers three programming assignments at the beginning of the build season related to this, to write pseudo code to drive a mecanum drive setup (I broke it into neat little chunks for them).

http://lib.store.yahoo.net/lib/yhst-...lSpecSheet.pdf

A discussion on vectors is useful in teaching mecanum wheels, and an understanding of vectors is critical in making sure the robot's wheels are correctly placed (The whole "diamond" versus "X", and an ability to spin).

Thinking about it in terms of "This wheel must spin this way when you want the robot to travel in this direction" is useful, and breaking it into one part at a time makes it more manageable.
__________________
Be Healthy. Never Stop Learning. Say It Like It Is. Own It.

Like our values? Flexware Innovation is looking for Automation Engineers. Check us out!
  #5   Spotlight this post!  
Unread 10-02-2010, 17:20
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,098
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: mecanum/holonomic/omni drive

Quote:
Originally Posted by efoote868 View Post
Thinking about it in terms of "This wheel must spin this way when you want the robot to travel in this direction" is useful, and breaking it into one part at a time makes it more manageable.
The way I presented it our team was along these lines:

- which way must each of the four wheels spin in order to go forward?

- which way must each of the wheels spin in order to spin clockwise?

- which way must each of the wheels spin in order to slide right?

Then, once they figured that out, the "aha" moment was understanding that these actions could be superimposed using simple addition to get an algorithm which would allow the robot to execute all three maneuvers at the same time, in any proportion desired.


~
  #6   Spotlight this post!  
Unread 10-02-2010, 17:25
Egg 3141592654's Avatar
Egg 3141592654 Egg 3141592654 is offline
Now a mentor, always a student
FRC #0810 (Mechanical Bulls)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2008
Location: Long Island
Posts: 53
Egg 3141592654 is on a distinguished road
Re: mecanum/holonomic/omni drive

The Holonomic drive never worked for our team, instead what I did was i established each of the 4 wheel motors independently and set values from the joystick. Speed was set using the "Set" method and wired straight from the joystick axis values. Naturally, there is an algorithm to flip motor speeds appropriately to allow functionality of the Mecanum Wheels.

Using this method allows a side of the robot to be front, as in ours, and also allows those who don't like coordinates to get the job done. Just thought that that idea should be broadcast, and good luck!
  #7   Spotlight this post!  
Unread 10-02-2010, 17:45
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,098
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: mecanum/holonomic/omni drive

Hello Egg,

I'm not sure I understand what you said, but you've captured my interest. Could you elaborate just a bit please?

Quote:
Originally Posted by Egg 3141592654 View Post
The Holonomic drive never worked for our team
What exactly didn't work? Is it that you had trouble converting the joystick outputs to polar coordinates, or some other problem?

Quote:
Originally Posted by Egg 3141592654 View Post
i established each of the 4 wheel motors independently
What what does it mean to "establish" each of the 4 wheel motors "independently"? How is this different from, for example, what I posted?


Quote:
Originally Posted by Egg 3141592654 View Post
Speed was ... wired straight from the joystick axis values
Not sure what "wired straight from the joystick values" means. What would be an example of something not wired straight from the joystick values?

Thanks


~
  #8   Spotlight this post!  
Unread 10-02-2010, 18:11
Egg 3141592654's Avatar
Egg 3141592654 Egg 3141592654 is offline
Now a mentor, always a student
FRC #0810 (Mechanical Bulls)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2008
Location: Long Island
Posts: 53
Egg 3141592654 is on a distinguished road
Re: mecanum/holonomic/omni drive

Sorry if i wasn't so clear, what i meant was this...

The Holonomic drive never worked for autonomous (getting, setting, etc.), so we did what i was explaining later in the post. In the WPI library, you can establish individual Jaguar/Victor motors, each with their own separate values. Naturally, with something like Mechanum wheels, this would be perferred when each motor spins in a unique way.

The "wiring" aspect was the moving of numbers from the "get" method in the joystick class to the "Set speed" method.

The Pseudo code looks something like this...

Jaguar motor1 = new Jaguar(1);
Jaguar motor2 = new Jaguar(2);
Jaguar motor3 = new Jaguar(3);
Jaguar motor4 = new Jaguar(4); <-- that is declaring everything separate
Joystick joy = new Joystick(1);

... code...

if(joy.getAxisY() == -1)
{
motor1.setSpeed(joy.getAxisY());
motor2.setSpeed(joy.getAxisY()*-1); <-- setting everything seperate
motor3..... you get the point.
}

Essentially, I re-created the Holonomic drive without actually using the Holonomic Drive in Labview. I didn't use it because 1. it didn't appear to work when i tried it and 2. I can just as easily overload it. Hopefully this cleared things up for you.


*NOTE: Pseudo done as if in Java*
__________________
"The answers to the book of life are not found in the back." Charlie Brown

Software Mentor - Team Apex Robotics 5803

Lead Programmer - Team 810 Mechanical Bulls '09-'11
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
does any one have a working holonomic mecanum setup? Must Be Drama NI LabVIEW 9 14-02-2010 04:54
How do you wire the inputs for holonomic drive (omni wheels) star_lancer NI LabVIEW 8 22-01-2010 22:29
Holonomic drive vi with mecanum wheels dwodrich NI LabVIEW 7 18-01-2010 16:01
Holonomic vs Mecanum Help!! kSniper Technical Discussion 10 25-03-2008 16:57
Holonomic/Omni vs Defense Alex Burman Technical Discussion 15 15-02-2006 20:35


All times are GMT -5. The time now is 18:28.

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