Another episode in the reflow controller story…
Here is yesterday’s graph again, but manually annotated this time:

Actually, I went ahead and extended the code to add those axis labels in there. I was concerned that they would overlap and distract from the graph data itself, but after seeing this… it clearly improves readability.
The trick is to get the PID control factors right, and these will be different for each setup. Right now, I just picked a couple of values which seem to be working ok on my particular grill. I’ve extended the JeeNode sketch to allow adjusting these values via a serial USB connection:
<N> P P factor (x1000)
<N> I I factor (x1000)
<N> D D factor (x1000)
<N> L I limit (x1000)
The PID calculation is:
(Pfactor*Pval + Ifactor*Ival - Dfactor*Dval) / 1000
In other words, these factors are specified as a multiple of 0.001.
The result is brought into a range of 0..100. This in turn is used to determine when, how often, and how long to turn on the heater in the grill/oven/skillet.
The reflow profile parameters are also adjustable from the serial link:
<N> o ON temperature (°C), default 70
<N> w minimum time in WARMUP phase (sec), default 60
<N> p temperature at end of PREHEAT phase (°C), default 140
<N> s temperature at end of SOAK phase (°C), default 170
<N> m maximum REFLOW temperature (°C), default 250
<N> r minimum time in REFLOW phase (sec), default 15
<N> c temperature at end of COOL phase (°C), default 150
<N> f temperature at end of FINAL phase (°C), default 50
Once the FINAL phase ends, the JeeNode will power itself down.
A few more parameters:
<N> l lower calibration temperature limit (°C), default 40
<N> u upper calibration temperature limit (°C), default 120
<N> d stable duration (sec), default 5
<N> t stable trigger gap (°C), default 25
<N> a number of temperature averages to take, default 250
Some parameters for reporting, which happens once per second:
<N> i wireless node ID (sending disabled if 0), default 8
<N> b wireless frequency (4=433, 8=868, 9=915), default 8
<N> g wireless net group, default 5
<N> e enable (1) or disable (0) serial reports, default 0
And finally, the parameters which control the FS20 remote switch:
<N> H house code to use for FS20, default 4660
<N> h device ID to use for FS20, default 1
All PID factors and other parameters are stored in EEPROM, so they will remain in effect until changed.
To get a summary of all the current settings, type a question mark: “?”.
To reset all parameters to their “factory” defaults, type an exclamation mark: “!”.
The code for the “reflowTimer.pde” sketch is here The current code size is ≈ 14 Kb. I’ll probably be tweaking it a bit further in the coming days.
One thing I’d like to try adding to the current sketch is an easy way to self-calibrate and come up with a workable set of P/I/D factors, so that it can be used with a variety of electrical grills, toasters, skillets, ovens, barbecues, whatever – under the motto: if it can melt solder, we should try it!
The JeeMon script is here and is about 150 lines of code. If you save it as “application.tcl” next to JeeMon, it will automatically be picked up when JeeMon is launched. The code is still work-in-progress at this point: you will have to manually edit the “device” variable to refer to your attached JeeNode/JeeLink running RF12demo – you can also set it to a COM port (Windows) or tty device (Linux/Mac). Likewise, the “nodeID” variable should be set to match the current setting in the Reflow Timer sketch (“i” parameter):
variable device usb-A900ad5m ;# which JeeNode/JeeLink to attach to
variable nodeID 8 ;# which node ID to listen to
The frequency band + netgroup of the JeeNode/JeeLink are assumed to have been previously set in RF12demo.
Note that the script is an optional GUI front-end – you can launch it anytime, or you can ignore this whole JeeMon thing, since the sketch does not depend on it. It’ll drive the reflow process with or without the GUI.
If you try this out, or have suggestions about how to improve things, please let me know.
Update – I’ve adjusted the info above to match the latest code changes.