Browse Source

Merge pull request #4914 from Rerouter/PID-Unconstrained-Itemp

Pid unconstrained itemp
pull/1/head
Scott Lahteine 8 years ago
committed by GitHub
parent
commit
473f4a17a8
  1. 3
      Marlin/Configuration.h
  2. 3
      Marlin/example_configurations/Cartesio/Configuration.h
  3. 3
      Marlin/example_configurations/Felix/Configuration.h
  4. 1
      Marlin/example_configurations/Felix/DUAL/Configuration.h
  5. 3
      Marlin/example_configurations/Hephestos/Configuration.h
  6. 3
      Marlin/example_configurations/Hephestos_2/Configuration.h
  7. 3
      Marlin/example_configurations/K8200/Configuration.h
  8. 3
      Marlin/example_configurations/K8400/Configuration.h
  9. 3
      Marlin/example_configurations/K8400/Dual-head/Configuration.h
  10. 3
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  11. 3
      Marlin/example_configurations/RigidBot/Configuration.h
  12. 3
      Marlin/example_configurations/SCARA/Configuration.h
  13. 3
      Marlin/example_configurations/TAZ4/Configuration.h
  14. 3
      Marlin/example_configurations/WITBOX/Configuration.h
  15. 3
      Marlin/example_configurations/adafruit/ST7565/Configuration.h
  16. 3
      Marlin/example_configurations/delta/biv2.5/Configuration.h
  17. 3
      Marlin/example_configurations/delta/generic/Configuration.h
  18. 3
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  19. 3
      Marlin/example_configurations/delta/kossel_pro/Configuration.h
  20. 3
      Marlin/example_configurations/delta/kossel_xl/Configuration.h
  21. 3
      Marlin/example_configurations/makibox/Configuration.h
  22. 3
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  23. 22
      Marlin/temperature.cpp
  24. 8
      Marlin/temperature.h

3
Marlin/Configuration.h

@ -298,7 +298,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 PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
#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
@ -345,8 +344,6 @@
//#define PID_BED_DEBUG // Sends debug data to the serial port.
#define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
//120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
#define DEFAULT_bedKp 10.00

3
Marlin/example_configurations/Cartesio/Configuration.h

@ -299,7 +299,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 PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
#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
@ -347,8 +346,6 @@
//#define PID_BED_DEBUG // Sends debug data to the serial port.
#define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
//24V 500W silicone heater on to 4mm glass CartesioW
#define DEFAULT_bedKp 390
#define DEFAULT_bedKi 70

3
Marlin/example_configurations/Felix/Configuration.h

@ -298,7 +298,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 PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
#define K1 0.95 //smoothing factor within the PID
// Felix 2.0+ electronics with v4 Hotend
@ -334,8 +333,6 @@
//#define PID_BED_DEBUG // Sends debug data to the serial port.
#define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
// Felix Foil Heater
#define DEFAULT_bedKp 103.37
#define DEFAULT_bedKi 2.79

1
Marlin/example_configurations/Felix/DUAL/Configuration.h

@ -298,7 +298,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 PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
#define K1 0.95 //smoothing factor within the PID
// Felix 2.0+ electronics with v4 Hotend

3
Marlin/example_configurations/Hephestos/Configuration.h

@ -301,7 +301,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 PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
#define K1 0.95 //smoothing factor within the PID
// Hephestos i3
@ -337,8 +336,6 @@
//#define PID_BED_DEBUG // Sends debug data to the serial port.
#define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
//120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
#define DEFAULT_bedKp 10.00

3
Marlin/example_configurations/Hephestos_2/Configuration.h

@ -298,7 +298,6 @@
// Set/get with gcode: M301 E[extruder number, 0-2]
#define PID_FUNCTIONAL_RANGE 250 // 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 PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
#define K1 0.95 //smoothing factor within the PID
// Tuned PID values using M303
@ -339,8 +338,6 @@
//#define PID_BED_DEBUG // Sends debug data to the serial port.
#define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
//120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
#define DEFAULT_bedKp 10.00

3
Marlin/example_configurations/K8200/Configuration.h

@ -305,7 +305,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 PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
#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
@ -356,8 +355,6 @@
//#define PID_BED_DEBUG // Sends debug data to the serial port.
#define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
//120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
//#define DEFAULT_bedKp 10.00

3
Marlin/example_configurations/K8400/Configuration.h

