06-01-2017 07:53 AM
Hello,
I have a program that uses a PID with a square function to fluctuate the flow of heat into a system in order to keep it between the specific temperature limits. Once this target temperature range is reached I need the program to hold that temperature and sit there for a specific period of time. If someone has an idea of the logic behind this it would be greatly appreciated.
A couple more parameters I need implemented:
1. If the temperature ventures outside of the range I need, is there a way to pause the time until it stabilizes?
2. Another function that would be nice would be if the user inputted value for the "specific time" is zero, I would want it to skip this step entirely and move on to the next phase.
Thank you
Solved! Go to Solution.
06-01-2017 08:13 AM
Hi!
You can do this in many ways...
An easy way to do it is to add a Shift Register to your loop and a case loop to send the value to hold into it. If the temperature range is not reached, keep its last value ; otherwise update it with the actual temperature (temperature to save). See attached snippet (you can drag this image onto your block diagram and it will create the code).
06-01-2017 08:49 AM
Thank you, zyly!
So the "temp to keep" would be the nominal temp I am shooting for? Where would I implement the function to count time when the range is reached?
06-01-2017 09:43 AM
'Temp to keep' is the temperature to save when it enters in the temperature range.
To count time it enters the range, you can apply the same technique : add a shift register to hold your counter value, and increment the value inside the True case. But becarefull, you'll want to increment only when the 'temp reached?' goes from false to true... To do so you can use the boolean crossing function or do it by yourself with another shift register/feedback node 😉