Mecanum wheel twist issues.

This year we are working with a mecanum drive system. We have everything working peachy but the twist. When we twist the joystick, the robot moves in a completely random pattern. Forward, backward, and strafe are all fine.

To handle the operations we are using the Cartesian mecanum drive. For the twist we tried using

stick.GetTwist()

and

stick.GetZ()

Using the GetTwist caused the robot to spaz out upon enabling. Using the GetZ seemed to be working but when twisting the robot acted like it was fighting against itself. At first I thought it may be interference from other joystick values, but I also called the mecanum Cartesian drive with no input besides a 1 for twist, which caused the same spastic behavior as using GetTwist.

Do you guys have any idea what the problem may be? At this point, we think it may be a mechanical issue.

Gently tip the bot up on its side and take a picture of the bottom showing all 4 wheels and post it here.

Then put the bot on blocks (all 4 wheels off the floor) and give it a twist (rotate) command, tell us what direction each of the wheels is spinning.

What model joystick are you using?

Here is a picture of the underside of the bot:


Please excuse the sub par wiring job. We’re still working on cleaning that up.

When twisting the joystick to the left, the front and back wheels turn away from each other. The front go forward and the back go backward. When twisting the joystick right, that is reversed, with the front going back and the back going forward.

As for the joystick, we are using a Logitech extreme 3D pro.





All four wheels appear to be mounted in the correct configuration.

When twisting the joystick to the left, the front and back wheels turn away from each other. The front go forward and the back go backward. When twisting the joystick right, that is reversed, with the front going back and the back going forward.

That would explain why you are not rotating.

To rotate clockwise, the left wheels should be going forward and the right wheels backward. Vice-versa for turning counter-clockwise.

So could this possibly be an issue with the ports the motor controllers are plugged into?

A sample code maybe helpful.

At this point, I would say it appears to be either a wiring error or a code error. I bet if you post your code and focused pictures of how you have the motors wired you’ll get more detailed help.

Right now the only portion of code that has anything to do with the driving looks like this:

myRobot.MecanumDrive_Cartesian(stick.GetX(), stick.GetY(), stick.GetZ());

stick being the joystick and myRobot being the robot drive.

The ports are initialized as so:

myRobot(1,2,3,4),
stick(1)

The wiring is as follows:
Front left motor- Port 1
Front right motor- Port 2
Back left motor- Port 3
Back right motor- Port 4

EDIT:
I forgot as a side note, the MecanumDrive_Cartesian calls for input from a gyro at the end. That has not been included yet as we are working on getting our gyro mounted and working now.

The RobotDrive constructor takes four motors in the order frontLeft, rearLeft, frontRight, rearRight. It looks like you have ports 2 and 3 swapped.

This was the solution. Thank you!