@ -298,7 +298,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 PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
#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
@ -345,8 +344,6 @@
//#define PID_BED_DEBUG // Sends debug data to the serial port.
#define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
//120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
#define DEFAULT_bedKp 10.00

3
Marlin/example_configurations/K8400/Dual-head/Configuration.h

@ -298,7 +298,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 PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
#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
@ -345,8 +344,6 @@
//#define PID_BED_DEBUG // Sends debug data to the serial port.
#define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
//120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
#define DEFAULT_bedKp 10.00

3
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h

@ -298,7 +298,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 PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
#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
@ -345,8 +344,6 @@
//#define PID_BED_DEBUG // Sends debug data to the serial port.
#define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
//120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
#define DEFAULT_bedKp 10.00

3
Marlin/example_configurations/RigidBot/Configuration.h

@ -301,7 +301,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 PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
#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
@ -349,8 +348,6 @@
//#define PID_BED_DEBUG // Sends debug data to the serial port.
#define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
//RigidBot, from pid autotune
#define DEFAULT_bedKp 355
#define DEFAULT_bedKi 66.5

3
Marlin/example_configurations/SCARA/Configuration.h

@ -330,7 +330,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 PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
#define K1 0.95 //smoothing factor within the PID
// Merlin Hotend: From Autotune
@ -366,8 +365,6 @@
//#define PID_BED_DEBUG // Sends debug data to the serial port.
#define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
//12v Heatbed Mk3 12V in parallel
//from pidautotune
#define DEFAULT_bedKp 630.14

3
Marlin/example_configurations/TAZ4/Configuration.h

@ -298,7 +298,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 PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
#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
@ -355,8 +354,6 @@
//#define PID_BED_DEBUG // Sends debug data to the serial port.
#define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
//24V 360W silicone heater from NPH on 3mm borosilicate (TAZ 2.2+)
#define DEFAULT_bedKp 20
#define DEFAULT_bedKi 5

3
Marlin/example_configurations/WITBOX/Configuration.h

@ -301,7 +301,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 PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
#define K1 0.95 //smoothing factor within the PID
// Witbox
@ -337,8 +336,6 @@
//#define PID_BED_DEBUG // Sends debug data to the serial port.
#define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
//120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
#define DEFAULT_bedKp 10.00

3
Marlin/example_configurations/adafruit/ST7565/Configuration.h

@ -298,7 +298,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 PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
#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
@ -345,8 +344,6 @@
//#define PID_BED_DEBUG // Sends debug data to the serial port.
#define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
//120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
#define DEFAULT_bedKp 10.00

3
Marlin/example_configurations/delta/biv2.5/Configuration.h

@ -298,7 +298,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 PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
#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
@ -345,8 +344,6 @@
//#define PID_BED_DEBUG // Sends debug data to the serial port.
#define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
//120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
#define DEFAULT_bedKp 10.00

3
Marlin/example_configurations/delta/generic/Configuration.h

@ -298,7 +298,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 PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
#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
@ -345,8 +344,6 @@
//#define PID_BED_DEBUG // Sends debug data to the serial port.
#define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
//120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
#define DEFAULT_bedKp 10.00

3
Marlin/example_configurations/delta/kossel_mini/Configuration.h

@ -298,7 +298,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 PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
#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
@ -345,8 +344,6 @@
//#define PID_BED_DEBUG // Sends debug data to the serial port.
#define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
//120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
#define DEFAULT_bedKp 10.00

3
Marlin/example_configurations/delta/kossel_pro/Configuration.h

@ -304,7 +304,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 PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
#define K1 0.95 //smoothing factor within the PID
// Kossel Pro
@ -340,8 +339,6 @@
//#define PID_BED_DEBUG // Sends debug data to the serial port.
#define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
//Kossel Pro heated bed plate with borosilicate glass
//from pidautotune (M303 E-1 S60 C8)
#define DEFAULT_bedKp 370.25

3
Marlin/example_configurations/delta/kossel_xl/Configuration.h

@ -291,7 +291,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 PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
#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
@ -343,8 +342,6 @@
//#define PID_BED_DEBUG // Sends debug data to the serial port.
#define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
//120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
#define DEFAULT_bedKp 15.00

3
Marlin/example_configurations/makibox/Configuration.h

@ -298,7 +298,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 PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
#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
@ -348,8 +347,6 @@
//#define PID_BED_DEBUG // Sends debug data to the serial port.
#define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
//120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
#define DEFAULT_bedKp 10.00

3
Marlin/example_configurations/tvrrug/Round2/Configuration.h

