From 576fd5bb4483c567a678935d135162827f7a4ebb Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Wed, 3 Apr 2019 17:32:09 +0000 Subject: [PATCH] - skip rast if temp already reached - activate plant an start of rast git-svn-id: http://moon:8086/svn/projects/HendiControl@216 fda53097-d464-4ada-af97-ba876c37ca34 --- Control/brewpi/controller.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) 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) +