Browse Source

Merge pull request #4933 from thinkyhead/rc_drop_pid_func_range

Squashed - Removal of PID functional range
Scott Lahteine 8 years ago
parent
commit
00261cbfcb
24 changed files with 40 additions and 96 deletions
  1. 1
    3
      Marlin/Configuration.h
  2. 1
    3
      Marlin/example_configurations/Cartesio/Configuration.h
  3. 1
    3
      Marlin/example_configurations/Felix/Configuration.h
  4. 1
    3
      Marlin/example_configurations/Felix/DUAL/Configuration.h
  5. 1
    3
      Marlin/example_configurations/Hephestos/Configuration.h
  6. 1
    3
      Marlin/example_configurations/Hephestos_2/Configuration.h
  7. 1
    3
      Marlin/example_configurations/K8200/Configuration.h
  8. 1
    3
      Marlin/example_configurations/K8400/Configuration.h
  9. 1
    3
      Marlin/example_configurations/K8400/Dual-head/Configuration.h
  10. 1
    3
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  11. 1
    3
      Marlin/example_configurations/RigidBot/Configuration.h
  12. 1
    3
      Marlin/example_configurations/SCARA/Configuration.h
  13. 1
    3
      Marlin/example_configurations/TAZ4/Configuration.h
  14. 1
    3
      Marlin/example_configurations/WITBOX/Configuration.h
  15. 1
    3
      Marlin/example_configurations/adafruit/ST7565/Configuration.h
  16. 1
    3
      Marlin/example_configurations/delta/biv2.5/Configuration.h
  17. 1
    3
      Marlin/example_configurations/delta/generic/Configuration.h
  18. 1
    3
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  19. 1
    3
      Marlin/example_configurations/delta/kossel_pro/Configuration.h
  20. 1
    3
      Marlin/example_configurations/delta/kossel_xl/Configuration.h
  21. 1
    3
      Marlin/example_configurations/makibox/Configuration.h
  22. 1
    3
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  23. 18
    29
      Marlin/temperature.cpp
  24. 0
    1
      Marlin/temperature.h

+ 1
- 3
Marlin/Configuration.h View File

288
 // Comment the following line to disable PID and enable bang-bang.
288
 // Comment the following line to disable PID and enable bang-bang.
289
 #define PIDTEMP
289
 #define PIDTEMP
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
291
-#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
291
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active); 255=full current
292
 #if ENABLED(PIDTEMP)
292
 #if ENABLED(PIDTEMP)
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
299
-  #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
300
-                                  // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
301
   #define K1 0.95 //smoothing factor within the PID
299
   #define K1 0.95 //smoothing factor within the PID
302
 
300
 
303
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
301
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it

+ 1
- 3
Marlin/example_configurations/Cartesio/Configuration.h View File

289
 // Comment the following line to disable PID and enable bang-bang.
289
 // Comment the following line to disable PID and enable bang-bang.
290
 #define PIDTEMP
290
 #define PIDTEMP
291
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
291
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
292
-#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
292
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active; 255=full current
293
 #if ENABLED(PIDTEMP)
293
 #if ENABLED(PIDTEMP)
294
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
294
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
295
   //#define PID_DEBUG // Sends debug data to the serial port.
295
   //#define PID_DEBUG // Sends debug data to the serial port.
297
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
297
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
298
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
298
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
299
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
299
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
300
-  #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
301
-                                  // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
302
   #define K1 0.95 //smoothing factor within the PID
300
   #define K1 0.95 //smoothing factor within the PID
303
 
301
 
304
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
302
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it

+ 1
- 3
Marlin/example_configurations/Felix/Configuration.h View File

288
 // Comment the following line to disable PID and enable bang-bang.
288
 // Comment the following line to disable PID and enable bang-bang.
289
 #define PIDTEMP
289
 #define PIDTEMP
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
291
-#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
291
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active; 255=full current
292
 #if ENABLED(PIDTEMP)
