bmfrc
1
Hi,
I’m using gyro sensor - ADXRS450_Gyro
For the PID I’m are using PIDController:
PIDController pidc = new PIDController(Kp, Ki, Kd, GYRO_OBJECT, MOTOR_OBJECT);
If I want to make a 90 degrees turn to the left, I understand that the right and left motors need to get the opposite values,
But I don’t know what an how to set the SetSetpoint value:
Right Motor: pidc.setSetpoint(?)
Left Motor: pidc.setSetpoint(?)
Thanks!
cnc4
2
I think you can do:
motorLeft.setInverted(true);
To make the left side inverted, not sure if this will work, if not try using:
motorLeft.reverseOutput(true);
Just don’t forget to use the Follower mode with this solution.
If you want to use two pid contollers you can do:
Right Motor: pidc.setSetpoint(setPoint);
Left Motor: pidc.setSetpoint(-setPoint);
bmfrc
3
Thanks a lot! I will give it a try…