Mecanum and Gear Ratios

We have a slight problem… we are using mecanum wheels this year, and there is a different gear ratio for the front set of wheels than for the back set. The front set are 4.67:1 and the back set are 12.75:1. We are using the mecanumDrive_Cartesian() method (Java w/netbeans). How can we modify the speed of the front wheels easily?

I don’t think that’s something you want to fix with software.

I know it’s not ideal, but we don’t really have the time to fix the gear ratios at this point. I am just hoping there is a possibility we can fix this with software :frowning:

It might be a little difficult with software, since the torque applied to each wheel is different. You could try scaling the back wheels down by 4.67/12.75, by simply multiplying the motor output by that ratio. Small signals to the motors will most likely have a strange affect on them as well; it’s kind of a strange situation. Just make sure you have the right transmissions ready to swap in for your first regional.

I do not know how to modify the speed of the motors without making new motor objects and recreating the entire mecanum_DriveCartesian method. Is there any other way?

So you’re running two CIMple boxes and two Toughboxes?

This is a problem screaming for a hardware fix.

The negative side effects can be mitigated in software, but you’ll likely have to use encoders and velocity-PD controllers for each of the four wheels to maintain consistent output velocities. While I am not familiar with the supplied Java mecanum drive framework, it may be necessary to write your own mecanum drive code to achieve these objectives.

The best solution is to call up other local FRC teams and see if you can trade either the CIMple or Toughbox gearboxes to have four identical gearboxes. Most FRC teams are more than willing to trade (equal valued) spare parts to help other local teams.

I completely agree with the above that this is a HW problem and should be addressed that way ASAP. If you must adjust in SW you can scale the motor values in the wpilibj method rather than creating your own drive routine. Keep in mind not to let values get above/below 1.0/-1.0 and that any changes will be overwritten by updates. But if you keep those in mind it is probably easiest as it just requires multiplying by constants in one spot.
Let me know if you need details, I don’t have the wpilib src with me but can post something tonight.

Good luck!

Thanks guys. We’re going to try to get some Toughboxes from a team in our area that isn’t competing this year, but if not we will probably have to try and do it in the software.

I was actually going to try and scale down the Y value of the joystick when the front motors speed calculations were taking place (in RobotDrive.java), but I can’t figure out how to modify it. Is it read-only because it’s part of the wpilib libraries? And if so, can I make it not read-only somehow?

Scaling only the Y won’t be sufficient to give you proper control.
You can modify RobotDrive.java in NetBeans, open wpilibj as a project, edit the file (back up or comment out the original code), and build the project as normal. (Don’t make it your main project when opening)

Ah, thank you! I will try this next time we work on it. Why wouldn’t scaling the Y value be enough?

Edit: Nevermind, I just realized. The X and twist axes are definitely going to need to be scaled as well. Thanks for saving me from grief later on :stuck_out_tongue: