Chief Delphi

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

mrklempae 03-03-2013 00:51

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?

MARS_James 03-03-2013 00:59

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.

BigJ 03-03-2013 02:17

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

jblay 03-03-2013 03:09

Re: Mecanum steering
 
We did this in 2011, I'll ask our head programmer from that year to reply in this thread.

carrillo694 03-03-2013 10:21

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.

pfreivald 03-03-2013 10:27

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?

Greg McKaskle 03-03-2013 20:07

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

jbsmithtx 03-03-2013 20:30

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

pfreivald 04-03-2013 07:12

Re: Mecanum steering
 
Quote:

Originally Posted by Greg McKaskle (Post 1243049)
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 (Post 1243049)
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.

Alan Anderson 04-03-2013 08:26

Re: Mecanum steering
 
Quote:

Originally Posted by pfreivald (Post 1243269)
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.

jvriezen 04-03-2013 09:02

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.

pfreivald 04-03-2013 17:43

Re: Mecanum steering
 
Quote:

Originally Posted by Alan Anderson (Post 1243281)
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.

mrklempae 06-03-2013 13:45

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.

pfreivald 06-03-2013 15:12

Re: Mecanum steering
 
Quote:

Originally Posted by mrklempae (Post 1244501)
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...

carrillo694 06-03-2013 15:25

Re: Mecanum steering
 
Quote:

Originally Posted by mrklempae (Post 1244501)
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.


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

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