|
|
|
@ -188,6 +188,12 @@ void PID_autotune(float temp, int extruder, int ncycles)
|
|
|
|
|
float Kp, Ki, Kd;
|
|
|
|
|
float max = 0, min = 10000;
|
|
|
|
|
|
|
|
|
|
#if (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1) || \
|
|
|
|
|
(defined(EXTRUDER_1_AUTO_FAN_PIN) && EXTRUDER_1_AUTO_FAN_PIN > -1) || \
|
|
|
|
|
(defined(EXTRUDER_2_AUTO_FAN_PIN) && EXTRUDER_2_AUTO_FAN_PIN > -1)
|
|
|
|
|
unsigned long extruder_autofan_last_check = millis();
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
if ((extruder >= EXTRUDERS)
|
|
|
|
|
#if (TEMP_BED_PIN <= -1)
|
|
|
|
|
||(extruder < 0)
|
|
|
|
@ -224,6 +230,16 @@ void PID_autotune(float temp, int extruder, int ncycles)
|
|
|
|
|
|
|
|
|
|
max=max(max,input);
|
|
|
|
|
min=min(min,input);
|
|
|
|
|
|
|
|
|
|
#if (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1) || \
|
|
|
|
|
(defined(EXTRUDER_1_AUTO_FAN_PIN) && EXTRUDER_1_AUTO_FAN_PIN > -1) || \
|
|
|
|
|
(defined(EXTRUDER_2_AUTO_FAN_PIN) && EXTRUDER_2_AUTO_FAN_PIN > -1)
|
|
|
|
|
if(millis() - extruder_autofan_last_check > 2500) {
|
|
|
|
|
checkExtruderAutoFans();
|
|
|
|
|
extruder_autofan_last_check = millis();
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
if(heating == true && input > temp) {
|
|
|
|
|
if(millis() - t2 > 5000) {
|
|
|
|
|
heating=false;
|
|
|
|
|