How do I program an X drive if one of the motors is slower than the rest? Is there a way slow the other motors?

Hi I don’t know if this has been answered before but I can’t find any info on the matter. Is there a way to slow down the motors on an X drive while it uses a joystick? This is due to one slow motor in the drive. (Also I program in VCS vex c++)

I am really surprised that you are having this issue. Are you sure you don’t have additional friction or a bent axle on that motor?

Nonetheless you could add a decimal ratio to each of your motor assignments and slow down the other three motors.

Basing on this example: holonomic-programming which I have not tested…

double ratio1 = 0.75;
double ratio2 = 0.75;
double ratio3 = 0.75;
double ratio4 = 1.0;

void usercontrol( void ) {
  while (1) {

    //...joystick code...

	m1 = ((joy_1_y) + (-1 * joy_1_x) + (-1 * joy_2_x))      * ratio1;
	m2 = ((-1 * joy_1_y) + (-1 * joy_1_x) + (-1 * joy_2_x)) * ratio2;
	m3 = ((-1 * joy_1_y) + (joy_1_x) + (-1 * joy_2_x))      * ratio3;
	m4 = ((joy_1_y) + (joy_1_x) + (-1 * joy_2_x))           * ratio4;

	Motor1.spin(vex::directionType::fwd,m1,vex::velocityUnits::pct );
	Motor2.spin(vex::directionType::fwd,m2,vex::velocityUnits::pct );
	Motor3.spin(vex::directionType::fwd,m3,vex::velocityUnits::pct );
	Motor4.spin(vex::directionType::fwd,m4,vex::velocityUnits::pct );

	vex::task::sleep(20); 
  }
}
2 Likes

if one motor is slower than the others you may have one of these issues:

  • high friction on that wheel (could be from poor build quality, misaligned holes, or bent axles)
  • the slower motor is using a slower gear cartridge. make sure all 4 motors are using the same cartridge.

You could slow down the other motors in your code, but it’s much much better to fix the issue in that one motor than it is to lower the speed in all the others.

5 Likes