|
Java CANJaguar PID Issues
We are trying to do position control with a CANJaguar and a potentiometer. If we enable the motor with PID control, and try to set the PIDs to 0.0, 0.0, 0.0, they don't change. A .getP() returns the last higher value etc.
More problematic, if we setup and enable the PID loop in init(), then select teleop or autonomous and enable then the motor will move. Always. If we do not enable the motor in init(), don't define it yet, but do so in teleop, then the motor does not move the first time. But if we disable, then reenable teleop the motor moves. Similarly if we then go to auto the motor moves. Since we want to enable and use the position control in auto, we run the risk of the motors moving when we go from auto to teleop.
We have not found a method to disable the motor once initialized such that we may go into teleop or autonomous without the motor moving. Its as if enabling teleop or auto gives the motor an enable which starts it moving prior to the PID loop taking over.
Disabling (.disable() ) the motor doesn't work as the motor moves when we enable. We have also tried .enable(initialPosition).
Setting the PID values to 0.0, 0.0, 0.0, doesn't take. We print them out and they didn't change. No error generated. The CANJaguar appears to like our initial settings so much it won't let us overwrite them with zeros. Must think we don't know what we're doing.
Any help or ideas would be appreciated. Thanks.
|