mike-matera / FastPID

A fast, integer based PID controller suitable for Arduino.
GNU Lesser General Public License v2.1
139 stars 44 forks source link

Use FastPID for cooling? #8

Closed hossians closed 5 years ago

hossians commented 5 years ago

Hi

I wonder how to use FastPID for cooling, i.e. you want the output to increase when the input increases? One way of doing it would be to use negative Kp,Ki and Kd. But the FastPID do not accept values below 0. By modifying the library I have done tests with negative values and works as intended, but I assume the check for negative values are there for a reason?

/Henrik

mike-matera commented 5 years ago

Simple!

All you have to do is invert the feedback.

output = myPID.step(-input)

Cheers ./m