br3ttb / Arduino-PID-Library

1.96k stars 1.11k forks source link

Output goes to 0 when above setpoint. #124

Open ZachElkins opened 2 years ago

ZachElkins commented 2 years ago

I am running in to an issue where the output is always 0 when the input is greater than the set-point, but seems to be working fine when it is below it.

I think at least one other person is having the same issue, found in the Google Group. (https://groups.google.com/g/diy-pid-control/c/Z9zokl6ngZQ)

heaterC commented 2 years ago

As you can find in the documentation, the output window is by default 0-255, but you can easily change this.

drf5n commented 1 year ago

Yes, the default output range is set to the analogWrite(...) range of 0-255. If you want it to go negative, use SetOutputLimits:

https://playground.arduino.cc/Code/PIDLibrarySetOutputLimits/