From 589e97210255605c04c1d501ce1362462c7780d0 Mon Sep 17 00:00:00 2001 From: David Ramiro Date: Sun, 24 Mar 2019 18:30:53 +0100 Subject: [PATCH] Raise PWM frequency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adjusting PWM frequencies to better match FDD8780, WSK220N04 and VS40200ATD MOSFET spec. - Heater PWM frequency increased from 7.6294 Hz to 30.5176 Hz – Referencing the Forward Bias Safe Area from the MOSFET's datasheets, this value should be safer. - Use software PWM for fans to reduce whine – The higher PWM frequency works well with the stock parts cooling fan and might allow for better control of third party fans --- Marlin/Configuration.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index fb2be19..8c488f6 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -379,10 +379,10 @@ // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it - // i3 Mega - #define DEFAULT_Kp 15.94 - #define DEFAULT_Ki 1.17 - #define DEFAULT_Kd 54.19 + // i3 Mega stock v5 hotend, 40W heater cartridge (3.6Ω @ 22°C) + #define DEFAULT_Kp 18.58 + #define DEFAULT_Ki 1.38 + #define DEFAULT_Kd 62.40 // Ultimaker //#define DEFAULT_Kp 22.2 @@ -436,10 +436,10 @@ //#define PID_BED_DEBUG // Sends debug data to the serial port. - //Anycubic i3 Mega 160W Ultrabase - #define DEFAULT_bedKp 251.78 - #define DEFAULT_bedKi 49.57 - #define DEFAULT_bedKd 319.73 + //Anycubic i3 Mega Ultrabase (0.9Ω @ 22°C) + #define DEFAULT_bedKp 187.45 + #define DEFAULT_bedKi 35.75 + #define DEFAULT_bedKd 245.71 //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) //from pidautotune @@ -1827,13 +1827,13 @@ // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency // which is not as annoying as with the hardware PWM. On the other hand, if this frequency // is too low, you should also increment SOFT_PWM_SCALE. -//#define FAN_SOFT_PWM +#define FAN_SOFT_PWM // Incrementing this by 1 will double the software PWM frequency, // affecting heaters, and the fan if FAN_SOFT_PWM is enabled. // However, control resolution will be halved for each increment; // at zero value, there are 128 effective control positions. -#define SOFT_PWM_SCALE 0 +#define SOFT_PWM_SCALE 2 // If SOFT_PWM_SCALE is set to a value higher than 0, dithering can // be used to mitigate the associated resolution loss. If enabled,