Slow X-drive

My team has an X-drive for this year’s competition. When we went to our first and second competitions, we noticed that our drive is somewhat slower than the other X-drive robots. Below is our code for the drivetrain for driver control:

  driveLF.move(rightJoystickY + rightJoystickX + leftJoystickX);
  driveLB.move(rightJoystickY - rightJoystickX + leftJoystickX);
  driveRF.move(-rightJoystickY + rightJoystickX + leftJoystickX);
  driveRB.move(-rightJoystickY - rightJoystickX + leftJoystickX);

Does this code make sense or is it the drive that is having issues?

Are your wheels a smaller size than theirs? Also, you may need to post your whole drive code.

I think the ones that we’ve seen are similar to ours (200 rpm 3.25 inch wheels)

void driverControl() {
  int leftJoystickX = controller.get_analog(ANALOG_LEFT_X);
  int leftJoystickY = controller.get_analog(ANALOG_LEFT_Y);
  int rightJoystickX = controller.get_analog(ANALOG_RIGHT_X);
  int rightJoystickY = controller.get_analog(ANALOG_RIGHT_Y);

  driveLF.move(rightJoystickY + rightJoystickX + leftJoystickX);
  driveLB.move(rightJoystickY - rightJoystickX + leftJoystickX);
  driveRF.move(-rightJoystickY + rightJoystickX + leftJoystickX);
  driveRB.move(-rightJoystickY - rightJoystickX + leftJoystickX);
}

this is the entire code (written in pros). We declare this function in a while true loop in opcontrol.

That’s slower than 4" wheels (and coincidentally, most teams have been using 4" 1:1 200 rpm)

3 Likes

I’m pretty sure at least a few teams at the competition were using 3.25 wheels, and they achieved a higher drive speed.

First, I don’t see anything in your code that would slow your drivetrain. You could check that your motors are turning at full speed by using the motors tab on the v5 brain. If your motors are turning at 200 rpm in a straight line or a pure turn, then you are getting maximum raw performance.

The reality of the situation is as follows, either your motors are not turning at full speed(probably not the case), or your competition’s drive trains are probably designed to go faster(likely). Teams may be using 4" wheels on their X, using faster gearboxes, or are gearing up their drive motors. Each approach has advantages and disandvantages

2 Likes

How do you know? There are so many variables you aren’t even considering. Consider the fact that code isn’t the only issue with the robot’s speed.

Other variables can include (but not limited to):

  • too much internal friction
  • too much weight
  • x-drive diagonals not exactly perpendicular
  • code isn’t scaling output power properly
  • low battery (there is a decline in motor performance on lower battery –– contrary to popular belief)
8 Likes

though with V5 this has gotten better
You are using omni wheels for this X drive right? make sure they can spin freely when the axle is out of the motor and arent rubbing on anything
picutures would help
What i have found is the motors can deform bearing flats if you tighten them all the way so make sure your using a good hole on the flat(to fix simply drill out the flat )

1 Like

send a pic of the drive

1 Like

I see the issue. You need to multiply the values by 2. The controllers give values from -100 to 100, but 200 RPM motors accept input between -200 and 200.

1 Like

In pros, the range is [-127,127]
Reference

The joysticks also return a value within that range. So, that can’t be the issue. Make sure the controller can reach and return the max output values.

5 Likes

Ah, I didn’t realize this was PROS. My apologies.

3 Likes