292
 #if ENABLED(PIDTEMP)
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
299
-  #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
300
-                                  // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
301
   #define K1 0.95 //smoothing factor within the PID
299
   #define K1 0.95 //smoothing factor within the PID
302
 
300
 
303
   // Felix 2.0+ electronics with v4 Hotend
301
   // Felix 2.0+ electronics with v4 Hotend

+ 1
- 3
Marlin/example_configurations/Felix/DUAL/Configuration.h View File

288
 // Comment the following line to disable PID and enable bang-bang.
288
 // Comment the following line to disable PID and enable bang-bang.
289
 #define PIDTEMP
289
 #define PIDTEMP
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
291
-#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
291
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active; 255=full current
292
 #if ENABLED(PIDTEMP)
292
 #if ENABLED(PIDTEMP)
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
299
-  #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
300
-                                  // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
301
   #define K1 0.95 //smoothing factor within the PID
299
   #define K1 0.95 //smoothing factor within the PID
302
 
300
 
303
   // Felix 2.0+ electronics with v4 Hotend
301
   // Felix 2.0+ electronics with v4 Hotend

+ 1
- 3
Marlin/example_configurations/Hephestos/Configuration.h View File

291
 // Comment the following line to disable PID and enable bang-bang.
291
 // Comment the following line to disable PID and enable bang-bang.
292
 #define PIDTEMP
292
 #define PIDTEMP
293
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
293
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
294
-#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
294
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active; 255=full current
295
 #if ENABLED(PIDTEMP)
295
 #if ENABLED(PIDTEMP)
296
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
296
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
297
   //#define PID_DEBUG // Sends debug data to the serial port.
297
   //#define PID_DEBUG // Sends debug data to the serial port.
299
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
299
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
300
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
300
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
301
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
301
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
302
-  #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
303
-                                  // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
304
   #define K1 0.95 //smoothing factor within the PID
302
   #define K1 0.95 //smoothing factor within the PID
305
 
303
 
306
   // Hephestos i3
304
   // Hephestos i3

+ 1
- 3
Marlin/example_configurations/Hephestos_2/Configuration.h View File

288
 // Comment the following line to disable PID and enable bang-bang.
288
 // Comment the following line to disable PID and enable bang-bang.
289
 #define PIDTEMP
289
 #define PIDTEMP
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
291
-#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
291
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active; 255=full current
292
 #if ENABLED(PIDTEMP)
292
 #if ENABLED(PIDTEMP)
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
299
-  #define PID_FUNCTIONAL_RANGE 250  // If the temperature difference between the target temperature and the actual temperature
300
-                                    // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
301
   #define K1 0.95 //smoothing factor within the PID
299
   #define K1 0.95 //smoothing factor within the PID
302
 
300
 
303
   // Tuned PID values using M303
301
   // Tuned PID values using M303

+ 1
- 3
Marlin/example_configurations/K8200/Configuration.h View File

295
 // Comment the following line to disable PID and enable bang-bang.
295
 // Comment the following line to disable PID and enable bang-bang.
296
 #define PIDTEMP
296
 #define PIDTEMP
297
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
297
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
298
-#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
298
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active; 255=full current
299
 #if ENABLED(PIDTEMP)
299
 #if ENABLED(PIDTEMP)
300
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
300
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
301
   //#define PID_DEBUG // Sends debug data to the serial port.
301
   //#define PID_DEBUG // Sends debug data to the serial port.
303
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
303
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
304
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
304
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
305
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
305
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
306
-  #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
307
-                                  // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
308
   #define K1 0.95 //smoothing factor within the PID
306
   #define K1 0.95 //smoothing factor within the PID
309
 
307
 
310
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
308
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it

+ 1
- 3
Marlin/example_configurations/K8400/Configuration.h View File

288
 // Comment the following line to disable PID and enable bang-bang.
288
 // Comment the following line to disable PID and enable bang-bang.
289
 #define PIDTEMP
289
 #define PIDTEMP
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
291
-#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
291
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active; 255=full current
292
 #if ENABLED(PIDTEMP)
292
 #if ENABLED(PIDTEMP)
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
299
-  #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
300
-                                  // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
301
   #define K1 0.95 //smoothing factor within the PID
299
   #define K1 0.95 //smoothing factor within the PID
302
 
300
 
303
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
301
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it

+ 1
- 3
Marlin/example_configurations/K8400/Dual-head/Configuration.h View File

288
 // Comment the following line to disable PID and enable bang-bang.
288
 // Comment the following line to disable PID and enable bang-bang.
289
 #define PIDTEMP
289
 #define PIDTEMP
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
291
-#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
291
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active; 255=full current
292
 #if ENABLED(PIDTEMP)
292
 #if ENABLED(PIDTEMP)
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
299
-  #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
300
-                                  // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
301
   #define K1 0.95 //smoothing factor within the PID
299
   #define K1 0.95 //smoothing factor within the PID
302
 
300
 
303
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
301
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it

+ 1
- 3
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h View File

288
 // Comment the following line to disable PID and enable bang-bang.
288
 // Comment the following line to disable PID and enable bang-bang.
289
 #define PIDTEMP
289
 #define PIDTEMP
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
291
-#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
291
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active; 255=full current
292
 #if ENABLED(PIDTEMP)
292
 #if ENABLED(PIDTEMP)
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
299
-  #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
300
-                                  // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
301
   #define K1 0.95 //smoothing factor within the PID
299
   #define K1 0.95 //smoothing factor within the PID
302
 
300
 
303
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
301
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it

+ 1
- 3
Marlin/example_configurations/RigidBot/Configuration.h View File

291
 // Comment the following line to disable PID and enable bang-bang.
291
 // Comment the following line to disable PID and enable bang-bang.
292
 #define PIDTEMP
292
 #define PIDTEMP
293
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
293
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
294
-#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
294
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active; 255=full current
295
 #if ENABLED(PIDTEMP)
295
 #if ENABLED(PIDTEMP)
296
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
296
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
297
   //#define PID_DEBUG // Sends debug data to the serial port.
297
   //#define PID_DEBUG // Sends debug data to the serial port.
299
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
299
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
300
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
300
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
301
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
301
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
302
-  #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
303
-                                  // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
304
   #define K1 0.95 //smoothing factor within the PID
302
   #define K1 0.95 //smoothing factor within the PID
305
 
303
 
306
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
304
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it

+ 1
- 3
Marlin/example_configurations/SCARA/Configuration.h View File

320
 // Comment the following line to disable PID and enable bang-bang.
320
 // Comment the following line to disable PID and enable bang-bang.
321
 #define PIDTEMP
321
 #define PIDTEMP
322
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
322
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
323
-#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
323
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active; 255=full current
324
 #if ENABLED(PIDTEMP)
324
 #if ENABLED(PIDTEMP)
325
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
325
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
326
   //#define PID_DEBUG // Sends debug data to the serial port.
326
   //#define PID_DEBUG // Sends debug data to the serial port.
328
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
328
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
329
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
329
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
330
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
330
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
331
-  #define PID_FUNCTIONAL_RANGE 20 // If the temperature difference between the target temperature and the actual temperature
332
-                                  // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
333
   #define K1 0.95 //smoothing factor within the PID
331
   #define K1 0.95 //smoothing factor within the PID
334
 
332
 
335
   // Merlin Hotend: From Autotune
333
   // Merlin Hotend: From Autotune

+ 1
- 3
Marlin/example_configurations/TAZ4/Configuration.h View File

288
 // Comment the following line to disable PID and enable bang-bang.
288
 // Comment the following line to disable PID and enable bang-bang.
289
 #define PIDTEMP
289
 #define PIDTEMP
290
 #define BANG_MAX 70 // limits current to nozzle while in bang-bang mode; 255=full current
290
 #define BANG_MAX 70 // limits current to nozzle while in bang-bang mode; 255=full current
