Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Code For Mecanum Wheels (http://www.chiefdelphi.com/forums/showthread.php?t=55896)

jacobhurwitz 18-02-2008 11:24

Re: Code For Mecanum Wheels
 
Quote:

Originally Posted by JonA (Post 700926)
Controlling any holonomic-omnidirectional drive system is the same whether it is any number of omni-wheels or mecanum-wheels. The output of the motors are related by a sin curve. Phase shifting the sin curve by the desired heading results in the proper motor outputs for each of the wheels.

Having had a mecanum drive the last two years, we have attempted a number of control algorithms and have settled on this one. Please note that this algorithm takes advantage of Binary-Radians (256 b-rads per revolution) to simplify the trig math.

I hope that you find this useful in your attempts to control your onmi bot.

This seems really complicated. We've found that the method I linked to above works just fine and is quite easy to program.

LieAfterLie 29-02-2008 07:53

Re: Code For Mecanum Wheels
 
I just add the joystick axes together and subtract 254, then chop off the ends, limiting it to 0-254. Works perfectly.

Bomberofdoom 26-07-2008 08:30

Re: Code For Mecanum Wheels
 
Okay, wow....sirious headache! :yikes:

Brining up this old post (if you can call 5 months old.....actually I can...:confused: ) 'cause someone mentioned in the NI forums the mechanum drive and I found this link and I'm interested in understanding the princepiles of working with mecanum in programming (not that I'm sure that my team will be using mecanum next year, but it's allways good to learn in any case).

From what I understand, you need 4 motors for each wheel (for a 4W drive), and by the look of an explantions given about one of the mecanum functions written in this post, by moving the left front and right rear wheels in one direction and the left rear and the right front in the opposite, the combination of the forces applied by the wheels will make the robot move on the mechanum wheels (the side ones that allow the "sliding")?

I find that kind of confusing...I actually thought you need an extra motor for each wheel in order to move the side wheels to do the slide...

If I can understand that, I'm pretty sure I can understand the algorithms written on how to determine the PWM given to the motors of the wheels.

BigJ 26-07-2008 10:15

Re: Code For Mecanum Wheels
 
The wheels are made up of rollers that are placed at an angle (like an omni wheel, only at 45 degrees instead of perpendicular).

You need one motor for each wheel.

Driving the wheel does not create force completely forward or backward, rather at an angle, due to the rollers rolling freely on the ground as the entire wheel drives forward.

Driving all 4 wheels forwards makes the sideways components of the forces cancel each other out, causing the robot to drive forward (this is why the front-left and back-right rollers are at the same angle, and the front-right and back-left rollers are at the same angle).

Driving one sides wheels towards each other and the other sides wheels away from each other will make all the forward/backward components of the forces cancel to create a sideways motion.

Driving one sides wheels forward and the other sides wheels backwards will cause the robot to rotate (just like a tank drive).

The algorithms in this topic present ways to take the joystick input and use it to create PWM output to the motors to "mix" the drives of the wheels to create the desired translation/rotation by nullifying certain parts/amounts of the different forces acting upon the robot.

EricH 26-07-2008 10:33

Re: Code For Mecanum Wheels
 
Driving the wheels on opposite corners (e.g.front left and back right) gets you diagonal motion (due to roller alignment).

Nir, I think you were thinking of a crab/swerve drive. Mecanum turns the wheels either forwards or backwards, but not in any other direction.

Bomberofdoom 26-07-2008 14:39

Re: Code For Mecanum Wheels
 
There's a diffrence between mecanum and omni?! :yikes:

Akash Rastogi 26-07-2008 14:52

Re: Code For Mecanum Wheels
 
Quote:

Originally Posted by Bomberofdoom (Post 758789)
There's a difference between mecanum and omni?! :yikes:

Oddly enough I found a single picture that dispels confusion about the wheels. On the bottom are omniwheels, and above are mecanum wheels. Note the difference in angle of the rollers to the center axis of the wheel.


Bomberofdoom 26-07-2008 17:00

Re: Code For Mecanum Wheels
 
Oh, cool!

So what's the big diffrence between (in terms of pros/cons)?

The only thing I can point out is that mec has big 45 degree angled wheels along the whole "big wheel" frame, and the omni has small pendecular (however you write that...90 degrees) wheels (and much more of them) along the "big wheel".

Mec takes more space and requires the robot's "inner" base be smaller due to the bigger space required to insert the wheel.

and it seems the mec is a bit more suffisticated in terms of the way it's designed and therefore I presume that the price for mec wheels are higher than omni.

right/wrong? what else?

artdutra04 26-07-2008 18:45

Re: Code For Mecanum Wheels
 
Quote:

Originally Posted by lilstogi11 (Post 758791)
Oddly enough I found a single picture that dispels confusion about the wheels. On the bottom are omniwheels, and above are mecanum wheels. Note the difference in angle of the rollers to the center axis of the wheel.

http://www.chiefdelphi.com/media/img...fc619eb6_l.jpg

Holy photo size, Batman!

(It took almost all of my 1920x1200 resolution to see that one...)

My suggestion for next time: either link to that page in CD-Media, right click on photo > View Photo and use that URL to embed, or use the cdm-description=photo vbcode tag like this:


BigJ 26-07-2008 20:53

Re: Code For Mecanum Wheels
 
Mecanum must also be as close to a perfect square as possible (the points contacting the ground that is) otherwise it will lose a lot of efficiency.

Akash Rastogi 26-07-2008 22:46

Re: Code For Mecanum Wheels
 
Quote:

Originally Posted by BigJ (Post 758833)
Mecanum must also be as close to a perfect square as possible (the points contacting the ground that is) otherwise it will lose a lot of efficiency.

So true. We learned this the hard way. Never got to use the full advantages of the mecanums this year because 1) we didn't use a suspension system to keep all wheel on the ground at all times and 2) the geometry was not perfect.

Just things to keep in mind. Oh, and thanks Art, I'll remember that for next time.:o

BigJ 27-07-2008 19:02

Re: Code For Mecanum Wheels
 
I know suspension is a "must" on even slightly uneven surfaces, but 1675 has never actually designed suspension for our mecanum drive and it worked just fine this year (despite the bumps under the carpet).

We really should get around to one, though.


All times are GMT -5. The time now is 19:46.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi