common for both devices

This commit is contained in:
Alexander Belov 2025-01-05 01:51:56 +07:00
parent ef791654b4
commit f395491f45
3 changed files with 9 additions and 7 deletions

View File

@ -92,7 +92,7 @@ bool inSelectionMode = true;
// #include "GyverPID.h" // #include "GyverPID.h"
#include "pid.h" #include "pid.h"
double Setpoint, Input, Output; double Setpoint, Input, Output;
GyverPID regulator(50, 1, 20, 1000); GyverPID regulator(10, 2, 10, 1000);
bool temperatureSensorError = false; bool temperatureSensorError = false;

View File

@ -20,12 +20,12 @@ void HandlePwmHeaterDisplay() {
currentGraphItemNumber = 0; currentGraphItemNumber = 0;
} }
byte graphHeight = 10; byte graphHeight = 8;
byte currentAmount = Output==0 ? 0 : (Output-1)/99.0 * (graphHeight) + 1; byte currentAmount = Output==0 ? 0 : (Output-1)/99.0 * (graphHeight) + 1;
graphStates[currentGraphItemNumber] = currentAmount; graphStates[currentGraphItemNumber] = currentAmount;
byte rightMargin = 127; byte rightMargin = 128;
byte topMargin = 63-graphHeight; byte topMargin = 63-graphHeight;
byte itemsDisplayed = 0; byte itemsDisplayed = 0;

View File

@ -8,10 +8,12 @@ void HandleExecution() {
getPhaseAndTemperature(); getPhaseAndTemperature();
regulator.input = (float)Input; if (Input > 20 && Input < 95) {
regulator.setpoint = Setpoint; regulator.input = (float)Input;
regulator.getResultNow(); regulator.setpoint = Setpoint;
Output = regulator.output; regulator.getResultNow();
Output = regulator.output;
}
if (isComplete && currentPhase >= activeProfile.numPhases && !finishTime) { if (isComplete && currentPhase >= activeProfile.numPhases && !finishTime) {
finishTime = currentTime; finishTime = currentTime;