Mecanum Trouble

Our team is trying mecanum this year with four Talon SRXs and CAN, however we’ve been having troubles with the motors not behaving as expected, we are aware that the code from NI is not correct, but we’ve tried various configurations, and nothing has worked, we’ve ensured our SRXs are ID-ed properly yet still the code refuses to work, forward/backward, and rotate will work fine but strafing fail, or strafing and rotate work but forward/backward fail, all help is appreciated,
-Jack

Run this test and post your results here.

Also, tilt your bot on its side and take a picture of the bottom showing all 4 wheels. Post the picture here.

Update: we achieved strafing and forward/backward, but rotation is not working, the front motors run forwards and the back backwards, or vice-versa based on direction of rotation, so that all motors are pulling outward and are fighting each other, the wheels are arranged in the proper X-formation, we arranged our input values and everything else is functioning properly, here is the code we used that fixed the problem: http://pho.to/8fJab from this thread: http://www.chiefdelphi.com/forums/showthread.php?t=132800&highlight=mechanum
We also used this link to setup or rotation values: http://www.pobots.com/files/8213/5726/0394/mecanum.pdf
Again, all help is appreciated,
-Jack

As viewed from the top of the bot, or from below? (They won’t be the same).

we achieved strafing and forward/backward, but rotation is not working… Again, all help is appreciated

Do this:

The wheels are arranged in the proper X as viewed from the top of the bot, as I believe they should be. Right now, sending a pure forward, backward, left, or right signal has the bot going in the right direction. The rotate, however, has all of the wheels going outward from each other (the two front go forward while the two back go backward) or all inward (front go backward, back go forward).

Which rotate command direction (clockwise or counterclockwise) corresponds to which behavior (all outward or all inward)?

The above advice is incorrect.

From the top, rollers should look like X.
From the bottom, rollers should look like diamond.

You got me there… My interpretation of “X from the top” is different than others apparently. After looking at the linked PDF, based on the description the wheels are in the correct orientation.

My apologies… Carry on…

(I often describe it to the team as diamond from the top because the rollers face each other in a diamond shape. Guess I should tell them differently. Never thought to look at the way the rollers relate to each other…)

If a rotate clockwise command causes all the wheels to run outward you need to swap the FrontRight and BackLeft motor commands.

If a rotate clockwise command causes all the wheels to run inward you need to swap the FrontLeft and BackRight motor comands.

Others here can advise you how to do that in the software, or you can swap the appropriate motor wires.

Outward or inward is a bit confusing, try looking directly at the wheels from the outside of the robot, while the robot is elevated and not touching the floor. If you crank the joystick clockwise, all of the wheels should appear to turn counter-clockwise, when viewed from the outside. Take note of the ones that are going clockwise.

Go into begin.vi, and right-click on the terminal on the left side of the 4-motor drive open vi, that matches the inversion for the motors which spin clockwise. Click on the new boolean constant to turn it from false to true. Do this for all motors that are turning the wrong way.

If you have trouble finding the motor inversion terminals (which likely are unconnected), use Control-H to bring up the context-sensitive help, and mouse over the drive open vi.

All of this assumes that your motors are called in the correct position. In most cases, you will likely have to invert two of the four motors.

He defined exactly what he meant by those terms in his earlier post:

… but he didn’t clearly specify which rotate command (clockwise or counterclockwise) was causing which wheel motion (“outward” or “inward”).

If he does what you recommended above, it will fix the rotate problem, but break the forward/reverse and strafe right/left motions which are presently working correctly.

What he needs to do is swap the FrontRight and BackLeft motor commands (if the rotate clockwise command is causing the wheels to turn “outward”) or swap the FrontLeft and BackRight motor commands (if the rotate clockwise command is causing the wheels to turn “inward”).

All of this assumes that your motors are called in the correct position.
They are not. That’s the problem.

The attached chart shows the situation if OP meant to say that a rotate clockwise command
caused the front wheels to rotate forward and the back wheels to rotate backward.

  • Green means wheel rotation forward
  • Red means wheel rotation backward
  • Columns B D F H J L show what it should
    be - Columns labeled “?” show what it is actually
    doing (per OP’s testing)

As you can see, swapping the FrontRight and BackLeft motor commands will correct the problem:

Just for some clarification, when you say swap the Front Right and Back Left motors, do you mean within the HolonomicDrive.vi, or is there a place within the teleop.vi to do that? Our Build session starts in about half an hour, so we can tell how well it worked then.

Just to be clear, I said swap the motor commands, not the motors. This can be accomplished in software, or in hardware by swapping the motor wires (while leaving the motors themselves unmoved). Swapping the physical motors themselves would serve no purpose here.

do you mean within the HolonomicDrive.vi, or is there a place within the teleop.vi to do that? Our Build session starts in about half an hour, so we can tell how well it worked then.

I don’t do LabVIEW. Do whatever you have to do so that the motor commands are swapped. What that means is this:

  • the command that presently is going to the FrontRight motor should be sent instead to the BackLeft motor, and*
  • the command that presently is going to the BackLeft motor should be sent instead to the FrontRight motor

I think that can be accomplished in the Begin vi, wherever you assign the CAN addresses for the 4 motor locations. If there are any LabVIEW gurus reading, please chime in here.

PS: you never did answer this post. It’s important; it determines which motor commands should be swapped.

Swap them in Begin, making the inputs to the Open 4 Motor Drive match the actual motors on the robot.

Sending the robot a clockwise signal makes all of the wheels turn inward towards each other. When we made the change for the motor commands all it did was changed the strafing to the all in/out command and changed what we wanted the rotation to be to strafing.

Here’s a screenshot of our code, just to reiterate, this is the code that has forward, backward, and strafing correct but has a problem with rotating. When we try to rotate clockwise the robots wheels all run inward (meaning, the two front wheel go backward and the two back wheels go forward) and when we try to rotate counterclockwise the wheels go outward (the two front go forward and the two back go backward).

Begin

](http://s278.photobucket.com/user/DawgThePorcupine/media/ScreenshotBegin_zpsf197473d_1.png.html)http://i278.photobucket.com/albums/kk84/DawgThePorcupine/ScreenshotBegin_zpsf197473d_1.png

Holonomic

](http://s278.photobucket.com/user/DawgThePorcupine/media/ScreenshotMecanum_zps1bc5647b_1.png.html)http://i278.photobucket.com/albums/kk84/DawgThePorcupine/ScreenshotMecanum_zps1bc5647b_1.png

Teleop

](http://s278.photobucket.com/user/DawgThePorcupine/media/ScreenshotTeleop_zpsaf308811_1.png.html)http://i278.photobucket.com/albums/kk84/DawgThePorcupine/ScreenshotTeleop_zpsaf308811_1.png

**If that’s the case, the change you should have made, according to previous posts, is to swap the FrontLeft and BackRight motor commands. Is that what you did?

If not, undo what you did and make the correct change.**

What change did you make?

Looks like the change was not done properly.

Please post LabVIEW png snippet of before & after code.