Go to Post FIRST is not about winning awards, it's about learning and advancing the human culture - crispyc [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 03-03-2013, 00:51
mrklempae mrklempae is offline
Registered User
no team
 
Join Date: Jan 2013
Location: Montana
Posts: 19
mrklempae is an unknown quantity at this point
Mecanum steering

Hello! Our team has been using tank drive for the last three years or so, but next year we'll hopefully be switching to Mecanum wheels. I was wondering if it is possible to program a robot so that one joystick controls forward/backward/strafeleft/straferight and another joystick controls rotation. I've looked at the classes provided (we're programming in C++), and I'm not sure what to think of them. I'm pretty sure we'll need to implement the gyro. Can this be done?
  #2   Spotlight this post!  
Unread 03-03-2013, 00:59
MARS_James's Avatar
MARS_James MARS_James is offline
Always Scouting
AKA: James Comstock
FRC #0179 (The Children of The Swamp)
Team Role: Tactician
 
Join Date: Jan 2010
Rookie Year: 2006
Location: Jupiter, Florida
Posts: 1,968
MARS_James has a reputation beyond reputeMARS_James has a reputation beyond reputeMARS_James has a reputation beyond reputeMARS_James has a reputation beyond reputeMARS_James has a reputation beyond reputeMARS_James has a reputation beyond reputeMARS_James has a reputation beyond reputeMARS_James has a reputation beyond reputeMARS_James has a reputation beyond reputeMARS_James has a reputation beyond reputeMARS_James has a reputation beyond repute
Send a message via AIM to MARS_James
Re: Mecanum steering

Hopefully I can help you out by giving a simple answer yes it is possible in fact that is exactly how we controlled out robot in 2011 with mecanums. And you don't need a gyro (though you can if you want)

Now time for what I say every time this comes up on Delphi. I am a huge supporter of nontraditional drive systems (not tankdrive), and am glad that I was able to work with them as a student and continue to work with them as a mentor and in my place of work that being said here are somethings to really think about before making the switch to mecanum.

1. Do you want to regulate 4 CIMS to drive the wheels?
This year with the increase to 6 CIMS, and the addition of the MiniCIMS it was not an issue but if this changes it can mean limits in your designs.

2. Do you have the programming support to handle the switch?
Unfortunately this is sometimes over looked but it takes a lot of fine tuning on the programming side to make a great mecanum drive, without it they can be a nightmare.

3. Is your robot better at the game for having mecanums?
This may seem weird coming from a member of a team who is on its third straight year using the wheels but not all games is it a good idea to use mecanums or all strategies. This year if your robot was designed as a 30 point climber who played defense for most of the match you wouldn't want mecanums you would want the power from a tank drive. Another example of previous games where mecanum drives would not have made your robot better would be 2005 or 2002 where the field was either impeded by a lot of obstacles or where pushing power was the real game changer.

What i am trying to get at is the part of your post where you say next year you are switching, don't assume that till you see next years game.
__________________
Driving Record: 24-8
Coaching Record: 66-31
2014 South Florida Regional Woodie Flowers Finalist



Last edited by MARS_James : 03-03-2013 at 01:08. Reason: not ready to post
  #3   Spotlight this post!  
Unread 03-03-2013, 02:17
BigJ BigJ is offline
Registered User
AKA: Josh P.
FRC #1675 (Ultimate Protection Squad)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Milwaukee, WI
Posts: 947
BigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond repute
Re: Mecanum steering

It's definitely possible. Your direction and magnitude come from one stick, and the rotation comes from the other.

I'd like to remind people stumbling in here that this is the Programming subforum and not an appropriate place to start a mecanum debate
  #4   Spotlight this post!  
Unread 03-03-2013, 03:09
jblay's Avatar
jblay jblay is offline
Here comes StuyPulse
AKA: Joe Blay
FRC #0694 (StuyPulse)
Team Role: Coach
 
Join Date: Feb 2008
Rookie Year: 2006
Location: New York, NY
Posts: 984
jblay has a reputation beyond reputejblay has a reputation beyond reputejblay has a reputation beyond reputejblay has a reputation beyond reputejblay has a reputation beyond reputejblay has a reputation beyond reputejblay has a reputation beyond reputejblay has a reputation beyond reputejblay has a reputation beyond reputejblay has a reputation beyond reputejblay has a reputation beyond repute
Re: Mecanum steering

We did this in 2011, I'll ask our head programmer from that year to reply in this thread.
__________________
It's pronounced StighPulse like HighPulse
2016 Curie Champions
2016 New York City Champions
2016 New York City Engineering Inspiration
2015 New York City Finalists
2013 New York City Champions
2012 Connecticut Chairman's
2011 Connecticut Chairman's
2010 Connecticut Chairman's

2010 New York City Champions
2008 New York City Engineering Inspiration
2007 New York City Finalists
2006 New York City Finalists
2005 New York City Chairman's
2003 New York City Champions
2002 New York City Engineering Inspiration
2001 New York City Finalists
  #5   Spotlight this post!  
Unread 03-03-2013, 10:21
carrillo694's Avatar
carrillo694 carrillo694 is offline
Alex Carrillo
FRC #0694 (Stuypulse)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2009
Location: New York, NY
Posts: 66
carrillo694 is a jewel in the roughcarrillo694 is a jewel in the roughcarrillo694 is a jewel in the roughcarrillo694 is a jewel in the rough
Re: Mecanum steering

See the MecanumDrive_Cartesian() function in the RobotDrive class:

Code:
void RobotDrive::MecanumDrive_Cartesian(float x,
float 	y,
float 	rotation,
float 	gyroAngle = 0.0 
)
Pass in the X and Y coordinates of one stick, and pass the X coordinate of another stick to serve as the "rotation" rate, and then finally pass in an angle from the gyro to the `gyroAngle` field to rotate your cartesian x/y inputs relative to your robot's orientation. That way, pushing "forward" on your x/y joystick will always translate to the direction that your robot absolutely considers true 0 degrees based on your gyro feedback, no matter which direction the robot is actually facing.

You will only need to use the gyro if you want your controls to be "field-oriented," such that pushing forward on your joystick means the robot always heads directly away from you, no matter which way it is pointing. If you want it to be "robot-oriented," such that forward on the joystick always means the robot travels in the direction that its front face is pointing, just pass a 0 to the `gyroAngle` field of the function.

Last edited by carrillo694 : 03-03-2013 at 10:23. Reason: Clarified whether or not a gyro is needed.
  #6   Spotlight this post!  
Unread 03-03-2013, 10:27
pfreivald's Avatar
pfreivald pfreivald is offline
Registered User
AKA: Patrick Freivald
FRC #1551 (The Grapes of Wrath)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2001
Location: Naples, NY
Posts: 2,304
pfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond repute
Re: Mecanum steering

We've used mecanum (and then octocanum) for quite a few years now, but this was the first year we decided to add the gyro and try to do some fancy things...

And we got a lot of drift on the gyro, so we ended up disabling it. Any ideas on how to prevent this?
__________________
Patrick Freivald -- Mentor
Team 1551
"The Grapes of Wrath"
Bausch & Lomb, PTC Corporation, and Naples High School

I write books, too!
  #7   Spotlight this post!  
Unread 03-03-2013, 20:07
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,756
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Mecanum steering

How much drift? Can you quantify it in degrees/time?

Please give specifics on the gyro, how it is mounted, how it is used in the code, how the robot moves, and when the error accumulates.

Greg McKaskle
  #8   Spotlight this post!  
Unread 03-03-2013, 20:30
jbsmithtx's Avatar
jbsmithtx jbsmithtx is offline
FIRST Fanatic
AKA: Josh Smith
FRC #4206 (RoboVikes)
Team Role: Engineer
 
Join Date: Aug 2012
Rookie Year: 2012
Location: Fort Worth, TX
Posts: 91
jbsmithtx is a jewel in the roughjbsmithtx is a jewel in the roughjbsmithtx is a jewel in the rough
Re: Mecanum steering

Our team began using mecanum this year. We found it impossible to use without a gyro. Nearly every time we drove, it careened in an arc. Adding a gyro fixed all problems. And with the rotation aspect, we set a constant value to rotate at with the top left and right buttons on the joystick (about 50%) and it worked like a charm
  #9   Spotlight this post!  
Unread 04-03-2013, 07:12
pfreivald's Avatar
pfreivald pfreivald is offline
Registered User
AKA: Patrick Freivald
FRC #1551 (The Grapes of Wrath)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2001
Location: Naples, NY
Posts: 2,304
pfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond repute
Re: Mecanum steering

Quote:
Originally Posted by Greg McKaskle View Post
How much drift? Can you quantify it in degrees/time?
It was negligible throughout the build season and practice day, but went wonky during our first qualification match, with a drift pushing 5-10 degrees per second, easy.

Quote:
Originally Posted by Greg McKaskle View Post
Please give specifics on the gyro, how it is mounted, how it is used in the code, how the robot moves, and when the error accumulates.
Kit gyro, mounted to the frame (isolated, of course) near the CM, and we can watch the error accumulate by printing the values even when we strip all gyro-related everything from the code (besides getting the value we're printing, of course) and have the robot up on blocks so that it can't turn.
__________________
Patrick Freivald -- Mentor
Team 1551
"The Grapes of Wrath"
Bausch & Lomb, PTC Corporation, and Naples High School

I write books, too!
  #10   Spotlight this post!  
Unread 04-03-2013, 08:26
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,113
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: Mecanum steering

Quote:
Originally Posted by pfreivald View Post
It was negligible throughout the build season and practice day, but went wonky during our first qualification match, with a drift pushing 5-10 degrees per second, easy.

Kit gyro, mounted to the frame (isolated, of course) near the CM, and we can watch the error accumulate by printing the values even when we strip all gyro-related everything from the code (besides getting the value we're printing, of course) and have the robot up on blocks so that it can't turn.
I'm sure you checked for broken wires, but that sort of "drift" is one symptom of the gyro not actually providing a voltage to be measured. That can happen if the gyro output isn't connected to the analog input, or if the gyro isn't getting power.
  #11   Spotlight this post!  
Unread 04-03-2013, 09:02
jvriezen jvriezen is offline
Registered User
FRC #3184 (Burnsville Blaze)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Burnsville, MN
Posts: 643
jvriezen has a reputation beyond reputejvriezen has a reputation beyond reputejvriezen has a reputation beyond reputejvriezen has a reputation beyond reputejvriezen has a reputation beyond reputejvriezen has a reputation beyond reputejvriezen has a reputation beyond reputejvriezen has a reputation beyond reputejvriezen has a reputation beyond reputejvriezen has a reputation beyond reputejvriezen has a reputation beyond repute
Re: Mecanum steering

We controlled our mecanums in 2011 and 2012 with a single joystick. It has to have the extra degree of freedom (twist) in addition to the normal x/y capability. I think it was the Attack 3D joy stick.

We also used a gyro in 2011. To deal with gyro drift, we had a gyro reset button and a gyro disable button. To reset, you spun the bot until it faces what ought to be 0 degrees, and the press the button. I think we had to reset once or twice per match...

Not sure why we didn't have a gyro in 2012, but depending upon driver, it was often disable in 2011 base on driver preference.
__________________
John Vriezen
FRC, Mentor, Inspector #3184 2016- #4859 2015, #2530 2010-2014 FTC Mentor, Inspector #7152 2013-14
  #12   Spotlight this post!  
Unread 04-03-2013, 17:43
pfreivald's Avatar
pfreivald pfreivald is offline
Registered User
AKA: Patrick Freivald
FRC #1551 (The Grapes of Wrath)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2001
Location: Naples, NY
Posts: 2,304
pfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond repute
Re: Mecanum steering

Quote:
Originally Posted by Alan Anderson View Post
I'm sure you checked for broken wires, but that sort of "drift" is one symptom of the gyro not actually providing a voltage to be measured. That can happen if the gyro output isn't connected to the analog input, or if the gyro isn't getting power.
Right. We checked for that, and the powered gyro was drifting at that speed.
__________________
Patrick Freivald -- Mentor
Team 1551
"The Grapes of Wrath"
Bausch & Lomb, PTC Corporation, and Naples High School

I write books, too!
  #13   Spotlight this post!  
Unread 06-03-2013, 13:45
mrklempae mrklempae is offline
Registered User
no team
 
Join Date: Jan 2013
Location: Montana
Posts: 19
mrklempae is an unknown quantity at this point
Re: Mecanum steering

So it's really that easy to drive like that? I assume that you must need encoders to ensure that the motors are spinning at exactly the same speed. How would that be done? How about field-centric steering? Is that particularly difficult to program? Like I said, we don't exactly have any Mecanum wheels to test out with (yet), so this is purely for the sake of learning.
  #14   Spotlight this post!  
Unread 06-03-2013, 15:12
pfreivald's Avatar
pfreivald pfreivald is offline
Registered User
AKA: Patrick Freivald
FRC #1551 (The Grapes of Wrath)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2001
Location: Naples, NY
Posts: 2,304
pfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond repute
Re: Mecanum steering

Quote:
Originally Posted by mrklempae View Post
So it's really that easy to drive like that?
Yes, it's really easy to drive like that. One of the nice things about mecanum driving is that your robot is controlled just like a first-person shooter! This is the first year we've ever used encoders on our drive, and we only have one on a single wheel...
__________________
Patrick Freivald -- Mentor
Team 1551
"The Grapes of Wrath"
Bausch & Lomb, PTC Corporation, and Naples High School

I write books, too!
  #15   Spotlight this post!  
Unread 06-03-2013, 15:25
carrillo694's Avatar
carrillo694 carrillo694 is offline
Alex Carrillo
FRC #0694 (Stuypulse)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2009
Location: New York, NY
Posts: 66
carrillo694 is a jewel in the roughcarrillo694 is a jewel in the roughcarrillo694 is a jewel in the roughcarrillo694 is a jewel in the rough
Re: Mecanum steering

Quote:
Originally Posted by mrklempae View Post
So it's really that easy to drive like that? I assume that you must need encoders to ensure that the motors are spinning at exactly the same speed. How would that be done? How about field-centric steering? Is that particularly difficult to program? Like I said, we don't exactly have any Mecanum wheels to test out with (yet), so this is purely for the sake of learning.
In 2011 we experimented with speed-controlled mecanum wheels. If you can devise a method to tune your wheel speed feedback loop perfectly, then you will probably see better performance than with open-loop voltage control. We also found it necessary to introduce weight gain constants for each wheel, because the weight distribution of our robot affected mecanum control.

Our team's retrospective analysis of mecanum performance in 2011 is unfortunately more qualitative than it is quantitative -- which is to say some of us would say that there was a noticeable improvement in control, whereas others would say that both our tuned and un-tuned mecanum control was relatively imperfect, perhaps because we did not tune well enough.
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 03:30.

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