diff --git a/Control/brewpi/controller.py b/Control/brewpi/controller.py index bbfb76e..3f7a39a 100644 --- a/Control/brewpi/controller.py +++ b/Control/brewpi/controller.py @@ -100,7 +100,7 @@ class Controller(): if self.thread != None: self.is_pause = True self.stirrer.deactivate() - self.plant.setPower(0) + self.plant.activate(False) def cont(self): if self.thread != None: @@ -124,16 +124,13 @@ class Controller(): self.rast(rast) if self.rast_abort: break + time.sleep(1); if not self.is_restart: self.receipe_sema.release() def rast(self, rast): - # Stirrer - self.stirrer.activate() - self.stirrer.setCycleTime(self.stirrCycleTime) - # Temperature self.theta = self.plant.getTemperature() theta_soll = rast['temp'] @@ -151,7 +148,14 @@ class Controller(): # ------------------------------ # The loop # ------------------------------ - doLoop = True + doLoop = theta_soll > self.theta + if doLoop: + # Stirrer + self.stirrer.activate() + self.plant.activate(True) + + self.stirrer.setCycleTime(self.stirrCycleTime) + useKalman = False while(doLoop): @@ -285,3 +289,5 @@ class Controller(): doLoop = False self.stirrer.deactivate() + self.plant.activate(False) +