@ -298,7 +298,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 PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
#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
@ -335,8 +334,6 @@
//#define PID_BED_DEBUG // Sends debug data to the serial port.
#define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
//120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
#define DEFAULT_bedKp 10.00

22
Marlin/temperature.cpp

@ -136,9 +136,7 @@ volatile bool Temperature::temp_meas_ready = false;
int Temperature::lpq_ptr = 0;
#endif
float Temperature::pid_error[HOTENDS],
Temperature::temp_iState_min[HOTENDS],
Temperature::temp_iState_max[HOTENDS];
float Temperature::pid_error[HOTENDS];
bool Temperature::pid_reset[HOTENDS];
#endif
@ -148,9 +146,7 @@ volatile bool Temperature::temp_meas_ready = false;
Temperature::pTerm_bed,
Temperature::iTerm_bed,
Temperature::dTerm_bed,
Temperature::pid_error_bed,
Temperature::temp_iState_min_bed,
Temperature::temp_iState_max_bed;
Temperature::pid_error_bed;
#else
millis_t Temperature::next_bed_check_ms;
#endif
@ -448,12 +444,6 @@ void Temperature::updatePID() {
#if ENABLED(PID_EXTRUSION_SCALING)
last_e_position = 0;
#endif
HOTEND_LOOP() {
temp_iState_max[e] = (PID_INTEGRAL_DRIVE_MAX) / PID_PARAM(Ki, e);
}
#endif
#if ENABLED(PIDTEMPBED)
temp_iState_max_bed = (PID_BED_INTEGRAL_DRIVE_MAX) / bedKi;
#endif
}
@ -564,7 +554,6 @@ float Temperature::get_pid_output(int e) {
}
pTerm[HOTEND_INDEX] = PID_PARAM(Kp, HOTEND_INDEX) * pid_error[HOTEND_INDEX];
temp_iState[HOTEND_INDEX] += pid_error[HOTEND_INDEX];
temp_iState[HOTEND_INDEX] = constrain(temp_iState[HOTEND_INDEX], temp_iState_min[HOTEND_INDEX], temp_iState_max[HOTEND_INDEX]);
iTerm[HOTEND_INDEX] = PID_PARAM(Ki, HOTEND_INDEX) * temp_iState[HOTEND_INDEX];
pid_output = pTerm[HOTEND_INDEX] + iTerm[HOTEND_INDEX] - dTerm[HOTEND_INDEX];
@ -627,7 +616,6 @@ float Temperature::get_pid_output(int e) {
pid_error_bed = target_temperature_bed - current_temperature_bed;
pTerm_bed = bedKp * pid_error_bed;
temp_iState_bed += pid_error_bed;
temp_iState_bed = constrain(temp_iState_bed, temp_iState_min_bed, temp_iState_max_bed);
iTerm_bed = bedKi * temp_iState_bed;
dTerm_bed = K2 * bedKd * (current_temperature_bed - temp_dState_bed) + K1 * dTerm_bed;
@ -955,16 +943,10 @@ void Temperature::init() {
// populate with the first value
maxttemp[e] = maxttemp[0];
#if ENABLED(PIDTEMP)
temp_iState_min[e] = 0.0;
temp_iState_max[e] = (PID_INTEGRAL_DRIVE_MAX) / PID_PARAM(Ki, e);
#if ENABLED(PID_EXTRUSION_SCALING)
last_e_position = 0;
#endif
#endif //PIDTEMP
#if ENABLED(PIDTEMPBED)
temp_iState_min_bed = 0.0;
temp_iState_max_bed = (PID_BED_INTEGRAL_DRIVE_MAX) / bedKi;
#endif //PIDTEMPBED
}
#if ENABLED(PIDTEMP) && ENABLED(PID_EXTRUSION_SCALING)

8
Marlin/temperature.h

@ -157,9 +157,7 @@ class Temperature {
static int lpq_ptr;
#endif
static float pid_error[HOTENDS],
temp_iState_min[HOTENDS],
temp_iState_max[HOTENDS];
static float pid_error[HOTENDS];
static bool pid_reset[HOTENDS];
#endif
@ -169,9 +167,7 @@ class Temperature {
pTerm_bed,
iTerm_bed,
dTerm_bed,
pid_error_bed,
temp_iState_min_bed,
temp_iState_max_bed;
pid_error_bed;
#else
static millis_t next_bed_check_ms;
#endif

Loading…
Cancel
Save