diff --git a/lib/oven.py b/lib/oven.py index a8f6260..a141cf0 100644 --- a/lib/oven.py +++ b/lib/oven.py @@ -480,25 +480,8 @@ class PID(): window_size = 100 error = float(setpoint - ispoint) - - # this removes the need for config.stop_integral_windup - # it turns the controller into a binary on/off switch - # any time it's outside the window defined by - # config.pid_control_window - if error < (-1 * config.pid_control_window): - log.info("kiln outside pid control window, max cooling") - self.lastErr = error - self.lastNow = now - return 0 - if error > (1 * config.pid_control_window): - log.info("kiln outside pid control window, max heating") - self.lastErr = error - self.lastNow = now - return 1 - icomp = (error * timeDelta * (1/self.ki)) self.iterm += (error * timeDelta * (1/self.ki)) - dErr = (error - self.lastErr) / timeDelta output = self.kp * error + self.iterm + self.kd * dErr out4logs = output @@ -512,6 +495,17 @@ class PID(): output = float(output / window_size) + # this removes the need for config.stop_integral_windup + # it turns the controller into a binary on/off switch + # any time it's outside the window defined by + # config.pid_control_window + if error < (-1 * config.pid_control_window): + log.info("kiln outside pid control window, max cooling") + output = 0 + if error > (1 * config.pid_control_window): + log.info("kiln outside pid control window, max heating") + output = 1 + self.pidstats = { 'time': time.mktime(now.timetuple()), 'timeDelta': timeDelta, diff --git a/public/assets/css/picoreflow.css b/public/assets/css/picoreflow.css index 8e77db7..8237cf7 100644 --- a/public/assets/css/picoreflow.css +++ b/public/assets/css/picoreflow.css @@ -124,6 +124,18 @@ body { display: inline-block; } +.bar { + width:70%; + //padding: 2px 2px 0px 2px; + //display:block; + display: inline-block; + font-family:arial; + font-size:12px; + background-color:#ca3c38; + color:#000; + //position:absolute; + //bottom:0; + } .ds-led-hazard-active { color: rgb(255, 204, 0); diff --git a/public/assets/js/picoreflow.js b/public/assets/js/picoreflow.js index 479b7b7..4bbadb5 100644 --- a/public/assets/js/picoreflow.js +++ b/public/assets/js/picoreflow.js @@ -561,8 +561,7 @@ $(document).ready(function() $('#act_temp').html(parseInt(x.temperature)); if (x.heat > 0.0) { - setTimeout(function() { $('#heat').addClass("ds-led-heat-active") }, 0 ) - setTimeout(function() { $('#heat').removeClass("ds-led-heat-active") }, (x.heat*1000.0)-5) + $('#heat').html('
') } if (x.cool > 0.5) { $('#cool').addClass("ds-led-cool-active"); } else { $('#cool').removeClass("ds-led-cool-active"); } if (x.air > 0.5) { $('#air').addClass("ds-led-air-active"); } else { $('#air').removeClass("ds-led-air-active"); }