From 17ee948ed1ff594ee0e0d66ada7d1e144c1f2a11 Mon Sep 17 00:00:00 2001 From: -help Date: Wed, 14 Feb 2024 13:53:17 +0200 Subject: [PATCH] testuing --- platformio.ini | 6 +++--- src/globals.cpp | 16 ++++++---------- src/globals.h | 8 ++++---- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/platformio.ini b/platformio.ini index 1249f5f..9a9ce09 100644 --- a/platformio.ini +++ b/platformio.ini @@ -25,10 +25,10 @@ lib_deps = adafruit/Adafruit GFX Library@^1.11.5 adafruit/Adafruit ST7735 and ST7789 Library@^1.10.0 https://github.com/adafruit/Adafruit_BusIO.git - SPI - Wire - https://github.com/PowerBroker2/ArduPID.git + https://github.com/PowerBroker2/ArduPID.git@0.2.1 https://github.com/PowerBroker2/FireTimer.git https://github.com/adafruit/Adafruit_SSD1306.git https://github.com/RobTillaart/Stopwatch_RT.git@0.3.5 + SPI + Wire diff --git a/src/globals.cpp b/src/globals.cpp index 3a8cc3f..0f3df0d 100644 --- a/src/globals.cpp +++ b/src/globals.cpp @@ -31,17 +31,13 @@ TempCalibration calibration_100K_3950 = {25, 100000, 107, 4957, 167, 1000}; // To measure the resistence turn off the controller completley and measure between GND and the left pin of the connector with the thermistor unplugged // 2.5k reference = Best accuracy around 138C - - - Thermistor thermistor1(THERMISTOR2_PIN, 2125, ThermistorZ_Placement::BOTTOM, ThermistorXY_Placement::MIDDLE); //- > 2125Kohm set refrence - Thermistor thermistor2(THERMISTOR3_PIN, 9100, ThermistorZ_Placement::BOTTOM, ThermistorXY_Placement::MIDDLE_LOW_TEMP);// -> 9100Kohm set refrence//// 9k reference = Best accuracy around 90C -> This thermistor is used for the preheat phase if attached - Thermistor thermistor3(THERMISTOR4_PIN, 564, ThermistorZ_Placement::BOTTOM, ThermistorXY_Placement::MIDDLE_HIGH_TEMP);//-> 564Kohm set refrence // 564R reference = Best accuracy around 210C - Thermistor thermistor6(THERMISTOR1_PIN, 2545 , ThermistorZ_Placement::ON_PCB, ThermistorXY_Placement::MIDDLE);// -> 2545Kohm set refrence -> This thermistor is set directly touching the PCB to be soldered - + Thermistor thermistor2(THERMISTOR2_PIN, 2125, ThermistorZ_Placement::BOTTOM, ThermistorXY_Placement::MIDDLE); //- > 2125Kohm set refrence + Thermistor thermistor3(THERMISTOR3_PIN, 9100, ThermistorZ_Placement::BOTTOM, ThermistorXY_Placement::MIDDLE_LOW_TEMP);// -> 9100Kohm set refrence//// 9k reference = Best accuracy around 90C -> This thermistor is used for the preheat phase if attached + Thermistor thermistor4(THERMISTOR4_PIN, 564, ThermistorZ_Placement::BOTTOM, ThermistorXY_Placement::MIDDLE_HIGH_TEMP);//-> 564Kohm set refrence // 564R reference = Best accuracy around 210C + Thermistor thermistor1(THERMISTOR1_PIN, 2545 , ThermistorZ_Placement::ON_PCB, ThermistorXY_Placement::MIDDLE);// -> 2545Kohm set refrence -> This thermistor is set directly touching the PCB to be soldered // Unused by defualt, keep unplugged - Thermistor thermistor4(THERMISTOR4_PIN, 564, ThermistorZ_Placement::BOTTOM, ThermistorXY_Placement::MIDDLE_HIGH_TEMP); - Thermistor thermistor5(THERMISTOR5_PIN,5727, ThermistorZ_Placement::TOP, ThermistorXY_Placement::MIDDLE_LOW_TEMP); - + Thermistor thermistor5(THERMISTOR4_PIN, 564, ThermistorZ_Placement::BOTTOM, ThermistorXY_Placement::MIDDLE_HIGH_TEMP); + Thermistor thermistor6(THERMISTOR5_PIN,5727, ThermistorZ_Placement::TOP, ThermistorXY_Placement::MIDDLE_LOW_TEMP); //--------------------------------------------------------------------------------------------------------------------------------------- diff --git a/src/globals.h b/src/globals.h index 81baf33..a21b2a1 100644 --- a/src/globals.h +++ b/src/globals.h @@ -37,7 +37,7 @@ //PID Controller values -#define PID_P 60 +#define PID_P 3 #define PID_I 5 #define PID_D 100 @@ -47,12 +47,12 @@ //////////////////////////////////////// //The actual PWM of the mosfet is 0 for max and 255 for off //This gets inverted after the setpoint is grabbed from the PID controller in the main loop -#define PID_OUTPUT_MIN 255 -#define PID_OUTPUT_MAX 0 +#define PID_OUTPUT_MIN 0 +#define PID_OUTPUT_MAX 130 ////////////////////////////////////// -#define PID_SAMPLE_TIME 0.1 +#define PID_SAMPLE_TIME 20