diff --git a/g2core/settings/settings_Printrbot_Simple_1608.h b/g2core/settings/settings_Printrbot_Simple_1608.h index 8fc30ccc..40dceaa1 100644 --- a/g2core/settings/settings_Printrbot_Simple_1608.h +++ b/g2core/settings/settings_Printrbot_Simple_1608.h @@ -71,7 +71,7 @@ #define STATUS_REPORT_INTERVAL_MS 250 // milliseconds - set $SV=0 to disable // Defaults for 3DP -#define STATUS_REPORT_DEFAULTS "line","posx","posy","posz","posa","vel","he1t","he1st","he1at","feed","unit","path","stat" +#define STATUS_REPORT_DEFAULTS "line","posx","posy","posz","posa","vel","he1t","he1st","he1at","he1op","he3t","he3st","he3at","he3op","feed","unit","path","stat" // There are no heater two or three, but these would show those: ,"he2t","he2st","he2at","he3t","he3st","he3at" // Defaults for motion debugging @@ -355,7 +355,7 @@ /*** Extruders / Heaters ***/ -#define MIX_FAN_VALUE 0.4 // (he1fm) at MIN_FAN_TEMP the fan comes on at this spped (0.0-1.0) +#define MIN_FAN_VALUE 0.4 // (he1fm) at MIN_FAN_TEMP the fan comes on at this spped (0.0-1.0) #define MAX_FAN_VALUE 0.75 // (he1fp) at MAX_FAN_TEMP the fan is at this spped (0.0-1.0) #define MIN_FAN_TEMP 50.0 // (he1fl) at this temp the fan starts to ramp up linearly #define MAX_FAN_TEMP 100.0 // (he1fh) at this temperature the fan is at "full speed" (MAX_FAN_VALUE) @@ -370,7 +370,7 @@ #define H2_DEFAULT_I 0.05 #define H2_DEFAULT_D 150.0 -#define H3_DEFAULT_ENABLE false +#define H3_DEFAULT_ENABLE true #define H3_DEFAULT_P 9.0 #define H3_DEFAULT_I 0.12 #define H3_DEFAULT_D 400.0 diff --git a/g2core/temperature.cpp b/g2core/temperature.cpp index ebb3fccc..1e377627 100755 --- a/g2core/temperature.cpp +++ b/g2core/temperature.cpp @@ -84,8 +84,11 @@ #ifndef TEMP_MIN_RISE_DEGREES_OVER_TIME #define TEMP_MIN_RISE_DEGREES_OVER_TIME (float)10.0 #endif +#ifndef TEMP_MIN_BED_RISE_DEGREES_OVER_TIME +#define TEMP_MIN_BED_RISE_DEGREES_OVER_TIME (float)3.0 +#endif #ifndef TEMP_MIN_RISE_TIME -#define TEMP_MIN_RISE_TIME (float)(60.0 * 1000.0) // 20 seconds +#define TEMP_MIN_RISE_TIME (float)(60.0 * 1000.0) // one minute #endif #ifndef TEMP_MIN_RISE_DEGREES_FROM_TARGET #define TEMP_MIN_RISE_DEGREES_FROM_TARGET (float)10.0 @@ -230,8 +233,8 @@ void ADCPin::interrupt() { // Heated bed Thermistor thermistor3 { - /*T1:*/ 20.0, /*T2:*/ 190.0, /*T3:*/ 255.0, - /*R1:*/ 140000.0, /*R2:*/ 490.0, /*R3:*/ 109.0, /*pullup_resistance:*/ 4700, /*inline_resistance:*/ 4700 + /*T1:*/ 20.0, /*T2:*/ 42.0, /*T3:*/ 76.0, + /*R1:*/ 140000.0, /*R2:*/ 36755.0, /*R3:*/ 10000.0, /*pullup_resistance:*/ 4700, /*inline_resistance:*/ 4700 }; #if ADC0_AVAILABLE == 1 namespace Motate { @@ -331,11 +334,12 @@ struct PID { bool _at_set_point; Timeout _rise_time_timeout; // used to keep track of if we are increasing temperature fast enough + float _min_rise_over_time; // the amount of degrees that it must rise in the given time float _rise_time_checkpoint; // when we start the timer, we set _rise_time_checkpoint to the minimum goal bool _enable; // set true to enable this heater - PID(float P, float I, float D, float startSetPoint = 0.0) : _p_factor{P/100.0f}, _i_factor{I/100.0f}, _d_factor{D/100.0f}, _set_point{startSetPoint}, _at_set_point{false} {}; + PID(float P, float I, float D, float min_rise_over_time, float startSetPoint = 0.0) : _p_factor{P/100.0f}, _i_factor{I/100.0f}, _d_factor{D/100.0f}, _set_point{startSetPoint}, _at_set_point{false}, _min_rise_over_time(min_rise_over_time) {}; float getNewOutput(float input) { // If the input is < 0, the sensor failed @@ -380,7 +384,7 @@ struct PID { if (!_rise_time_timeout.isSet() && (_set_point > (input + TEMP_MIN_RISE_DEGREES_FROM_TARGET))) { _rise_time_timeout.set(TEMP_MIN_RISE_TIME); - _rise_time_checkpoint = min(input + TEMP_MIN_RISE_DEGREES_OVER_TIME, _set_point + TEMP_SETPOINT_HYSTERESIS); + _rise_time_checkpoint = min(input + _min_rise_over_time, _set_point + TEMP_SETPOINT_HYSTERESIS); } } @@ -437,9 +441,9 @@ struct PID { // NOTICE, the JSON alters incoming values for these! // {he1p:9} == 9.0/100.0 here -PID pid1 { 9.0, 0.11, 400.0 }; // default values -PID pid2 { 7.5, 0.12, 400.0 }; // default values -PID pid3 { 7.5, 0.12, 400.0 }; // default values +PID pid1 { 9.0, 0.11, 400.0, TEMP_MIN_RISE_DEGREES_OVER_TIME }; // default values +PID pid2 { 7.5, 0.12, 400.0, TEMP_MIN_RISE_DEGREES_OVER_TIME }; // default values +PID pid3 { 7.5, 0.12, 400.0, TEMP_MIN_BED_RISE_DEGREES_OVER_TIME }; // default values Timeout pid_timeout;