Merge pull request #2067 from thinkyhead/thermal_unified

Fix heating error message
2.0.x
Scott Lahteine 10 years ago
commit 56090fc374

@ -25,7 +25,7 @@
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the * 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 * 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, * 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_PERIOD 16 // Seconds
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius #define WATCH_TEMP_INCREASE 4 // Degrees Celsius

@ -25,7 +25,7 @@
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the * 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 * 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, * 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_PERIOD 16 // Seconds
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius #define WATCH_TEMP_INCREASE 4 // Degrees Celsius

@ -25,7 +25,7 @@
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the * 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 * 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, * 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_PERIOD 16 // Seconds
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius #define WATCH_TEMP_INCREASE 4 // Degrees Celsius

@ -25,7 +25,7 @@
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the * 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 * 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, * 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_PERIOD 16 // Seconds
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius #define WATCH_TEMP_INCREASE 4 // Degrees Celsius

@ -25,7 +25,7 @@
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the * 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 * 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, * 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_PERIOD 16 // Seconds
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius #define WATCH_TEMP_INCREASE 4 // Degrees Celsius

@ -25,7 +25,7 @@
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the * 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 * 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, * 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_PERIOD 16 // Seconds
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius #define WATCH_TEMP_INCREASE 4 // Degrees Celsius

@ -25,7 +25,7 @@
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the * 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 * 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, * 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_PERIOD 16 // Seconds
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius #define WATCH_TEMP_INCREASE 4 // Degrees Celsius

@ -25,7 +25,7 @@
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the * 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 * 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, * 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_PERIOD 16 // Seconds
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius #define WATCH_TEMP_INCREASE 4 // Degrees Celsius

@ -25,7 +25,7 @@
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the * 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 * 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, * 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_PERIOD 16 // Seconds
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius #define WATCH_TEMP_INCREASE 4 // Degrees Celsius

@ -25,7 +25,7 @@
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the * 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 * 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, * 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_PERIOD 16 // Seconds
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius #define WATCH_TEMP_INCREASE 4 // Degrees Celsius

@ -25,7 +25,7 @@
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the * 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 * 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, * 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_PERIOD 16 // Seconds
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius #define WATCH_TEMP_INCREASE 4 // Degrees Celsius

@ -25,7 +25,7 @@
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the * 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 * 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, * 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_PERIOD 16 // Seconds
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius #define WATCH_TEMP_INCREASE 4 // Degrees Celsius

