Преглед изворни кода

ADAPTIVE_FAN_SLOWING extension to hotend thermal protection (#12853)

InsanityAutomation пре 5 година
родитељ
комит
082f6a27de
88 измењених фајлова са 405 додато и 161 уклоњено
  1. 2
    0
      Marlin/Configuration_adv.h
  2. 2
    13
      Marlin/src/Marlin.cpp
  3. 0
    18
      Marlin/src/Marlin.h
  4. 2
    0
      Marlin/src/config/default/Configuration_adv.h
  5. 2
    0
      Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h
  6. 2
    0
      Marlin/src/config/examples/Anet/A2/Configuration_adv.h
  7. 2
    0
      Marlin/src/config/examples/Anet/A2plus/Configuration_adv.h
  8. 2
    0
      Marlin/src/config/examples/Anet/A6/Configuration_adv.h
  9. 2
    0
      Marlin/src/config/examples/Anet/A8/Configuration_adv.h
  10. 2
    0
      Marlin/src/config/examples/ArmEd/Configuration_adv.h
  11. 2
    0
      Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h
  12. 2
    0
      Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h
  13. 2
    0
      Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h
  14. 2
    0
      Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h
  15. 2
    0
      Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h
  16. 2
    0
      Marlin/src/config/examples/Cartesio/Configuration_adv.h
  17. 2
    0
      Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h
  18. 2
    0
      Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h
  19. 2
    0
      Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h
  20. 2
    0
      Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h
  21. 2
    0
      Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h
  22. 2
    0
      Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h
  23. 2
    0
      Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h
  24. 2
    0
      Marlin/src/config/examples/Einstart-S/Configuration_adv.h
  25. 2
    0
      Marlin/src/config/examples/Felix/Configuration_adv.h
  26. 2
    0
      Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h
  27. 2
    0
      Marlin/src/config/examples/Formbot/Raptor/Configuration_adv.h
  28. 2
    0
      Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration_adv.h
  29. 2
    0
      Marlin/src/config/examples/Formbot/T_Rex_3/Configuration_adv.h
  30. 2
    0
      Marlin/src/config/examples/Geeetech/MeCreator2/Configuration_adv.h
  31. 2
    0
      Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h
  32. 2
    0
      Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h
  33. 2
    0
      Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h
  34. 2
    0
      Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h
  35. 2
    0
      Marlin/src/config/examples/MakerParts/Configuration_adv.h
  36. 2
    0
      Marlin/src/config/examples/Malyan/M150/Configuration_adv.h
  37. 2
    0
      Marlin/src/config/examples/Malyan/M200/Configuration_adv.h
  38. 2
    0
      Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h
  39. 2
    0
      Marlin/src/config/examples/Mks/Robin/Configuration_adv.h
  40. 2
    0
      Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h
  41. 2
    0
      Marlin/src/config/examples/RigidBot/Configuration_adv.h
  42. 2
    0
      Marlin/src/config/examples/SCARA/Configuration_adv.h
  43. 2
    0
      Marlin/src/config/examples/Sanguinololu/Configuration_adv.h
  44. 2
    0
      Marlin/src/config/examples/TheBorg/Configuration_adv.h
  45. 2
    0
      Marlin/src/config/examples/TinyBoy2/Configuration_adv.h
  46. 2
    0
      Marlin/src/config/examples/Tronxy/X3A/Configuration_adv.h
  47. 2
    0
      Marlin/src/config/examples/UltiMachine/Archim1/Configuration_adv.h
  48. 2
    0
      Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h
  49. 2
    0
      Marlin/src/config/examples/VORONDesign/Configuration_adv.h
  50. 1
    1
      Marlin/src/config/examples/VORONDesign/_Bootscreen.h
  51. 2
    0
      Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h
  52. 2
    0
      Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h
  53. 2
    0
      Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h
  54. 2
    0
      Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration_adv.h
  55. 2
    0
      Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h
  56. 2
    0
      Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h
  57. 2
    0
      Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h
  58. 2
    0
      Marlin/src/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h
  59. 2
    0
      Marlin/src/config/examples/delta/MKS/SBASE/Configuration_adv.h
  60. 2
    0
      Marlin/src/config/examples/delta/Tevo Little Monster/Configuration_adv.h
  61. 2
    0
      Marlin/src/config/examples/delta/generic/Configuration_adv.h
  62. 2
    0
      Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h
  63. 2
    0
      Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h
  64. 2
    0
      Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h
  65. 2
    0
      Marlin/src/config/examples/makibox/Configuration_adv.h
  66. 2
    0
      Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h
  67. 2
    0
      Marlin/src/config/examples/wt150/Configuration_adv.h
  68. 1
    1
      Marlin/src/feature/power.cpp
  69. 1
    1
      Marlin/src/feature/power_loss_recovery.cpp
  70. 7
    3
      Marlin/src/gcode/control/M42.cpp
  71. 3
    3
      Marlin/src/gcode/control/M80_M81.cpp
  72. 8
    44
      Marlin/src/gcode/temperature/M106_M107.cpp
  73. 11
    7
      Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp
  74. 13
    6
      Marlin/src/lcd/dogm/status_screen_DOGM.cpp
  75. 11
    4
      Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp
  76. 9
    3
      Marlin/src/lcd/extensible_ui/ui_api.cpp
  77. 3
    2
      Marlin/src/lcd/extensible_ui/ui_api.h
  78. 1
    1
      Marlin/src/lcd/malyanlcd.cpp
  79. 1
    1
      Marlin/src/lcd/menu/menu_main.cpp
  80. 11
    11
      Marlin/src/lcd/menu/menu_temperature.cpp
  81. 8
    8
      Marlin/src/lcd/menu/menu_tune.cpp
  82. 4
    4
      Marlin/src/module/planner.cpp
  83. 1
    19
      Marlin/src/module/probe.cpp
  84. 0
    4
      Marlin/src/module/probe.h
  85. 113
    4
      Marlin/src/module/temperature.cpp
  86. 65
    0
      Marlin/src/module/temperature.h
  87. 2
    2
      Marlin/src/module/tool_change.cpp
  88. 1
    1
      buildroot/share/tests/LPC1768_tests

+ 2
- 0
Marlin/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 13
Marlin/src/Marlin.cpp Прегледај датотеку

@@ -164,17 +164,6 @@ bool Running = true;
164 164
   TempUnit input_temp_units = TEMPUNIT_C;
165 165
 #endif
166 166
 
167
-#if FAN_COUNT > 0
168
-  uint8_t fan_speed[FAN_COUNT] = { 0 };
169
-  #if ENABLED(EXTRA_FAN_SPEED)
170
-    uint8_t old_fan_speed[FAN_COUNT], new_fan_speed[FAN_COUNT];
171
-  #endif
172
-  #if ENABLED(PROBING_FANS_OFF)
173
-    bool fans_paused; // = false;
174
-    uint8_t paused_fan_speed[FAN_COUNT] = { 0 };
175
-  #endif
176
-#endif
177
-
178 167
 // For M109 and M190, this flag may be cleared (by M108) to exit the wait loop
179 168
 volatile bool wait_for_heatup = true;
180 169
 
@@ -655,7 +644,7 @@ void stop() {
655 644
   print_job_timer.stop();
656 645
 
657 646
   #if ENABLED(PROBING_FANS_OFF)
658
-    if (fans_paused) fans_pause(false); // put things back the way they were
647
+    if (thermalManager.fans_paused) thermalManager.set_fans_paused(false); // put things back the way they were
659 648
   #endif
660 649
 
661 650
   if (IsRunning()) {
@@ -976,7 +965,7 @@ void loop() {
976 965
         quickstop_stepper();
977 966
         print_job_timer.stop();
978 967
         thermalManager.disable_all_heaters();
979
-        zero_fan_speeds();
968
+        thermalManager.zero_fan_speeds();
980 969
         wait_for_heatup = false;
981 970
         #if ENABLED(POWER_LOSS_RECOVERY)
982 971
           card.removeJobRecoveryFile();

+ 0
- 18
Marlin/src/Marlin.h Прегледај датотеку

@@ -81,24 +81,6 @@ extern volatile bool wait_for_heatup;
81 81
 // Inactivity shutdown timer
82 82
 extern millis_t max_inactive_time, stepper_inactive_time;
83 83
 
84
-#if FAN_COUNT > 0
85
-  extern uint8_t fan_speed[FAN_COUNT];
86
-  #if ENABLED(EXTRA_FAN_SPEED)
87
-    extern uint8_t old_fan_speed[FAN_COUNT], new_fan_speed[FAN_COUNT];
88
-  #endif
89
-  #if ENABLED(PROBING_FANS_OFF)
90
-    extern bool fans_paused;
91
-    extern uint8_t paused_fan_speed[FAN_COUNT];
92
-  #endif
93
-  #define FANS_LOOP(I) LOOP_L_N(I, FAN_COUNT)
94
-#endif
95
-
96
-inline void zero_fan_speeds() {
97
-  #if FAN_COUNT > 0
98
-    FANS_LOOP(i) fan_speed[i] = 0;
99
-  #endif
100
-}
101
-
102 84
 #if ENABLED(USE_CONTROLLER_FAN)
103 85
   extern uint8_t controllerfan_speed;
104 86
 #endif

+ 2
- 0
Marlin/src/config/default/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Anet/A2/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Anet/A2plus/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Anet/A6/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 60        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 10    // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Anet/A8/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 60        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 10    // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/ArmEd/Configuration_adv.h Прегледај датотеку

@@ -81,6 +81,8 @@
81 81
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
82 82
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
83 83
 
84
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
85
+
84 86
   /**
85 87
    * Whenever an M104, M109, or M303 increases the target temperature, the
86 88
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 45        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 2     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 60        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 2     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Cartesio/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Einstart-S/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Felix/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 2     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Formbot/Raptor/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 210       // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 2     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 60        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 10    // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Formbot/T_Rex_3/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 60        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 10    // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Geeetech/MeCreator2/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/MakerParts/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Malyan/M150/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Malyan/M200/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Mks/Robin/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 50        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 6     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/RigidBot/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/SCARA/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Sanguinololu/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/TheBorg/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 50        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 6     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/TinyBoy2/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Tronxy/X3A/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/UltiMachine/Archim1/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/VORONDesign/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 1
- 1
Marlin/src/config/examples/VORONDesign/_Bootscreen.h Прегледај датотеку

@@ -77,5 +77,5 @@ const unsigned char custom_start_bmp[] PROGMEM = {
77 77
   B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
78 78
   B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
79 79
   B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
80
-  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 
80
+  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000
81 81
 };

+ 2
- 0
Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h Прегледај датотеку

@@ -87,6 +87,8 @@
87 87
   #define THERMAL_PROTECTION_PERIOD 60        // Seconds
88 88
   #define THERMAL_PROTECTION_HYSTERESIS 8     // Degrees Celsius
89 89
 
90
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
91
+
90 92
   /**
91 93
    * Whenever an M104, M109, or M303 increases the target temperature, the
92 94
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 60        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/delta/MKS/SBASE/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 50        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 6     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/delta/Tevo Little Monster/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 60        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 10     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/delta/generic/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 50        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 3     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/makibox/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 0
Marlin/src/config/examples/wt150/Configuration_adv.h Прегледај датотеку

@@ -77,6 +77,8 @@
77 77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78 78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
79 79
 
80
+  //#define ADAPTIVE_FAN_SLOWING              // Slow part cooling fan if temperature drops
81
+
80 82
   /**
81 83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82 84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 1
- 1
Marlin/src/feature/power.cpp Прегледај датотеку

@@ -39,7 +39,7 @@ millis_t Power::lastPowerOn;
39 39
 
40 40
 bool Power::is_power_needed() {
41 41
   #if ENABLED(AUTO_POWER_FANS)
42
-    FANS_LOOP(i) if (fan_speed[i]) return true;
42
+    FANS_LOOP(i) if (thermalManager.fan_speed[i]) return true;
43 43
   #endif
44 44
 
45 45
   #if ENABLED(AUTO_POWER_E_FANS)

+ 1
- 1
Marlin/src/feature/power_loss_recovery.cpp Прегледај датотеку

@@ -162,7 +162,7 @@ void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*=
162 162
     #endif
163 163
 
164 164
     #if FAN_COUNT
165
-      COPY(info.fan_speed, fan_speed);
165
+      COPY(info.fan_speed, thermalManager.fan_speed);
166 166
     #endif
167 167
 
168 168
     #if HAS_LEVELING

+ 7
- 3
Marlin/src/gcode/control/M42.cpp Прегледај датотеку

@@ -24,6 +24,10 @@
24 24
 #include "../../Marlin.h" // for pin_is_protected
25 25
 #include "../../inc/MarlinConfig.h"
26 26
 
27
+#if FAN_COUNT > 0
28
+  #include "../../module/temperature.h"
29
+#endif
30
+
27 31
 /**
28 32
  * M42: Change pin status via GCode
29 33
  *
@@ -52,13 +56,13 @@ void GcodeSuite::M42() {
52 56
   #if FAN_COUNT > 0
53 57
     switch (pin) {
54 58
       #if HAS_FAN0
55
-        case FAN_PIN: fan_speed[0] = pin_status; break;
59
+        case FAN_PIN: thermalManager.fan_speed[0] = pin_status; break;
56 60
       #endif
57 61
       #if HAS_FAN1
58
-        case FAN1_PIN: fan_speed[1] = pin_status; break;
62
+        case FAN1_PIN: thermalManager.fan_speed[1] = pin_status; break;
59 63
       #endif
60 64
       #if HAS_FAN2
61
-        case FAN2_PIN: fan_speed[2] = pin_status; break;
65
+        case FAN2_PIN: thermalManager.fan_speed[2] = pin_status; break;
62 66
       #endif
63 67
     }
64 68
   #endif

+ 3
- 3
Marlin/src/gcode/control/M80_M81.cpp Прегледај датотеку

@@ -100,10 +100,10 @@ void GcodeSuite::M81() {
100 100
   planner.finish_and_disable();
101 101
 
102 102
   #if FAN_COUNT > 0
103
-    zero_fan_speeds();
103
+    thermalManager.zero_fan_speeds();
104 104
     #if ENABLED(PROBING_FANS_OFF)
105
-      fans_paused = false;
106
-      ZERO(paused_fan_speed);
105
+      thermalManager.fans_paused = false;
106
+      ZERO(thermalManager.paused_fan_speed);
107 107
     #endif
108 108
   #endif
109 109
 

+ 8
- 44
Marlin/src/gcode/temperature/M106_M107.cpp Прегледај датотеку

@@ -25,13 +25,9 @@
25 25
 #if FAN_COUNT > 0
26 26
 
27 27
 #include "../gcode.h"
28
-#include "../../Marlin.h" // for fan_speed
29
-
30 28
 #include "../../module/motion.h"
29
+#include "../../module/temperature.h"
31 30
 
32
-#if ENABLED(SINGLENOZZLE)
33
-  #include "../../module/tool_change.h"
34
-#endif
35 31
 
36 32
 /**
37 33
  * M106: Set Fan Speed
@@ -50,39 +46,16 @@ void GcodeSuite::M106() {
50 46
   const uint8_t p = parser.byteval('P', MIN(active_extruder, FAN_COUNT - 1));
51 47
 
52 48
   if (p < MIN(EXTRUDERS, FAN_COUNT)) {
53
-    uint16_t s = parser.ushortval('S', 255);
54
-    NOMORE(s, 255U);
55
-
56
-    uint8_t np = p;
57
-
58
-    #if ENABLED(SINGLENOZZLE)
59
-      if (p != active_extruder) {
60
-        if (p < EXTRUDERS) singlenozzle_fan_speed[p] = s;
61
-        return;
62
-      }
63
-      np = 0; // Always use fan index 0 with SINGLENOZZLE
64
-    #endif
65 49
 
66 50
     #if ENABLED(EXTRA_FAN_SPEED)
67 51
       const int16_t t = parser.intval('T');
68
-      if (t > 0) {
69
-        switch (t) {
70
-          case 1:
71
-            fan_speed[np] = old_fan_speed[np];
72
-            break;
73
-          case 2:
74
-            old_fan_speed[np] = fan_speed[np];
75
-            fan_speed[np] = new_fan_speed[np];
76
-            break;
77
-          default:
78
-            new_fan_speed[np] = MIN(t, 255U);
79
-            break;
80
-        }
81
-        return;
82
-      }
83
-    #endif // EXTRA_FAN_SPEED
52
+      if (t > 0) return thermalManager.set_temp_fan_speed(p, t);
53
+    #endif
54
+
55
+    uint16_t s = parser.ushortval('S', 255);
56
+    NOMORE(s, 255U);
84 57
 
85
-    fan_speed[np] = s;
58
+    thermalManager.set_fan_speed(p, s);
86 59
   }
87 60
 }
88 61
 
@@ -90,16 +63,7 @@ void GcodeSuite::M106() {
90 63
  * M107: Fan Off
91 64
  */
92 65
 void GcodeSuite::M107() {
93
-  const uint16_t p = parser.byteval('P', active_extruder);
94
-
95
-  #if ENABLED(SINGLENOZZLE)
96
-    if (p != active_extruder) {
97
-      if (p < EXTRUDERS) singlenozzle_fan_speed[p] = 0;
98
-      return;
99
-    }
100
-  #endif
101
-
102
-  if (p < MIN(EXTRUDERS, FAN_COUNT)) fan_speed[p] = 0;
66
+  thermalManager.set_fan_speed(parser.byteval('P', active_extruder), 0);
103 67
 }
104 68
 
105 69
 #endif // FAN_COUNT > 0

+ 11
- 7
Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp Прегледај датотеку

@@ -866,11 +866,15 @@ void MarlinUI::draw_status_screen() {
866 866
           _draw_print_progress();
867 867
         #else
868 868
           char c;
869
-          int per;
869
+          uint16_t per;
870 870
           #if HAS_FAN0
871
-            if (blink) {
872
-              c = 'F';
873
-              per = ((int(fan_speed[0]) + 1) * 100) / 256;
871
+            if (blink || thermalManager.fan_speed_scaler[0] < 128) {
872
+              uint16_t spd = thermalManager.fan_speed[0];
873
+              if (blink) c = 'F';
874
+              #if ENABLED(ADAPTIVE_FAN_SLOWING)
875
+                else { c = '*'; spd = (spd * thermalManager.fan_speed_scaler[0]) >> 7; }
876
+              #endif
877
+              per = thermalManager.fanPercent(spd);
874 878
             }
875 879
             else
876 880
           #endif
@@ -1049,13 +1053,13 @@ void MarlinUI::draw_status_screen() {
1049 1053
       #if FAN_COUNT > 0
1050 1054
         if (0
1051 1055
           #if HAS_FAN0
1052
-            || fan_speed[0]
1056
+            || thermalManager.fan_speed[0]
1053 1057
           #endif
1054 1058
           #if HAS_FAN1
1055
-            || fan_speed[1]
1059
+            || thermalManager.fan_speed[1]
1056 1060
           #endif
1057 1061
           #if HAS_FAN2
1058
-            || fan_speed[2]
1062
+            || thermalManager.fan_speed[2]
1059 1063
           #endif
1060 1064
         ) leds |= LED_C;
1061 1065
       #endif // FAN_COUNT > 0

+ 13
- 6
Marlin/src/lcd/dogm/status_screen_DOGM.cpp Прегледај датотеку

@@ -291,7 +291,7 @@ void MarlinUI::draw_status_screen() {
291 291
       static uint8_t fan_frame;
292 292
       if (old_blink != blink) {
293 293
         old_blink = blink;
294
-        if (!fan_speed[0] || ++fan_frame >= STATUS_FAN_FRAMES) fan_frame = 0;
294
+        if (!thermalManager.fan_speed[0] || ++fan_frame >= STATUS_FAN_FRAMES) fan_frame = 0;
295 295
       }
296 296
     #endif
297 297
     if (PAGE_CONTAINS(STATUS_FAN_Y, STATUS_FAN_Y + STATUS_FAN_HEIGHT - 1))
@@ -305,7 +305,7 @@ void MarlinUI::draw_status_screen() {
305 305
             fan_frame == 3 ? status_fan3_bmp :
306 306
           #endif
307 307
         #elif STATUS_FAN_FRAMES > 1
308
-          blink && fan_speed[0] ? status_fan1_bmp :
308
+          blink && thermalManager.fan_speed[0] ? status_fan1_bmp :
309 309
         #endif
310 310
         status_fan0_bmp
311 311
       );
@@ -328,11 +328,18 @@ void MarlinUI::draw_status_screen() {
328 328
     // Fan, if a bitmap was provided
329 329
     #if DO_DRAW_FAN
330 330
       if (PAGE_CONTAINS(STATUS_FAN_TEXT_Y - INFO_FONT_ASCENT, STATUS_FAN_TEXT_Y - 1)) {
331
-        const int per = ((int(fan_speed[0]) + 1) * 100) / 256;
332
-        if (per) {
331
+        char c = '%';
332
+        uint16_t spd = thermalManager.fan_speed[0];
333
+        if (spd) {
334
+          #if ENABLED(ADAPTIVE_FAN_SLOWING)
335
+            if (!blink && thermalManager.fan_speed_scaler[0] < 128) {
336
+              spd = (spd * thermalManager.fan_speed_scaler[0]) >> 7;
337
+              c = '*';
338
+            }
339
+          #endif
333 340
           lcd_moveto(STATUS_FAN_TEXT_X, STATUS_FAN_TEXT_Y);
334
-          lcd_put_u8str(itostr3(per));
335
-          lcd_put_wchar('%');
341
+          lcd_put_u8str(itostr3(thermalManager.fanPercent(spd)));
342
+          lcd_put_wchar(c);
336 343
         }
337 344
       }
338 345
     #endif

+ 11
- 4
Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp Прегледај датотеку

@@ -707,7 +707,7 @@ bool ST7920_Lite_Status_Screen::indicators_changed() {
707 707
   // them only during blinks we gain a bit of stability.
708 708
   const bool       blink             = ui.get_blink();
709 709
   const uint16_t   feedrate_perc     = feedrate_percentage;
710
-  const uint8_t    fs                = (((uint16_t)fan_speed[0] + 1) * 100) / 256;
710
+  const uint16_t   fs                = (thermalManager.fan_speed[0] * uint16_t(thermalManager.fan_speed_scaler[0])) >> 7;
711 711
   const int16_t    extruder_1_target = thermalManager.degTargetHotend(0);
712 712
   #if HOTENDS > 1
713 713
     const int16_t  extruder_2_target = thermalManager.degTargetHotend(1);
@@ -734,7 +734,6 @@ void ST7920_Lite_Status_Screen::update_indicators(const bool forceUpdate) {
734 734
     const bool       blink             = ui.get_blink();
735 735
     const duration_t elapsed           = print_job_timer.duration();
736 736
     const uint16_t   feedrate_perc     = feedrate_percentage;
737
-    const uint8_t    fs                = (((uint16_t)fan_speed[0] + 1) * 100) / 256;
738 737
     const int16_t    extruder_1_temp   = thermalManager.degHotend(0),
739 738
                      extruder_1_target = thermalManager.degTargetHotend(0);
740 739
     #if HOTENDS > 1
@@ -753,12 +752,20 @@ void ST7920_Lite_Status_Screen::update_indicators(const bool forceUpdate) {
753 752
     #if HAS_HEATED_BED
754 753
       draw_bed_temp(bed_temp, bed_target, forceUpdate);
755 754
     #endif
756
-    draw_fan_speed(fs);
755
+
756
+    uint16_t spd = thermalManager.fan_speed[0];
757
+
758
+    #if ENABLED(ADAPTIVE_FAN_SLOWING)
759
+      if (!blink && thermalManager.fan_speed_scaler[0] < 128)
760
+        spd = (spd * thermalManager.fan_speed_scaler[0]) >> 7;
761
+    #endif
762
+
763
+    draw_fan_speed(thermalManager.fanPercent(spd));
757 764
     draw_print_time(elapsed);
758 765
     draw_feedrate_percentage(feedrate_perc);
759 766
 
760 767
     // Update the fan and bed animations
761
-    if (fs) draw_fan_icon(blink);
768
+    if (spd) draw_fan_icon(blink);
762 769
     #if HAS_HEATED_BED
763 770
       draw_heat_icon(bed_target > 0 && blink, bed_target > 0);
764 771
     #endif

+ 9
- 3
Marlin/src/lcd/extensible_ui/ui_api.cpp Прегледај датотеку

@@ -180,7 +180,13 @@ namespace ExtUI {
180 180
     return thermalManager.degTargetHotend(extruder - E0);
181 181
   }
182 182
 
183
-  float getFan_percent(const fan_t fan) { return ((float(fan_speed[fan - FAN0]) + 1) * 100) / 256; }
183
+  float getTargetFan_percent(const fan_t fan) {
184
+    return thermalManager.fanPercent(thermalManager.fan_speed[fan - FAN0]);
185
+  }
186
+
187
+  float getActualFan_percent(const fan_t fan) {
188
+    return thermalManager.fanPercent((thermalManager.fan_speed[fan - FAN0] * uint16_t(thermalManager.fan_speed_scaler[fan - FAN0])) >> 7);
189
+  }
184 190
 
185 191
   float getAxisPosition_mm(const axis_t axis) {
186 192
     return flags.manual_motion ? destination[axis] : current_position[axis];
@@ -560,9 +566,9 @@ namespace ExtUI {
560 566
     thermalManager.setTargetHotend(clamp(value, 0, heater_maxtemp[e] - 15), e);
561 567
   }
562 568
 
563
-  void setFan_percent(float value, const fan_t fan) {
569
+  void setTargetFan_percent(const float value, const fan_t fan) {
564 570
     if (fan < FAN_COUNT)
565
-      fan_speed[fan - FAN0] = clamp(round(value * 255 / 100), 0, 255);
571
+      thermalManager.set_fan_speed(fan - FAN0, map(value, 0, 100, 0, 255));
566 572
   }
567 573
 
568 574
   void setFeedrate_percent(const float value) {

+ 3
- 2
Marlin/src/lcd/extensible_ui/ui_api.h Прегледај датотеку

@@ -72,7 +72,8 @@ namespace ExtUI {
72 72
   float getActualTemp_celsius(const extruder_t);
73 73
   float getTargetTemp_celsius(const heater_t);
74 74
   float getTargetTemp_celsius(const extruder_t);
75
-  float getFan_percent(const fan_t);
75
+  float getTargetFan_percent(const fan_t);
76
+  float getActualFan_percent(const fan_t);
76 77
   float getAxisPosition_mm(const axis_t);
77 78
   float getAxisPosition_mm(const extruder_t);
78 79
   float getAxisSteps_per_mm(const axis_t);
@@ -100,7 +101,7 @@ namespace ExtUI {
100 101
 
101 102
   void setTargetTemp_celsius(const float, const heater_t);
102 103
   void setTargetTemp_celsius(const float, const extruder_t);
103
-  void setFan_percent(const float, const fan_t);
104
+  void setTargetFan_percent(const float, const fan_t);
104 105
   void setAxisPosition_mm(const float, const axis_t);
105 106
   void setAxisPosition_mm(const float, const extruder_t);
106 107
   void setAxisSteps_per_mm(const float, const axis_t);

+ 1
- 1
Marlin/src/lcd/malyanlcd.cpp Прегледај датотеку

@@ -255,7 +255,7 @@ void process_lcd_p_command(const char* command) {
255 255
         quickstop_stepper();
256 256
         print_job_timer.stop();
257 257
         thermalManager.disable_all_heaters();
258
-        zero_fan_speeds();
258
+        thermalManager.zero_fan_speeds();
259 259
         wait_for_heatup = false;
260 260
         write_to_lcd_P(PSTR("{SYS:STARTED}"));
261 261
       #endif

+ 1
- 1
Marlin/src/lcd/menu/menu_main.cpp Прегледај датотеку

@@ -54,7 +54,7 @@ void lcd_pause() {
54 54
 void lcd_resume() {
55 55
   #if ENABLED(SDSUPPORT)
56 56
     if (card.isPaused()) enqueue_and_echo_commands_P(PSTR("M24"));
57
-  #elif ENABLED(ACTION_ON_RESUME)
57
+  #elif defined(ACTION_ON_RESUME)
58 58
     SERIAL_ECHOLNPGM("//action:" ACTION_ON_RESUME);
59 59
   #endif
60 60
 }

+ 11
- 11
Marlin/src/lcd/menu/menu_temperature.cpp Прегледај датотеку

@@ -52,9 +52,9 @@ void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb
52 52
   #endif
53 53
   #if FAN_COUNT > 0
54 54
     #if FAN_COUNT > 1
55
-      fan_speed[active_extruder < FAN_COUNT ? active_extruder : 0] = fan;
55
+      thermalManager.set_fan_speed(active_extruder < FAN_COUNT ? active_extruder : 0, fan);
56 56
     #else
57
-      fan_speed[0] = fan;
57
+      thermalManager.set_fan_speed(0, fan);
58 58
     #endif
59 59
   #else
60 60
     UNUSED(fan);
@@ -292,7 +292,7 @@ void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb
292 292
   }
293 293
 
294 294
   void lcd_cooldown() {
295
-    zero_fan_speeds();
295
+    thermalManager.zero_fan_speeds();
296 296
     thermalManager.disable_all_heaters();
297 297
     ui.return_to_status();
298 298
   }
@@ -339,21 +339,21 @@ void menu_temperature() {
339 339
   //
340 340
   #if FAN_COUNT > 0
341 341
     #if HAS_FAN0
342
-      MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_FAN_SPEED FAN_SPEED_1_SUFFIX, &fan_speed[0], 0, 255);
342
+      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int8, MSG_FAN_SPEED FAN_SPEED_1_SUFFIX, &thermalManager.lcd_tmpfan_speed[0], 0, 255, thermalManager.lcd_setFanSpeed0);
343 343
       #if ENABLED(EXTRA_FAN_SPEED)
344
-        MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED FAN_SPEED_1_SUFFIX, &new_fan_speed[0], 3, 255);
344
+        MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED FAN_SPEED_1_SUFFIX, &thermalManager.new_fan_speed[0], 3, 255);
345 345
       #endif
346 346
     #endif
347
-    #if HAS_FAN1
348
-      MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_FAN_SPEED " 2", &fan_speed[1], 0, 255);
347
+    #if HAS_FAN1 || (ENABLED(SINGLENOZZLE) && EXTRUDERS > 1)
348
+      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int8, MSG_FAN_SPEED " 2", &thermalManager.lcd_tmpfan_speed[1], 0, 255, thermalManager.lcd_setFanSpeed1);
349 349
       #if ENABLED(EXTRA_FAN_SPEED)
350
-        MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED " 2", &new_fan_speed[1], 3, 255);
350
+        MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED " 2", &thermalManager.new_fan_speed[1], 3, 255);
351 351
       #endif
352 352
     #endif
353
-    #if HAS_FAN2
354
-      MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_FAN_SPEED " 3", &fan_speed[2], 0, 255);
353
+    #if HAS_FAN2 || (ENABLED(SINGLENOZZLE) && EXTRUDERS > 2)
354
+      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int8, MSG_FAN_SPEED " 3", &thermalManager.lcd_tmpfan_speed[2], 0, 255, thermalManager.lcd_setFanSpeed2);
355 355
       #if ENABLED(EXTRA_FAN_SPEED)
356
-        MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED " 3", &new_fan_speed[2], 3, 255);
356
+        MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED " 3", &thermalManager.new_fan_speed[2], 3, 255);
357 357
       #endif
358 358
     #endif
359 359
   #endif // FAN_COUNT > 0

+ 8
- 8
Marlin/src/lcd/menu/menu_tune.cpp Прегледај датотеку

@@ -141,21 +141,21 @@ void menu_tune() {
141 141
   //
142 142
   #if FAN_COUNT > 0
143 143
     #if HAS_FAN0
144
-      MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_FAN_SPEED FAN_SPEED_1_SUFFIX, &fan_speed[0], 0, 255);
144
+      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int8, MSG_FAN_SPEED FAN_SPEED_1_SUFFIX, &thermalManager.lcd_tmpfan_speed[0], 0, 255, thermalManager.lcd_setFanSpeed0);
145 145
       #if ENABLED(EXTRA_FAN_SPEED)
146
-        MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED FAN_SPEED_1_SUFFIX, &new_fan_speed[0], 3, 255);
146
+        MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED FAN_SPEED_1_SUFFIX, &thermalManager.new_fan_speed[0], 3, 255);
147 147
       #endif
148 148
     #endif
149
-    #if HAS_FAN1
150
-      MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_FAN_SPEED " 2", &fan_speed[1], 0, 255);
149
+    #if HAS_FAN1 || (ENABLED(SINGLENOZZLE) && EXTRUDERS > 1)
150
+      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int8, MSG_FAN_SPEED " 2", &thermalManager.lcd_tmpfan_speed[1], 0, 255, thermalManager.lcd_setFanSpeed1);
151 151
       #if ENABLED(EXTRA_FAN_SPEED)
152
-        MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED " 2", &new_fan_speed[1], 3, 255);
152
+        MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED " 2", &thermalManager.new_fan_speed[1], 3, 255);
153 153
       #endif
154 154
     #endif
155
-    #if HAS_FAN2
156
-      MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_FAN_SPEED " 3", &fan_speed[2], 0, 255);
155
+    #if HAS_FAN2 || (ENABLED(SINGLENOZZLE) && EXTRUDERS > 2)
156
+      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int8, MSG_FAN_SPEED " 3", &thermalManager.lcd_tmpfan_speed[2], 0, 255, thermalManager.lcd_setFanSpeed2);
157 157
       #if ENABLED(EXTRA_FAN_SPEED)
