Bladeren bron

🔧 Group FAST_PWM_FAN.options (#23331)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
Robby Candra 3 jaren geleden
bovenliggende
commit
3e737cbc91
No account linked to committer's email address

+ 0
- 3
Marlin/Configuration.h Bestand weergeven

@@ -2841,9 +2841,6 @@
2841 2841
 // :[1,2,3,4,5,6,7,8]
2842 2842
 //#define NUM_M106_FANS 1
2843 2843
 
2844
-// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino
2845
-//#define FAST_PWM_FAN
2846
-
2847 2844
 // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
2848 2845
 // which is not as annoying as with the hardware PWM. On the other hand, if this frequency
2849 2846
 // is too low, you should also increment SOFT_PWM_SCALE.

+ 20
- 9
Marlin/Configuration_adv.h Bestand weergeven

@@ -549,18 +549,21 @@
549 549
 //#define FAN_MAX_PWM 128
550 550
 
551 551
 /**
552
- * FAST PWM FAN Settings
552
+ * Fan Fast PWM
553 553
  *
554
- * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h)
555
- * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a
556
- * frequency as close as possible to the desired frequency.
554
+ * Combinations of PWM Modes, prescale values and TOP resolutions are used internally
555
+ * to produce a frequency as close as possible to the desired frequency.
557 556
  *
558
- * FAST_PWM_FAN_FREQUENCY [undefined by default]
557
+ * FAST_PWM_FAN_FREQUENCY
559 558
  *   Set this to your desired frequency.
560
- *   If left undefined this defaults to F = F_CPU/(2*255*1)
561
- *   i.e., F = 31.4kHz on 16MHz microcontrollers or F = 39.2kHz on 20MHz microcontrollers.
562
- *   These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required
559
+ *   For AVR, if left undefined this defaults to F = F_CPU/(2*255*1)
560
+ *            i.e., F = 31.4kHz on 16MHz microcontrollers or F = 39.2kHz on 20MHz microcontrollers.
561
+ *   For non AVR, if left undefined this defaults to F = 1Khz.
562
+ *   This F value is only to protect the hardware from an absence of configuration
563
+ *   and not to complete it when users are not aware that the frequency must be specifically set to support the target board.
564
+ *
563 565
  *   NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior.
566
+ *         Setting very high frequencies can damage your hardware.
564 567
  *
565 568
  * USE_OCR2A_AS_TOP [undefined by default]
566 569
  *   Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2:
@@ -570,9 +573,17 @@
570 573
  *   PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.)
571 574
  *   USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies.
572 575
  */
576
+//#define FAST_PWM_FAN    // Increase the fan PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino
573 577
 #if ENABLED(FAST_PWM_FAN)
574
-  //#define FAST_PWM_FAN_FREQUENCY 31400
578
+  //#define FAST_PWM_FAN_FREQUENCY 31400  // Define here to override the defaults below
575 579
   //#define USE_OCR2A_AS_TOP
580
+  #ifndef FAST_PWM_FAN_FREQUENCY
581
+    #ifdef __AVR__
582
+      #define FAST_PWM_FAN_FREQUENCY ((F_CPU) / (2 * 255 * 1))
583
+    #else
584
+      #define FAST_PWM_FAN_FREQUENCY 1000U
585
+    #endif
586
+  #endif
576 587
 #endif
577 588
 
578 589
 /**

+ 0
- 11
Marlin/src/inc/Conditionals_post.h Bestand weergeven

@@ -2668,17 +2668,6 @@
2668 2668
 #endif
2669 2669
 
2670 2670
 /**
2671
- * FAST PWM FAN default PWM frequency
2672
- */
2673
-#if !defined(FAST_PWM_FAN_FREQUENCY) && ENABLED(FAST_PWM_FAN)
2674
-  #ifdef __AVR__
2675
-    #define FAST_PWM_FAN_FREQUENCY ((F_CPU) / (2 * 255 * 1))
2676
-  #else
2677
-    #define FAST_PWM_FAN_FREQUENCY 1000U
2678
-  #endif
2679
-#endif
2680
-
2681
-/**
2682 2671
  * Controller Fan Settings
2683 2672
  */
2684 2673
 #if PIN_EXISTS(CONTROLLER_FAN)

+ 0
- 1
Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h Bestand weergeven

@@ -95,7 +95,6 @@
95 95
   #define FAN_MAX_PWM                        255
96 96
 #else
97 97
   #define FAST_PWM_FAN                            // STM32 Variant allow TIMER2 Hardware PWM
98
-  #define FAST_PWM_FAN_FREQUENCY           31400  // This frequency allow a good range, fan starts at 3%, half noise at 50%
99 98
   #define FAN_MIN_PWM                          5
100 99
   #define FAN_MAX_PWM                        255
101 100
 #endif

Laden…
Annuleren
Opslaan