Преглед на файлове

ADAPTIVE_FAN_SLOWING extension to hotend thermal protection (#12853)

InsanityAutomation преди 6 години
родител
ревизия
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 2
- 13
Marlin/src/Marlin.cpp Целия файл

164
   TempUnit input_temp_units = TEMPUNIT_C;
164
   TempUnit input_temp_units = TEMPUNIT_C;
165
 #endif
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
 // For M109 and M190, this flag may be cleared (by M108) to exit the wait loop
167
 // For M109 and M190, this flag may be cleared (by M108) to exit the wait loop
179
 volatile bool wait_for_heatup = true;
168
 volatile bool wait_for_heatup = true;
180
 
169
 
655
   print_job_timer.stop();
644
   print_job_timer.stop();
656
 
645
 
657
   #if ENABLED(PROBING_FANS_OFF)
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
   #endif
648
   #endif
660
 
649
 
661
   if (IsRunning()) {
650
   if (IsRunning()) {
976
         quickstop_stepper();
965
         quickstop_stepper();
977
         print_job_timer.stop();
966
         print_job_timer.stop();
978
         thermalManager.disable_all_heaters();
967
         thermalManager.disable_all_heaters();
979
-        zero_fan_speeds();
968
+        thermalManager.zero_fan_speeds();
980
         wait_for_heatup = false;
969
         wait_for_heatup = false;
981
         #if ENABLED(POWER_LOSS_RECOVERY)
970
         #if ENABLED(POWER_LOSS_RECOVERY)
982
           card.removeJobRecoveryFile();
971
           card.removeJobRecoveryFile();

+ 0
- 18
Marlin/src/Marlin.h Целия файл

81
 // Inactivity shutdown timer
81
 // Inactivity shutdown timer
82
 extern millis_t max_inactive_time, stepper_inactive_time;
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
 #if ENABLED(USE_CONTROLLER_FAN)
84
 #if ENABLED(USE_CONTROLLER_FAN)
103
   extern uint8_t controllerfan_speed;
85
   extern uint8_t controllerfan_speed;
104
 #endif
86
 #endif

+ 2
- 0
Marlin/src/config/default/Configuration_adv.h Целия файл

77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 60        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 60        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 10    // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 60        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 60        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 10    // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
81
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
82
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
87
    * Whenever an M104, M109, or M303 increases the target temperature, the
86
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 45        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 45        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 2     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 60        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 60        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 2     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 2     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 210       // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 210       // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 2     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 60        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 60        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 10    // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 60        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 60        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 10    // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 50        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 50        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 6     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 50        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 50        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 6     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 1
- 1
Marlin/src/config/examples/VORONDesign/_Bootscreen.h Целия файл

77
   B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
77
   B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
78
   B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
78
   B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
79
   B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
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
   #define THERMAL_PROTECTION_PERIOD 60        // Seconds
87
   #define THERMAL_PROTECTION_PERIOD 60        // Seconds
88
   #define THERMAL_PROTECTION_HYSTERESIS 8     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
93
    * Whenever an M104, M109, or M303 increases the target temperature, the
92
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 60        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 60        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 50        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 50        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 6     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 60        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 60        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 10     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 50        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 50        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 3     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
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
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
77
   #define THERMAL_PROTECTION_PERIOD 40        // Seconds
78
   #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
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
    * Whenever an M104, M109, or M303 increases the target temperature, the
83
    * Whenever an M104, M109, or M303 increases the target temperature, the
82
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature
84
    * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature

+ 1
- 1
Marlin/src/feature/power.cpp Целия файл

39
 
39
 
40
 bool Power::is_power_needed() {
40
 bool Power::is_power_needed() {
41
   #if ENABLED(AUTO_POWER_FANS)
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
   #endif
43
   #endif
44
 
44
 
45
   #if ENABLED(AUTO_POWER_E_FANS)
45
   #if ENABLED(AUTO_POWER_E_FANS)

+ 1
- 1
Marlin/src/feature/power_loss_recovery.cpp Целия файл

162
     #endif
162
     #endif
163
 
163
 
164
     #if FAN_COUNT
164
     #if FAN_COUNT
165
-      COPY(info.fan_speed, fan_speed);
165
+      COPY(info.fan_speed, thermalManager.fan_speed);
166
     #endif
166
     #endif
167
 
167
 
168
     #if HAS_LEVELING
168
     #if HAS_LEVELING

+ 7
- 3
Marlin/src/gcode/control/M42.cpp Целия файл

24
 #include "../../Marlin.h" // for pin_is_protected
24
 #include "../../Marlin.h" // for pin_is_protected
25
 #include "../../inc/MarlinConfig.h"
25
 #include "../../inc/MarlinConfig.h"
26
 
26
 
27
+#if FAN_COUNT > 0
28
+  #include "../../module/temperature.h"
29
+#endif
30
+
27
 /**
31
 /**
28
  * M42: Change pin status via GCode
32
  * M42: Change pin status via GCode
29
  *
33
  *
52
   #if FAN_COUNT > 0
56
   #if FAN_COUNT > 0
53
     switch (pin) {
57
     switch (pin) {
54
       #if HAS_FAN0
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
       #endif
60
       #endif
57
       #if HAS_FAN1
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
       #endif
63
       #endif
60
       #if HAS_FAN2
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
       #endif
66
       #endif
63
     }
67
     }
64
   #endif
68
   #endif

+ 3
- 3
Marlin/src/gcode/control/M80_M81.cpp Целия файл

100
   planner.finish_and_disable();
100
   planner.finish_and_disable();
101
 
101
 
102
   #if FAN_COUNT > 0
102
   #if FAN_COUNT > 0
103
-    zero_fan_speeds();
103
+    thermalManager.zero_fan_speeds();
104
     #if ENABLED(PROBING_FANS_OFF)
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
     #endif
107
     #endif
108
   #endif
108
   #endif
109
 
109
 

+ 8
- 44
Marlin/src/gcode/temperature/M106_M107.cpp Целия файл

25
 #if FAN_COUNT > 0
25
 #if FAN_COUNT > 0
26
 
26
 
27
 #include "../gcode.h"
27
 #include "../gcode.h"
28
-#include "../../Marlin.h" // for fan_speed
29
-
30
 #include "../../module/motion.h"
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
  * M106: Set Fan Speed
33
  * M106: Set Fan Speed
50
   const uint8_t p = parser.byteval('P', MIN(active_extruder, FAN_COUNT - 1));
46
   const uint8_t p = parser.byteval('P', MIN(active_extruder, FAN_COUNT - 1));
51
 
47
 
52
   if (p < MIN(EXTRUDERS, FAN_COUNT)) {
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
     #if ENABLED(EXTRA_FAN_SPEED)
50
     #if ENABLED(EXTRA_FAN_SPEED)
67
       const int16_t t = parser.intval('T');
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
  * M107: Fan Off
63
  * M107: Fan Off
91
  */
64
  */
92
 void GcodeSuite::M107() {
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
 #endif // FAN_COUNT > 0
69
 #endif // FAN_COUNT > 0

+ 11
- 7
Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp Целия файл

866
           _draw_print_progress();
866
           _draw_print_progress();
867
         #else
867
         #else
868
           char c;
868
           char c;
869
-          int per;
869
+          uint16_t per;
870
           #if HAS_FAN0
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
             else
879
             else
876
           #endif
880
           #endif
1049
       #if FAN_COUNT > 0
1053
       #if FAN_COUNT > 0
1050
         if (0
1054
         if (0
1051
           #if HAS_FAN0
1055
           #if HAS_FAN0
1052
-            || fan_speed[0]
1056
+            || thermalManager.fan_speed[0]
1053
           #endif
1057
           #endif
1054
           #if HAS_FAN1
1058
           #if HAS_FAN1
1055
-            || fan_speed[1]
1059
+            || thermalManager.fan_speed[1]
1056
           #endif
1060
           #endif
1057
           #if HAS_FAN2
1061
           #if HAS_FAN2
1058
-            || fan_speed[2]
1062
+            || thermalManager.fan_speed[2]
1059
           #endif
1063
           #endif
1060
         ) leds |= LED_C;
1064
         ) leds |= LED_C;
1061
       #endif // FAN_COUNT > 0
1065
       #endif // FAN_COUNT > 0

+ 13
- 6
Marlin/src/lcd/dogm/status_screen_DOGM.cpp Целия файл

291
       static uint8_t fan_frame;
291
       static uint8_t fan_frame;
292
       if (old_blink != blink) {
292
       if (old_blink != blink) {
293
         old_blink = blink;
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
     #endif
296
     #endif
297
     if (PAGE_CONTAINS(STATUS_FAN_Y, STATUS_FAN_Y + STATUS_FAN_HEIGHT - 1))
297
     if (PAGE_CONTAINS(STATUS_FAN_Y, STATUS_FAN_Y + STATUS_FAN_HEIGHT - 1))
305
             fan_frame == 3 ? status_fan3_bmp :
305
             fan_frame == 3 ? status_fan3_bmp :
306
           #endif
306
           #endif
307
         #elif STATUS_FAN_FRAMES > 1
307
         #elif STATUS_FAN_FRAMES > 1
308
-          blink && fan_speed[0] ? status_fan1_bmp :
308
+          blink && thermalManager.fan_speed[0] ? status_fan1_bmp :
309
         #endif
309
         #endif
310
         status_fan0_bmp
310
         status_fan0_bmp
311
       );
311
       );
328
     // Fan, if a bitmap was provided
328
     // Fan, if a bitmap was provided
329
     #if DO_DRAW_FAN
329
     #if DO_DRAW_FAN
330
       if (PAGE_CONTAINS(STATUS_FAN_TEXT_Y - INFO_FONT_ASCENT, STATUS_FAN_TEXT_Y - 1)) {
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
           lcd_moveto(STATUS_FAN_TEXT_X, STATUS_FAN_TEXT_Y);
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
     #endif
345
     #endif

+ 11
- 4
Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp Целия файл

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

+ 9
- 3
Marlin/src/lcd/extensible_ui/ui_api.cpp Целия файл

180
     return thermalManager.degTargetHotend(extruder - E0);
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
   float getAxisPosition_mm(const axis_t axis) {
191
   float getAxisPosition_mm(const axis_t axis) {
186
     return flags.manual_motion ? destination[axis] : current_position[axis];
192
     return flags.manual_motion ? destination[axis] : current_position[axis];
560
     thermalManager.setTargetHotend(clamp(value, 0, heater_maxtemp[e] - 15), e);
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
     if (fan < FAN_COUNT)
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
   void setFeedrate_percent(const float value) {
574
   void setFeedrate_percent(const float value) {

+ 3
- 2
Marlin/src/lcd/extensible_ui/ui_api.h Целия файл

72
   float getActualTemp_celsius(const extruder_t);
72
   float getActualTemp_celsius(const extruder_t);
73
   float getTargetTemp_celsius(const heater_t);
73
   float getTargetTemp_celsius(const heater_t);
74
   float getTargetTemp_celsius(const extruder_t);
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
   float getAxisPosition_mm(const axis_t);
77
   float getAxisPosition_mm(const axis_t);
77
   float getAxisPosition_mm(const extruder_t);
78
   float getAxisPosition_mm(const extruder_t);
78
   float getAxisSteps_per_mm(const axis_t);
79
   float getAxisSteps_per_mm(const axis_t);
100
 
101
 
101
   void setTargetTemp_celsius(const float, const heater_t);
102
   void setTargetTemp_celsius(const float, const heater_t);
102
   void setTargetTemp_celsius(const float, const extruder_t);
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
   void setAxisPosition_mm(const float, const axis_t);
105
   void setAxisPosition_mm(const float, const axis_t);
105
   void setAxisPosition_mm(const float, const extruder_t);
106
   void setAxisPosition_mm(const float, const extruder_t);
106
   void setAxisSteps_per_mm(const float, const axis_t);
107
   void setAxisSteps_per_mm(const float, const axis_t);

+ 1
- 1
Marlin/src/lcd/malyanlcd.cpp Целия файл

255
         quickstop_stepper();
255
         quickstop_stepper();
256
         print_job_timer.stop();
256
         print_job_timer.stop();
257
         thermalManager.disable_all_heaters();
257
         thermalManager.disable_all_heaters();
258
-        zero_fan_speeds();
258
+        thermalManager.zero_fan_speeds();
259
         wait_for_heatup = false;
259
         wait_for_heatup = false;
260
         write_to_lcd_P(PSTR("{SYS:STARTED}"));
260
         write_to_lcd_P(PSTR("{SYS:STARTED}"));
261
       #endif
261
       #endif

+ 1
- 1
Marlin/src/lcd/menu/menu_main.cpp Целия файл

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

+ 11
- 11
Marlin/src/lcd/menu/menu_temperature.cpp Целия файл

52
   #endif
52
   #endif
53
   #if FAN_COUNT > 0
53
   #if FAN_COUNT > 0
54
     #if FAN_COUNT > 1
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
     #else
56
     #else
57
-      fan_speed[0] = fan;
57
+      thermalManager.set_fan_speed(0, fan);
58
     #endif
58
     #endif
59
   #else
59
   #else
60
     UNUSED(fan);
60
     UNUSED(fan);
292
   }
292
   }
293
 
293
 
294
   void lcd_cooldown() {
294
   void lcd_cooldown() {
295
-    zero_fan_speeds();
295
+    thermalManager.zero_fan_speeds();
296
     thermalManager.disable_all_heaters();
296
     thermalManager.disable_all_heaters();
297
     ui.return_to_status();
297
     ui.return_to_status();
298
   }
298
   }
339
   //
339
   //
340
   #if FAN_COUNT > 0
340
   #if FAN_COUNT > 0
341
     #if HAS_FAN0
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
       #if ENABLED(EXTRA_FAN_SPEED)
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
       #endif
345
       #endif
346
     #endif
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
       #if ENABLED(EXTRA_FAN_SPEED)
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
       #endif
351
       #endif
352
     #endif
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
       #if ENABLED(EXTRA_FAN_SPEED)
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
       #endif
357
       #endif
358
     #endif
358
     #endif
359
   #endif // FAN_COUNT > 0
359
   #endif // FAN_COUNT > 0

+ 8
- 8
Marlin/src/lcd/menu/menu_tune.cpp Целия файл

141
   //
141
   //
142
   #if FAN_COUNT > 0
142
   #if FAN_COUNT > 0
143
     #if HAS_FAN0
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
       #if ENABLED(EXTRA_FAN_SPEED)
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
       #endif
147
       #endif
148
     #endif
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
       #if ENABLED(EXTRA_FAN_SPEED)
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
       #endif
153
       #endif
154
     #endif
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
       #if ENABLED(EXTRA_FAN_SPEED)
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
       #endif
159
       #endif
160
     #endif
160
     #endif
161
   #endif // FAN_COUNT > 0
161
   #endif // FAN_COUNT > 0

+ 4
- 4
Marlin/src/module/planner.cpp Целия файл

1178
   #endif
1178
   #endif
1179
 
1179
 
1180
   if (has_blocks_queued()) {
1180
   if (has_blocks_queued()) {
1181
-
1182
     #if FAN_COUNT > 0
1181
     #if FAN_COUNT > 0
1183
       FANS_LOOP(i)
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
     #endif
1184
     #endif
1186
 
1185
 
1187
     block_t* block;
1186
     block_t* block;
1203
   }
1202
   }
1204
   else {
1203
   else {
1205
     #if FAN_COUNT > 0
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
     #endif
1207
     #endif
1208
 
1208
 
1209
     #if ENABLED(BARICUDA)
1209
     #if ENABLED(BARICUDA)
1903
   #endif
1903
   #endif
1904
 
1904
 
1905
   #if FAN_COUNT > 0
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
   #endif
1907
   #endif
1908
 
1908
 
1909
   #if ENABLED(BARICUDA)
1909
   #if ENABLED(BARICUDA)

+ 1
- 19
Marlin/src/module/probe.cpp Целия файл

268
 
268
 
269
 #endif // Z_PROBE_ALLEN_KEY
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
 #if QUIET_PROBING
271
 #if QUIET_PROBING
290
   void probing_pause(const bool p) {
272
   void probing_pause(const bool p) {
291
     #if ENABLED(PROBING_HEATERS_OFF)
273
     #if ENABLED(PROBING_HEATERS_OFF)
292
       thermalManager.pause(p);
274
       thermalManager.pause(p);
293
     #endif
275
     #endif
294
     #if ENABLED(PROBING_FANS_OFF)
276
     #if ENABLED(PROBING_FANS_OFF)
295
-      fans_pause(p);
277
+      thermalManager.set_fans_paused(p);
296
     #endif
278
     #endif
297
     #if ENABLED(PROBING_STEPPERS_OFF)
279
     #if ENABLED(PROBING_STEPPERS_OFF)
298
       disable_e_steppers();
280
       disable_e_steppers();

+ 0
- 4
Marlin/src/module/probe.h Целия файл

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

+ 113
- 4
Marlin/src/module/temperature.cpp Целия файл

55
   #include "../feature/leds/printer_event_leds.h"
55
   #include "../feature/leds/printer_event_leds.h"
56
 #endif
56
 #endif
57
 
57
 
58
+#if ENABLED(SINGLENOZZLE)
59
+  #include "tool_change.h"
60
+#endif
61
+
58
 #if HOTEND_USES_THERMISTOR
62
 #if HOTEND_USES_THERMISTOR
59
   #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
63
   #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
60
     static void* heater_ttbl_map[2] = { (void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE };
64
     static void* heater_ttbl_map[2] = { (void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE };
92
 
96
 
93
 // public:
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
 #if ENABLED(AUTO_POWER_E_FANS)
103
 #if ENABLED(AUTO_POWER_E_FANS)
100
-  uint8_t Temperature::autofan_speed[HOTENDS] = { 0 };
104
+  uint8_t Temperature::autofan_speed[HOTENDS]; // = { 0 }
101
 #endif
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
 #if HAS_HEATED_BED
192
 #if HAS_HEATED_BED
104
   float Temperature::current_temperature_bed = 0.0;
193
   float Temperature::current_temperature_bed = 0.0;
105
   int16_t Temperature::current_temperature_bed_raw = 0,
194
   int16_t Temperature::current_temperature_bed_raw = 0,
1529
     switch (*state) {
1618
     switch (*state) {
1530
       // Inactive state waits for a target temperature to be set
1619
       // Inactive state waits for a target temperature to be set
1531
       case TRInactive: break;
1620
       case TRInactive: break;
1621
+
1532
       // When first heating, wait for the temperature to be reached then go to Stable state
1622
       // When first heating, wait for the temperature to be reached then go to Stable state
1533
       case TRFirstHeating:
1623
       case TRFirstHeating:
1534
         if (current < tr_target_temperature[heater_index]) break;
1624
         if (current < tr_target_temperature[heater_index]) break;
1535
         *state = TRStable;
1625
         *state = TRStable;
1626
+
1536
       // While the temperature is stable watch for a bad temperature
1627
       // While the temperature is stable watch for a bad temperature
1537
       case TRStable:
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
         if (current >= tr_target_temperature[heater_index] - hysteresis_degc) {
1646
         if (current >= tr_target_temperature[heater_index] - hysteresis_degc) {
1539
           *timer = millis() + period_seconds * 1000UL;
1647
           *timer = millis() + period_seconds * 1000UL;
1540
           break;
1648
           break;
1541
         }
1649
         }
1542
         else if (PENDING(millis(), *timer)) break;
1650
         else if (PENDING(millis(), *timer)) break;
1543
         *state = TRRunaway;
1651
         *state = TRRunaway;
1652
+
1544
       case TRRunaway:
1653
       case TRRunaway:
1545
         _temp_error(heater_id, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, heater_id));
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
       static float analog_to_celsiusChamber(const int raw);
320
       static float analog_to_celsiusChamber(const int raw);
321
     #endif
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
      * Called from the Temperature ISR
389
      * Called from the Temperature ISR
325
      */
390
      */

+ 2
- 2
Marlin/src/module/tool_change.cpp Целия файл

674
 
674
 
675
         #if ENABLED(SINGLENOZZLE)
675
         #if ENABLED(SINGLENOZZLE)
676
           #if FAN_COUNT > 0
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
           #endif
679
           #endif
680
 
680
 
681
           singlenozzle_temp[active_extruder] = thermalManager.target_temperature[0];
681
           singlenozzle_temp[active_extruder] = thermalManager.target_temperature[0];

+ 1
- 1
buildroot/share/tests/LPC1768_tests Целия файл

36
 opt_set TEMP_SENSOR_0 1
36
 opt_set TEMP_SENSOR_0 1
37
 opt_set TEMP_SENSOR_1 5
37
 opt_set TEMP_SENSOR_1 5
38
 opt_set TEMP_SENSOR_BED 1
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
            FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY \
40
            FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY \
41
            FIX_MOUNTED_PROBE Z_SAFE_HOMING AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \
41
            FIX_MOUNTED_PROBE Z_SAFE_HOMING AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \
42
            BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \
42
            BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \

Loading…
Отказ
Запис