-
-
Notifications
You must be signed in to change notification settings - Fork 19.5k
[1.1.x] Add M701 and M702 filament load and unload #7107
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
Conversation
The conflict is with For the MK2 multiplexer the procedure is interesting, probably runs this way to get the best filament pull… // MK2 firmware behavior:
// - Make sure temperature is high enough
// - Raise Z to at least 15 to make room
// - Extrude 1cm of filament in 1 second
// - Under 230C quickly purge ~12mm, over 230C purge ~10mm
// - Change E max feedrate to 80, eject the filament from the tube. Sync.
// - Restore E max feedrate to 50 |
Marlin/ultralcd.cpp
Outdated
MENU_ITEM(gcode, MSG_FILAMENTLOAD, PSTR("M701")); | ||
#else | ||
if (!thermalManager.targetTooColdToExtrude(0)) | ||
MENU_ITEM(gcode, MSG_FILAMENTLOAD1, PSTR("M701 T0")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use MSG_FILAMENT_LOAD MSG_E0
here. Then there is no need for multiple redundant MSG_FILAMENTLOADn
defines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some changes are needed, some suggested.
Marlin/ultralcd.cpp
Outdated
MENU_ITEM(gcode, MSG_FILAMENTUNLOAD, PSTR("M702")); | ||
#else | ||
if (!thermalManager.targetTooColdToExtrude(0)) | ||
MENU_ITEM(gcode, MSG_FILAMENTUNLOAD1, PSTR("M702 T0")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use MSG_FILAMENT_UNLOAD MSG_E0
here. Then there is no need for multiple redundant MSG_FILAMENTUNLOADn
defines.
Marlin/temperature.h
Outdated
UNUSED(e); | ||
#endif | ||
return allow_cold_extrude ? false : degTargetHotend(HOTEND_INDEX) < extrude_min_temp; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might as well make an inline for the formula:
FORCE_INLINE static bool tooCold(const int16_t temp) { return allow_cold_extrude ? false : temp < extrude_min_temp; }
static bool tooColdToExtrude(const uint8_t e) {
#if HOTENDS == 1
UNUSED(e);
#endif
return tooCold(degHotend(HOTEND_INDEX));
}
static bool targetTooColdToExtrude(const uint8_t e) {
#if HOTENDS == 1
UNUSED(e);
#endif
return tooCold(degTargetHotend(HOTEND_INDEX));
}
Marlin/ultralcd.cpp
Outdated
@@ -3588,12 +3627,15 @@ void kill_screen(const char* lcd_msg) { | |||
*/ | |||
#if ENABLED(ADVANCED_PAUSE_FEATURE) | |||
|
|||
static AdvancedPauseMode advanced_pause_mode = ADVANCED_PAUSE_MODE_PAUSE_PRINT; | |||
static uint8_t advanced_pause_extruder = active_extruder; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't use the value of another global as the initializer of a global.
Marlin/ultralcd.cpp
Outdated
default: | ||
STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER_PAUSE, true, true); | ||
break; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is repeated several times, it should be made into a macro…
#define _ADVANCED_PAUSE_HEADER() \
do { switch (advanced_pause_mode) { \
case ADVANCED_PAUSE_MODE_LOAD_FILAMENT: \
STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER_LOAD, true, true); \
break; \
case ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT: \
STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER_UNLOAD, true, true); \
break; \
default: \
STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER_PAUSE, true, true); \
break; \
} } while(0)
…and then they can all be replaced by:
_ADVANCED_PAUSE_HEADER();
Marlin/ultralcd.cpp
Outdated
default: | ||
STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER_PAUSE, true, true); | ||
break; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_ADVANCED_PAUSE_HEADER();
Marlin/ultralcd.cpp
Outdated
default: | ||
STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER_PAUSE, true, true); | ||
break; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_ADVANCED_PAUSE_HEADER();
Marlin/ultralcd.cpp
Outdated
default: | ||
STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER_PAUSE, true, true); | ||
break; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_ADVANCED_PAUSE_HEADER();
Marlin/ultralcd.cpp
Outdated
default: | ||
STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER_PAUSE, true, true); | ||
break; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_ADVANCED_PAUSE_HEADER();
Marlin/language_en.h
Outdated
#endif | ||
#ifndef MSG_FILAMENTLOAD1 | ||
#define MSG_FILAMENTLOAD1 _UxGT("Load filament 1") | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one MSG_FILAMENTLOAD
is needed. Append MSG_E0
, MSG_E1
, etc., in the code if numbers are needed. For example:
MENU_ITEM(gcode, MSG_FILAMENT_LOAD MSG_E0, PSTR("M701 T0"));
Marlin/language_en.h
Outdated
@@ -602,6 +602,45 @@ | |||
#ifndef MSG_FILAMENTCHANGE | |||
#define MSG_FILAMENTCHANGE _UxGT("Change filament") | |||
#endif | |||
#ifndef MSG_FILAMENTLOADUNLOAD | |||
#define MSG_FILAMENTLOADUNLOAD _UxGT("Filament Un/Load") | |||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This menu could also be called Change Filament — or these options could simply be included in the existing Change Filament menu, since load and unload are each just half of a filament change.
I could make this a configurable option, such that no parameter either unloads the active extruder, or unloads all extruders that are above the minimum temperature. I could also add an unload all option to the LCD.
How would you like me to proceed? This procedure is very specific to the MK2, and I personally don't like the idea of changing max feedrates since that can cause issues with other printers. My suggestion would be to first implement a generic process, and then printer-specific processes could be added as desired. |
Agreed... Even though the MK2 is providing the motivation to do this and this code is specifically aimed at that purpose... Probably the existing Configuration.h values can be used to handle both the generic case and the MK2 specific case.
Agreed. It should be possible to do a generic version of the code. And maybe it works especially well on the MK2 ??? |
Even though the MK2 is providing the motivation to do this and this code is specifically aimed at that purpose...
For me, that's not true. I'm just getting tired of manually feeding
filament through my 450mm Bowden tubes. I suspect that's a more general use
case than the MK2.
|
OK... I made a bad assumption! :) But clearly, it should be possible to make a generic version of this work with just about all machines! Thank You for the correction. |
@thinkyhead where did you find that procedure for the MK2? I didn't see anything like that in their fork. |
I've updated this to address @thinkyhead's comments. However, I've got a job going for a customer, so I haven't had an opportunity to do much testing of my changes. If anyone (cough @Roxy-3D cough) has some time to help me out with testing, that would be greatly appreciated. |
I had an opportunity to perform some testing this morning. I fixed an issue with |
Cool, this is what I was looking for. It might be hard to make this a generic enough function for all printers but it seems an owner of a printer could formulate their own gcode commands to accomplish the task to their needs. What I mean to say is to create an item in configuration.h (or configuration_adv.h), similar to enabling case LED.. #define ShowFilamentLoadUnloadMenuItem IgnoreFilamentRunoutSensor=1 Example.. |
@Eddiiie M701 and M702 are pretty configurable in Configuration_adv.h. Is there a configurable option not there that you would like to see? |
Yes, this is what I was looking for.
Will try this out. Thank you.
…________________________________
From: Thomas Moore <[email protected]>
Sent: Friday, July 14, 2017 6:46 PM
To: MarlinFirmware/Marlin
Cc: Eddiiie; Mention
Subject: Re: [MarlinFirmware/Marlin] Add M701 and M702 filament load and unload (#7107)
@Eddiiie<https://github.com/eddiiie> M701 and M702 are pretty configurable in Configuration_adv.h. Is there a configurable option not there that you would like to see?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#7107 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AKItQM-CvVv2ctuMmYFmruyy31S6ex-Mks5sOBn1gaJpZM4OAeVL>.
|
@thinkyhead Have you had an opportunity to re-review this yet? |
bb58d68
to
524f4ee
Compare
54081a8
to
4e19c59
Compare
38898fa
to
7c1adff
Compare
I ask all , to make these commands in PERMANENT MODE , not in features , and for 1256 processors ... then to not be forced to enable ' PAUSE STRONG CODE ' just for loading/unloading By LCD and Gcode , because of interface ' octoprint and ..... i'm dreaming , the marlin web interface ' |
7c81e3c
to
b567790
Compare
@tcm0116 Let's revisit this in light of the latest code changes where ❄️ ❄️ ❄️ 🎄 ❄️ 🎄 ❄️ 🎄 ❄️ 🎄 🎄 ❄️ ❄️🎄 |
8e6deba
to
2fcc15d
Compare
Rebased and squashed. Moved general improvement changes out to #8965. |
2fcc15d
to
0c4d921
Compare
I did add echo messages when user interaction is required:
If you want, we can define them based on if an LCD controller is available, emergency parser is available, or both. That would probably make it less confusing and prevent someone from trying to use M108 when they don't have emergency parser enabled. |
The message about |
0c4d921
to
bcd26fc
Compare
Now to package this up for 2.0.x . . . |
Give me a few minutes. I'm modifying M701 and M702 to use EDIT: Sigh. It helps if I re-enable that option in the configuration... |
Good improvements. Rolling them in… |
5ef621b
to
81193e9
Compare
This is merged to "finalize" the basic form of everything. I'm putting together a PR for 2.0.x with the same changes, and should have that posted today. |
Good deal. Thanks for helping me take this over the goal line. |
Happy to assist — especially with features that are long overdue. Much thinking about a proper LCD methodology to simplify some things. I'm considering using internal LCD-only G-codes (e.g., For the most part the LCD code works smoothly now, and the menu system is pretty nifty (if baroque). So the first step toward improving the LCD code is just to (yes) split it up into more manageable parts that compile independently, and then see what independent units stand out. So that's something I will undertake soon. |
Hi, it appears as if ticket #8993 is related to this PR. I just thought I would reference it here to help getting the right eyeballs to look into it. |
It looks like the bug has been largely resolved, but I notice that lcd_temp_menu_e0_filament_change() is being defined in line 4145 of "ultralcd.cpp" while it is first used in line 1393. This will likely cause issues when compiling with "avr-gcc". I suggest moving the declarations of the lcd_temp_menu_eN_filament_change() functions above lcd_tune_menu(). |
Thanks! Resolved by #9032. |
This is a rebase and rework of #6493 to work with the new advanced pause capability.
I've extensively tested this on my dual-nozzle Prusa i3 clone with a 20x4 LCD.