291
-#define PID_MAX 74 // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
291
+#define PID_MAX 74 // limits current to nozzle while PID is active; 255=full current
292
 #if ENABLED(PIDTEMP)
292
 #if ENABLED(PIDTEMP)
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
299
-  #define PID_FUNCTIONAL_RANGE 16 // If the temperature difference between the target temperature and the actual temperature
300
-                                  // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
301
   #define K1 0.95 //smoothing factor within the PID
299
   #define K1 0.95 //smoothing factor within the PID
302
 
300
 
303
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
301
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it

+ 1
- 3
Marlin/example_configurations/WITBOX/Configuration.h View File

291
 // Comment the following line to disable PID and enable bang-bang.
291
 // Comment the following line to disable PID and enable bang-bang.
292
 #define PIDTEMP
292
 #define PIDTEMP
293
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
293
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
294
-#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
294
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active; 255=full current
295
 #if ENABLED(PIDTEMP)
295
 #if ENABLED(PIDTEMP)
296
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
296
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
297
   //#define PID_DEBUG // Sends debug data to the serial port.
297
   //#define PID_DEBUG // Sends debug data to the serial port.
299
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
299
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
300
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
300
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
301
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
301
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
302
-  #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
303
-                                  // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
304
   #define K1 0.95 //smoothing factor within the PID
302
   #define K1 0.95 //smoothing factor within the PID
305
 
303
 
306
   // Witbox
304
   // Witbox

+ 1
- 3
Marlin/example_configurations/adafruit/ST7565/Configuration.h View File

288
 // Comment the following line to disable PID and enable bang-bang.
288
 // Comment the following line to disable PID and enable bang-bang.
289
 #define PIDTEMP
289
 #define PIDTEMP
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
291
-#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
291
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active; 255=full current
292
 #if ENABLED(PIDTEMP)
292
 #if ENABLED(PIDTEMP)
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
299
-  #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
300
-                                  // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
301
   #define K1 0.95 //smoothing factor within the PID
299
   #define K1 0.95 //smoothing factor within the PID
302
 
300
 
303
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
301
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it

+ 1
- 3
Marlin/example_configurations/delta/biv2.5/Configuration.h View File

288
 // Comment the following line to disable PID and enable bang-bang.
288
 // Comment the following line to disable PID and enable bang-bang.
289
 #define PIDTEMP
289
 #define PIDTEMP
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
291
-#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
291
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active; 255=full current
292
 #if ENABLED(PIDTEMP)
292
 #if ENABLED(PIDTEMP)
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
299
-  #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
300
-                                  // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
301
   #define K1 0.95 //smoothing factor within the PID
299
   #define K1 0.95 //smoothing factor within the PID
302
 
300
 
303
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
301
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it

+ 1
- 3
Marlin/example_configurations/delta/generic/Configuration.h View File

288
 // Comment the following line to disable PID and enable bang-bang.
288
 // Comment the following line to disable PID and enable bang-bang.
289
 #define PIDTEMP
289
 #define PIDTEMP
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
291
-#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
291
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active; 255=full current
292
 #if ENABLED(PIDTEMP)
292
 #if ENABLED(PIDTEMP)
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
299
-  #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
300
-                                  // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
301
   #define K1 0.95 //smoothing factor within the PID
299
   #define K1 0.95 //smoothing factor within the PID
302
 
300
 
303
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
301
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it

+ 1
- 3
Marlin/example_configurations/delta/kossel_mini/Configuration.h View File

288
 // Comment the following line to disable PID and enable bang-bang.
288
 // Comment the following line to disable PID and enable bang-bang.
289
 #define PIDTEMP
289
 #define PIDTEMP
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
291
-#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
291
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active; 255=full current
292
 #if ENABLED(PIDTEMP)
292
 #if ENABLED(PIDTEMP)
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
299
-  #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
300
-                                  // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
301
   #define K1 0.95 //smoothing factor within the PID
