From 5693a6e3c9a3350da9d73288605f9457dd9a27cf Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 12 May 2015 18:17:13 -0700 Subject: [PATCH 1/4] Fix heating error message --- Marlin/temperature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 5ca03a757..a5ee27313 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -626,7 +626,7 @@ void manage_heater() { if (degHotend(e) < watch_target_temp[e]) { // Stop! disable_all_heaters(); - _temp_error(e, MSG_HEATING_FAILED, MSG_HEATING_FAILED_LCD); + _temp_error(e, PSTR(MSG_HEATING_FAILED), PSTR(MSG_HEATING_FAILED_LCD)); } else { // Only check once per M104/M109 From 6697a8f3752a32290f876a214a9e46fcaf2a9c53 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 12 May 2015 18:22:47 -0700 Subject: [PATCH 2/4] Watch the heater a little longer --- Marlin/temperature.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index a5ee27313..7043eeda0 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -620,6 +620,7 @@ void manage_heater() { // Check if the temperature is failing to increase #ifdef THERMAL_PROTECTION_HOTENDS + // Is it time to check this extruder's heater? if (watch_heater_next_ms[e] && ms > watch_heater_next_ms[e]) { // Has it failed to increase enough? @@ -629,10 +630,11 @@ void manage_heater() { _temp_error(e, PSTR(MSG_HEATING_FAILED), PSTR(MSG_HEATING_FAILED_LCD)); } else { - // Only check once per M104/M109 - watch_heater_next_ms[e] = 0; + // Start again if the target is still far off + start_watching_heater(e); } } + #endif // THERMAL_PROTECTION_HOTENDS #ifdef TEMP_SENSOR_1_AS_REDUNDANT From d693e0f3784d72f9acdc610cd3dcf242b993f356 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 12 May 2015 18:30:38 -0700 Subject: [PATCH 3/4] Use WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1 as difference limit --- Marlin/Configuration_adv.h | 2 +- Marlin/configurator/config/Configuration_adv.h | 2 +- Marlin/example_configurations/Felix/Configuration_adv.h | 2 +- Marlin/example_configurations/Hephestos/Configuration_adv.h | 2 +- Marlin/example_configurations/K8200/Configuration_adv.h | 2 +- Marlin/example_configurations/SCARA/Configuration_adv.h | 2 +- Marlin/example_configurations/WITBOX/Configuration_adv.h | 2 +- Marlin/example_configurations/delta/biv2.5/Configuration_adv.h | 2 +- Marlin/example_configurations/delta/generic/Configuration_adv.h | 2 +- .../delta/kossel_mini/Configuration_adv.h | 2 +- Marlin/example_configurations/makibox/Configuration_adv.h | 2 +- Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h | 2 +- Marlin/temperature.cpp | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 1d94ede57..44f2f96dd 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -25,7 +25,7 @@ * Whenever an M104 or M109 increases the target temperature the firmware will wait for the * WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109, - * but only if the current temperature is below the target by at least 2 * WATCH_TEMP_INCREASE degrees. + * but only if the current temperature is far enough below the target for a reliable test. */ #define WATCH_TEMP_PERIOD 16 // Seconds #define WATCH_TEMP_INCREASE 4 // Degrees Celsius diff --git a/Marlin/configurator/config/Configuration_adv.h b/Marlin/configurator/config/Configuration_adv.h index e816e9eb5..b03d42a61 100644 --- a/Marlin/configurator/config/Configuration_adv.h +++ b/Marlin/configurator/config/Configuration_adv.h @@ -25,7 +25,7 @@ * Whenever an M104 or M109 increases the target temperature the firmware will wait for the * WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109, - * but only if the current temperature is below the target by at least 2 * WATCH_TEMP_INCREASE degrees. + * but only if the current temperature is far enough below the target for a reliable test. */ #define WATCH_TEMP_PERIOD 16 // Seconds #define WATCH_TEMP_INCREASE 4 // Degrees Celsius diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index 82bc7130d..244ec0652 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -25,7 +25,7 @@ * Whenever an M104 or M109 increases the target temperature the firmware will wait for the * WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109, - * but only if the current temperature is below the target by at least 2 * WATCH_TEMP_INCREASE degrees. + * but only if the current temperature is far enough below the target for a reliable test. */ #define WATCH_TEMP_PERIOD 16 // Seconds #define WATCH_TEMP_INCREASE 4 // Degrees Celsius diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index dc9139023..6d5102ca4 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -25,7 +25,7 @@ * Whenever an M104 or M109 increases the target temperature the firmware will wait for the * WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109, - * but only if the current temperature is below the target by at least 2 * WATCH_TEMP_INCREASE degrees. + * but only if the current temperature is far enough below the target for a reliable test. */ #define WATCH_TEMP_PERIOD 16 // Seconds #define WATCH_TEMP_INCREASE 4 // Degrees Celsius diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index 82bc7130d..244ec0652 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -25,7 +25,7 @@ * Whenever an M104 or M109 increases the target temperature the firmware will wait for the * WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109, - * but only if the current temperature is below the target by at least 2 * WATCH_TEMP_INCREASE degrees. + * but only if the current temperature is far enough below the target for a reliable test. */ #define WATCH_TEMP_PERIOD 16 // Seconds #define WATCH_TEMP_INCREASE 4 // Degrees Celsius diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index 8d0f89f92..60a58797c 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -25,7 +25,7 @@ * Whenever an M104 or M109 increases the target temperature the firmware will wait for the * WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109, - * but only if the current temperature is below the target by at least 2 * WATCH_TEMP_INCREASE degrees. + * but only if the current temperature is far enough below the target for a reliable test. */ #define WATCH_TEMP_PERIOD 16 // Seconds #define WATCH_TEMP_INCREASE 4 // Degrees Celsius diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 0323efc7e..6382b6c1e 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -25,7 +25,7 @@ * Whenever an M104 or M109 increases the target temperature the firmware will wait for the * WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109, - * but only if the current temperature is below the target by at least 2 * WATCH_TEMP_INCREASE degrees. + * but only if the current temperature is far enough below the target for a reliable test. */ #define WATCH_TEMP_PERIOD 16 // Seconds #define WATCH_TEMP_INCREASE 4 // Degrees Celsius diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h index 52d91378f..e5e3a11fd 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h @@ -25,7 +25,7 @@ * Whenever an M104 or M109 increases the target temperature the firmware will wait for the * WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109, - * but only if the current temperature is below the target by at least 2 * WATCH_TEMP_INCREASE degrees. + * but only if the current temperature is far enough below the target for a reliable test. */ #define WATCH_TEMP_PERIOD 16 // Seconds #define WATCH_TEMP_INCREASE 4 // Degrees Celsius diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index 40e7458a7..4f2b11454 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -25,7 +25,7 @@ * Whenever an M104 or M109 increases the target temperature the firmware will wait for the * WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109, - * but only if the current temperature is below the target by at least 2 * WATCH_TEMP_INCREASE degrees. + * but only if the current temperature is far enough below the target for a reliable test. */ #define WATCH_TEMP_PERIOD 16 // Seconds #define WATCH_TEMP_INCREASE 4 // Degrees Celsius diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index 5df4e54e5..f4cb49222 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -25,7 +25,7 @@ * Whenever an M104 or M109 increases the target temperature the firmware will wait for the * WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109, - * but only if the current temperature is below the target by at least 2 * WATCH_TEMP_INCREASE degrees. + * but only if the current temperature is far enough below the target for a reliable test. */ #define WATCH_TEMP_PERIOD 16 // Seconds #define WATCH_TEMP_INCREASE 4 // Degrees Celsius diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 2c05afdda..7d33bd9ee 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -25,7 +25,7 @@ * Whenever an M104 or M109 increases the target temperature the firmware will wait for the * WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109, - * but only if the current temperature is below the target by at least 2 * WATCH_TEMP_INCREASE degrees. + * but only if the current temperature is far enough below the target for a reliable test. */ #define WATCH_TEMP_PERIOD 16 // Seconds #define WATCH_TEMP_INCREASE 4 // Degrees Celsius diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index a320f3228..2747e0098 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -25,7 +25,7 @@ * Whenever an M104 or M109 increases the target temperature the firmware will wait for the * WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109, - * but only if the current temperature is below the target by at least 2 * WATCH_TEMP_INCREASE degrees. + * but only if the current temperature is far enough below the target for a reliable test. */ #define WATCH_TEMP_PERIOD 16 // Seconds #define WATCH_TEMP_INCREASE 4 // Degrees Celsius diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 7043eeda0..ff730507a 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -1007,7 +1007,7 @@ void tp_init() { */ void start_watching_heater(int e) { millis_t ms = millis() + WATCH_TEMP_PERIOD * 1000; - if (degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE * 2)) { + if (degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1)) { watch_target_temp[e] = degHotend(e) + WATCH_TEMP_INCREASE; watch_heater_next_ms[e] = ms; } From fcfd99c1aecaef1be898ca72282b118ca65ba26e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 12 May 2015 18:46:16 -0700 Subject: [PATCH 4/4] Add comments to lcd_control_temperature_menu --- Marlin/ultralcd.cpp | 47 ++++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index a1a24dbcd..1bcd3dbaa 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -7,12 +7,11 @@ #include "stepper.h" #include "configuration_store.h" -int8_t encoderDiff; /* encoderDiff is updated from interrupt context and added to encoderPosition every LCD update */ +int8_t encoderDiff; // updated from interrupt context and added to encoderPosition every LCD update bool encoderRateMultiplierEnabled; int32_t lastEncoderMovementMillis; -/* Configuration settings */ int plaPreheatHotendTemp; int plaPreheatHPBTemp; int plaPreheatFanSpeed; @@ -25,9 +24,7 @@ int absPreheatFanSpeed; millis_t previous_lcd_status_ms = 0; #endif -/* !Configuration settings */ - -//Function pointer to menu functions. +// Function pointer to menu functions. typedef void (*menuFunc_t)(); uint8_t lcd_status_message_level; @@ -875,10 +872,17 @@ static void lcd_control_menu() { * "Control" > "Temperature" submenu * */ - static void lcd_control_temperature_menu() { START_MENU(); + + // + // ^ Control + // MENU_ITEM(back, MSG_CONTROL, lcd_control_menu); + + // + // Nozzle, Nozzle 2, Nozzle 3, Nozzle 4 + // #if TEMP_SENSOR_0 != 0 MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15); #endif @@ -897,16 +901,32 @@ static void lcd_control_temperature_menu() { #endif // EXTRUDERS > 3 #endif // EXTRUDERS > 2 #endif // EXTRUDERS > 1 + + // + // Bed + // #if TEMP_SENSOR_BED != 0 MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15); #endif + + // + // Fan Speed + // MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255); + + // + // Autotemp, Min, Max, Fact + // #if defined(AUTOTEMP) && (TEMP_SENSOR_0 != 0) MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &autotemp_enabled); MENU_ITEM_EDIT(float3, MSG_MIN, &autotemp_min, 0, HEATER_0_MAXTEMP - 15); MENU_ITEM_EDIT(float3, MSG_MAX, &autotemp_max, 0, HEATER_0_MAXTEMP - 15); MENU_ITEM_EDIT(float32, MSG_FACTOR, &autotemp_factor, 0.0, 1.0); #endif + + // + // PID-P, PID-I, PID-D, PID-C + // #ifdef PIDTEMP // set up temp variables - undo the default scaling raw_Ki = unscalePID_i(PID_PARAM(Ki,0)); @@ -959,7 +979,15 @@ static void lcd_control_temperature_menu() { #endif//EXTRUDERS > 1 #endif //PID_PARAMS_PER_EXTRUDER #endif//PIDTEMP + + // + // Preheat PLA conf + // MENU_ITEM(submenu, MSG_PREHEAT_PLA_SETTINGS, lcd_control_temperature_preheat_pla_settings_menu); + + // + // Preheat ABS conf + // MENU_ITEM(submenu, MSG_PREHEAT_ABS_SETTINGS, lcd_control_temperature_preheat_abs_settings_menu); END_MENU(); } @@ -969,7 +997,6 @@ static void lcd_control_temperature_menu() { * "Temperature" > "Preheat PLA conf" submenu * */ - static void lcd_control_temperature_preheat_pla_settings_menu() { START_MENU(); MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_menu); @@ -991,7 +1018,6 @@ static void lcd_control_temperature_preheat_pla_settings_menu() { * "Temperature" > "Preheat ABS conf" submenu * */ - static void lcd_control_temperature_preheat_abs_settings_menu() { START_MENU(); MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_menu); @@ -1013,7 +1039,6 @@ static void lcd_control_temperature_preheat_abs_settings_menu() { * "Control" > "Motion" submenu * */ - static void lcd_control_motion_menu() { START_MENU(); MENU_ITEM(back, MSG_CONTROL, lcd_control_menu); @@ -1055,7 +1080,6 @@ static void lcd_control_motion_menu() { * "Control" > "Filament" submenu * */ - static void lcd_control_volumetric_menu() { START_MENU(); MENU_ITEM(back, MSG_CONTROL, lcd_control_menu); @@ -1083,7 +1107,6 @@ static void lcd_control_volumetric_menu() { * "Control" > "Contrast" submenu * */ - #ifdef HAS_LCD_CONTRAST static void lcd_set_contrast() { if (encoderPosition != 0) { @@ -1103,7 +1126,6 @@ static void lcd_control_volumetric_menu() { * "Control" > "Retract" submenu * */ - #ifdef FWRETRACT static void lcd_control_retract_menu() { START_MENU(); @@ -1141,7 +1163,6 @@ static void lcd_sd_updir() { * "Print from SD" submenu * */ - void lcd_sdcard_menu() { if (lcdDrawUpdate == 0 && LCD_CLICKED == 0) return; // nothing to do (so don't thrash the SD card) uint16_t fileCnt = card.getnrfilenames();