Bläddra i källkod

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 år sedan
förälder
incheckning
3d91bd486c
2 ändrade filer med 19 tillägg och 0 borttagningar
  1. 5
    0
      Marlin/Configuration_adv.h
  2. 14
    0
      Marlin/planner.cpp

+ 5
- 0
Marlin/Configuration_adv.h Visa fil

66
 //#define CONTROLLERFAN_PIN 23 //Pin used for the fan to cool controller, comment out to disable this function
66
 //#define CONTROLLERFAN_PIN 23 //Pin used for the fan to cool controller, comment out to disable this function
67
 #define CONTROLLERFAN_SEC 60 //How many seconds, after all motors were disabled, the fan should run
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
 //=============================Mechanical Settings===========================
75
 //=============================Mechanical Settings===========================
71
 //===========================================================================
76
 //===========================================================================

+ 14
- 0
Marlin/planner.cpp Visa fil

466
   }
466
   }
467
 #if FAN_PIN > -1
467
 #if FAN_PIN > -1
468
   #ifndef FAN_SOFT_PWM
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
   analogWrite(FAN_PIN,tail_fan_speed);
483
   analogWrite(FAN_PIN,tail_fan_speed);
470
   #endif
484
   #endif
471
 #endif
485
 #endif

Laddar…
Avbryt
Spara