@ -620,19 +620,21 @@ void manage_heater() {
// Check if the temperature is failing to increase // Check if the temperature is failing to increase
#ifdef THERMAL_PROTECTION_HOTENDS #ifdef THERMAL_PROTECTION_HOTENDS
// Is it time to check this extruder's heater? // Is it time to check this extruder's heater?
if (watch_heater_next_ms[e] && ms > watch_heater_next_ms[e]) { if (watch_heater_next_ms[e] && ms > watch_heater_next_ms[e]) {
// Has it failed to increase enough? // Has it failed to increase enough?
if (degHotend(e) < watch_target_temp[e]) { if (degHotend(e) < watch_target_temp[e]) {
// Stop! // Stop!
disable_all_heaters(); 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 { else {
// Only check once per M104/M109 // Start again if the target is still far off
watch_heater_next_ms[e] = 0; start_watching_heater(e);
} }
} }
#endif // THERMAL_PROTECTION_HOTENDS #endif // THERMAL_PROTECTION_HOTENDS
#ifdef TEMP_SENSOR_1_AS_REDUNDANT #ifdef TEMP_SENSOR_1_AS_REDUNDANT
@ -1005,7 +1007,7 @@ void tp_init() {
*/ */
void start_watching_heater(int e) { void start_watching_heater(int e) {
millis_t ms = millis() + WATCH_TEMP_PERIOD * 1000; 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_target_temp[e] = degHotend(e) + WATCH_TEMP_INCREASE;
watch_heater_next_ms[e] = ms; watch_heater_next_ms[e] = ms;
} }

@ -7,12 +7,11 @@
#include "stepper.h" #include "stepper.h"
#include "configuration_store.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; bool encoderRateMultiplierEnabled;
int32_t lastEncoderMovementMillis; int32_t lastEncoderMovementMillis;
/* Configuration settings */
int plaPreheatHotendTemp; int plaPreheatHotendTemp;
int plaPreheatHPBTemp; int plaPreheatHPBTemp;
int plaPreheatFanSpeed; int plaPreheatFanSpeed;
@ -25,9 +24,7 @@ int absPreheatFanSpeed;
millis_t previous_lcd_status_ms = 0; millis_t previous_lcd_status_ms = 0;
#endif #endif
/* !Configuration settings */ // Function pointer to menu functions.
//Function pointer to menu functions.
typedef void (*menuFunc_t)(); typedef void (*menuFunc_t)();
uint8_t lcd_status_message_level; uint8_t lcd_status_message_level;
@ -875,10 +872,17 @@ static void lcd_control_menu() {
* "Control" > "Temperature" submenu * "Control" > "Temperature" submenu
* *
*/ */
static void lcd_control_temperature_menu() { static void lcd_control_temperature_menu() {
START_MENU(); START_MENU();
//
// ^ Control
//
MENU_ITEM(back, MSG_CONTROL, lcd_control_menu); MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
//
// Nozzle, Nozzle 2, Nozzle 3, Nozzle 4
//
#if TEMP_SENSOR_0 != 0 #if TEMP_SENSOR_0 != 0
MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15); MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15);
#endif #endif
@ -897,16 +901,32 @@ static void lcd_control_temperature_menu() {
#endif // EXTRUDERS > 3 #endif // EXTRUDERS > 3
#endif // EXTRUDERS > 2 #endif // EXTRUDERS > 2
#endif // EXTRUDERS > 1 #endif // EXTRUDERS > 1
//
// Bed
//
#if TEMP_SENSOR_BED != 0 #if TEMP_SENSOR_BED != 0
MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15); MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15);
#endif #endif
//
// Fan Speed
//
MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255); MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255);
//
// Autotemp, Min, Max, Fact
//
#if defined(AUTOTEMP) && (TEMP_SENSOR_0 != 0) #if defined(AUTOTEMP) && (TEMP_SENSOR_0 != 0)
MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &autotemp_enabled); 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_MIN, &autotemp_min, 0, HEATER_0_MAXTEMP - 15);
MENU_ITEM_EDIT(float3, MSG_MAX, &autotemp_max, 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); MENU_ITEM_EDIT(float32, MSG_FACTOR, &autotemp_factor, 0.0, 1.0);
#endif #endif
//
// PID-P, PID-I, PID-D, PID-C
//
#ifdef PIDTEMP #ifdef PIDTEMP
// set up temp variables - undo the default scaling // set up temp variables - undo the default scaling
raw_Ki = unscalePID_i(PID_PARAM(Ki,0)); raw_Ki = unscalePID_i(PID_PARAM(Ki,0));
@ -959,7 +979,15 @@ static void lcd_control_temperature_menu() {
#endif//EXTRUDERS > 1 #endif//EXTRUDERS > 1
#endif //PID_PARAMS_PER_EXTRUDER #endif //PID_PARAMS_PER_EXTRUDER
#endif//PIDTEMP #endif//PIDTEMP
//
// Preheat PLA conf
//
MENU_ITEM(submenu, MSG_PREHEAT_PLA_SETTINGS, lcd_control_temperature_preheat_pla_settings_menu); 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); MENU_ITEM(submenu, MSG_PREHEAT_ABS_SETTINGS, lcd_control_temperature_preheat_abs_settings_menu);
END_MENU(); END_MENU();
} }
@ -969,7 +997,6 @@ static void lcd_control_temperature_menu() {
* "Temperature" > "Preheat PLA conf" submenu * "Temperature" > "Preheat PLA conf" submenu
* *
*/ */
static void lcd_control_temperature_preheat_pla_settings_menu() { static void lcd_control_temperature_preheat_pla_settings_menu() {
START_MENU(); START_MENU();
MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_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 * "Temperature" > "Preheat ABS conf" submenu
* *
*/ */
static void lcd_control_temperature_preheat_abs_settings_menu() { static void lcd_control_temperature_preheat_abs_settings_menu() {
START_MENU(); START_MENU();
MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_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 * "Control" > "Motion" submenu
* *
*/ */
static void lcd_control_motion_menu() { static void lcd_control_motion_menu() {
START_MENU(); START_MENU();
MENU_ITEM(back, MSG_CONTROL, lcd_control_menu); MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
@ -1055,7 +1080,6 @@ static void lcd_control_motion_menu() {
* "Control" > "Filament" submenu * "Control" > "Filament" submenu
* *
*/ */
static void lcd_control_volumetric_menu() { static void lcd_control_volumetric_menu() {
START_MENU(); START_MENU();
MENU_ITEM(back, MSG_CONTROL, lcd_control_menu); MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
@ -1083,7 +1107,6 @@ static void lcd_control_volumetric_menu() {
* "Control" > "Contrast" submenu * "Control" > "Contrast" submenu
* *
*/ */
#ifdef HAS_LCD_CONTRAST #ifdef HAS_LCD_CONTRAST
static void lcd_set_contrast() { static void lcd_set_contrast() {
if (encoderPosition != 0) { if (encoderPosition != 0) {
@ -1103,7 +1126,6 @@ static void lcd_control_volumetric_menu() {
* "Control" > "Retract" submenu * "Control" > "Retract" submenu
* *
*/ */
#ifdef FWRETRACT #ifdef FWRETRACT
static void lcd_control_retract_menu() { static void lcd_control_retract_menu() {
START_MENU(); START_MENU();
@ -1141,7 +1163,6 @@ static void lcd_sd_updir() {
* "Print from SD" submenu * "Print from SD" submenu
* *
*/ */
void lcd_sdcard_menu() { void lcd_sdcard_menu() {
if (lcdDrawUpdate == 0 && LCD_CLICKED == 0) return; // nothing to do (so don't thrash the SD card) if (lcdDrawUpdate == 0 && LCD_CLICKED == 0) return; // nothing to do (so don't thrash the SD card)
uint16_t fileCnt = card.getnrfilenames(); uint16_t fileCnt = card.getnrfilenames();

Loading…
Cancel
Save