Brett, I've used your profile settings below on a project to set an oven to 160C for 20 minutes. At the end of the process the PID stopped controlling and the oven stayed on, baking up to 280C! This fried my work
I may have done something wrong, and I'll post the code when I'm at my development machine. However, it got me thinking. Could I suggest to you a new command?
> // stop.
where <relay state
> = 0 is with relays held OFF, and 1 is with relays held ON. This would give you flexibility for how people have configured heating, cooling, etc.
> = 0 | <value
. If pid crosses max temp
then the device will shut off.
You could use this in two ways. if max temp
is specified as a real number (e.g. -50.6 or 0.0 or 160) and this command is placed at the beginning of the file, it sets a safety ceiling, i.e., if the PID loses control or some other logic is wrong, the controlled device will shut down safely. If max temp
is set to 0 (no decimal points) then it's used as a stop command at the end of the file.
You may have ways of doing this with existing commands, but without a little more documentation (hint, hint
) it's hard to tell.
A suggestion for the profile file is that you also consider using command words rather than numbers, e.g. step, wait, ramp, stop