299
   #define K1 0.95 //smoothing factor within the PID
302
 
300
 
303
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
301
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it

+ 1
- 3
Marlin/example_configurations/delta/kossel_pro/Configuration.h View File

294
 // Comment the following line to disable PID and enable bang-bang.
294
 // Comment the following line to disable PID and enable bang-bang.
295
 #define PIDTEMP
295
 #define PIDTEMP
296
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
296
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
297
-#define PID_MAX  125 // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
297
+#define PID_MAX  125 // limits current to nozzle while PID is active; 255=full current
298
 #if ENABLED(PIDTEMP)
298
 #if ENABLED(PIDTEMP)
299
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
299
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
300
   //#define PID_DEBUG // Sends debug data to the serial port.
300
   //#define PID_DEBUG // Sends debug data to the serial port.
302
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
302
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
303
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
303
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
304
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
304
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
305
-  #define PID_FUNCTIONAL_RANGE 50 // If the temperature difference between the target temperature and the actual temperature
306
-                                  // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
307
   #define K1 0.95 //smoothing factor within the PID
305
   #define K1 0.95 //smoothing factor within the PID
308
 
306
 
309
   // Kossel Pro
307
   // Kossel Pro

+ 1
- 3
Marlin/example_configurations/delta/kossel_xl/Configuration.h View File

281
 // Comment the following line to disable PID and enable bang-bang.
281
 // Comment the following line to disable PID and enable bang-bang.
282
 #define PIDTEMP
282
 #define PIDTEMP
283
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
283
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
284
-#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
284
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active; 255=full current
285
 #if ENABLED(PIDTEMP)
285
 #if ENABLED(PIDTEMP)
286
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
286
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
287
   //#define PID_DEBUG // Sends debug data to the serial port.
287
   //#define PID_DEBUG // Sends debug data to the serial port.
289
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
289
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
290
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
290
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
291
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
291
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
292
-  #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
293
-                                  // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
294
   #define K1 0.95 //smoothing factor within the PID
292
   #define K1 0.95 //smoothing factor within the PID
295
 
293
 
296
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
294
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it

+ 1
- 3
Marlin/example_configurations/makibox/Configuration.h View File

288
 // Comment the following line to disable PID and enable bang-bang.
288
 // Comment the following line to disable PID and enable bang-bang.
289
 #define PIDTEMP
289
 #define PIDTEMP
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
291
-#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
291
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active; 255=full current
292
 #if ENABLED(PIDTEMP)
292
 #if ENABLED(PIDTEMP)
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
299
-  #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
300
-                                  // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
301
   #define K1 0.95 //smoothing factor within the PID
299
   #define K1 0.95 //smoothing factor within the PID
302
 
300
 
303
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
301
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it

+ 1
- 3
Marlin/example_configurations/tvrrug/Round2/Configuration.h View File

288
 // Comment the following line to disable PID and enable bang-bang.
288
 // Comment the following line to disable PID and enable bang-bang.
289
 #define PIDTEMP
289
 #define PIDTEMP
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
290
 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
291
-#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
291
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active; 255=full current
292
 #if ENABLED(PIDTEMP)
292
 #if ENABLED(PIDTEMP)
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
293
   //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
294
   //#define PID_DEBUG // Sends debug data to the serial port.
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
296
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
297
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
298
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
299
-  #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
300
-                                  // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
301
   #define K1 0.95 //smoothing factor within the PID
299
   #define K1 0.95 //smoothing factor within the PID
302
 
300
 
303
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
301
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it

+ 18
- 29
Marlin/temperature.cpp View File

137
   #endif
137
   #endif
138
 
138
 
139
   float Temperature::pid_error[HOTENDS];
139
   float Temperature::pid_error[HOTENDS];
140
-  bool Temperature::pid_reset[HOTENDS];
141
 #endif
140
 #endif
142
 
141
 
143
 #if ENABLED(PIDTEMPBED)
