![]() |
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?
|
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. |
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 |
Re: Mecanum steering
We did this in 2011, I'll ask our head programmer from that year to reply in this thread.
|
Re: Mecanum steering
See the MecanumDrive_Cartesian() function in the RobotDrive class:
Code:
void RobotDrive::MecanumDrive_Cartesian(float x,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. |
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? |
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 |
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
|
Re: Mecanum steering
Quote:
Quote:
|
Re: Mecanum steering
Quote:
|
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. |
Re: Mecanum steering
Quote:
|
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.
|
Re: Mecanum steering
Quote:
|
Re: Mecanum steering
Quote:
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. |
Re: Mecanum steering
I forgot to answer your other questions!
Quote:
Quote:
|
Re: Mecanum steering
Quote:
Quote:
The WPILib RoboDrive methods have an input for gyro angle. Code:
/** |
Re: Mecanum steering
Quote:
To anyone, how does the gyro temp feedback work in the code? (I don't usually get into the programming so you should talk to me like I'm 6) I'm poking through the java API and didn't notice temp anywhere in the gyro class. Since the temp is obviously going to a different channel than the gyro, it seems i would need to also set temp up as a separate sensor, but that too i didn't see in the sensorbase class. ?? Also to add 2 cents on the general mecanum talk: We've used mecanum since 2011 and never seen the "forward command equals horrible spin result" described all the time on CD. This is without gyro or encoder feedback. We have never been accused of having really fantastically designed and constructed drivetrains and have never given much (or any) time to weight distribution. This year a test drivebase was made which exhibited something kinda like the "forward command equals spin", but it was very minor and the driver was able to compensate for it without much trouble. Just looking at it everyone figured the problem was the fact that the electronics board thrown on top had the battery cantilevered outside of the frame. At this point the battery had to be 25-50% of the total weight. :eek: THEN it was discovered that the 8020 frame was assembled incorrectly causing the frame to be warped. :eek: :eek: The combination of the 2 had one wheel taking almost none of weight. And still the driving behavior was not that bad. This leads me to the hypothesis that "forward command equals horrible spin result" behavior reported frequently is almost always caused by incorrect use or poor functionality of the gyro... |
Re: Mecanum steering
No, no additional information. Our driver is nails without it, and we don't need it for autonomous, so it's something we plan on investigating further in the off season.
|
| All times are GMT -5. The time now is 22:50. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi