View unanswered posts | View active topics It is currently Sun May 29, 2016 5:57 pm

 Page 1 of 1 [ 4 posts ]
 Print view Previous topic | Next topic
Omni dtrectional drive system
Author Message
Rookie

Joined: Fri Sep 25, 2009 11:31 pm
Posts: 2
Omni dtrectional drive system
We are a new team and are excited about the build and comeratery that is present in this group.

We are looking at using a 4 wheel omni drive system on our robot. We are looking for help or a sample code that can be used to start us out on this large but interesting task.

Any help or information will be greatly appriciated.

Fri Sep 25, 2009 11:44 pm

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Re: Omni dtrectional drive system
Gwinter,

It is really important you understand the underlying math of an omniwheeled system. It's not terribly complex but it really makes things easier. I have a somewhat working omniwheeled robot that I am working on at the moment. It uses 3 wheels instead of the 4 you want.

This is the code I have:
 Code:#define MAXMOTORSPEED 50const float sqrt3div2 = 0.866025;int round(float f){  return (f>0)?(int)(f+0.5):(int)(f - 0.5);}void getMotorSpeeds(int &motorSpeedA, int &motorSpeedB, int &motorSpeedC, int angle, int Vb) {  float Vw1, Vw2, Vw3, norm_factor;  Vw1 = Vb*cosDegrees(angle);  Vw2 = Vb*(-0.5*cosDegrees(angle) + sqrt3div2*sinDegrees(angle));  Vw3 = Vb*(-0.5*cosDegrees(angle) - sqrt3div2*sinDegrees(angle));  norm_factor = 1.0;  if (Vw1 > MAXMOTORSPEED) {    norm_factor = MAXMOTORSPEED / Vw1;  } else if (Vw2 > MAXMOTORSPEED) {    norm_factor = MAXMOTORSPEED / Vw2;  } else if (Vw3 > MAXMOTORSPEED) {    norm_factor = MAXMOTORSPEED / Vw3;  }  motorSpeedA = round(Vw1 * norm_factor);  motorSpeedB = round(Vw2 * norm_factor);  motorSpeedC = round(Vw3 * norm_factor);}

For any given wheel, the speed it needs to turn at is :
Vw = Vb (cos Aw * cos At + sin Aw * sin At)

Vw = speed of the wheel
Vb = speed of the robot's body
Aw = the angle of the wheel on the body
At = the angle at which the body is travelling

So for a robot with 3 wheels (at 0, 120 and 240 degrees around the body), like my example, you get the following formulae:
 Code:Vw1 = Vb (cos   0 * cos At + sin   0 * sin At)Vw2 = Vb (cos 120 * cos At + sin 120 * sin At)Vw3 = Vb (cos 240 * cos At + sin 240 * sin At)

Sometimes a term will disappear from the calculations because it's 0, sometimes it's simplified because it's 1. You need to figure out what angles your wheels are at and create the formulae for your Vw1, Vw2, Vw3 and Vw4.

I am not going to give you the answers, you have all the information here for a robot with 3 and a generic formula.

You need to figure out why I have the following code:
 Code:  if (Vw1 > MAXMOTORSPEED) {    norm_factor = MAXMOTORSPEED / Vw1;  } else if (Vw2 > MAXMOTORSPEED) {    norm_factor = MAXMOTORSPEED / Vw2;  } else if (Vw3 > MAXMOTORSPEED) {    norm_factor = MAXMOTORSPEED / Vw3;  }

Good luck, if you have more questions, don't hesitate to ask, but don't ask me to write out the formulae for the 4 wheels, you should be able to do that yourself.

Regards,
Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]

Sat Sep 26, 2009 2:03 am
Rookie

Joined: Fri Sep 25, 2009 11:31 pm
Posts: 2
Re: Omni dtrectional drive system
I have figured out all the codes and the 4 wheel coding and alot of the formulas drop out with the use of the wheel angles. So it is simple. I am confused where the Vb and the Angle the body is traveling (At) comes from.

Are you using a gyro for input.

I have developed an array to draw the sine and cosine vales from vice using the nxt to calculate them each time. This should speed up the process.

I have also written a code for using joysticks to directly control the motors will this work in direct control modes.

gwinter

Wed Sep 30, 2009 10:38 am

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Re: Omni dtrectional drive system
 gwinter wrote:I have figured out all the codes and the 4 wheel coding and alot of the formulas drop out with the use of the wheel angles. So it is simple. I am confused where the Vb and the Angle the body is traveling (At) comes from.

Vb is the velocity of the body. A four wheeled omniwheel robot is much more efficient when it comes to translating the motor's movement to that of the body. At is the angle at which the body is travelling. You should check out http://nxtasy.org/2006/12/27/omni-teaches-physics/ for more info on the physics of this. Also be sure to read up on this http://technicbricks.blogspot.com/2008/ ... ns_29.html

 Quote:Are you using a gyro for input.

Nope, math is all I am using for now. I am planning to make it remote controllable (as well as autonomous) using the new HiTechnic IRReceiver sensor.

Regards,
Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]

Wed Sep 30, 2009 12:08 pm
Display posts from previous:  Sort by
 Page 1 of 1 [ 4 posts ]

#### Who is online

Users browsing this forum: No registered users and 1 guest

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ ROBOTC Applications    ROBOTC for LEGO MINDSTORMS       Third-party sensors    ROBOTC for CORTEX & PIC    ROBOTC for VEX IQ    ROBOTC for Arduino    Robot Virtual Worlds    Multi-Robot Communications    Issues and Bugs Competitions & Partners    Mini Urban Challenge    CS2N Robot Virtual Worlds Competitions       VEX Skyrise Competition 2014-2015       VEX Toss Up 2013-2014       FTC Block Party! 2013-2014    Competitions using VEX - BEST, TSA, VEX, and RoboFest!    FTC Programming    RoboCup Junior and Other ROBOT Competitions Virtual Brick Robotics Discussions    General Discussions    Project Discussions Off-Topic ROBOTC Forum & ROBOTC.net Suggestions/Feedback    ROBOTC Forums Suggestions/Comments    ROBOTC.net Suggestions/Comments       NXT Programming: Tips for Beginning with ROBOTC       VEX Programming: Tips for Beginning with ROBOTC    2013 Robotics Summer Of Learning       VEX Toss Up Programming Challenge       FTC Ring It Up! Programming Challenge    International Forums       Spanish Forums          ROBOTC for MINDSTORMS          ROBOTC for VEX       French Forums          ROBOTC pour Mindstorms          ROBOTC pour IFI VEX       Japanese Forums （日本語のフォーラム）       German Forums    2015 Spring Carnival Event    PLTW (Project Lead The Way)    Robotics Merit Badge    2014 Robotics Academy Summer of Learning