View Single Post
  #1   Spotlight this post!  
Unread 15-01-2015, 15:45
marcusb258 marcusb258 is offline
Registered User
FRC #2601
 
Join Date: Jan 2013
Location: New York
Posts: 4
marcusb258 is an unknown quantity at this point
PIDController help

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!