From 76e93e8fdbe12bee502ad44e1e39be0dadee9601 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Tue, 26 Mar 2019 19:12:20 +0000 Subject: [PATCH] - warp factor is parameter git-svn-id: http://moon:8086/svn/projects/HendiControl@140 fda53097-d464-4ada-af97-ba876c37ca34 --- Control/brewpi/Rezept-001.json | 2 +- Control/brewpi/brewpi.cfg.json | 13 +++++++------ Control/brewpi/brewpi.py | 4 +--- Control/brewpi/controller.py | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Control/brewpi/Rezept-001.json b/Control/brewpi/Rezept-001.json index da61e00..28a9705 100644 --- a/Control/brewpi/Rezept-001.json +++ b/Control/brewpi/Rezept-001.json @@ -4,7 +4,7 @@ "Wasser_kg" : 18, "stirrSpeedHeat" : 50, "stirrSpeedRast" : 30, - "stirrDutyRast" : 0.2, + "stirrDutyRast" : 0.5, "stirrCycleTime" : 120, "Rasten" : [ diff --git a/Control/brewpi/brewpi.cfg.json b/Control/brewpi/brewpi.cfg.json index 082a66e..31a2a4d 100644 --- a/Control/brewpi/brewpi.cfg.json +++ b/Control/brewpi/brewpi.cfg.json @@ -2,12 +2,13 @@ "Controller" : { - "dt" : 1.0, - "cont_ctrl" : true, - "P_min" : 0, - "P_max" : 3000, - "P_q_W" : 100, - "theta_lock_K" : 0.5, + "dt" : 1.0, + "cont_ctrl" : true, + "P_min" : 0, + "P_max" : 3000, + "P_q_W" : 100, + "theta_lock_K" : 0.5, + "sim_warp_factor" : 1.0, "Hold" : { "Acqu": { "Pid" : { diff --git a/Control/brewpi/brewpi.py b/Control/brewpi/brewpi.py index 3f682b4..8e9e598 100644 --- a/Control/brewpi/brewpi.py +++ b/Control/brewpi/brewpi.py @@ -6,7 +6,6 @@ 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): @@ -41,8 +40,7 @@ if __name__ == '__main__': configJson = json.load(fp) plant = Mass(configJson["WaterSim"]) -# ruehrer = Stirrer(configJson["Controller"]['dt']) - ruehrer = Pololu1376(configJson["Controller"]['dt'], "/dev/ttyACM0", "115200") + ruehrer = Stirrer(configJson["Controller"]['dt']) ablauf = Controller(configJson["Controller"], plant, ruehrer) diff --git a/Control/brewpi/controller.py b/Control/brewpi/controller.py index 2537eb1..2141641 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 = params['sim_warp_factor'] self.report_interval = 1.0 self.report_last_time = 0 self.thread = None