View Full Version : Mecanum Question about strafing.
SeafordVikingR
07-02-2014, 18:06
Our robot has mecanum wheels and can go forward, back and turn perfectly fine. When we try to get the robot to strafe it only seems to turn with a wider radius. Is there a way for cleaner strafing? Is it a mechanical issue or is it a problem with programming? We think it may be because the wheels aren't all turning in sync with each other, but we'd like some confirmation. Thank in advance.
When strafing one side (left/right) will have wheels rotating toward each other, and the other side will have the wheels rotating away from each other.
If this is happening, and you're still not strafing, check that the wheels are in the right spots, and that the rollers are free spinning.
RobotDoktor
07-02-2014, 18:33
The wheels are in the correct X formation right?
TheBassett
07-02-2014, 18:37
Well make sure the rollers on the wheels form an "X" in the center(Front right and Back left rollers should make an invisible line with each other and FL/BR should also line up. Ex: http://robosavvy.com/store/images/nexusrobot/10009_03.jpg). We had some really weird things happen, that sounds similar to what you have, when one wheel was put on backwards.
Hope this helps!
wireties
07-02-2014, 18:38
You also need pretty good weight distribution (equal weight over all 4 wheels) and good control over the RPMs of each wheel. We always used encoders on each wheel. Plus your frame has to very level with all 4 wheels making contact, some teams even have their mecanum wheels on a simple spring suspension.
xXhunter47Xx
07-02-2014, 20:06
If you're not using a gyro and/or encoders, it will not strafe correctly. The gyro will help rule out any unwanted rotation and the encoder will help speed control. We're using Mecanum and we've been experiencing the same problem until the gyro is on.
SeafordVikingR
07-02-2014, 20:07
Yes, the wheels are in the "X" formation. What happens is, it strafes but as if it's on a curve rather than strafing straight left and right.
TheBassett
07-02-2014, 20:19
How are you guys driving your robot? We used tank drive when we had mecanum wheels(both Vex Pro and Andymark) and had no problem strafing with it, even before we put any regulating code on it. We haven't really tried anything but tank when we were using mecanum so maybe that's the difference?
Also, if you are using Andymark wheels try making sure each roller spins freely, occasionally those rods got bent on ours and it would stop or slow down one of the rollers from spinning and also make the robot do strange things.
SeafordVikingR
07-02-2014, 21:12
At the moment, we have the controls on one joystick, but we may move onto tank drive too. Though, I read what hunter said about the gyro and maybe that's it? We have a gyro, but I wasn't sure if we needed to use it.
orangemoore
07-02-2014, 21:25
At the moment, we have the controls on one joystick, but we may move onto tank drive too. Though, I read what hunter said about the gyro and maybe that's it? We have a gyro, but I wasn't sure if we needed to use it.
Are you using encoders at all? If not it is hard to control you robot really well.
Tyler2517
07-02-2014, 22:06
I would be that your frame is either to ridged and all 4 wheels are not getting the same amount of traction, or your weigh is not distributed correctly leaving uneven traction.
Depending on how your algorithms (i am not a programmer all i know is that we wright our own C++ code for it) work can you manually compensate (ie try turning when you rotate). Or implement PID on each of the wheels we have has success with both methods and depending on the driver we have enabled our PID or disabled it.
I can say in general in my experience you don't need gyro, encoders, or precision weight distribution to get a good strafe.
posting a quick video showing these things below will greatly increase your chances of getting some help, because we are all making a lot of assumptions in trying to guess your problem.
1) show your best and worst spinning rollers
2) show wheel rotations during strafe (as magnets mentioned). you can also put the bot on blocks to show this.
3) a clear shot to show the path the robot goes in when commanded to strafe
Also, the "O" vs "X" configuration wouldn't affect your ability to strafe, it would just go in the opposite direction. a worm's eye view X configuration would make it hard to rotate the bot.
xXhunter47Xx
07-02-2014, 22:29
That's how we sort of solved our problem. It still does the curve thing but a lot less, it only curves at slow turtle speeds. We're currently implementing PID with Encoders so we can make it do that even less.
wireties
07-02-2014, 22:34
Yes, the wheels are in the "X" formation. What happens is, it strafes but as if it's on a curve rather than strafing straight left and right.
Your motors and/or transmissions are not producing exactly the same wheel speed and/or your weight is not properly distributed. This is expected. If it strafed perfectly you would be lucky. You need encoders for each wheel or need to characterize the performance of each motor/transmission/wheel and account for this in your code. I'm not sure how a gyro would help you - that would be a tricky algorithm.
HTH
xXhunter47Xx
07-02-2014, 22:43
Well we coded in labview so that might have been the reason why it was so easy for us. You are right though wireties, from messing with mecanum since day 1 of build season we realized that strafing perfectly is not a thing. We can get very close but it wouldn't work.
wireties
07-02-2014, 23:06
Well we coded in labview so that might have been the reason why it was so easy for us. You are right though wireties, from messing with mecanum since day 1 of build season we realized that strafing perfectly is not a thing. We can get very close but it wouldn't work.
Yeah, most people miss the fact that the OEM says the CIM motor curves can be +/- 10% (at least at the free speed point).
SeafordVikingR
10-02-2014, 16:32
Thank you all for the responses. We did attempt to play with the gyro, but with no success. However! We realized that the wheels weren't moving in the right direction when they were strafing. What we had were the 2 front wheels moving in the same direction and and the 2 back wheels moving in the opposite direction. What we really needed were the opposite wheels, top left & bottom right, to be moving in the same direction. So when we figured that out all we did was switch the pwms in labview and now it strafes beautifully!
Thank you all for the responses. We did attempt to play with the gyro, but with no success. However! We realized that the wheels weren't moving in the right direction when they were strafing. What we had were the 2 front wheels moving in the same direction and and the 2 back wheels moving in the opposite direction. What we really needed were the opposite wheels, top left & bottom right, to be moving in the same direction. So when we figured that out all we did was switch the pwms in labview and now it strafes beautifully!
Just curious, did you have the wheels incorrectly selected in the code? (For example, Front right and Back right were swapped in the code)
SeafordVikingR
13-02-2014, 19:39
See the thing is, the defaulted mecanum code had each motor set to a pwm already, but that's also where the problem was for us. A simple switch of the pwms in the code fixed it up nicely, though.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.