Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M600 can power down nozzles if filament change takes too long #5737

Closed
wants to merge 53 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
04c2e16
Nozzle shutdown during M600
Roxy-3D Jan 21, 2017
ae8af09
Nozzle shutdown during M600
Roxy-3D Jan 21, 2017
885aa8d
Nozzle shutdown during M600
Roxy-3D Jan 21, 2017
3ab8095
Nozzle shutdown during M600
Roxy-3D Jan 21, 2017
f0b52c3
fix botched edit
Roxy-3D Jan 22, 2017
77df0e9
Don't let compiler complain about integer overflow
Roxy-3D Jan 22, 2017
37e426c
Show nozzle temperature while heating nozzle
Roxy-3D Jan 23, 2017
b28ec22
Show nozzle temperature while heating during M600
Roxy-3D Jan 23, 2017
4e8990f
Make M600 show nozzle temp while heating
Roxy-3D Jan 23, 2017
0aa5dc5
Display active extruder during M600 instead of extruder 0
Roxy-3D Jan 23, 2017
880ca62
Try to get Travis happy
Roxy-3D Jan 24, 2017
afbe00d
Fix botched edit that confuses Travis
Roxy-3D Jan 24, 2017
b730236
Undo change to try to make Travis happy
Roxy-3D Jan 24, 2017
a1a4f8e
Change wording...
Roxy-3D Jan 24, 2017
81cb599
Add Tannoo's new Filament Change Messages
Roxy-3D Jan 24, 2017
8c14676
One more Tannoo message added!
Roxy-3D Jan 24, 2017
3aa9ee7
Switch over to Tannoo's symbolic text names
Roxy-3D Jan 24, 2017
6e7945d
Update Readme
Tannoo Jan 25, 2017
0d59f08
Update Marlin_main.cpp
Roxy-3D Jan 26, 2017
50528f5
Show temp on more filament change screens
Tannoo Jan 26, 2017
f8094ae
Show Active Nozzle Temp
Tannoo Jan 28, 2017
44d3042
A few subtle screen changes.. ;)
Tannoo Jan 31, 2017
58b1dc5
Update ultralcd.cpp
Tannoo Jan 31, 2017
22a4057
Update ultralcd.cpp
Tannoo Jan 31, 2017
6eac529
Trying to make Travis happy
Tannoo Jan 31, 2017
498c1d4
Travis correction?
Tannoo Feb 1, 2017
9301fac
Undoing last commit
Tannoo Feb 1, 2017
5d925bb
See if this helps
Tannoo Feb 1, 2017
108caec
Maybe Travis will like this?
Tannoo Feb 1, 2017
b6ecc32
Merge pull request #1 from Roxy-3D/Tannoo-patch-1
Tannoo Feb 1, 2017
fbb1aed
Cleanup and toocold menu change (#3)
Tannoo Feb 2, 2017
310920e
Changes for Travis (#4)
Tannoo Feb 2, 2017
79ad72a
Declaration for Travis (#5)
Tannoo Feb 2, 2017
36e25c2
Travis Happy Yet (#6)
Tannoo Feb 2, 2017
249a181
Travis Happy Yet (#7)
Tannoo Feb 2, 2017
ff566a2
Travis Happy Yet (#8)
Tannoo Feb 2, 2017
da422a5
Update ultralcd.h
Tannoo Feb 2, 2017
716297f
Update ultralcd.h
Tannoo Feb 2, 2017
3b317fb
Update ultralcd.h
Tannoo Feb 2, 2017
db174b6
Remove Filament Change from Prepare Menu if too cold
Tannoo Feb 2, 2017
9a30ca0
Update M119
Tannoo Feb 7, 2017
940b343
Beep timeout cleanup
Tannoo Feb 7, 2017
1945abd
Missed a configuration setting.
Tannoo Feb 7, 2017
202f359
Move Tannoo's changes to RCBugFix
Roxy-3D Feb 7, 2017
dc1b247
moving stuff over from RC branch
Roxy-3D Feb 7, 2017
4560097
move changes from RC to RCBugFix
Roxy-3D Feb 7, 2017
ee38b06
Move a definition from RC to RCBugFix
Roxy-3D Feb 7, 2017
f26f5fb
Safer defaults for Filament Change
Roxy-3D Feb 7, 2017
ec95991
M600 will now display nozzle number on Graphics LCD's
Roxy-3D Feb 7, 2017
39d6354
Make M600 display correct active nozzle number
Roxy-3D Feb 7, 2017
27bc189
Better center Hotend Status message
Roxy-3D Feb 8, 2017
37ddd79
Better center Nozzle Temp message
Roxy-3D Feb 8, 2017
c550c97
More tweaking to get message centered nicely
Roxy-3D Feb 8, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -685,12 +685,16 @@
#define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm
// Longer length for bowden printers to fast load filament into whole bowden tube over the hotend,
// Short or zero length for printers without bowden where loading is not used
#define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast
#define FILAMENT_CHANGE_LOAD_FEEDRATE 6 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast
#define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend,
// 0 to disable for manual extrusion
// Filament can be extruded repeatedly from the filament exchange menu to fill the hotend,
// or until outcoming filament color is not clear for filament color change
#define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate
#define FILAMENT_CHANGE_NOZZLE_TIMEOUT 45L // Turn off nozzle if user doesn't change filament within this time limit in seconds
#define FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS 5L // Number of alert beeps before printer goes quiet
#define STEPPER_MOTORS_DONT_TIMEOUT_DURING_FILAMENT_CHANGE // Enable to make stepper motors hold position during filament change even if it
// takes longer than DEFAULT_STEPPER_DEACTIVE_TIME
#endif

/******************************************************************************\
Expand Down
99 changes: 88 additions & 11 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7255,6 +7255,28 @@ inline void gcode_M503() {

#if ENABLED(FILAMENT_CHANGE_FEATURE)

millis_t next_buzz = 0;
unsigned long int runout_beep = 0;

void filament_change_beep() {
millis_t ms = millis();
if (ms >= next_buzz) {
if (runout_beep <= FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS ) { // Only beep as long as we are supposed to!
BUZZ(300, 2000);
next_buzz = ms + 2500; // Beep every 2.5s while waiting
runout_beep++;
}
else if (runout_beep > FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS &&
runout_beep <= (FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS + 5)) { // End with a burst of short beeps
BUZZ(200, 2000);
next_buzz = ms + 400; // Beep
runout_beep++;
}
}
}

bool busy_doing_M600 = false;

/**
* M600: Pause for filament change
*
Expand All @@ -7275,6 +7297,8 @@ inline void gcode_M503() {
return;
}

busy_doing_M600 = true; // Stepper Motors can't timeout when this is set

// Show initial message and wait for synchronize steppers
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_INIT);
stepper.synchronize();
Expand Down Expand Up @@ -7332,6 +7356,7 @@ inline void gcode_M503() {

stepper.synchronize();
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_UNLOAD);
idle();

// Unload filament
if (code_seen('L')) destination[E_AXIS] += code_value_axis_units(E_AXIS);
Expand All @@ -7349,30 +7374,75 @@ inline void gcode_M503() {
disable_e3();
delay(100);

#if HAS_BUZZER
millis_t next_buzz = 0;
#endif
millis_t nozzle_timeout = millis() + FILAMENT_CHANGE_NOZZLE_TIMEOUT*1000L;
bool nozzle_timed_out = false;
float temps[4];
int iii;

// Wait for filament insert by user and press button
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_INSERT);

// LCD click or M108 will clear this
wait_for_user = true;
idle();

wait_for_user = true; // LCD click or M108 will clear this
next_buzz = 0;
runout_beep = 0;
for( iii=0; iii<HOTENDS; iii++) //Save nozzle temps
temps[iii] = thermalManager.target_temperature[iii];

while (wait_for_user) {
#if HAS_BUZZER
millis_t ms = millis();
if (ms >= next_buzz) {
BUZZ(300, 2000);
next_buzz = ms + 2500; // Beep every 2.5s while waiting
millis_t current_ms = millis();
if (nozzle_timed_out == true)
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_CLICK_TO_HEAT_NOZZLE);
#if HAS_BUZZER
filament_change_beep();
#endif //HAS_BUZZER

if (current_ms >= nozzle_timeout) {
if (nozzle_timed_out == false ) {
nozzle_timed_out = true; // if the nozzle time out happens, remember we turned off the nozzles.
for( iii=0; iii<HOTENDS; iii++) // turn off all the nozzles
thermalManager.setTargetHotend( 0.0 , iii );

lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_CLICK_TO_HEAT_NOZZLE);
}
}
idle(true);
}

if (nozzle_timed_out == true ) { // Turn nozzles back on if we turned them off.
for( iii=0; iii<HOTENDS; iii++)
thermalManager.setTargetHotend( temps[iii] , iii );
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT);
}

KEEP_CHECKING_TEMPS:
idle();
for( iii=0; iii<HOTENDS; iii++){
if (abs(thermalManager.degHotend(iii)-temps[iii]) > 3 ) {
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT);
goto KEEP_CHECKING_TEMPS;
}
}

wait_for_user = true; // LCD click or M108 will clear this
next_buzz = 0;
runout_beep = 0;
while (wait_for_user) {
if (nozzle_timed_out == true)
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_INSERT);
else break;
#if HAS_BUZZER
filament_change_beep();
#endif
idle(true);
}

// Show load message
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_LOAD);

idle();

// Load filament
if (code_seen('L')) destination[E_AXIS] -= code_value_axis_units(E_AXIS);
#if defined(FILAMENT_CHANGE_LOAD_LENGTH) && FILAMENT_CHANGE_LOAD_LENGTH > 0
Expand Down Expand Up @@ -7424,6 +7494,7 @@ inline void gcode_M503() {

// Show status screen
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_STATUS);
busy_doing_M600 = false; // Allow Stepper Motors to be turned off during inactivity
}

#endif // FILAMENT_CHANGE_FEATURE
Expand Down Expand Up @@ -10033,7 +10104,13 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
millis_t ms = millis();

if (max_inactive_time && ELAPSED(ms, previous_cmd_ms + max_inactive_time)) kill(PSTR(MSG_KILLED));


#if ENABLED(FILAMENT_CHANGE_FEATURE)
#ifdef STEPPER_MOTORS_DONT_TIMEOUT_DURING_FILAMENT_CHANGE
if (busy_doing_M600 == false ) // We only allow the stepper motors to time out if
#endif // we are not in the middle of an M600 command.
#endif

if (stepper_inactive_time && ELAPSED(ms, previous_cmd_ms + stepper_inactive_time)
&& !ignore_stepper_queue && !planner.blocks_queued()) {
#if ENABLED(DISABLE_INACTIVE_X)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/dogm_font_data_ISO10646_1_tr.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
X Font ascent = 7 descent=-1
Max Font ascent = 8 descent=-1
*/
#include "U8glib.h"
#include <U8glib.h>
const u8g_fntpgm_uint8_t ISO10646_TR[2591] U8G_SECTION(".progmem.ISO10646_TR") = {
0,6,9,0,254,7,1,146,3,33,32,255,255,8,255,7,
255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128,
Expand Down
4 changes: 4 additions & 0 deletions Marlin/endstops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ void Endstops::M119() {
SERIAL_PROTOCOLPGM(MSG_Z_PROBE);
SERIAL_PROTOCOLLN(((READ(Z_MIN_PROBE_PIN)^Z_MIN_PROBE_ENDSTOP_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN));
#endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
SERIAL_PROTOCOLPGM(MSG_FILAMENT_RUNOUT_SENSOR);
SERIAL_PROTOCOLLN(((READ(FIL_RUNOUT_PIN)^FIL_RUNOUT_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN));
#endif
} // Endstops::M119

#if ENABLED(Z_DUAL_ENDSTOPS)
Expand Down
4 changes: 3 additions & 1 deletion Marlin/enum.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ enum TempState {
FILAMENT_CHANGE_MESSAGE_EXTRUDE,
FILAMENT_CHANGE_MESSAGE_OPTION,
FILAMENT_CHANGE_MESSAGE_RESUME,
FILAMENT_CHANGE_MESSAGE_STATUS
FILAMENT_CHANGE_MESSAGE_STATUS,
FILAMENT_CHANGE_MESSAGE_CLICK_TO_HEAT_NOZZLE,
FILAMENT_CHANGE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT
};
#endif
#endif
Expand Down
1 change: 1 addition & 0 deletions Marlin/language.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
#define MSG_Z2_MIN "z2_min: "
#define MSG_Z2_MAX "z2_max: "
#define MSG_Z_PROBE "z_probe: "
#define MSG_FILAMENT_RUNOUT_SENSOR "filament_Runout_Sensor: "
#define MSG_ERR_MATERIAL_INDEX "M145 S<index> out of range (0-1)"
#define MSG_ERR_M355_NONE "No case light"
#define MSG_ERR_M421_PARAMETERS "M421 required parameters missing"
Expand Down
21 changes: 20 additions & 1 deletion Marlin/language_en.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
#ifndef WELCOME_MSG
#define WELCOME_MSG MACHINE_NAME _UxGT(" ready.")
#endif
#ifndef MSG_BACK
#define MSG_BACK _UxGT("Back")
#endif
#ifndef MSG_SD_INSERTED
#define MSG_SD_INSERTED _UxGT("Card inserted")
#endif
Expand Down Expand Up @@ -486,7 +489,6 @@
#ifndef MSG_DELTA_CALIBRATE_CENTER
#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Calibrate Center")
#endif

#ifndef MSG_INFO_MENU
#define MSG_INFO_MENU _UxGT("About Printer")
#endif
Expand Down Expand Up @@ -583,6 +585,12 @@
#ifndef MSG_FILAMENT_CHANGE_OPTION_RESUME
#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Resume print")
#endif
#ifndef MSG_FILAMENT_CHANGE_MINTEMP
#define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("Minimum Temp is ")
#endif
#ifndef MSG_FILAMENT_CHANGE_NOZZLE
#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Nozzle: ")
#endif

//
// Filament Change screens show up to 3 lines on a 4-line display
Expand All @@ -603,6 +611,14 @@
#define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("and press button")
#define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("to continue...")
#endif
#ifndef MSG_FILAMENT_CHANGE_HEAT_1
#define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Press button to")
#define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("heat nozzle.")
#endif
#ifndef MSG_FILAMENT_CHANGE_HEATING_1
#define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Heating nozzle")
#define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Please wait...")
#endif
#ifndef MSG_FILAMENT_CHANGE_LOAD_1
#define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Wait for")
#define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filament load")
Expand All @@ -625,6 +641,9 @@
#ifndef MSG_FILAMENT_CHANGE_INSERT_1
#define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insert and Click")
#endif
#ifndef MSG_FILAMENT_CHANGE_HEATING_1
#define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Heating...")
#endif
#ifndef MSG_FILAMENT_CHANGE_LOAD_1
#define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Loading...")
#endif
Expand Down
Loading