1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-23 20:18:52 +00:00

Merge pull request #1234 from gregrebholz/issue_1069

Fixes #1069.  Added "auto fan" checks to PID_autotune.
This commit is contained in:
Bo Herrmannsen 2014-12-28 10:12:08 +01:00
commit 0d957872a0
2 changed files with 19 additions and 0 deletions

View File

@ -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;

View File

@ -186,5 +186,8 @@ FORCE_INLINE void autotempShutdown(){
void PID_autotune(float temp, int extruder, int ncycles);
void setExtruderAutoFanState(int pin, bool state);
void checkExtruderAutoFans();
#endif