From 94330705c7e48ef2d4462368c01ea74281c63db4 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 25 Mar 2015 11:51:41 +0100 Subject: [PATCH] Move definition of PIDdT back to temperature.h make it unconditional remove all definitions in the 'Configuration.h's remove form 'Conditionals.h' --- Marlin/Conditionals.h | 11 ----------- Marlin/Configuration.h | 3 +-- Marlin/configurator/config/Configuration.h | 3 +-- Marlin/example_configurations/Felix/Configuration.h | 3 +-- .../example_configurations/Felix/Configuration_DUAL.h | 3 +-- .../example_configurations/Hephestos/Configuration.h | 3 +-- Marlin/example_configurations/K8200/Configuration.h | 3 +-- Marlin/example_configurations/SCARA/Configuration.h | 3 +-- Marlin/example_configurations/WITBOX/Configuration.h | 3 +-- .../delta/generic/Configuration.h | 3 +-- .../delta/kossel_mini/Configuration.h | 3 +-- Marlin/example_configurations/makibox/Configuration.h | 3 +-- .../tvrrug/Round2/Configuration.h | 3 +-- Marlin/temperature.cpp | 4 ++++ 14 files changed, 16 insertions(+), 35 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index fc6d6573e..c471ec436 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -390,16 +390,5 @@ #define WRITE_FAN(v) WRITE(FAN_PIN, v) #endif - /** - * Sampling period of the temperature routine - * This override comes originally from temperature.cpp - * The Configuration.h option is basically ignored. - */ - #ifdef PID_dT - #undef PID_dT - #endif - #define PID_dT ((OVERSAMPLENR * 12.0)/(F_CPU / 64.0 / 256.0)) - - #endif //CONFIGURATION_LCD #endif //CONDITIONALS_H diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index f5a36e6b9..c02392be4 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -184,7 +184,6 @@ Here are some standard links for getting your machine calibrated: // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID - #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Ultimaker @@ -209,7 +208,7 @@ Here are some standard links for getting your machine calibrated: // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis // // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. -// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz, +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. // If your configuration is significantly different than this and you don't understand the issues involved, you probably diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index 71cbdebae..bfc62f578 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -193,7 +193,6 @@ Here are some standard links for getting your machine calibrated: // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID - #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Ultimaker @@ -218,7 +217,7 @@ Here are some standard links for getting your machine calibrated: // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis // // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. -// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz, +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. // If your configuration is significantly different than this and you don't understand the issues involved, you probably diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index e9801813f..865a55167 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -184,7 +184,6 @@ Here are some standard links for getting your machine calibrated: // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID - #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // Felix 2.0+ electronics with v4 Hotend #define DEFAULT_Kp 12 @@ -199,7 +198,7 @@ Here are some standard links for getting your machine calibrated: // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis // // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. -// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz, +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. // If your configuration is significantly different than this and you don't understand the issues involved, you probably diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h index e9e4623ca..e9e0adba4 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -184,7 +184,6 @@ Here are some standard links for getting your machine calibrated: // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID - #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // Felix 2.0+ electronics with v4 Hotend #define DEFAULT_Kp 12 @@ -199,7 +198,7 @@ Here are some standard links for getting your machine calibrated: // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis // // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. -// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz, +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. // If your configuration is significantly different than this and you don't understand the issues involved, you probably diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index c5b0243d5..5c426a5da 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -184,7 +184,6 @@ Here are some standard links for getting your machine calibrated: // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID - #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Ultimaker @@ -215,7 +214,7 @@ Here are some standard links for getting your machine calibrated: // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis // // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. -// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz, +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. // If your configuration is significantly different than this and you don't understand the issues involved, you probably diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index bc0f3e5df..96a261caf 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -184,7 +184,6 @@ Here are some standard links for getting your machine calibrated: // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID - #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Ultimaker @@ -214,7 +213,7 @@ Here are some standard links for getting your machine calibrated: // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis // // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. -// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz, +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. // If your configuration is significantly different than this and you don't understand the issues involved, you probably diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index d42bebe3a..30dc73184 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -202,7 +202,6 @@ Here are some standard links for getting your machine calibrated: // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID - #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Ultimaker @@ -238,7 +237,7 @@ Here are some standard links for getting your machine calibrated: // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis // // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. -// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz, +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. // If your configuration is significantly different than this and you don't understand the issues involved, you probably diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 481b59125..7a395d012 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -184,7 +184,6 @@ Here are some standard links for getting your machine calibrated: // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID - #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Ultimaker @@ -214,7 +213,7 @@ Here are some standard links for getting your machine calibrated: // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis // // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. -// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz, +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. // If your configuration is significantly different than this and you don't understand the issues involved, you probably diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 0baf7de1c..fb78c269d 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -217,7 +217,6 @@ Here are some standard links for getting your machine calibrated: // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID - #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Ultimaker @@ -242,7 +241,7 @@ Here are some standard links for getting your machine calibrated: // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis // // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. -// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz, +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. // If your configuration is significantly different than this and you don't understand the issues involved, you probably diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 9f5f89ca5..556a98bf3 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -218,7 +218,6 @@ Here are some standard links for getting your machine calibrated: // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID - #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Ultimaker @@ -243,7 +242,7 @@ Here are some standard links for getting your machine calibrated: // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis // // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. -// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz, +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. // If your configuration is significantly different than this and you don't understand the issues involved, you probably diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index f6561b3af..3e8c07fe4 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -184,7 +184,6 @@ Here are some standard links for getting your machine calibrated: // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID - #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Ultimaker @@ -209,7 +208,7 @@ Here are some standard links for getting your machine calibrated: // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis // // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. -// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz, +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. // If your configuration is significantly different than this and you don't understand the issues involved, you probably diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 17928b536..22e16e4ee 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -184,7 +184,6 @@ Here are some standard links for getting your machine calibrated: // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define K1 0.95 //smoothing factor within the PID - #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // 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 @@ -214,7 +213,7 @@ Here are some standard links for getting your machine calibrated: // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis // // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. -// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz, +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. // If your configuration is significantly different than this and you don't understand the issues involved, you probably diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 713d0312f..abbc0600c 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -45,6 +45,10 @@ #define K2 (1.0-K1) #endif +#ifdef PIDTEMPBED + #define PID_dT ((OVERSAMPLENR * 12.0)/(F_CPU / 64.0 / 256.0)) +#endif + //=========================================================================== //============================= public variables ============================ //===========================================================================