i had a thought last night about the gains ...

first a sidebar: the PIC is really cute little processor, but it is kind of simplistic in its math abilities. i find the best way handle numbers is in "sign-magnitude" format. That is, when i subtract, if the answer is negative, i immediately do a 2's complement to get the absolute value and set a flag bit.

So, considering the gains for the PID, this gives me two temperature ranges:

*vBelow*, where the coil temperature is below SETPOINT

and

*vAbove*, where the coil temperature is above SETPOINT

So the thought i had last night, is the gains should be different in each region, because the coil heats up much faster than it cools off, by about a factor of 5, but there is instantaneous delay in response, so, say, a factor of 3 is enough.

i just loaded and tested some new gains ... (bump!) ... and this works much better. Now, of course, this is just the first test, and i'm not anal if i'm not thorough, and gf says i really am "detail oriented" ...

So here are today's gains:

vAbove: (-30 * P), (-.25 * I), (either -20(+) or +10(-) * D)

vBelow: (+10 * P), (+.125 * I), (either -10(+) or +5(-) * D)

D, the derivative term, is also a signed value, with a positive slope(+) or a negative(-) slope.

Also there are limits on changes to the P, I and D values, which seems to dampen out jitter in the MAX6675 readings (if there is any).

These gains keep a tight limit on the upward error. That is, the green LED bounces off every now and then as the temp dips below SETPOINT before being corrected. i didn't see the annoying drift up on the high side.

Also, hitting BUTTON1 to raise the temp by 10F was amazingly accurate and fast.