diff --git a/config.py b/config.py index 3a7dd90..33e133d 100644 --- a/config.py +++ b/config.py @@ -228,3 +228,13 @@ automatic_restart_state_file = os.path.abspath(os.path.join(os.path.dirname( __f kiln_profiles_directory = os.path.abspath(os.path.join(os.path.dirname( __file__ ),"storage", "profiles")) #kiln_profiles_directory = os.path.abspath(os.path.join(os.path.dirname( __file__ ),'..','kiln-profiles','pottery')) + +######################################################################## +# low temperature throttling of elements +# kiln elements have lots of power and tend to drastically overshoot +# at low temperatures. When under the set point and outside the PID +# control window and below throttle_below_temp, only throttle_percent +# of the elements are used max. +# To prevent throttling, set throttle_percent to 100. +throttle_below_temp = 300 +throttle_percent = 20 diff --git a/lib/oven.py b/lib/oven.py index 245c662..028fd5c 100644 --- a/lib/oven.py +++ b/lib/oven.py @@ -793,6 +793,10 @@ class PID(): elif error > (1 * config.pid_control_window): log.info("kiln outside pid control window, max heating") output = 1 + if config.throttle_below_temp and config.throttle_percent: + if ispoint <= config.throttle_below_temp: + output = config.throttle_percent/100 + log.info("max heating throttled at %d percent below %d degrees to prevent overshoot" % (config.throttle_percent,config.throttle_below_temp)) else: icomp = (error * timeDelta * (1/self.ki)) self.iterm += (error * timeDelta * (1/self.ki))