kopia lustrzana https://github.com/jbruce12000/kiln-controller
adding configurable emergencies
rodzic
6209d61b48
commit
8fbb3ab649
22
config.py
22
config.py
|
@ -130,12 +130,6 @@ pid_control_window = 5 #degrees
|
|||
# cheap thermocouple. Invest in a better thermocouple.
|
||||
thermocouple_offset=0
|
||||
|
||||
# some kilns/thermocouples start erroneously reporting "short"
|
||||
# errors at higher temperatures due to plasma forming in the kiln.
|
||||
# Set this to False to ignore these errors and assume the temperature
|
||||
# reading was correct anyway
|
||||
honour_theromocouple_short_errors = False
|
||||
|
||||
# number of samples of temperature to average.
|
||||
# If you suffer from the high temperature kiln issue and have set
|
||||
# honour_theromocouple_short_errors to False,
|
||||
|
@ -145,13 +139,25 @@ temperature_average_samples = 40
|
|||
# Thermocouple AC frequency filtering - set to True if in a 50Hz locale, else leave at False for 60Hz locale
|
||||
ac_freq_50hz = False
|
||||
|
||||
########################################################################
|
||||
# Emergencies - or maybe not
|
||||
########################################################################
|
||||
# There are all kinds of emergencies that can happen including:
|
||||
# - temperature is too high (emergency_shutoff_temp exceeded)
|
||||
# - lost connection to thermocouple
|
||||
# - unknown error with thermocouple
|
||||
# - too many errors in a short period from thermocouple
|
||||
# and some people just want to ignore all of that and just log the emergencies but do not quit
|
||||
ignore_emergencies = False
|
||||
# but in some cases, you might want to ignore a specific error, log it,
|
||||
# and continue running your profile.
|
||||
ignore_temp_too_high = False
|
||||
ignore_lost_connection_tc = False
|
||||
ignore_unknown_tc_error = False
|
||||
ignore_too_many_tc_errors = False
|
||||
# some kilns/thermocouples start erroneously reporting "short"
|
||||
# errors at higher temperatures due to plasma forming in the kiln.
|
||||
# Set this to True to ignore these errors and assume the temperature
|
||||
# reading was correct anyway
|
||||
ignore_tc_short_errors = False
|
||||
|
||||
########################################################################
|
||||
# automatic restarts - if you have a power brown-out and the raspberry pi
|
||||
|
|
10
lib/oven.py
10
lib/oven.py
|
@ -164,7 +164,7 @@ class TempSensorReal(TempSensor):
|
|||
self.unknownError = self.thermocouple.unknownError
|
||||
|
||||
is_bad_value = self.noConnection | self.unknownError
|
||||
if config.honour_theromocouple_short_errors:
|
||||
if not config.ignore_tc_short_errors:
|
||||
is_bad_value |= self.shortToGround | self.shortToVCC
|
||||
|
||||
if not is_bad_value:
|
||||
|
@ -273,22 +273,22 @@ class Oven(threading.Thread):
|
|||
if (self.board.temp_sensor.temperature + config.thermocouple_offset >=
|
||||
config.emergency_shutoff_temp):
|
||||
log.info("emergency!!! temperature too high")
|
||||
if not config.ignore_emergencies == True:
|
||||
if config.ignore_temp_too_high == False:
|
||||
self.abort_run()
|
||||
|
||||
if self.board.temp_sensor.noConnection:
|
||||
log.info("emergency!!! lost connection to thermocouple")
|
||||
if not config.ignore_emergencies == True:
|
||||
if config.ignore_lost_connection_tc == False:
|
||||
self.abort_run()
|
||||
|
||||
if self.board.temp_sensor.unknownError:
|
||||
log.info("emergency!!! unknown thermocouple error")
|
||||
if not config.ignore_emergencies == True:
|
||||
if config.ignore_unknown_tc_error == False:
|
||||
self.abort_run()
|
||||
|
||||
if self.board.temp_sensor.bad_percent > 30:
|
||||
log.info("emergency!!! too many errors in a short period")
|
||||
if not config.ignore_emergencies == True:
|
||||
if config.ignore_too_many_tc_errors == False:
|
||||
self.abort_run()
|
||||
|
||||
def reset_if_schedule_ended(self):
|
||||
|
|
Ładowanie…
Reference in New Issue