Hello, I am currently working with a robot, and am relatively new to controlling CANSparkMax motors through a PID loop. I was wondering if I can control two motors with a follow command, while still using a PID loop. I am wondering this because it seems like a separate thing to the set command, and I don’t know if it will work with other motors in the same way.
Basically I am wondering if this:
backLeftMotor.follow(frontLeftMotor);
SparkPIDController frontLeftPID = frontLeftMotor.getPIDController();
frontLeftPID.setReference(speed, ControlType.kVelocity);
Works the same as this:
backLeftMotor.follow(frontLeftMotor);
frontLeftMotor.set(speed);