Programming for Mecanum Wheel Chassis

Hello,

My team is trying out mecanum wheels (AndyMark 4 inch diameter) on our robot for FTC Velocity Vortex. Driving forwards, backwards, and turning works fine, however, we are not able to strafe sideways.

When we press the gamepad A button or the gamepad B button (our strafe controls), the robot moves in random directions, although occasionally it does strafe properly for a few seconds (which probably rules out any mechanical reasons for failure).

N.B.: “Bot” is a public class (please see bot.java); FL, FR, BL, BR refer to motors that power mecanum wheels (front-left, front-right, back-left, back-right respectively)

We suspect that using the “Bot” class causes problems, though we are not completely sure why or if that is true at all.

We would greatly appreciate any advice on this matter. I’ve posted links to our code below:

Teleop program
Direction (enum)
Bot.java

Thank you very much.

There is code out there for mecanum drive you can find to verify your code. Our team built 3 drive trains this year and I was part of the mecanum team. Though I wasn’t in charge of coding, our robot was having the same issue of unable to drive side ways or diagonal. We realized the orientation of the wheel affected it’s mobility drastically and if it wasn’t in the correct order, it would prohibit sideways movement. Before changing the code, look up orientation of the wheels because there are different orientations out there and we did it 3 different ways before it worked with our code.

Sent from my iPhone using Tapatalk

Put the bot up on blocks and tell us what each wheel is doing when you give a pure strafe command.

Also, post a bird’s-eye (or worm’s eye) picture of the bot so we can see how the 4 mec wheels are mounted.

As above.

One possible scenario which could cause your issue is if you swapped the control signal to the wheels on either the left or the right side (whether in code or wiring). Forward, reverse, and spinning would all work just fine, but strafing would try to compress or stretch the robot along the width axis.

Pictures

The “top view” picture shows our robot from earlier this week when we put the wheels on. We have not moved the wheels at all, but we did change the gear ratio (originally geared for speed, now geared for torque, as seen in the “full bot” picture)

Unfortunately I don’t have a video of the bot on blocks, but the wheels turn erratically (the reason we suspect it’s a programming issue).

We did do some tests earlier with another program although we still had our old speed gear ratio at that point. The wheels spun as they were supposed to (left side wheels spinning towards each other, right side wheels spinning away from each other, and vice-versa for strafing in the other direction), but the robot moved diagonally (when we tried left strafe, it moved forward diagonally to the left, when we tried right strafe, it moved forward diagonally to the right. We thought that our robot did not have enough torque to strafe properly, so we changed the gear ratio to what it is now.

Was our conjecture about torque a valid one?

Thanks for your help!

I see only two motors. You are using four motors (one for each wheel), yes?

It looks like you are actually gearing up the speed from the motor to the wheels. Yikes. I don’t know what kind of motors you are using, but if they are anything like FRC motors you need to gear them down. Way down.

Yes, we are using one motor per wheel. That picture was taken before we got all the motors on.

We geared the motors down yesterday (2:1).

What is the free speed of the motors you are using?

160 rpm (they’re AndyMark NeveRest 40s)

That’s a gearmotor. It’s already been geared way down (40:1)

Max power is only 14 watts. How fast do you need to go, and how heavy is that robot going to be?