From 7d157bc3f8be5174ce137eef485792469b3e3c25 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Wed, 10 Oct 2018 18:12:59 +0200 Subject: [PATCH 1/4] gitignore --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..c70611a29 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +################################################################################ +# This .gitignore file was automatically created by Microsoft(R) Visual Studio. +################################################################################ + +/Firmware/.vs/Firmware/v14 From b4128064bd0b9580b100d6c73ab244f765007481 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Wed, 10 Oct 2018 18:13:14 +0200 Subject: [PATCH 2/4] gitignore --- .gitignore | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.gitignore b/.gitignore index c70611a29..b7035fd60 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,16 @@ ################################################################################ /Firmware/.vs/Firmware/v14 +/Firmware/Doc/html/search +/Firmware/Doc/html +/Firmware/Doc/latex +/Firmware/__vm +/html +/latex +/Doxyfile +/Firmware/Configuration_prusa.h +/Firmware/Marlin_main.cpp~RF12cfae7.TMP +/Firmware/Firmware.vcxproj.filters +/Firmware/Firmware.vcxproj +/Firmware/Firmware.sln +/Firmware/Firmware - Shortcut.lnk From 2b54e4ae4b13c922450c031af15b9e2898bffddf Mon Sep 17 00:00:00 2001 From: MRprusa3d Date: Thu, 27 Sep 2018 04:23:00 +0200 Subject: [PATCH 3/4] preHeatError correction of preHeatError detection --- Firmware/temperature.cpp | 94 +++++++++---------- ...5mm_MK2-MultiMaterial-RAMBo10a-E3Dv6full.h | 2 +- ...5mm_MK2-MultiMaterial-RAMBo13a-E3Dv6full.h | 2 +- .../variants/1_75mm_MK2-RAMBo10a-E3Dv6full.h | 2 +- .../variants/1_75mm_MK2-RAMBo13a-E3Dv6full.h | 2 +- 5 files changed, 48 insertions(+), 54 deletions(-) diff --git a/Firmware/temperature.cpp b/Firmware/temperature.cpp index f249f98f0..dc4c797a5 100644 --- a/Firmware/temperature.cpp +++ b/Firmware/temperature.cpp @@ -1105,25 +1105,25 @@ void temp_runaway_check(int _heater_id, float _target_temperature, float _curren static int __preheat_counter[2] = { 0,0}; static int __preheat_errors[2] = { 0,0}; - -#ifdef TEMP_RUNAWAY_BED_TIMEOUT - if (_isbed) - { - __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; - __timeout = TEMP_RUNAWAY_BED_TIMEOUT; - } -#endif -#ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT - if (!_isbed) - { - __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; - __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; - } -#endif if (millis() - temp_runaway_timer[_heater_id] > 2000) { +#ifdef TEMP_RUNAWAY_BED_TIMEOUT + if (_isbed) + { + __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; + __timeout = TEMP_RUNAWAY_BED_TIMEOUT; + } +#endif +#ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT + if (!_isbed) + { + __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; + __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; + } +#endif + temp_runaway_timer[_heater_id] = millis(); if (_output == 0) { @@ -1147,42 +1147,36 @@ void temp_runaway_check(int _heater_id, float _target_temperature, float _curren } } - if (temp_runaway_status[_heater_id] == TempRunaway_PREHEAT) + if ((_current_temperature < _target_temperature) && (temp_runaway_status[_heater_id] == TempRunaway_PREHEAT)) { - if (_current_temperature < ((_isbed) ? (0.8 * _target_temperature) : 150)) //check only in area where temperature is changing fastly for heater, check to 0.8 x target temperature for bed + __preheat_counter[_heater_id]++; + if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes { - __preheat_counter[_heater_id]++; - //SERIAL_ECHOPGM("counter[0]:"); MYSERIAL.println(__preheat_counter[0]); - //SERIAL_ECHOPGM("counter[1]:"); MYSERIAL.println(__preheat_counter[1]); - //SERIAL_ECHOPGM("_isbed"); MYSERIAL.println(_isbed); - if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes - { - /*SERIAL_ECHOLNPGM("Heater:"); - MYSERIAL.print(_heater_id); - SERIAL_ECHOPGM(" Current temperature:"); - MYSERIAL.print(_current_temperature); - SERIAL_ECHOPGM(" Tstart:"); - MYSERIAL.print(__preheat_start[_heater_id]);*/ - - if (_current_temperature - __preheat_start[_heater_id] < 2) { - __preheat_errors[_heater_id]++; - /*SERIAL_ECHOPGM(" Preheat errors:"); - MYSERIAL.println(__preheat_errors[_heater_id]);*/ - } - else { - //SERIAL_ECHOLNPGM(""); - __preheat_errors[_heater_id] = 0; - } - - if (__preheat_errors[_heater_id] > ((_isbed) ? 2 : 5)) - { - if (farm_mode) { prusa_statistics(0); } - temp_runaway_stop(true, _isbed); - if (farm_mode) { prusa_statistics(91); } - } - __preheat_start[_heater_id] = _current_temperature; - __preheat_counter[_heater_id] = 0; + /*SERIAL_ECHOPGM("Heater:"); + MYSERIAL.print(_heater_id); + SERIAL_ECHOPGM(" T:"); + MYSERIAL.print(_current_temperature); + SERIAL_ECHOPGM(" Tstart:"); + MYSERIAL.print(__preheat_start[_heater_id]);*/ + + if (_current_temperature - __preheat_start[_heater_id] < 2) { + __preheat_errors[_heater_id]++; + /*SERIAL_ECHOPGM(" Preheat errors:"); + MYSERIAL.println(__preheat_errors[_heater_id]);*/ } + else { + //SERIAL_ECHOLNPGM(""); + __preheat_errors[_heater_id] = 0; + } + + if (__preheat_errors[_heater_id] > ((_isbed) ? 2 : 5)) + { + if (farm_mode) { prusa_statistics(0); } + temp_runaway_stop(true, _isbed); + if (farm_mode) { prusa_statistics(91); } + } + __preheat_start[_heater_id] = _current_temperature; + __preheat_counter[_heater_id] = 0; } } @@ -1192,7 +1186,7 @@ void temp_runaway_check(int _heater_id, float _target_temperature, float _curren temp_runaway_check_active = false; } - if (!temp_runaway_check_active && _output > 0) + if (_output > 0) { temp_runaway_check_active = true; } @@ -1201,7 +1195,7 @@ void temp_runaway_check(int _heater_id, float _target_temperature, float _curren if (temp_runaway_check_active) { // we are in range - if (_target_temperature - __hysteresis < _current_temperature && _current_temperature < _target_temperature + __hysteresis) + if ((_current_temperature > (_target_temperature - __hysteresis)) && (_current_temperature < (_target_temperature + __hysteresis))) { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; diff --git a/Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo10a-E3Dv6full.h index 2f4836c49..ffed5e268 100644 --- a/Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo10a-E3Dv6full.h @@ -114,7 +114,7 @@ EXTRUDER SETTINGS #endif // Extrude mintemp -#define EXTRUDE_MINTEMP 130 +#define EXTRUDE_MINTEMP 175 // Extruder cooling fans #define EXTRUDER_0_AUTO_FAN_PIN 8 diff --git a/Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo13a-E3Dv6full.h b/Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo13a-E3Dv6full.h index c31ad1267..14fed3ece 100644 --- a/Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo13a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo13a-E3Dv6full.h @@ -114,7 +114,7 @@ EXTRUDER SETTINGS #endif // Extrude mintemp -#define EXTRUDE_MINTEMP 130 +#define EXTRUDE_MINTEMP 175 // Extruder cooling fans #define EXTRUDER_0_AUTO_FAN_PIN 8 diff --git a/Firmware/variants/1_75mm_MK2-RAMBo10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK2-RAMBo10a-E3Dv6full.h index 043ddb81a..6bb14493a 100644 --- a/Firmware/variants/1_75mm_MK2-RAMBo10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK2-RAMBo10a-E3Dv6full.h @@ -114,7 +114,7 @@ EXTRUDER SETTINGS #endif // Extrude mintemp -#define EXTRUDE_MINTEMP 130 +#define EXTRUDE_MINTEMP 175 // Extruder cooling fans #define EXTRUDER_0_AUTO_FAN_PIN 8 diff --git a/Firmware/variants/1_75mm_MK2-RAMBo13a-E3Dv6full.h b/Firmware/variants/1_75mm_MK2-RAMBo13a-E3Dv6full.h index 773085c92..33ed46da3 100644 --- a/Firmware/variants/1_75mm_MK2-RAMBo13a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK2-RAMBo13a-E3Dv6full.h @@ -114,7 +114,7 @@ EXTRUDER SETTINGS #endif // Extrude mintemp -#define EXTRUDE_MINTEMP 130 +#define EXTRUDE_MINTEMP 175 // Extruder cooling fans #define EXTRUDER_0_AUTO_FAN_PIN 8 From 550542e3308d2e108b7964d063d6971df4b8fa80 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Wed, 10 Oct 2018 18:37:32 +0200 Subject: [PATCH 4/4] clean input command queue when thermal_runaway occurs --- Firmware/temperature.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Firmware/temperature.cpp b/Firmware/temperature.cpp index dc4c797a5..9e8fdd36d 100644 --- a/Firmware/temperature.cpp +++ b/Firmware/temperature.cpp @@ -1227,6 +1227,9 @@ void temp_runaway_stop(bool isPreheat, bool isBed) card.sdprinting = false; card.closefile(); } + // Clean the input command queue + // This is necessary, because in command queue there can be commands which would later set heater or bed temperature. + cmdqueue_reset(); disable_heater(); disable_x();