br3ttb / Arduino-PID-Library

1.93k stars 1.11k forks source link

Output jumps to 1000+ #54

Closed bonnee closed 7 years ago

bonnee commented 7 years ago

I'm running this library in reverse mode and i get this output to the serial console:

Target 40C - Temp 41C - Duty 29
Target 40C - Temp 41C - Duty 34
Target 40C - Temp 41C - Duty 39
Target 40C - Temp 41C - Duty 44
Target 40C - Temp 41C - Duty 49
Target 40C - Temp 41C - Duty 54
Target 40C - Temp 41C - Duty 59
Target 40C - Temp 41C - Duty 64
Target 40C - Temp 41C - Duty 69
Target 40C - Temp 41C - Duty 74
Target 40C - Temp 41C - Duty 79
Target 40C - Temp 41C - Duty 84
Target 40C - Temp 41C - Duty 89
Target 40C - Temp 41C - Duty 94
Target 40C - Temp 41C - Duty 99
Target 40C - Temp 41C - Duty 1044

Where the first value is the setpoint, the second is the input and the last is the output. The output range is set from 14 to 255.

Idk why but when exceeding 100 the output becomes 1000+ and the program stops running.

This only happens when Ki is non-zero.

bonnee commented 7 years ago

The issue disappeared after some unrelated code change.