From f395491f453cb299e98cdf473884bbab39502be5 Mon Sep 17 00:00:00 2001 From: Aleksander Belov Date: Sun, 5 Jan 2025 01:51:56 +0700 Subject: [PATCH] common for both devices --- hot_fermentation.ino | 2 +- t_heater.ino | 4 ++-- t_main.ino | 10 ++++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/hot_fermentation.ino b/hot_fermentation.ino index ef70a8a..bb68036 100644 --- a/hot_fermentation.ino +++ b/hot_fermentation.ino @@ -92,7 +92,7 @@ bool inSelectionMode = true; // #include "GyverPID.h" #include "pid.h" double Setpoint, Input, Output; -GyverPID regulator(50, 1, 20, 1000); +GyverPID regulator(10, 2, 10, 1000); bool temperatureSensorError = false; diff --git a/t_heater.ino b/t_heater.ino index 947a4ed..77aa8dd 100644 --- a/t_heater.ino +++ b/t_heater.ino @@ -20,12 +20,12 @@ void HandlePwmHeaterDisplay() { currentGraphItemNumber = 0; } - byte graphHeight = 10; + byte graphHeight = 8; byte currentAmount = Output==0 ? 0 : (Output-1)/99.0 * (graphHeight) + 1; graphStates[currentGraphItemNumber] = currentAmount; - byte rightMargin = 127; + byte rightMargin = 128; byte topMargin = 63-graphHeight; byte itemsDisplayed = 0; diff --git a/t_main.ino b/t_main.ino index be6e812..7c7c764 100644 --- a/t_main.ino +++ b/t_main.ino @@ -8,10 +8,12 @@ void HandleExecution() { getPhaseAndTemperature(); - regulator.input = (float)Input; - regulator.setpoint = Setpoint; - regulator.getResultNow(); - Output = regulator.output; + if (Input > 20 && Input < 95) { + regulator.input = (float)Input; + regulator.setpoint = Setpoint; + regulator.getResultNow(); + Output = regulator.output; + } if (isComplete && currentPhase >= activeProfile.numPhases && !finishTime) { finishTime = currentTime;