Go to Post If you water it and nurture it and fertilize it and put it out in the sunlight, it might just grow up to be a big lathe... :) - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
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 12-01-2011, 21:08
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 494
tomy has a spectacular aura abouttomy has a spectacular aura about
Best way to control the mechanum wheels

So I've heard that it's easier to control the robot with four mechunum wheels with an x-box controller. Is this true? If it is true how do you program that, because I'm our teams programmer?
  #2   Spotlight this post!  
Unread 12-01-2011, 21:16
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: Best way to control the mechanum wheels

First, before touching any code, write down everything on paper. Now I personally have no experience with mechanum drive, but I do have lots of experiences when the robot goes haywire because I used the wrong operation or something silly like that. Always double check before hitting "run".

I would say if the X axis (or what ever you are trying to control the strafing with) is past a certain point then switch to "strafing" mode. Then make the wheels rotate based on the x axis. Its quiet simple IMHO. I assume you would have the same code for the regular 4, 6, 8 wheel drive then tag on the strafing.
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
  #3   Spotlight this post!  
Unread 12-01-2011, 21:22
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 494
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: Best way to control the mechanum wheels

slow down there i forgot to say this our first year with mecanum wheels should we just stick to the basics with the joysticks?
  #4   Spotlight this post!  
Unread 12-01-2011, 21:25
Stephen of REX's Avatar
Stephen of REX Stephen of REX is offline
Registered User
FRC #1727 (REX)
Team Role: College Student
 
Join Date: Dec 2008
Rookie Year: 2006
Location: Cockeysville, Baltimore Co. MD
Posts: 164
Stephen of REX is an unknown quantity at this point
Re: Best way to control the mechanum wheels

You should use a joystick with a twist axis. Forward and back make the robot go forward and back, side to side makes it strafe, and twisting the joystick turns the robot. I have no idea about the programming though, I do mechanical/CAD.
__________________

Go REX!!!
  #5   Spotlight this post!  
Unread 12-01-2011, 21:26
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: Best way to control the mechanum wheels

Quote:
Originally Posted by tomy View Post
slow down there i forgot to say this our first year with mecanum wheels should we just stick to the basics with the joysticks?
No, I say go for it bro. If you do not have the resources to build a prototype, I can make a software simulator for you. It won't be a robot driving on screen, but I can do motors on screen displaying its PWMs. First get the regular 4 wheel drive working with 1 joystick (the xbox controller in this case) then I will assist you with the mechanum drive. From the looks of it, its just the 4 wheel arcade with some extra
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
  #6   Spotlight this post!  
Unread 12-01-2011, 21:28
EricH's Avatar
EricH EricH is offline
New year, new team
FRC #1197 (Torbots)
Team Role: Engineer
 
Join Date: Jan 2005
Rookie Year: 2003
Location: SoCal
Posts: 19,777
EricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond repute
Re: Best way to control the mechanum wheels

Quote:
Originally Posted by tomy View Post
slow down there i forgot to say this our first year with mecanum wheels should we just stick to the basics with the joysticks?
And you're starting during build?

Stick to the joysticks. There's prewritten code around somewhere; you would of course have to find it in your favorite language and tweak it for your robot.

I don't recommend doing mecanum in the six weeks if you haven't done it before; if you do it that way, KISS is a MUST. Start with stuff that's already out there.

David, you're close to right about the method, except that you forgot one thing: 4 independent motors vs 2 pairs of 2 motors. 2 pairs of 2 motors, you can Y-cable. 4 independent, it's a lot harder to Y-cable for some reason. Also use caution: Should you go to fallback (mecanum goes to 4WD rather easily), make sure you comment out the strafing--Alan Anderson of FRC45 found that out the hard way.

You could also do a complete directional program. That might be a bit harder.
__________________
Past teams:
2003-2007: FRC0330 BeachBots
2008: FRC1135 Shmoebotics
2012: FRC4046 Schroedinger's Dragons

"Rockets are tricky..."--Elon Musk

  #7   Spotlight this post!  
Unread 12-01-2011, 21:39
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 494
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: Best way to control the mechanum wheels

My team really wants to do mecanum wheels... Anyone got any sample code for two joysticks+mecanum wheels?
  #8   Spotlight this post!  
Unread 12-01-2011, 23:00
3p1c w1n 3p1c w1n is offline
Registered User
FRC #1529
 
