From f9d5619682ff29b8aeb3277a7e42b05a7273dc7e Mon Sep 17 00:00:00 2001 From: Robert Pelnar Date: Wed, 27 Dec 2017 18:20:04 +0100 Subject: [PATCH] MINTEMP safety for ambient temperature < 18C Silent mode acceleration limit lowered to 1000mm/s^2 --- Firmware/Configuration_prusa.h | 4 ++-- Firmware/temperature.cpp | 30 +++++++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/Firmware/Configuration_prusa.h b/Firmware/Configuration_prusa.h index 79a0b378..7095d66e 100644 --- a/Firmware/Configuration_prusa.h +++ b/Firmware/Configuration_prusa.h @@ -75,8 +75,8 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o #define MANUAL_FEEDRATE {2700, 2700, 1000, 100} // set the speeds for manual moves (mm/min) //Silent mode limits -#define SILENT_MAX_ACCEL_X 1024 // X-axis max acceleration in silent mode in mm/s^2 -#define SILENT_MAX_ACCEL_Y 1024 // Y-axis max axxeleration in silent mode in mm/s^2 +#define SILENT_MAX_ACCEL_X 1000 // X-axis max acceleration in silent mode in mm/s^2 +#define SILENT_MAX_ACCEL_Y 1000 // Y-axis max axxeleration in silent mode in mm/s^2 #define SILENT_MAX_ACCEL_X_ST (100*SILENT_MAX_ACCEL_X) // X max accel in steps/s^2 #define SILENT_MAX_ACCEL_Y_ST (100*SILENT_MAX_ACCEL_Y) // Y max accel in steps/s^2 #define SILENT_MAX_FEEDRATE 172 //max feedrate in mm/s, because mode switched to normal for homming , this value limits also homing, it should be greater (160mm/s=9600mm/min>2700mm/min) diff --git a/Firmware/temperature.cpp b/Firmware/temperature.cpp index 6164a04f..8556a9a1 100644 --- a/Firmware/temperature.cpp +++ b/Firmware/temperature.cpp @@ -1908,9 +1908,8 @@ void check_max_temp() } -void check_min_temp() +void check_min_temp_heater0() { - if (current_temperature_raw_ambient > OVERSAMPLENR*MINTEMP_MINAMBIENT_RAW) return; //heater #if HEATER_0_RAW_LO_TEMP > HEATER_0_RAW_HI_TEMP if (current_temperature_raw[0] >= minttemp_raw[0]) { @@ -1919,7 +1918,10 @@ void check_min_temp() #endif min_temp_error(0); } -//bed +} + +void check_min_temp_bed() +{ #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP if (current_temperature_bed_raw >= bed_minttemp_raw) { #else @@ -1929,6 +1931,28 @@ void check_min_temp() } } +void check_min_temp() +{ + static uint8_t heat_cycles = 0; + if (current_temperature_raw_ambient > OVERSAMPLENR*MINTEMP_MINAMBIENT_RAW) + { + if (READ(HEATER_0_PIN) == HIGH) + { +// if ((heat_cycles % 10) == 0) +// printf_P(PSTR("X%d\n"), heat_cycles); + if (heat_cycles > 50) //reaction time 5-10s + check_min_temp_heater0(); + else + heat_cycles++; + } + else + heat_cycles = 0; + return; + } + check_min_temp_heater0(); + check_min_temp_bed(); +} + void check_fans() { if (READ(TACH_0) != fan_state[0]) { fan_edge_counter[0] ++;