I have a simple PID script running inside of a timed loop to control a heating process. It works perfectly except that I cannot find a clean way to start the timer when it reaches the setpoint.
Right now, the loop just runs for a set amount of time (e.g., thirty minutes). I want it to run for a set amount of time after the heating reaches the setpoint. I can think of several ways to fudge this, for example with a couple of shift registers and a case structure or with a second loop, but these options seem very clunky.
I am sure there is a better way. Can I somehow create an event within the loop that only happens once, for example, to give a timer value one time when a boolean value changes and never rewrite it?
Thanks in advance for your help.