■ FIGURE 4
note is that the temphighcheck subroutine is NOT a direct
duplicate of the templowcheck subroutine. I discovered that
the fire could increase temperature much more quickly than it
could reduce the temperature. Additional ‘state’ checks for the
temphighcheck subroutines were necessary. I’ve labeled the
subroutines with intuitive names for easier debugging later on.
This innocuous subroutine does a lot more than it appears.
When a fire is lit, the program needs to know the position of the
exhaust damper (maybe the user has moved it manually since the
last fire), so FIRELIT calls the exhauststepcountreset subroutine.
This routine drives the exhaust damper to full open, then backs it
off four steps so that it is not riding directly on the limit switch. It
also updates the LCD display variable stepcount for stepper
motor position display.
The subroutine sets a bit called firelit to 1 and increments the
fire EEPROM data storage location. In addition (this may not be
obvious), at this time when the fire is lit, the Inc Time subroutine
(accessed from the MAIN loop) calls the IncreaseBurntimeMinutes
subroutine, which starts the burn time clock.
This subroutine simply resets variables and stores their new
value in EEPROM. At this point, the exhaust damper should be in
the wide open position because as the fire has been going out,
the control software will have driven it to maximum open.
To effectively control the fire, the present temperature
variable called temperature, as well as the old temperature
variable (tempold) needs to be saved. The difference between the
old and new temperatures is compared over various timeframes
and the exhaust damper is changed based on the rate of
change of the fire temperature. These various timeframes are
incremented with some of the variables listed in the start of this
subroutine — AttemptsLow, TempCheckCounter, and
■ SCHEMATIC 2
AttemptsHigh. I’ll explain these shortly. Please note that the
TempCheck subroutine is called every 10 seconds (determined
by the Inc Time subroutine).
1) The first condition tested for in the TempCheck subroutine is
If temperature <= lowtemp and temperature > tempold
then goto bypass
In this condition, the control loop does nothing. If the
temperature is rising on its own, just leave it. There is no reason
to force the fire to increase its temperature quickly if it is already
doing so on its own at this damper setting. I found that trying to
force a quick change only caused grief.
2) The second condition is the opposite of the previous condition:
If temperature >= hightemp and
temperature <= tempold then Goto
Once again, do nothing. If the temperature is falling on its
own, then let it be.
3) The third condition in the TEMPCHECK subroutine takes us to
the STABLE subroutine (explained momentarily).
4-5) The fourth and fifth conditions take us to the
TempLowCheck and TempHighCheck subroutines (covered next).
Don’t wait until the fire temperature drops below the
lowtemp or goes above the hightemp limit, because this will
cause wild oscillations of temperature.
Because we have a 50-degree tolerance level, the fire has a
tendency to either run away with itself or cool off way too much
before the damper starts responding. I have found (through
extensive testing) that if the program waited until the fire
temperature fell to the lower set limit, it was too hard to get the
fire to increase its temperature. The exhaust damper would open
every 10 seconds until it was wide open before the fire would
‘catch’ and begin burning hotter.
At this point, the fire would race over the hightemp limit and
burn too hot. The damper would then try to cool the fire off, thereby
causing the same problem, only this time in the cooling mode.
These fluctuations will swing between high and low
temperatures as the exhaust damper tries to maintain control. I
tried a tighter tolerance value, but this caused other problems.
The biggest one was the stepper motor was constantly running
open and closed trying to maintain tight control over the fire.
After much trial and error, I determined that the program needs
to do ‘state’ checks on the fire temperature while it is within the
lowtemp and hightemp tolerance and then take action accordingly.
The variable tempOldMinute does exactly as its name
implies — it stores a ‘state’ variable once a minute for the