From 05f32f34c7633b3aba7b50c93353e1e37e8cc868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Ha=C3=9Fel?= Date: Fri, 12 Apr 2024 00:27:01 +0200 Subject: [PATCH] PID evolve 2 --- src/Fermenter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Fermenter.cpp b/src/Fermenter.cpp index 8187f4a..c5b850a 100644 --- a/src/Fermenter.cpp +++ b/src/Fermenter.cpp @@ -65,9 +65,9 @@ void patrixLoop() { if (now - lastDebug >= 1000) { lastDebug = now; int heaterPercent = (int) round(100.0 * heaterPWM / CONTROL_PWM_MAX); - debug("p: %f | i: %f | d: %f | current: %4.1f | target: %4.1f | heater: %3d%%", proportional, integral, derivative, temperatureCurrent, temperatureTarget, heaterPercent); + debug("p: %.10f | i: %.10f | d: %.10f | current: %5.2f | target: %5.2f | heater: %3d%%", proportional, integral, derivative, temperatureCurrent, temperatureTarget, heaterPercent); if (emergencyCutOff) { - error("[EMERGENCY CUTOFF] temperatureCurrent (=%4.1f) > temperatureTarget + %4.1f (=%4.1f) [EMERGENCY CUTOFF]", temperatureCurrent, temperatureMaxOvershoot, temperatureTarget); + error("[EMERGENCY CUTOFF] temperatureCurrent (=%5.2f) > temperatureTarget + %5.2f (=%5.2f) [EMERGENCY CUTOFF]", temperatureCurrent, temperatureMaxOvershoot, temperatureTarget); } } } @@ -117,8 +117,8 @@ bool patrix_command(char *first) { } void configLoad() { - proportional = configGetDouble("p", 200); - integral = configGetDouble("i", 0); + proportional = configGetDouble("p", 3000); + integral = configGetDouble("i", 10); derivative = configGetDouble("d", 0); temperatureTarget = configGetDouble("target", 31); temperatureMaxOvershoot = configGetDouble("over", 5);