6 Motor Drivetrain Turning Issue

When using this code
Drivetrain.setDriveVelocity((Controller1.Axis3.position() + Controller1.Axis1.position()), percent);
Drivetrain.setDriveVelocity((Controller1.Axis3.position() - Controller1.Axis1.position()), percent);
Drivetrain.drive(forward);
(This is in a while (true) loop)
for my 6 motor drive which is configured like this
motor_group leftDrive( lb, lm, lf );
motor_group rightDrive( rb, rm, rf );
drivetrain Drivetrain( leftDrive, rightDrive, 3.75 * 3.14159265, 11, 12.5, distanceUnits::in );
This doesn’t work, for whatever reason. I want split arcade drive, and this almost works.

It drives forward and backward perfectly fine, however when turning, say, turning left, the wheels sort of buffer- all move in the same direction (the right motors are all reversed, but reversing the left ones / un-reversing the right ones doesn’t fix the issue) and sort of like flicker. You could be holding the joystick to the side and the wheels would move for a second and then stop moving, then move for another second, all at once. I’ve also tried reversing/un-reversing every single individual motor separately, but that didn’t work either.
Please help, I have a tournament tomorrow.

You need to control each side of the drive individually, not the entire thing. It looks like you sort of half-copied some example code, so try fully copying it instead.

1 Like

literally exactly what @2775Josh said.

Instead of doing

motor_group leftDrive( lb, lm, lf );
motor_group rightDrive( rb, rm, rf );
drivetrain Drivetrain( leftDrive, rightDrive, 3.75 * 3.14159265, 11, 12.5, distanceUnits::in );
while (true) {
  Drivetrain.setDriveVelocity((Controller1.Axis3.position() + Controller1.Axis1.position()), percent);
  Drivetrain.setDriveVelocity((Controller1.Axis3.position() - Controller1.Axis1.position()), percent);
  Drivetrain.drive(forward);
}

use the created motor groups to control the drivetrain, like this

motor_group leftDrive( lb, lm, lf );
motor_group rightDrive( rb, rm, rf );
drivetrain Drivetrain( leftDrive, rightDrive, 3.75 * 3.14159265, 11, 12.5, distanceUnits::in );
while (true) {
  leftDrive.setVelocity((Controller1.Axis3.position() + Controller1.Axis1.position()), percent);
  rightDrive.setVelocity((Controller1.Axis3.position() - Controller1.Axis1.position()), percent);
  leftDrive.spin(forward);
  rightDrive.spin(forward);
}