Our team is attempting to use PathWeaver and Trajectory for the first time. We have followed the tutorial for characterization using the System Identification tool. The problem we are facing is that our four Neo’s on the KOP chassis sound like a locomotive (say I think I can, I think I can, over and over is the rhythm it gives off) while the characterization tests are running. I was able to reproduce the same sound/issue using the MotorControllerGroup classes vs using master/follower setup in our drivetrain code.
This code runs fine, it used the master/follower pattern:
public Drivetrain() {
rightMaster = new CANSparkMax(DriveConstants.RightMasterMotorId, MotorType.kBrushless);
rightMaster.restoreFactoryDefaults();
rightMaster.setInverted(false);
rightMaster.setIdleMode(IdleMode.kBrake);
rightMaster.burnFlash();
rightFollower = new CANSparkMax(DriveConstants.rightFollowerMototId, MotorType.kBrushless);
rightFollower.restoreFactoryDefaults();
rightFollower.follow(rightMaster);
rightFollower.setInverted(false);
rightFollower.setIdleMode(IdleMode.kBrake);
rightFollower.burnFlash();
leftMaster = new CANSparkMax(DriveConstants.LeftMasterMotorId, MotorType.kBrushless);
leftMaster.restoreFactoryDefaults();
leftMaster.setInverted(true);
leftMaster.setIdleMode(IdleMode.kBrake);
leftMaster.burnFlash();
leftFollower = new CANSparkMax(DriveConstants.leftFollowerMotorId, MotorType.kBrushless);
leftFollower.restoreFactoryDefaults();
leftFollower.follow(leftMaster);
leftFollower.setInverted(true);
leftFollower.setIdleMode(IdleMode.kBrake);
leftFollower.burnFlash();
// leftMotors = new MotorControllerGroup(leftMaster, leftFollower);
// rightMotors = new MotorControllerGroup(rightMaster, rightFollower);
differentialDrive = new DifferentialDrive(leftMaster, rightMaster);
// differentialDrive = new DifferentialDrive(leftMotors, rightMotors);
}
This code uses the MotorControllerGroup class and just like the System Identification tests, the Neo’s stutter and sound like a locomotive accelerating as the tests run.
public Drivetrain() {
rightMaster = new CANSparkMax(DriveConstants.RightMasterMotorId, MotorType.kBrushless);
rightMaster.restoreFactoryDefaults();
rightMaster.setInverted(false);
rightMaster.setIdleMode(IdleMode.kBrake);
rightMaster.burnFlash();
rightFollower = new CANSparkMax(DriveConstants.rightFollowerMototId, MotorType.kBrushless);
rightFollower.restoreFactoryDefaults();
// rightFollower.follow(rightMaster);
rightFollower.setInverted(false);
rightFollower.setIdleMode(IdleMode.kBrake);
rightFollower.burnFlash();
leftMaster = new CANSparkMax(DriveConstants.LeftMasterMotorId, MotorType.kBrushless);
leftMaster.restoreFactoryDefaults();
leftMaster.setInverted(true);
leftMaster.setIdleMode(IdleMode.kBrake);
leftMaster.burnFlash();
leftFollower = new CANSparkMax(DriveConstants.leftFollowerMotorId, MotorType.kBrushless);
leftFollower.restoreFactoryDefaults();
// leftFollower.follow(leftMaster);
leftFollower.setInverted(true);
leftFollower.setIdleMode(IdleMode.kBrake);
leftFollower.burnFlash();
leftMotors = new MotorControllerGroup(leftMaster, leftFollower);
rightMotors = new MotorControllerGroup(rightMaster, rightFollower);
// differentialDrive = new DifferentialDrive(leftMaster, rightMaster);
differentialDrive = new DifferentialDrive(leftMotors, rightMotors);
}
Here is how we configured the System Identification tool for characterization tests:
We are using WPILIB 2022.3.1 version.
We don’t need to use the MotorControllerGroup classes, but we would like to use the System Identification tool and the two seem to have the same symptoms. Any ideas what we might be doing wrong, or if there is an underlying issue we are not aware of?
Thanks.