From 8d770b3086c5a19daa8eead677d14772f680738e Mon Sep 17 00:00:00 2001 From: James Kirikland Garner Date: Thu, 15 Dec 2022 10:23:08 -0800 Subject: [PATCH] Blinka merge, playing with config settings. --- config.py | 5 +++-- lib/oven.py | 2 +- lib/ovenWatcher.py | 6 ++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/config.py b/config.py index e6abc80..a3ac87c 100644 --- a/config.py +++ b/config.py @@ -82,7 +82,7 @@ max31856 = 0 # Every N seconds a decision is made about switching the relay[s] # on & off and for how long. The thermocouple is read # temperature_average_samples times during and the average value is used. -sensor_time_wait = 2 +sensor_time_wait = 0.2 ######################################################################## @@ -117,6 +117,7 @@ sim_R_o_nocool = 0.5 # K/W thermal resistance oven -> environment sim_R_o_cool = 0.05 # K/W " with cooling sim_R_ho_noair = 0.1 # K/W thermal resistance heat element -> oven sim_R_ho_air = 0.05 # K/W " with internal air circulation +sim_speedup_factor = 1000 ######################################################################## @@ -148,7 +149,7 @@ kiln_must_catch_up = True # or 100% off because the kiln is too hot. No integral builds up # outside the window. The bigger you make the window, the more # integral you will accumulate. This should be a positive integer. -pid_control_window = 5 #degrees +pid_control_window = 50 #degrees # thermocouple offset # If you put your thermocouple in ice water and it reads 36F, you can diff --git a/lib/oven.py b/lib/oven.py index 8a947d6..82c7bc7 100644 --- a/lib/oven.py +++ b/lib/oven.py @@ -508,7 +508,7 @@ class SimulatedOven(Oven): self.R_o_nocool = config.sim_R_o_nocool self.R_ho_noair = config.sim_R_ho_noair self.R_ho = self.R_ho_noair - self.speedup_factor = 1000 + self.speedup_factor = config.sim_speedup_factor # set temps to the temp of the surrounding environment self.t = self.t_env # deg C temp of oven diff --git a/lib/ovenWatcher.py b/lib/ovenWatcher.py index be13146..cd0b6ea 100644 --- a/lib/ovenWatcher.py +++ b/lib/ovenWatcher.py @@ -35,10 +35,8 @@ class OvenWatcher(threading.Thread): self.recording = False self.notify_all(oven_state) - if config.simulate: - time.sleep(self.oven.time_step) - else: - time.sleep(self.oven.time_step) + + time.sleep(self.oven.time_step) def lastlog_subset(self,maxpts=50):