Mecanum drive question

We have setup the default mecanum cartesian drive and we are not getting the expected results.

All directions commanded work properly except left and right.

When we move the joystick to the left the robot rotates instead of sliding and the same applies to the joystick move to the right.

Also we had to reverse polarity on the right front and right rear motor wires to get forward and backwards to be correct.

Any help?

This is the first test I do every time I set up a new Mecanum system:

Put the robot on blocks so that the wheel can spin freely.

Command the robot to drive forward, all wheels should move forward in the same direction. Just as you would expect from tank drive.

Command the robot to rotate clockwise. the wheels on one side of the robot will rotate in the opposite direction of the other side. Again, just as you would expect from tank drive.

Command the robot to strafe. You should see the wheels on diagonals rotating in the same direction, and opposite of the other diagonal. That is the front left and rear right should rotate the same direction, and the front right and rear left should be rotating the same direction, but opposite of the other two.

Once this is working you can put it on the floor and it should drive correctly. If any of the joystick directions are backwards, invert them in your program.

Are you using the built in wpi implementation for Mecanum drive or did you write your own code?

Do you have your wheels installed in the correct locations? If you look at the top of each wheel, the axle for each roller should point in toward the robot.

With mecanum, it will not drive very straight without a gyroscope sensor. So you will need to constantly l provide a little rotation as you drive to keep the robot facing a particular direction. It’s not hard but does take a little practice. :wink:

Inverting the right side motors is typical.

Look closely at the order of motors when you create your RobotDrive. Make sure they match your actual robot: front left, rear left, front right, rear right. You might have swapped the rear left and front right.