From 4ce9ddbb74052bce8799326e03bd9f5daa081957 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 15 Jun 2015 17:50:26 -0700 Subject: [PATCH 1/4] Check the temperature before filament change --- Marlin/Marlin_main.cpp | 6 ++++++ Marlin/configurator/config/language.h | 1 + Marlin/language.h | 1 + 3 files changed, 8 insertions(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 24eb891151..3dae65f713 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4891,6 +4891,12 @@ inline void gcode_M503() { */ inline void gcode_M600() { float target[NUM_AXIS], lastpos[NUM_AXIS], fr60 = feedrate / 60; + if (degHotend(active_extruder) < extrude_min_temp) { + SERIAL_ERROR_START; + SERIAL_ERRORLNPGM(MSG_TOO_COLD_FOR_M600); + return; + } + for (int i=0; i Date: Mon, 15 Jun 2015 17:52:51 -0700 Subject: [PATCH 2/4] Replace target with destination in M600 --- Marlin/Marlin_main.cpp | 53 ++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 3dae65f713..2d9ea465e6 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4890,55 +4890,57 @@ inline void gcode_M503() { * M600: Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal] */ inline void gcode_M600() { - float target[NUM_AXIS], lastpos[NUM_AXIS], fr60 = feedrate / 60; + if (degHotend(active_extruder) < extrude_min_temp) { SERIAL_ERROR_START; SERIAL_ERRORLNPGM(MSG_TOO_COLD_FOR_M600); return; } + float lastpos[NUM_AXIS], fr60 = feedrate / 60; + for (int i=0; i Date: Mon, 15 Jun 2015 17:54:41 -0700 Subject: [PATCH 3/4] Cleanup M600 documentation comments --- Marlin/Marlin_main.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 2d9ea465e6..4b77c64bae 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4887,7 +4887,16 @@ inline void gcode_M503() { #ifdef FILAMENTCHANGEENABLE /** - * M600: Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal] + * M600: Pause for filament change + * + * E[distance] - Retract the filament this far (negative value) + * Z[distance] - Move the Z axis by this distance + * X[position] - Move to this X position, with Y + * Y[position] - Move to this Y position, with X + * L[distance] - Retract distance for removal (manual reload) + * + * Default values are used for omitted arguments. + * */ inline void gcode_M600() { @@ -4987,6 +4996,7 @@ inline void gcode_M503() { lcd_reset_alert_level(); #ifdef DELTA + // Move XYZ to starting position, then E calculate_delta(lastpos); plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], fr60, active_extruder); plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], lastpos[E_AXIS], fr60, active_extruder); From 5ccb1c9e7d49dc2496574b925d74f78393606028 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 15 Jun 2015 17:55:39 -0700 Subject: [PATCH 4/4] Use millis for M600 audio feedback interval --- Marlin/Marlin_main.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 4b77c64bae..9a7c290942 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4963,10 +4963,14 @@ inline void gcode_M503() { disable_e3(); delay(100); LCD_ALERTMESSAGEPGM(MSG_FILAMENTCHANGE); - uint8_t cnt = 0; + millis_t next_tick = 0; while (!lcd_clicked()) { #ifndef AUTO_FILAMENT_CHANGE - if (++cnt == 0) lcd_quick_feedback(); // every 256th frame till the lcd is clicked + millis_t ms = millis(); + if (ms >= next_tick) { + lcd_quick_feedback(); + next_tick = ms + 2500; // feedback every 2.5s while waiting + } manage_heater(); manage_inactivity(true); lcd_update(); @@ -4976,6 +4980,7 @@ inline void gcode_M503() { st_synchronize(); #endif } // while(!lcd_clicked) + lcd_quick_feedback(); // click sound feedback #ifdef AUTO_FILAMENT_CHANGE current_position[E_AXIS]= 0;