|
|
|
|
104
|
// M240 - Trigger a camera to take a photograph
|
104
|
// M240 - Trigger a camera to take a photograph
|
105
|
// M301 - Set PID parameters P I and D
|
105
|
// M301 - Set PID parameters P I and D
|
106
|
// M302 - Allow cold extrudes
|
106
|
// M302 - Allow cold extrudes
|
|
|
107
|
+// M303 - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
|
107
|
// M400 - Finish all moves
|
108
|
// M400 - Finish all moves
|
108
|
// M500 - stores paramters in EEPROM
|
109
|
// M500 - stores paramters in EEPROM
|
109
|
// M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
|
110
|
// M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
|
110
|
// M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to.
|
111
|
// M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to.
|
111
|
// M503 - print the current settings (from memory not from eeprom)
|
112
|
// M503 - print the current settings (from memory not from eeprom)
|
112
|
-// M303 - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
|
|
|
113
|
// M999 - Restart after being stopped by error
|
113
|
// M999 - Restart after being stopped by error
|
114
|
|
114
|
|
115
|
//Stepper Movement Variables
|
115
|
//Stepper Movement Variables
|
|
|
|
|
940
|
#ifdef TEMP_RESIDENCY_TIME
|
940
|
#ifdef TEMP_RESIDENCY_TIME
|
941
|
/* start/restart the TEMP_RESIDENCY_TIME timer whenever we reach target temp for the first time
|
941
|
/* start/restart the TEMP_RESIDENCY_TIME timer whenever we reach target temp for the first time
|
942
|
or when current temp falls outside the hysteresis after target temp was reached */
|
942
|
or when current temp falls outside the hysteresis after target temp was reached */
|
943
|
- if ((residencyStart == -1 && target_direction && !isHeatingHotend(tmp_extruder)) ||
|
|
|
944
|
- (residencyStart == -1 && !target_direction && !isCoolingHotend(tmp_extruder)) ||
|
|
|
|
|
943
|
+ if ((residencyStart == -1 && target_direction && (degHotend(tmp_extruder) >= (degTargetHotend(tmp_extruder)-TEMP_WINDOW))) ||
|
|
|
944
|
+ (residencyStart == -1 && !target_direction && (degHotend(tmp_extruder) <= (degTargetHotend(tmp_extruder)+TEMP_WINDOW))) ||
|
945
|
(residencyStart > -1 && labs(degHotend(tmp_extruder) - degTargetHotend(tmp_extruder)) > TEMP_HYSTERESIS) )
|
945
|
(residencyStart > -1 && labs(degHotend(tmp_extruder) - degTargetHotend(tmp_extruder)) > TEMP_HYSTERESIS) )
|
946
|
{
|
946
|
{
|
947
|
residencyStart = millis();
|
947
|
residencyStart = millis();
|