Join Date: Jan 2010
Location: Indianapiolis
Posts: 53
3p1c w1n is an unknown quantity at this point
Re: Best way to control the mechanum wheels

This is my 2nd year programming and last year we had a basic 4 wheel drive. For this year the team has chosen to go with mecanum. I'm using labview. It would be awesome if someone could teach me the programming behind mecanum drive.
__________________
~Team 1529 Cybercards~
  #9   Spotlight this post!  
Unread 12-01-2011, 23:04
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 494
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: Best way to control the mechanum wheels

Im using c++ anyone got any good libraries?
  #10   Spotlight this post!  
Unread 12-01-2011, 23:07
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: Best way to control the mechanum wheels

Quote:
Originally Posted by tomy View Post
Im using c++ anyone got any good libraries?
The only library allowed is the WPILib.
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
  #11   Spotlight this post!  
Unread 13-01-2011, 02:00
EricH's Avatar
EricH EricH is offline
New year, new team
FRC #1197 (Torbots)
Team Role: Engineer
 
Join Date: Jan 2005
Rookie Year: 2003
Location: SoCal
Posts: 19,777
EricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond repute
Re: Best way to control the mechanum wheels

Quote:
Originally Posted by davidthefat View Post
The only library allowed is the WPILib.
Show me the rule, because I can't find that one in the Game Manual Section 4.

In 2008, I know I found a link to some "canned" mecanum code lying around CD. However, the programming language that year was C, so it wouldn't work this year without modification. I might be able to find it again... but it would take a while.
__________________
Past teams:
2003-2007: FRC0330 BeachBots
2008: FRC1135 Shmoebotics
2012: FRC4046 Schroedinger's Dragons

"Rockets are tricky..."--Elon Musk

  #12   Spotlight this post!  
Unread 13-01-2011, 04:35
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,125
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
Re: Best way to control the mechanum wheels

http://runnymede-robotics.googlecode..._Team_1310_V2/

http://www.youtube.com/user/1310Robo.../0/7mBxVPvyYwQ
__________________
In life, what you give, you keep. What you fail to give, you lose forever...
  #13   Spotlight this post!  
Unread 13-01-2011, 08:17
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: Best way to control the mechanum wheels

tomy,
For C++ (LV, & Java also) WPILib provides a couple Mecanum drive methods in the RobotDrive Class. I recommend you start out with MecanumDrive_Cartesian() function. Documentation of this function (generated using Doxygen on comments in WPILib) is provided online by Dustin Spicuzza of Team 2423 is here. It hasn't been updated since last Feb 5th but I dont expect any changes since then.

I don't know enough about how the left and right thumbsticks for the Xbox controller are mapped to axises in WPILib to give you a specific call. However, my suggestion is if you have a driver with experience on an Arcade Drive (single joystick for 4wd or 6wd) then use one thumbstick for y and rotation parameters in MecanumDrive_Cartesian() and the x-axis of another thumbstick for x. With this configuration, the driver can use one thumbstick to drive like the arcade drive (that they are experienced with) and add strafing with the other thumbstick. If you do not have experienced driver then decide which thumbstick mapping you think is best.

I encourage you to develop advanced features like the ones in Team 1310's code above once you are comfortable with Mecanum. The MecanumDrive_Cartesian() should be all you need to protoype the Mecanum and start training drivers. If you need any help initializing the RobotDrive with your 4 motors or anything else, just ask and I am sure someone on this forum will help ASAP

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 : 13-01-2011 at 08:20.
  #14   Spotlight this post!  
Unread 13-01-2011, 13:40
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Best way to control the mechanum wheels

Quote:
Originally Posted by davidthefat View Post
The only library allowed is the WPILib.
I'm not aware of that restriction. Where did you find it?
  #15   Spotlight this post!  
Unread 13-01-2011, 19:26
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: Best way to control the mechanum wheels

Quote:
Originally Posted by EricH View Post
Show me the rule, because I can't find that one in the Game Manual Section 4.

In 2008, I know I found a link to some "canned" mecanum code lying around CD. However, the programming language that year was C, so it wouldn't work this year without modification. I might be able to find it again... but it would take a while.
Quote:
Originally Posted by Alan Anderson View Post
I'm not aware of that restriction. Where did you find it?
I thought wrong then. So ,in the off season, technically I can spend my time writing my own library that would directly communicate with the FPGA or even modifying the FPGA to run my own library?
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
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


All times are GMT -5. The time now is 13:09.

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