From 8e258459c47356973bf827bc945c2762e7f174ec Mon Sep 17 00:00:00 2001 From: dasaki Date: Sat, 9 Nov 2019 16:50:06 +0100 Subject: [PATCH] cleanup --- ReflowController/ReflowController.ino | 7 ++++--- ReflowController/UI.h | 8 +++++--- ReflowController/config.h | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ReflowController/ReflowController.ino b/ReflowController/ReflowController.ino index e10813e..787925a 100644 --- a/ReflowController/ReflowController.ino +++ b/ReflowController/ReflowController.ino @@ -137,7 +137,7 @@ uint8_t zxLoopDelay = 0; // calibrate zero crossing: how many timerIsr happen within one zero crossing #define zxCalibrationLoops 128 -#define zxPerSecCalibrationTime 4000 +#define zxPerSecCalibrationTime 2000 struct { volatile uint8_t iterations; @@ -636,7 +636,6 @@ void loop(void) PID.SetControllerDirection(REVERSE); PID.SetTunings(fanPID.Kp, fanPID.Ki, fanPID.Kd); Setpoint = idleTemp; - } if (Input < (idleTemp + 5)) { @@ -660,7 +659,9 @@ void loop(void) // PIDTune.setpoint = 210.0; // is private inside PIDTune if (val != 0) { - currentState = CoolDown; + toggleAutoTune(); + Setpoint = idleTemp; + Output = 0; } if (currentState != Tune) { // we're done, set the tuning parameters diff --git a/ReflowController/UI.h b/ReflowController/UI.h index 8765cbb..65b396d 100644 --- a/ReflowController/UI.h +++ b/ReflowController/UI.h @@ -85,7 +85,7 @@ void displaySplash() { // splash screen tft.setCursor(2, 30); tft.setTextSize(2); - tft.print("Reflow"); + tft.print("nanoReflow"); tft.setCursor(tft.width()-120, 48); tft.print("Controller"); tft.setTextSize(1); @@ -745,12 +745,14 @@ void updateProcessDisplay() { alignRightPrefix((int)heaterValue); tft.print((int)heaterValue); tft.print('%'); - +#ifdef WITH_FAN tft.print(" \x2a"); alignRightPrefix((int)fanValue); tft.print((int)fanValue); tft.print('%'); - +#else + tft.print(" "); +#endif tft.print(" \x12 "); // alternative: \x7f printDouble(rampRate); tft.print("\367C/s "); diff --git a/ReflowController/config.h b/ReflowController/config.h index e965f3f..56ca19c 100644 --- a/ReflowController/config.h +++ b/ReflowController/config.h @@ -1,9 +1,9 @@ #ifndef CONFIG_H #define CONFIG_H -//#define ALWAYS_FIRST_RUN +//#define ALWAYS_FIRST_RUN // force resett to factory settings at startup //#define FAKE_HW 1 -#define PIDTUNE 1 // autotune wouldn't fit in the 28k available on my arduino pro micro. +//#define PIDTUNE 1 // autotune wouldn't fit in the 28k available on my arduino pro micro. #define WITH_BEEPER // Enables Beeper //#define WITH_FAN // Enables Lid opening Servo (not yet implemented) //#define WITH_SERVO // Enables Lid opening Servo (not yet implemented)