marcusb258
15-01-2015, 15:45
We've been experimenting with the PIDController class in WPILib. So far, we were able to get our motors spinning, but because of the amount of switching back and forth around the setpoint, the motors end up cycling a lot, dangerously. In order to remedy this, we attempted to use the setAbsoluteTolerance and setPercentTolerance methods from the PIDController, however, they appear to have no effect. For example, when setting the percent tolerance to 15, and with a setpoint of 200, the loop would continue to run even with a value of 195. Absolute tolerance showed the exact same problems. Does anyone know why these methods have no effect on the loop?
We DO have a quick fix, manually checking the error in the loop against a preset tolerance, but we would like to see if we can get it running in the built-in class.
If it helps, we're running this on a CANTalon with a USDigital encoder set to 4x mode. The loop is running on the RoboRio, not the talon.
Code:
https://github.com/steelhawks/PIDtest
Thanks!
We DO have a quick fix, manually checking the error in the loop against a preset tolerance, but we would like to see if we can get it running in the built-in class.
If it helps, we're running this on a CANTalon with a USDigital encoder set to 4x mode. The loop is running on the RoboRio, not the talon.
Code:
https://github.com/steelhawks/PIDtest
Thanks!