158
-        MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED " 3", &new_fan_speed[2], 3, 255);
158
+        MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED " 3", &thermalManager.new_fan_speed[2], 3, 255);
159 159
       #endif
160 160
     #endif
161 161
   #endif // FAN_COUNT > 0

+ 4
- 4
Marlin/src/module/planner.cpp Прегледај датотеку

@@ -1178,10 +1178,9 @@ void Planner::check_axes_activity() {
1178 1178
   #endif
1179 1179
 
1180 1180
   if (has_blocks_queued()) {
1181
-
1182 1181
     #if FAN_COUNT > 0
1183 1182
       FANS_LOOP(i)
1184
-        tail_fan_speed[i] = block_buffer[block_buffer_tail].fan_speed[i];
1183
+        tail_fan_speed[i] = (block_buffer[block_buffer_tail].fan_speed[i] * uint16_t(thermalManager.fan_speed_scaler[i])) >> 7;
1185 1184
     #endif
1186 1185
 
1187 1186
     block_t* block;
@@ -1203,7 +1202,8 @@ void Planner::check_axes_activity() {
1203 1202
   }
1204 1203
   else {
1205 1204
     #if FAN_COUNT > 0
1206
-      FANS_LOOP(i) tail_fan_speed[i] = fan_speed[i];
1205
+      FANS_LOOP(i)
1206
+        tail_fan_speed[i] = (thermalManager.fan_speed[i] * uint16_t(thermalManager.fan_speed_scaler[i])) >> 7;
1207 1207
     #endif
1208 1208
 
1209 1209
     #if ENABLED(BARICUDA)
@@ -1903,7 +1903,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
1903 1903
   #endif
1904 1904
 
1905 1905
   #if FAN_COUNT > 0
1906
-    FANS_LOOP(i) block->fan_speed[i] = fan_speed[i];
1906
+    FANS_LOOP(i) block->fan_speed[i] = thermalManager.fan_speed[i];
1907 1907
   #endif
1908 1908
 
1909 1909
   #if ENABLED(BARICUDA)

+ 1
- 19
Marlin/src/module/probe.cpp Прегледај датотеку

@@ -268,31 +268,13 @@ float zprobe_zoffset; // Initialized by settings.load()
268 268
 
269 269
 #endif // Z_PROBE_ALLEN_KEY
270 270
 
271
-#if ENABLED(PROBING_FANS_OFF)
272
-
273
-  void fans_pause(const bool p) {
274
-    if (p != fans_paused) {
275
-      fans_paused = p;
276
-      if (p)
277
-        for (uint8_t x = 0; x < FAN_COUNT; x++) {
278
-          paused_fan_speed[x] = fan_speed[x];
279
-          fan_speed[x] = 0;
280
-        }
281
-      else
282
-        for (uint8_t x = 0; x < FAN_COUNT; x++)
283
-          fan_speed[x] = paused_fan_speed[x];
284
-    }
285
-  }
286
-
287
-#endif // PROBING_FANS_OFF
288
-
289 271
 #if QUIET_PROBING
290 272
   void probing_pause(const bool p) {
291 273
     #if ENABLED(PROBING_HEATERS_OFF)
292 274
       thermalManager.pause(p);
293 275
     #endif
294 276
     #if ENABLED(PROBING_FANS_OFF)
295
-      fans_pause(p);
277
+      thermalManager.set_fans_paused(p);
296 278
     #endif
297 279
     #if ENABLED(PROBING_STEPPERS_OFF)
298 280
       disable_e_steppers();

+ 0
- 4
Marlin/src/module/probe.h Прегледај датотеку

@@ -58,10 +58,6 @@
58 58
   void probing_pause(const bool p);
59 59
 #endif
60 60
 
61
-#if ENABLED(PROBING_FANS_OFF)
62
-  void fans_pause(const bool p);
63
-#endif
64
-
65 61
 #if ENABLED(BLTOUCH)
66 62
   void bltouch_command(int angle);
67 63
   bool set_bltouch_deployed(const bool deploy);

+ 113
- 4
Marlin/src/module/temperature.cpp Прегледај датотеку

@@ -55,6 +55,10 @@
55 55
   #include "../feature/leds/printer_event_leds.h"
56 56
 #endif
57 57
 
58
+#if ENABLED(SINGLENOZZLE)
59
+  #include "tool_change.h"
60
+#endif
61
+
58 62
 #if HOTEND_USES_THERMISTOR
59 63
   #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
60 64
     static void* heater_ttbl_map[2] = { (void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE };
@@ -92,14 +96,99 @@ Temperature thermalManager;
92 96
 
93 97
 // public:
94 98
 
95
-float Temperature::current_temperature[HOTENDS] = { 0.0 };
96
-int16_t Temperature::current_temperature_raw[HOTENDS] = { 0 },
97
-        Temperature::target_temperature[HOTENDS] = { 0 };
99
+float Temperature::current_temperature[HOTENDS]; // = { 0.0 };
100
+int16_t Temperature::current_temperature_raw[HOTENDS], // = { 0 }
101
+        Temperature::target_temperature[HOTENDS]; // = { 0 }
98 102
 
99 103
 #if ENABLED(AUTO_POWER_E_FANS)
100
-  uint8_t Temperature::autofan_speed[HOTENDS] = { 0 };
104
+  uint8_t Temperature::autofan_speed[HOTENDS]; // = { 0 }
101 105
 #endif
102 106
 
107
+#if FAN_COUNT > 0
108
+
109
+  uint8_t Temperature::fan_speed[FAN_COUNT]; // = { 0 }
110
+
111
+  #if ENABLED(EXTRA_FAN_SPEED)
112
+    uint8_t Temperature::old_fan_speed[FAN_COUNT], Temperature::new_fan_speed[FAN_COUNT];
113
+
114
+    void Temperature::set_temp_fan_speed(const uint8_t fan, const int16_t tmp_temp) {
115
+      switch (tmp_temp) {
116
+        case 1:
117
+          set_fan_speed(fan, old_fan_speed[fan]);
118
+          break;
119
+        case 2:
120
+          old_fan_speed[fan] = fan_speed[fan];
121
+          set_fan_speed(fan, new_fan_speed[fan]);
122
+          break;
123
+        default:
124
+          new_fan_speed[fan] = MIN(tmp_temp, 255U);
125
+          break;
126
+      }
127
+    }
128
+
129
+  #endif
130
+
131
+  #if ENABLED(PROBING_FANS_OFF)
132
+    bool Temperature::fans_paused; // = false;
133
+    uint8_t Temperature::paused_fan_speed[FAN_COUNT]; // = { 0 }
134
+  #endif
135
+
136
+  #if ENABLED(ADAPTIVE_FAN_SLOWING)
137
+    uint8_t Temperature::fan_speed_scaler[FAN_COUNT] = ARRAY_N(FAN_COUNT, 128, 128, 128, 128, 128, 128);
138
+  #endif
139
+
140
+  #if HAS_LCD_MENU
141
+
142
+    uint8_t Temperature::lcd_tmpfan_speed[
143
+      #if ENABLED(SINGLENOZZLE)
144
+        MAX(EXTRUDERS, FAN_COUNT)
145
+      #else
146
+        FAN_COUNT
147
+      #endif
148
+    ]; // = { 0 }
149
+
150
+  #endif
151
+
152
+  void Temperature::set_fan_speed(uint8_t target, uint16_t speed) {
153
+
154
+    NOMORE(speed, 255U);
155
+
156
+    #if ENABLED(SINGLENOZZLE)
157
+      if (target != active_extruder) {
158
+        if (target < EXTRUDERS) singlenozzle_fan_speed[target] = speed;
159
+        return;
160
+      }
161
+      target = 0; // Always use fan index 0 with SINGLENOZZLE
162
+    #endif
163
+
164
+    if (target >= FAN_COUNT) return;
165
+    
166
+    fan_speed[target] = speed;
167
+    #if ENABLED(ULTRA_LCD)
168
+      lcd_tmpfan_speed[target] = speed;
169
+    #endif
170
+  }
171
+
172
+  #if ENABLED(PROBING_FANS_OFF)
173
+
174
+    void Temperature::set_fans_paused(const bool p) {
175
+      if (p != fans_paused) {
176
+        fans_paused = p;
177
+        if (p)
178
+          for (uint8_t x = 0; x < FAN_COUNT; x++) {
179
+            paused_fan_speed[x] = fan_speed[x];
180
+            fan_speed[x] = 0;
181
+          }
182
+        else
183
+          for (uint8_t x = 0; x < FAN_COUNT; x++)
184
+            fan_speed[x] = paused_fan_speed[x];
185
+      }
186
+    }
187
+
188
+  #endif // PROBING_FANS_OFF
189
+
190
+#endif // FAN_COUNT > 0
191
+
103 192
 #if HAS_HEATED_BED
104 193
   float Temperature::current_temperature_bed = 0.0;
105 194
   int16_t Temperature::current_temperature_bed_raw = 0,
@@ -1529,18 +1618,38 @@ void Temperature::init() {
1529 1618
     switch (*state) {
1530 1619
       // Inactive state waits for a target temperature to be set
1531 1620
       case TRInactive: break;
1621
+
1532 1622
       // When first heating, wait for the temperature to be reached then go to Stable state
1533 1623
       case TRFirstHeating:
1534 1624
         if (current < tr_target_temperature[heater_index]) break;
1535 1625
         *state = TRStable;
1626
+
1536 1627
       // While the temperature is stable watch for a bad temperature
1537 1628
       case TRStable:
1629
+
1630
+        #if ENABLED(ADAPTIVE_FAN_SLOWING) && FAN_COUNT > 0
1631
+          if (heater_id >= 0) {
1632
+            const int fan_index = MIN(heater_id, FAN_COUNT - 1);
1633
+            if (fan_speed[fan_index] == 0 || current >= tr_target_temperature[heater_id] - (hysteresis_degc * 0.25f))
1634
+              fan_speed_scaler[fan_index] = 128;
1635
+            else if (current >= tr_target_temperature[heater_id] - (hysteresis_degc * 0.3335f))
1636
+              fan_speed_scaler[fan_index] = 96;
1637
+            else if (current >= tr_target_temperature[heater_id] - (hysteresis_degc * 0.5f))
1638
+              fan_speed_scaler[fan_index] = 64;
1639
+            else if (current >= tr_target_temperature[heater_id] - (hysteresis_degc * 0.8f))
1640
+              fan_speed_scaler[fan_index] = 32;
1641
+            else
1642
+              fan_speed_scaler[fan_index] = 0;
1643
+          }
1644
+        #endif
1645
+
1538 1646
         if (current >= tr_target_temperature[heater_index] - hysteresis_degc) {
1539 1647
           *timer = millis() + period_seconds * 1000UL;
1540 1648
           break;
1541 1649
         }
1542 1650
         else if (PENDING(millis(), *timer)) break;
1543 1651
         *state = TRRunaway;
1652
+
1544 1653
       case TRRunaway:
1545 1654
         _temp_error(heater_id, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, heater_id));
1546 1655
     }

+ 65
- 0
Marlin/src/module/temperature.h Прегледај датотеку

@@ -320,6 +320,71 @@ class Temperature {
320 320
       static float analog_to_celsiusChamber(const int raw);
321 321
     #endif
322 322
 
323
+    #if FAN_COUNT > 0
324
+
325
+      static uint8_t fan_speed[FAN_COUNT];
326
+      #define FANS_LOOP(I) LOOP_L_N(I, FAN_COUNT)
327
+
328
+      static void set_fan_speed(const uint8_t target, const uint16_t speed);
329
+
330
+      #if ENABLED(PROBING_FANS_OFF)
331
+        static bool fans_paused;
332
+        static uint8_t paused_fan_speed[FAN_COUNT];
333
+      #endif
334
+
335
+      static constexpr inline uint8_t fanPercent(const uint8_t speed) { return (int(speed) * 100 + 127) / 255; }
336
+
337
+      #if ENABLED(ADAPTIVE_FAN_SLOWING)
338
+        static uint8_t fan_speed_scaler[FAN_COUNT];
339
+      #else
340
+        static constexpr uint8_t fan_speed_scaler[FAN_COUNT] = ARRAY_N(FAN_COUNT, 128, 128, 128, 128, 128, 128);
341
+      #endif
342
+
343
+      static inline uint8_t lcd_fanSpeedActual(const uint8_t target) {
344
+        return (fan_speed[target] * uint16_t(fan_speed_scaler[target])) >> 7;
345
+      }
346
+
347
+      #if ENABLED(EXTRA_FAN_SPEED)
348
+        static uint8_t old_fan_speed[FAN_COUNT], new_fan_speed[FAN_COUNT];
349
+        static void set_temp_fan_speed(const uint8_t fan, const int16_t tmp_temp);
350
+      #endif
351
+
352
+      #if HAS_LCD_MENU
353
+
354
+        static uint8_t lcd_tmpfan_speed[
355
+          #if ENABLED(SINGLENOZZLE)
356
+            MAX(EXTRUDERS, FAN_COUNT)
357
+          #else
358
+            FAN_COUNT
359
+          #endif
360
+        ];
361
+
362
+        static inline void lcd_setFanSpeed(const uint8_t target) { set_fan_speed(target, lcd_tmpfan_speed[target]); }
363
+
364
+        #if HAS_FAN0
365
+          FORCE_INLINE static void lcd_setFanSpeed0() { lcd_setFanSpeed(0); }
366
+        #endif
367
+        #if HAS_FAN1 || (ENABLED(SINGLENOZZLE) && EXTRUDERS > 1)
368
+          FORCE_INLINE static void lcd_setFanSpeed1() { lcd_setFanSpeed(1); }
369
+        #endif
370
+        #if HAS_FAN2 || (ENABLED(SINGLENOZZLE) && EXTRUDERS > 2)
371
+          FORCE_INLINE static void lcd_setFanSpeed2() { lcd_setFanSpeed(2); }
372
+        #endif
373
+
374
+      #endif // HAS_LCD_MENU
375
+
376
+      #if ENABLED(PROBING_FANS_OFF)
377
+        void set_fans_paused(const bool p);
378
+      #endif
379
+
380
+    #endif // FAN_COUNT > 0
381
+
382
+    static inline void zero_fan_speeds() {
383
+      #if FAN_COUNT > 0
384
+        FANS_LOOP(i) fan_speed[i] = 0;
385
+      #endif
386
+    }
387
+
323 388
     /**
324 389
      * Called from the Temperature ISR
325 390
      */

+ 2
- 2
Marlin/src/module/tool_change.cpp Прегледај датотеку

@@ -674,8 +674,8 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
674 674
 
675 675
         #if ENABLED(SINGLENOZZLE)
676 676
           #if FAN_COUNT > 0
677
-            singlenozzle_fan_speed[active_extruder] = fan_speed[0];
678
-            fan_speed[0] = singlenozzle_fan_speed[tmp_extruder];
677
+            singlenozzle_fan_speed[active_extruder] = thermalManager.fan_speed[0];
678
+            thermalManager.fan_speed[0] = singlenozzle_fan_speed[tmp_extruder];
679 679
           #endif
680 680
 
681 681
           singlenozzle_temp[active_extruder] = thermalManager.target_temperature[0];

+ 1
- 1
buildroot/share/tests/LPC1768_tests Прегледај датотеку

@@ -36,7 +36,7 @@ opt_set EXTRUDERS 2
36 36
 opt_set TEMP_SENSOR_0 1
37 37
 opt_set TEMP_SENSOR_1 5
38 38
 opt_set TEMP_SENSOR_BED 1
39
-opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT \
39
+opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT ADAPTIVE_FAN_SLOWING \
40 40
            FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY \
41 41
            FIX_MOUNTED_PROBE Z_SAFE_HOMING AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \
42 42
            BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \

Loading…
Откажи
Сачувај