142
 #if ENABLED(PIDTEMPBED)
195
 #endif
194
 #endif
196
 
195
 
197
 #if HAS_PID_HEATING
196
 #if HAS_PID_HEATING
198
-
199
   void Temperature::PID_autotune(float temp, int hotend, int ncycles, bool set_result/*=false*/) {
197
   void Temperature::PID_autotune(float temp, int hotend, int ncycles, bool set_result/*=false*/) {
200
     float input = 0.0;
198
     float input = 0.0;
201
     int cycles = 0;
199
     int cycles = 0;
236
 
234
 
237
     #if HAS_PID_FOR_BOTH
235
     #if HAS_PID_FOR_BOTH
238
       if (hotend < 0)
236
       if (hotend < 0)
239
-        soft_pwm_bed = bias = d = (MAX_BED_POWER) / 2;
237
+        soft_pwm_bed = bias = d = (MAX_BED_POWER) >> 1;
240
       else
238
       else
241
-        soft_pwm[hotend] = bias = d = (PID_MAX) / 2;
239
+        soft_pwm[hotend] = bias = d = (PID_MAX) >> 1;
242
     #elif ENABLED(PIDTEMP)
240
     #elif ENABLED(PIDTEMP)
243
-      soft_pwm[hotend] = bias = d = (PID_MAX) / 2;
241
+      soft_pwm[hotend] = bias = d = (PID_MAX) >> 1;
244
     #else
242
     #else
245
-      soft_pwm_bed = bias = d = (MAX_BED_POWER) / 2;
243
+      soft_pwm_bed = bias = d = (MAX_BED_POWER) >> 1;
246
     #endif
244
     #endif
247
 
245
 
248
     wait_for_heatup = true;
246
     wait_for_heatup = true;
452
 }
450
 }
453
 
451
 
454
 #if HAS_AUTO_FAN
452
 #if HAS_AUTO_FAN
