diff --git a/Control/brewpi/astirrer.py b/Control/brewpi/astirrer.py index 36f7c98..d6f7dcb 100644 --- a/Control/brewpi/astirrer.py +++ b/Control/brewpi/astirrer.py @@ -54,4 +54,4 @@ class AStirrer(abc.ABC): @abc.abstractmethod def deactivate(self): - pass \ No newline at end of file + pass diff --git a/Control/brewpi/brewpi.py b/Control/brewpi/brewpi.py index f394ce6..3f682b4 100644 --- a/Control/brewpi/brewpi.py +++ b/Control/brewpi/brewpi.py @@ -6,6 +6,7 @@ from controller import Controller from mass import Mass from stirrer import Stirrer from matplotlib.pyplot import figure, clf, plot, xlabel, ylabel, xlim, ylim, title, grid, axes, show, subplot +from pololu1376 import Pololu1376 def results_plot(self): @@ -40,7 +41,9 @@ if __name__ == '__main__': configJson = json.load(fp) plant = Mass(configJson["WaterSim"]) - ruehrer = Stirrer(configJson["Stirrer"]) +# ruehrer = Stirrer(configJson["Controller"]['dt']) + ruehrer = Pololu1376(configJson["Controller"]['dt'], "/dev/ttyACM0", "115200") + ablauf = Controller(configJson["Controller"], plant, ruehrer) fp = open("Rezept-001.json") diff --git a/Control/brewpi/controller.py b/Control/brewpi/controller.py index 2692f88..daf1013 100644 --- a/Control/brewpi/controller.py +++ b/Control/brewpi/controller.py @@ -30,7 +30,7 @@ class Controller(): self.power_v = np.empty(0) self.error_v = np.empty(0) self.time = 0 - self.sim_warp_factor = 100 + self.sim_warp_factor = 10 self.report_interval = 1.0 self.report_last_time = 0 self.thread = None @@ -89,7 +89,7 @@ class Controller(): def rast(self, rast): # Stirrer - self.stirrer.start() + self.stirrer.activate() self.stirrer.setCycleTime(self.stirrCycleTime) # Temperature @@ -217,4 +217,4 @@ class Controller(): time.sleep(time_to_sleep) - self.stirrer.stop() + self.stirrer.deactivate() diff --git a/Control/brewpi/pololu1376.py b/Control/brewpi/pololu1376.py index 9c0dfeb..52c5cdf 100644 --- a/Control/brewpi/pololu1376.py +++ b/Control/brewpi/pololu1376.py @@ -53,7 +53,7 @@ if __name__ == '__main__': print ("Set some speeds") s.setSpeed(50) time.sleep(2) - s.setSpeed(100) + s.setSpeed(20) time.sleep(2) s.setSpeed(50) time.sleep(2)