PID library issue

Hello all,
I'm attempting to make a temperature controller which will run on a PID loop. Upon doing research, I found what appears to be a good baseline as to what I need. I posted the link which contains the code I copied to a T as well as his schematic. I am now simply trying to get his code to work before I make any modifications. The problem I'm currently having with it is that the output value is always a zero, which makes me believe the myPID.compute() function is not computing the output for me. The input value will change as I vary the light intensity about the photoresistor but the output value will just remain at zero the whole time (i.e., the LED is always off). Anyone have any ideas as to why this is?

Regards,
Ryan

PID_Example.pdf (751 KB)

Anyone have any ideas as to why this is?

You need to post YOUR code.

Ok I figured out the problem. The input (process variable) was significantly greater than the setting point (target value). Thus, the output was always zero in attempt to compensate for that. Once I hard-coded a unchanging set point value that was closer to its target value, the output values were nonzero and the PID control loop started working (the input value was more or less tracking the set point value). :slight_smile: If I have any other issues, I'll be sure to post my code.