diff --git a/Marlin/Conditionals_post.h b/Marlin/Conditionals_post.h index 54d22278f6e41f31560a3f14ee15f1976df5b2b4..26c255ce8ccd19b09256d029a1d401aff47a3614 100644 --- a/Marlin/Conditionals_post.h +++ b/Marlin/Conditionals_post.h @@ -880,6 +880,23 @@ */ #define HAS_FANMUX PIN_EXISTS(FANMUX0) + /** + * MIN/MAX fan PWM scaling + */ + #ifndef FAN_MIN_PWM + #define FAN_MIN_PWM 0 + #endif + #ifndef FAN_MAX_PWM + #define FAN_MAX_PWM 255 + #endif + #if FAN_MIN_PWM < 0 || FAN_MIN_PWM > 255 + #error "FAN_MIN_PWM must be a value from 0 to 255." + #elif FAN_MAX_PWM < 0 || FAN_MAX_PWM > 255 + #error "FAN_MAX_PWM must be a value from 0 to 255." + #elif FAN_MIN_PWM > FAN_MAX_PWM + #error "FAN_MIN_PWM must be less than or equal to FAN_MAX_PWM." + #endif + /** * Bed Probe dependencies */ diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 0decaf8871cbc270ddd4dd0ec706f8f405dc30c6..9cfbc8957cea46b806a77aadfb43c776591b0be1 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h b/Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h index 704d2a068e4e5ee149265ee72899d78c71984c8d..e74167b3451351a9693bffdac1823c8d1fb28111 100644 --- a/Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/Anet/A6/Configuration_adv.h b/Marlin/example_configurations/Anet/A6/Configuration_adv.h index 0f92acd1a3a13621ba1eb17d92217e0f20e2e153..9250023780f9d869ed3482de0a9a42ecea96bc3e 100644 --- a/Marlin/example_configurations/Anet/A6/Configuration_adv.h +++ b/Marlin/example_configurations/Anet/A6/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/Anet/A8/Configuration_adv.h b/Marlin/example_configurations/Anet/A8/Configuration_adv.h index 159e2d2eca2c7a2b0e116d31e8e72ef711ac51eb..9ce78fad1da49edf95e18315e3ed20b97dd254f7 100644 --- a/Marlin/example_configurations/Anet/A8/Configuration_adv.h +++ b/Marlin/example_configurations/Anet/A8/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/BIBO/TouchX/Cyclops/Configuration_adv.h b/Marlin/example_configurations/BIBO/TouchX/Cyclops/Configuration_adv.h index 7a6a8dc2948a0106021081ec7d411abad1e1a44f..0200b5349f7be1da549025bb49b81be1b7181d96 100644 --- a/Marlin/example_configurations/BIBO/TouchX/Cyclops/Configuration_adv.h +++ b/Marlin/example_configurations/BIBO/TouchX/Cyclops/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/BIBO/TouchX/default/Configuration_adv.h b/Marlin/example_configurations/BIBO/TouchX/default/Configuration_adv.h index 0decaf8871cbc270ddd4dd0ec706f8f405dc30c6..9cfbc8957cea46b806a77aadfb43c776591b0be1 100644 --- a/Marlin/example_configurations/BIBO/TouchX/default/Configuration_adv.h +++ b/Marlin/example_configurations/BIBO/TouchX/default/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h b/Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h index c1c53725d44a3c03864bfad34138e46814ffab7c..85af155ce62efedf134ceea515e56ceabf4b00aa 100644 --- a/Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h index 15bfb09e69e23e3926d7c9187c1acfd0be62ef0d..3097bba39315df2a2f6a0af1f953794ababf7c58 100644 --- a/Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h b/Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h index c1c53725d44a3c03864bfad34138e46814ffab7c..85af155ce62efedf134ceea515e56ceabf4b00aa 100644 --- a/Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index 67e0870db490e4c076be05f8bd2bd06a1c9d17a3..006a3c2b9296126d5c1eb589461dc924d2f5b2d2 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/Creality/CR-10/Configuration_adv.h b/Marlin/example_configurations/Creality/CR-10/Configuration_adv.h index a49b3533147b1276cd547c6f71e86571e0bc261e..c252c747bc21eda074a20bafd411d2dfedcb3ba5 100755 --- a/Marlin/example_configurations/Creality/CR-10/Configuration_adv.h +++ b/Marlin/example_configurations/Creality/CR-10/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/Creality/CR-10S/Configuration_adv.h b/Marlin/example_configurations/Creality/CR-10S/Configuration_adv.h index 4c240c84eea2e8090613df74b8ff1ef180685b03..7bc828566d48f80ddfa8bf9d622cb2c69ba434b4 100644 --- a/Marlin/example_configurations/Creality/CR-10S/Configuration_adv.h +++ b/Marlin/example_configurations/Creality/CR-10S/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/Creality/CR-10mini/Configuration_adv.h b/Marlin/example_configurations/Creality/CR-10mini/Configuration_adv.h index 0247e323418ebd70738a45a3ae2172e2c576dfde..310fd684ebefda5802425247d2727f0159d1e769 100644 --- a/Marlin/example_configurations/Creality/CR-10mini/Configuration_adv.h +++ b/Marlin/example_configurations/Creality/CR-10mini/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/Creality/CR-8/Configuration_adv.h b/Marlin/example_configurations/Creality/CR-8/Configuration_adv.h index e28d4e2a61fe44de0ec139792c07ca172f5fbae7..9bf4e424461662f9d100ef6b618017e16d29737f 100644 --- a/Marlin/example_configurations/Creality/CR-8/Configuration_adv.h +++ b/Marlin/example_configurations/Creality/CR-8/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/Creality/Ender-2/Configuration_adv.h b/Marlin/example_configurations/Creality/Ender-2/Configuration_adv.h index 9ff0967d7205a95d673df219e69d651635efcb2a..cdce095fe790e8e494c5363c9e87376e04a1a50c 100644 --- a/Marlin/example_configurations/Creality/Ender-2/Configuration_adv.h +++ b/Marlin/example_configurations/Creality/Ender-2/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/Creality/Ender-3/Configuration_adv.h b/Marlin/example_configurations/Creality/Ender-3/Configuration_adv.h index edd0784c6486d935f0c2d84676b79e403dc1e163..080eb374a71952d9e624b27fbee429fe230d0e66 100644 --- a/Marlin/example_configurations/Creality/Ender-3/Configuration_adv.h +++ b/Marlin/example_configurations/Creality/Ender-3/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/Creality/Ender-4/Configuration_adv.h b/Marlin/example_configurations/Creality/Ender-4/Configuration_adv.h index e28d4e2a61fe44de0ec139792c07ca172f5fbae7..9bf4e424461662f9d100ef6b618017e16d29737f 100644 --- a/Marlin/example_configurations/Creality/Ender-4/Configuration_adv.h +++ b/Marlin/example_configurations/Creality/Ender-4/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index 7dd597b526110a93a62186dccbf6760e21fa2916..81c3e731eb15c4b01d4bad380fc167956733b31e 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/FolgerTech/i3-2020/Configuration_adv.h b/Marlin/example_configurations/FolgerTech/i3-2020/Configuration_adv.h index 4395aafe0d9aa43255ba2e8dbd16d2c5011fb7f4..6c7ea1678f3dfb98c8fbba39ecf6d4b12f710170 100644 --- a/Marlin/example_configurations/FolgerTech/i3-2020/Configuration_adv.h +++ b/Marlin/example_configurations/FolgerTech/i3-2020/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/Geeetech/Prusa i3 Pro C/Configuration_adv.h b/Marlin/example_configurations/Geeetech/Prusa i3 Pro C/Configuration_adv.h index e3955ea4a831a0a64a0779d63d24f3981b6510ab..d142240cde5b68087a9bd8068e8c52d8a2016327 100644 --- a/Marlin/example_configurations/Geeetech/Prusa i3 Pro C/Configuration_adv.h +++ b/Marlin/example_configurations/Geeetech/Prusa i3 Pro C/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/Geeetech/Prusa i3 Pro W/Configuration_adv.h b/Marlin/example_configurations/Geeetech/Prusa i3 Pro W/Configuration_adv.h index e3955ea4a831a0a64a0779d63d24f3981b6510ab..d142240cde5b68087a9bd8068e8c52d8a2016327 100644 --- a/Marlin/example_configurations/Geeetech/Prusa i3 Pro W/Configuration_adv.h +++ b/Marlin/example_configurations/Geeetech/Prusa i3 Pro W/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h b/Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h index 507448259277db2b8dd5d1ef0e66723f2bf8cd8e..1bd26c63a29590536cae0c105522a0b57d7eeb7a 100644 --- a/Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h +++ b/Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/JGAurora/A5/Configuration_adv.h b/Marlin/example_configurations/JGAurora/A5/Configuration_adv.h index 3401d9484939364e9580f42ca13f90f83c4faa11..400dbb88f21aff7812f8b9df989f6c3ecdee9ca0 100644 --- a/Marlin/example_configurations/JGAurora/A5/Configuration_adv.h +++ b/Marlin/example_configurations/JGAurora/A5/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/Malyan/M150/Configuration_adv.h b/Marlin/example_configurations/Malyan/M150/Configuration_adv.h index 797a24ebc991a74f5ac98506f8ff3b6ab0d1f864..c363f526614dd70e9fcf83359cca0520e5169932 100644 --- a/Marlin/example_configurations/Malyan/M150/Configuration_adv.h +++ b/Marlin/example_configurations/Malyan/M150/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/Micromake/C1/enhanced/Configuration_adv.h b/Marlin/example_configurations/Micromake/C1/enhanced/Configuration_adv.h index bc8fcee0eeef15eafc4a3688f199cfb225d486bb..7b52cb5cfb2bf50cb93e74f11a4a93fba9d6e00f 100644 --- a/Marlin/example_configurations/Micromake/C1/enhanced/Configuration_adv.h +++ b/Marlin/example_configurations/Micromake/C1/enhanced/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index e0eb35fc8a9f69ecb06865d0bd8fa8eaf4789fe1..4cfc363240ae90f502db59576da07692c46adf77 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index b2195b2386dc98452dc64975ea85d2f5e2526d58..f36e1a94c3a4178436f04526cab465fe3b72feb7 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/Sanguinololu/Configuration_adv.h b/Marlin/example_configurations/Sanguinololu/Configuration_adv.h index 15d6e76a92e6e00214a40d549cb40c908eef594f..f0867be9cf1f2610dad4ed0c48f5ec22220805c1 100644 --- a/Marlin/example_configurations/Sanguinololu/Configuration_adv.h +++ b/Marlin/example_configurations/Sanguinololu/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/TinyBoy2/Configuration_adv.h b/Marlin/example_configurations/TinyBoy2/Configuration_adv.h index 1f33e81741a36e7b2e9a9161796eea91abfee565..dfc27bd2879ba52797d8f48d4ca577fc4507655e 100644 --- a/Marlin/example_configurations/TinyBoy2/Configuration_adv.h +++ b/Marlin/example_configurations/TinyBoy2/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/Velleman/K8400/Configuration_adv.h b/Marlin/example_configurations/Velleman/K8400/Configuration_adv.h index 4743d8b9a337d3b845d4ecc98af42cba1f047898..483ecd8566bb50ce84a74a826bacc71209430afe 100644 --- a/Marlin/example_configurations/Velleman/K8400/Configuration_adv.h +++ b/Marlin/example_configurations/Velleman/K8400/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration_adv.h b/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration_adv.h index b2a81b473384e11e07d323c327d56c1b170ee559..b94d8447924ea5efe716e7fdf55376e664dc145d 100644 --- a/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration_adv.h +++ b/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h index 4ac32788126500dd89e4836488f9f7c5e35a6ea9..3c82c5c55eade9d8bb377db3c7e2588841dd4740 100644 --- a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h +++ b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/delta/FLSUN/kossel/Configuration_adv.h b/Marlin/example_configurations/delta/FLSUN/kossel/Configuration_adv.h index 8ea1d740882fd2ed4c422102783d538fe562b754..dbe611c79aa9144c03902aa6c4966bb9d9a265c0 100644 --- a/Marlin/example_configurations/delta/FLSUN/kossel/Configuration_adv.h +++ b/Marlin/example_configurations/delta/FLSUN/kossel/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h index 0774e76e9f7b90da1ad39b04d0cf6c6c2180410d..1a8de85a37bd6acc8037d61de3a18c04ba332b26 100644 --- a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index 0774e76e9f7b90da1ad39b04d0cf6c6c2180410d..1a8de85a37bd6acc8037d61de3a18c04ba332b26 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index 0774e76e9f7b90da1ad39b04d0cf6c6c2180410d..1a8de85a37bd6acc8037d61de3a18c04ba332b26 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index 64fe007078a4945d4d515078441fb55f3368261a..0dc966d18f11175f42a53bc9ec6d9eb67689cbcd 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -213,10 +213,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index 81bf8e765fa91663d8ed4ca8107e5bb1149e4830..4cac71822dcc66e508361ba24231d9220a4d3f35 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h b/Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h index ae85123273add81657d84823dc15fc00c2616725..f8dc5b9d8dd3e0527cfc4f8727d50f16fce1b197 100644 --- a/Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h +++ b/Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index b41ae0c888791e967b7806eb4752f363293f206a..c8e8d053f8202007039c228104c8e0c26149e6ea 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index 54b69487d64b74acee17213c9ba6e6d9c3ba0e12..8713fcb3fb74f9114ef80161c19b388360389445 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/example_configurations/wt150/Configuration_adv.h b/Marlin/example_configurations/wt150/Configuration_adv.h index df57683770410f2be5735e963d9312ff66af6f56..b327d9bd350ffdcb9362ab6ff144d0a02538648e 100644 --- a/Marlin/example_configurations/wt150/Configuration_adv.h +++ b/Marlin/example_configurations/wt150/Configuration_adv.h @@ -208,10 +208,20 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 -// This defines the minimal speed for the main fan, run in PWM mode -// to enable uncomment and set minimal PWM speed for reliable running (1-255) -// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ //#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 // @section extruder diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index f504665f0d49fe9ce80cd3aea3d4e36d0ca00b76..4d4b92e9dc8543fd4511298d836a5298ea3dd402 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -1084,8 +1084,8 @@ void Planner::check_axes_activity() { #endif // FAN_KICKSTART_TIME > 0 - #ifdef FAN_MIN_PWM - #define CALC_FAN_SPEED(f) (tail_fan_speed[f] ? ( FAN_MIN_PWM + (tail_fan_speed[f] * (255 - FAN_MIN_PWM)) / 255 ) : 0) + #if FAN_MIN_PWM != 0 || FAN_MAX_PWM != 255 + #define CALC_FAN_SPEED(f) (tail_fan_speed[f] ? map(tail_fan_speed[f], 1, 255, FAN_MIN_PWM, FAN_MAX_PWM) : 0) #else #define CALC_FAN_SPEED(f) tail_fan_speed[f] #endif