kopia lustrzana https://github.com/jbruce12000/kiln-controller
add throttling of elements below a specific temp if outside the pid control window
rodzic
e4f954f55b
commit
4fddeeb4a8
10
config.py
10
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
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue