diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 5e658f0c0..b3f43b4c2 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 1ad7aa9b4..72bdf8dd0 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -222,6 +222,8 @@ #error "BABYSTEP_ZPROBE_GFX_REVERSE is now set by OVERLAY_GFX_REVERSE. Please update your configurations." #elif defined(UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN) #error "UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN is now SEGMENT_LEVELED_MOVES. Please update your configuration." +#elif HAS_PID_HEATING && (defined(K1) || !defined(PID_K1)) + #error "K1 is now PID_K1. Please update your configuration." #endif /** diff --git a/Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h b/Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h index 02e84a9b9..9418f7f47 100644 --- a/Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h +++ b/Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 70 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX 74 // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 70 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX 74 // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 16 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Buda 2.0 on 24V diff --git a/Marlin/example_configurations/AliExpress/CL-260/Configuration.h b/Marlin/example_configurations/AliExpress/CL-260/Configuration.h index 2ccb39dee..20aa9ba54 100644 --- a/Marlin/example_configurations/AliExpress/CL-260/Configuration.h +++ b/Marlin/example_configurations/AliExpress/CL-260/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/Anet/A6/Configuration.h b/Marlin/example_configurations/Anet/A6/Configuration.h index 3a96b4ce7..cc82e88bd 100644 --- a/Marlin/example_configurations/Anet/A6/Configuration.h +++ b/Marlin/example_configurations/Anet/A6/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/Anet/A8/Configuration.h b/Marlin/example_configurations/Anet/A8/Configuration.h index 359aaf8cf..55843fc27 100644 --- a/Marlin/example_configurations/Anet/A8/Configuration.h +++ b/Marlin/example_configurations/Anet/A8/Configuration.h @@ -340,8 +340,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -351,7 +352,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 15 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/BQ/Hephestos/Configuration.h b/Marlin/example_configurations/BQ/Hephestos/Configuration.h index 5fb28853b..6a908de4d 100644 --- a/Marlin/example_configurations/BQ/Hephestos/Configuration.h +++ b/Marlin/example_configurations/BQ/Hephestos/Configuration.h @@ -342,8 +342,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -353,7 +354,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // Hephestos i3 #define DEFAULT_Kp 23.05 diff --git a/Marlin/example_configurations/BQ/Hephestos_2/Configuration.h b/Marlin/example_configurations/BQ/Hephestos_2/Configuration.h index 3af5077d2..cd2cb05e7 100644 --- a/Marlin/example_configurations/BQ/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/BQ/Hephestos_2/Configuration.h @@ -344,8 +344,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -355,7 +356,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 50 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // Tuned PID values using M303 #define DEFAULT_Kp 19.18 diff --git a/Marlin/example_configurations/BQ/WITBOX/Configuration.h b/Marlin/example_configurations/BQ/WITBOX/Configuration.h index cc1713b2a..4bfd3a382 100644 --- a/Marlin/example_configurations/BQ/WITBOX/Configuration.h +++ b/Marlin/example_configurations/BQ/WITBOX/Configuration.h @@ -342,8 +342,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -353,7 +354,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // Witbox #define DEFAULT_Kp 22.2 diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index cf8dfc700..eccef8aec 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -340,8 +340,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -351,7 +352,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/Creality/CR-10/Configuration.h b/Marlin/example_configurations/Creality/CR-10/Configuration.h index 175cdebd5..18019bad8 100755 --- a/Marlin/example_configurations/Creality/CR-10/Configuration.h +++ b/Marlin/example_configurations/Creality/CR-10/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 5954a40d6..789f25115 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // Felix 2.0+ electronics with v4 Hotend #define DEFAULT_Kp 12 diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index d638e91bc..5758bb9ef 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // Felix 2.0+ electronics with v4 Hotend #define DEFAULT_Kp 12 diff --git a/Marlin/example_configurations/FolgerTech/i3-2020/Configuration.h b/Marlin/example_configurations/FolgerTech/i3-2020/Configuration.h index fe5234374..35976de17 100644 --- a/Marlin/example_configurations/FolgerTech/i3-2020/Configuration.h +++ b/Marlin/example_configurations/FolgerTech/i3-2020/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/Geeetech/GT2560/Configuration.h b/Marlin/example_configurations/Geeetech/GT2560/Configuration.h index 9b7608e05..e2d6b1607 100644 --- a/Marlin/example_configurations/Geeetech/GT2560/Configuration.h +++ b/Marlin/example_configurations/Geeetech/GT2560/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // Geeetech MK8 Extruder #define DEFAULT_Kp 12.33 diff --git a/Marlin/example_configurations/Geeetech/I3_Pro_X-GT2560/Configuration.h b/Marlin/example_configurations/Geeetech/I3_Pro_X-GT2560/Configuration.h index 458029dc2..02f446713 100644 --- a/Marlin/example_configurations/Geeetech/I3_Pro_X-GT2560/Configuration.h +++ b/Marlin/example_configurations/Geeetech/I3_Pro_X-GT2560/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/Infitary/i3-M508/Configuration.h b/Marlin/example_configurations/Infitary/i3-M508/Configuration.h index 9e4be0a80..d21d3bbd8 100644 --- a/Marlin/example_configurations/Infitary/i3-M508/Configuration.h +++ b/Marlin/example_configurations/Infitary/i3-M508/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/Malyan/M150/Configuration.h b/Marlin/example_configurations/Malyan/M150/Configuration.h index 982ec529e..841cce677 100644 --- a/Marlin/example_configurations/Malyan/M150/Configuration.h +++ b/Marlin/example_configurations/Malyan/M150/Configuration.h @@ -347,8 +347,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -358,7 +359,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/Micromake/C1/basic/Configuration.h b/Marlin/example_configurations/Micromake/C1/basic/Configuration.h index aa18f5212..d8b375a3c 100644 --- a/Marlin/example_configurations/Micromake/C1/basic/Configuration.h +++ b/Marlin/example_configurations/Micromake/C1/basic/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/Micromake/C1/enhanced/Configuration.h b/Marlin/example_configurations/Micromake/C1/enhanced/Configuration.h index 977e0ed5e..5de6a703e 100644 --- a/Marlin/example_configurations/Micromake/C1/enhanced/Configuration.h +++ b/Marlin/example_configurations/Micromake/C1/enhanced/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index ad0bea91b..5450c018f 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 1650c8fde..058278fa6 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -342,8 +342,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -353,7 +354,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 4436fa8ef..febe7874f 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -369,8 +369,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -380,7 +381,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 20 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // Merlin Hotend: From Autotune #define DEFAULT_Kp 24.5 diff --git a/Marlin/example_configurations/Sanguinololu/Configuration.h b/Marlin/example_configurations/Sanguinololu/Configuration.h index c8613e96f..0c5af413d 100644 --- a/Marlin/example_configurations/Sanguinololu/Configuration.h +++ b/Marlin/example_configurations/Sanguinololu/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/TinyBoy2/Configuration.h b/Marlin/example_configurations/TinyBoy2/Configuration.h index 8acb2f8bd..2b5531ae2 100644 --- a/Marlin/example_configurations/TinyBoy2/Configuration.h +++ b/Marlin/example_configurations/TinyBoy2/Configuration.h @@ -366,8 +366,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -377,7 +378,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/Velleman/K8200/Configuration.h b/Marlin/example_configurations/Velleman/K8200/Configuration.h index a20f3aef0..16d46f1b9 100644 --- a/Marlin/example_configurations/Velleman/K8200/Configuration.h +++ b/Marlin/example_configurations/Velleman/K8200/Configuration.h @@ -359,8 +359,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -370,7 +371,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/Velleman/K8400/Configuration.h b/Marlin/example_configurations/Velleman/K8400/Configuration.h index 337ce512c..98b6a51b2 100644 --- a/Marlin/example_configurations/Velleman/K8400/Configuration.h +++ b/Marlin/example_configurations/Velleman/K8400/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h index 890883e77..91c42f784 100644 --- a/Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration.h b/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration.h index 7c16f070a..67c1f1eb9 100644 --- a/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration.h +++ b/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) #define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 029d7d11b..b2740b862 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h index 0a6be92ca..057ba49e0 100644 --- a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h +++ b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) #define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h index 311c05153..9d767cd36 100644 --- a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) #define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 3c998d946..3cf0d2099 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 7c467cd1a..6b672f3df 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 843ce104e..09abd744a 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -343,8 +343,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX 125 // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX 125 // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -354,7 +355,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 50 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // Kossel Pro #define DEFAULT_Kp 19.30 diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 5921ce3f8..fe2667eb5 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // oXis Kossel k800 XL diff --git a/Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h b/Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h index 6c2f51f7a..276661382 100644 --- a/Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h +++ b/Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h @@ -347,8 +347,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -358,7 +359,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 6c32e49c6..71d9604d5 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 898b8925e..d910be349 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // J-Head Mk V-B diff --git a/Marlin/example_configurations/wt150/Configuration.h b/Marlin/example_configurations/wt150/Configuration.h index 5e2a0043c..dfb87d5f8 100644 --- a/Marlin/example_configurations/wt150/Configuration.h +++ b/Marlin/example_configurations/wt150/Configuration.h @@ -339,8 +339,9 @@ // Comment the following line to disable PID and enable bang-bang. #define PIDTEMP -#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current -#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within the PID #if ENABLED(PIDTEMP) //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. //#define PID_DEBUG // Sends debug data to the serial port. @@ -350,7 +351,6 @@ // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define K1 0.95 //smoothing factor within the PID // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index ef46ca4d0..efc8e8199 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -47,10 +47,6 @@ #include "watchdog.h" #endif -#ifdef K1 // Defined in Configuration.h in the PID settings - #define K2 (1.0-K1) -#endif - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) static void* heater_ttbl_map[2] = { (void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE }; static uint8_t heater_ttbllen_map[2] = { HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN }; @@ -599,7 +595,7 @@ float Temperature::get_pid_output(const int8_t e) { #if ENABLED(PIDTEMP) #if DISABLED(PID_OPENLOOP) pid_error[HOTEND_INDEX] = target_temperature[HOTEND_INDEX] - current_temperature[HOTEND_INDEX]; - dTerm[HOTEND_INDEX] = K2 * PID_PARAM(Kd, HOTEND_INDEX) * (current_temperature[HOTEND_INDEX] - temp_dState[HOTEND_INDEX]) + K1 * dTerm[HOTEND_INDEX]; + dTerm[HOTEND_INDEX] = PID_K2 * PID_PARAM(Kd, HOTEND_INDEX) * (current_temperature[HOTEND_INDEX] - temp_dState[HOTEND_INDEX]) + PID_K1 * dTerm[HOTEND_INDEX]; temp_dState[HOTEND_INDEX] = current_temperature[HOTEND_INDEX]; #if HEATER_IDLE_HANDLER if (heater_idle_timeout_exceeded[HOTEND_INDEX]) { @@ -696,7 +692,7 @@ float Temperature::get_pid_output(const int8_t e) { temp_iState_bed += pid_error_bed; iTerm_bed = bedKi * temp_iState_bed; - dTerm_bed = K2 * bedKd * (current_temperature_bed - temp_dState_bed) + K1 * dTerm_bed; + dTerm_bed = PID_K2 * bedKd * (current_temperature_bed - temp_dState_bed) + PID_K1 * dTerm_bed; temp_dState_bed = current_temperature_bed; pid_output = pTerm_bed + iTerm_bed - dTerm_bed; diff --git a/Marlin/temperature.h b/Marlin/temperature.h index 30f03a3fb..03fecb08a 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -96,6 +96,17 @@ enum ADCSensorState { #define ACTUAL_ADC_SAMPLES max(int(MIN_ADC_ISR_LOOPS), int(SensorsReady)) +#if HAS_PID_HEATING + #define PID_K2 (1.0-PID_K1) + #define PID_dT ((OVERSAMPLENR * float(ACTUAL_ADC_SAMPLES)) / (F_CPU / 64.0 / 256.0)) + + // Apply the scale factors to the PID values + #define scalePID_i(i) ( (i) * PID_dT ) + #define unscalePID_i(i) ( (i) / PID_dT ) + #define scalePID_d(d) ( (d) / PID_dT ) + #define unscalePID_d(d) ( (d) * PID_dT ) +#endif + #if !HAS_HEATER_BED constexpr int16_t target_temperature_bed = 0; #endif @@ -124,10 +135,6 @@ class Temperature { soft_pwm_count_fan[FAN_COUNT]; #endif - #if ENABLED(PIDTEMP) || ENABLED(PIDTEMPBED) - #define PID_dT ((OVERSAMPLENR * float(ACTUAL_ADC_SAMPLES)) / (F_CPU / 64.0 / 256.0)) - #endif - #if ENABLED(PIDTEMP) #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1 @@ -148,12 +155,6 @@ class Temperature { #endif // PID_PARAMS_PER_HOTEND - // Apply the scale factors to the PID values - #define scalePID_i(i) ( (i) * PID_dT ) - #define unscalePID_i(i) ( (i) / PID_dT ) - #define scalePID_d(d) ( (d) / PID_dT ) - #define unscalePID_d(d) ( (d) * PID_dT ) - #endif #if ENABLED(PIDTEMPBED)