455
-
456
   void Temperature::checkExtruderAutoFans() {
453
   void Temperature::checkExtruderAutoFans() {
457
     const int8_t fanPin[] = { EXTRUDER_0_AUTO_FAN_PIN, EXTRUDER_1_AUTO_FAN_PIN, EXTRUDER_2_AUTO_FAN_PIN, EXTRUDER_3_AUTO_FAN_PIN };
454
     const int8_t fanPin[] = { EXTRUDER_0_AUTO_FAN_PIN, EXTRUDER_1_AUTO_FAN_PIN, EXTRUDER_2_AUTO_FAN_PIN, EXTRUDER_3_AUTO_FAN_PIN };
458
     const int fanBit[] = {
455
     const int fanBit[] = {
535
   #endif
532
   #endif
536
   float pid_output;
533
   float pid_output;
537
   #if ENABLED(PIDTEMP)
534
   #if ENABLED(PIDTEMP)
538
-    #if DISABLED(PID_OPENLOOP)
535
+    #if ENABLED(PID_OPENLOOP)
536
+      pid_output = constrain(target_temperature[HOTEND_INDEX], 0, PID_MAX);
537
+    #else
539
       pid_error[HOTEND_INDEX] = target_temperature[HOTEND_INDEX] - current_temperature[HOTEND_INDEX];
538
       pid_error[HOTEND_INDEX] = target_temperature[HOTEND_INDEX] - current_temperature[HOTEND_INDEX];
540
       dTerm[HOTEND_INDEX] = K2 * PID_PARAM(Kd, HOTEND_INDEX) * (current_temperature[HOTEND_INDEX] - temp_dState[HOTEND_INDEX]) + K1 * dTerm[HOTEND_INDEX];
539
       dTerm[HOTEND_INDEX] = K2 * PID_PARAM(Kd, HOTEND_INDEX) * (current_temperature[HOTEND_INDEX] - temp_dState[HOTEND_INDEX]) + K1 * dTerm[HOTEND_INDEX];
541
       temp_dState[HOTEND_INDEX] = current_temperature[HOTEND_INDEX];
540
       temp_dState[HOTEND_INDEX] = current_temperature[HOTEND_INDEX];
542
-      if (pid_error[HOTEND_INDEX] > PID_FUNCTIONAL_RANGE) {
543
-        pid_output = BANG_MAX;
544
-        pid_reset[HOTEND_INDEX] = true;
545
-      }
546
-      else if (pid_error[HOTEND_INDEX] < -(PID_FUNCTIONAL_RANGE) || target_temperature[HOTEND_INDEX] == 0) {
541
+      if (target_temperature[HOTEND_INDEX] == 0) {
547
         pid_output = 0;
542
         pid_output = 0;
548
-        pid_reset[HOTEND_INDEX] = true;
543
+        temp_iState[HOTEND_INDEX] = 0.0;
549
       }
544
       }
550
       else {
545
       else {
551
-        if (pid_reset[HOTEND_INDEX]) {
552
-          temp_iState[HOTEND_INDEX] = 0.0;
553
-          pid_reset[HOTEND_INDEX] = false;
554
-        }
555
         pTerm[HOTEND_INDEX] = PID_PARAM(Kp, HOTEND_INDEX) * pid_error[HOTEND_INDEX];
546
         pTerm[HOTEND_INDEX] = PID_PARAM(Kp, HOTEND_INDEX) * pid_error[HOTEND_INDEX];
556
         temp_iState[HOTEND_INDEX] += pid_error[HOTEND_INDEX];
547
         temp_iState[HOTEND_INDEX] += pid_error[HOTEND_INDEX];
557
         iTerm[HOTEND_INDEX] = PID_PARAM(Ki, HOTEND_INDEX) * temp_iState[HOTEND_INDEX];
548
         iTerm[HOTEND_INDEX] = PID_PARAM(Ki, HOTEND_INDEX) * temp_iState[HOTEND_INDEX];
584
           pid_output = 0;
575
           pid_output = 0;
585
         }
576
         }
586
       }
577
       }
587
-    #else
588
-      pid_output = constrain(target_temperature[HOTEND_INDEX], 0, PID_MAX);
589
     #endif //PID_OPENLOOP
578
     #endif //PID_OPENLOOP
590
 
579
 
591
     #if ENABLED(PID_DEBUG)
580
     #if ENABLED(PID_DEBUG)
975
       setPwmFrequency(FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
964
       setPwmFrequency(FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
976
     #endif
965
     #endif
977
     #if ENABLED(FAN_SOFT_PWM)
966
     #if ENABLED(FAN_SOFT_PWM)
978
-      soft_pwm_fan[0] = fanSpeedSoftPwm[0] / 2;
967
+      soft_pwm_fan[0] = fanSpeedSoftPwm[0] >> 1;
979
     #endif
968
     #endif
980
   #endif
969
   #endif
981
 
970
 
985
       setPwmFrequency(FAN1_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
974
       setPwmFrequency(FAN1_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
986
     #endif
975
     #endif
987
     #if ENABLED(FAN_SOFT_PWM)
976
     #if ENABLED(FAN_SOFT_PWM)
988
-      soft_pwm_fan[1] = fanSpeedSoftPwm[1] / 2;
977
+      soft_pwm_fan[1] = fanSpeedSoftPwm[1] >> 1;
989
     #endif
978
     #endif
990
   #endif
979
   #endif
991
 
980
 
995
       setPwmFrequency(FAN2_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
984
       setPwmFrequency(FAN2_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
996
     #endif
985
     #endif
997
     #if ENABLED(FAN_SOFT_PWM)
986
     #if ENABLED(FAN_SOFT_PWM)
998
-      soft_pwm_fan[2] = fanSpeedSoftPwm[2] / 2;
987
+      soft_pwm_fan[2] = fanSpeedSoftPwm[2] >> 1;
999
     #endif
988
     #endif
1000
   #endif
989
   #endif
1001
 
990
 
1455
 
1444
 
1456
       #if ENABLED(FAN_SOFT_PWM)
1445
       #if ENABLED(FAN_SOFT_PWM)
1457
         #if HAS_FAN0
1446
         #if HAS_FAN0
1458
-          soft_pwm_fan[0] = fanSpeedSoftPwm[0] / 2;
1447
+          soft_pwm_fan[0] = fanSpeedSoftPwm[0] >> 1;
1459
           WRITE_FAN(soft_pwm_fan[0] > 0 ? 1 : 0);
1448
           WRITE_FAN(soft_pwm_fan[0] > 0 ? 1 : 0);
1460
         #endif
1449
         #endif
1461
         #if HAS_FAN1
1450
         #if HAS_FAN1
1462
-          soft_pwm_fan[1] = fanSpeedSoftPwm[1] / 2;
1451
+          soft_pwm_fan[1] = fanSpeedSoftPwm[1] >> 1;
1463
           WRITE_FAN1(soft_pwm_fan[1] > 0 ? 1 : 0);
1452
           WRITE_FAN1(soft_pwm_fan[1] > 0 ? 1 : 0);
1464
         #endif
1453
         #endif
1465
         #if HAS_FAN2
1454
         #if HAS_FAN2
1466
-          soft_pwm_fan[2] = fanSpeedSoftPwm[2] / 2;
1455
+          soft_pwm_fan[2] = fanSpeedSoftPwm[2] >> 1;
1467
           WRITE_FAN2(soft_pwm_fan[2] > 0 ? 1 : 0);
1456
           WRITE_FAN2(soft_pwm_fan[2] > 0 ? 1 : 0);
1468
         #endif
1457
         #endif
1469
       #endif
1458
       #endif
1574
     #if ENABLED(FAN_SOFT_PWM)
1563
     #if ENABLED(FAN_SOFT_PWM)
1575
       if (pwm_count == 0) {
1564
       if (pwm_count == 0) {
1576
         #if HAS_FAN0
1565
         #if HAS_FAN0
1577
-          soft_pwm_fan[0] = fanSpeedSoftPwm[0] / 2;
1566
+          soft_pwm_fan[0] = fanSpeedSoftPwm[0] >> 1;
1578
           WRITE_FAN(soft_pwm_fan[0] > 0 ? 1 : 0);
1567
           WRITE_FAN(soft_pwm_fan[0] > 0 ? 1 : 0);
1579
         #endif
1568
         #endif
1580
         #if HAS_FAN1
1569
         #if HAS_FAN1
1581
-          soft_pwm_fan[1] = fanSpeedSoftPwm[1] / 2;
1570
+          soft_pwm_fan[1] = fanSpeedSoftPwm[1] >> 1;
1582
           WRITE_FAN1(soft_pwm_fan[1] > 0 ? 1 : 0);
1571
           WRITE_FAN1(soft_pwm_fan[1] > 0 ? 1 : 0);
1583
         #endif
1572
         #endif
1584
         #if HAS_FAN2
1573
         #if HAS_FAN2
1585
-          soft_pwm_fan[2] = fanSpeedSoftPwm[2] / 2;
1574
+          soft_pwm_fan[2] = fanSpeedSoftPwm[2] >> 1;
1586
           WRITE_FAN2(soft_pwm_fan[2] > 0 ? 1 : 0);
1575
           WRITE_FAN2(soft_pwm_fan[2] > 0 ? 1 : 0);
1587
         #endif
1576
         #endif
1588
       }
1577
       }

+ 0
- 1
Marlin/temperature.h View File

158
       #endif
158
       #endif
159
 
159
 
160
       static float pid_error[HOTENDS];
160
       static float pid_error[HOTENDS];
161
-      static bool pid_reset[HOTENDS];
162
     #endif
161
     #endif
163
 
162
 
164
     #if ENABLED(PIDTEMPBED)
163
     #if ENABLED(PIDTEMPBED)

Loading…
Cancel
Save