Selaa lähdekoodia

Add "kick fan" feature - briefly run fan at full speed on start.

Add a feature to run the cooling fan at full speed for a small period
(default 100ms) when first starting the fan.  Some fans wont reliably
start spinning at low power, and many fans have issue with the PWM at
low power.  However, once the fan starts spinning it can reliably be
set to a wide range of PWM values.
Kevin O'Connor 12 vuotta sitten
vanhempi
commit
3d91bd486c
2 muutettua tiedostoa jossa 19 lisäystä ja 0 poistoa
  1. 5
    0
      Marlin/Configuration_adv.h
  2. 14
    0
      Marlin/planner.cpp

+ 5
- 0
Marlin/Configuration_adv.h Näytä tiedosto

@@ -66,6 +66,11 @@
66 66
 //#define CONTROLLERFAN_PIN 23 //Pin used for the fan to cool controller, comment out to disable this function
67 67
 #define CONTROLLERFAN_SEC 60 //How many seconds, after all motors were disabled, the fan should run
68 68
 
69
+// When first starting the main fan, run it at full speed for the
70
+// given number of milliseconds.  This gets the fan spinning reliably
71
+// before setting a PWM value.  Set to zero to disable.
72
+#define FAN_KICKSTART_TIME 100
73
+
69 74
 //===========================================================================
70 75
 //=============================Mechanical Settings===========================
71 76
 //===========================================================================

+ 14
- 0
Marlin/planner.cpp Näytä tiedosto

@@ -466,6 +466,20 @@ void check_axes_activity()
466 466
   }
467 467
 #if FAN_PIN > -1
468 468
   #ifndef FAN_SOFT_PWM
469
+  if (FAN_KICKSTART_TIME) {
470
+    static unsigned long FanKickEnd;
471
+    if (tail_fan_speed) {
472
+      if (FanKickEnd == 0) {
473
+        // Just starting up fan - run at full power.
474
+        FanKickEnd = millis() + FAN_KICKSTART_TIME;
475
+        tail_fan_speed = 255;
476
+      } else if (FanKickEnd > millis())
477
+        // Fan still spinning up.
478
+        tail_fan_speed = 255;
479
+    } else {
480
+      FanKickEnd = 0;
481
+    }
482
+  }
469 483
   analogWrite(FAN_PIN,tail_fan_speed);
470 484
   #endif
471 485
 #endif

Loading…
Peruuta
Tallenna