-
-
Notifications
You must be signed in to change notification settings - Fork 19.7k
Manual Filament Change feature #3601
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
Changes from all commits
8439b97
87cf0bd
3c62e76
16c17e4
1099896
4d4cf08
09b2db4
2340f07
21fc34c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -508,5 +508,16 @@ | |
| #ifndef MSG_DELTA_CALIBRATE_CENTER | ||
| #define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" | ||
| #endif | ||
|
|
||
| #ifndef MSG_CHANGE_FILAMENT | ||
| #define MSG_CHANGE_FILAMENT "Filament" | ||
| #endif | ||
| #ifndef MSG_REMOVE_FILAMENT | ||
| #define MSG_REMOVE_FILAMENT "Remove" | ||
| #endif | ||
| #ifndef MSG_INSERT_FILAMENT | ||
| #define MSG_INSERT_FILAMENT "Insert" | ||
| #endif | ||
| #ifndef MSG_INSERT_FILAMENT_SLOW | ||
| #define MSG_INSERT_FILAMENT_SLOW "Slow Insert" | ||
| #endif | ||
| #endif // LANGUAGE_EN_H | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😄 |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,6 +61,10 @@ int absPreheatHotendTemp; | |
| int absPreheatHPBTemp; | ||
| int absPreheatFanSpeed; | ||
|
|
||
| bool filamentInsert; | ||
| bool filamentSlowInsert; | ||
| bool filamentRemove; | ||
|
|
||
| #if ENABLED(FILAMENT_LCD_DISPLAY) | ||
| millis_t previous_lcd_status_ms = 0; | ||
| #endif | ||
|
|
@@ -96,7 +100,11 @@ static void lcd_status_screen(); | |
| static void lcd_control_temperature_preheat_abs_settings_menu(); | ||
| static void lcd_control_motion_menu(); | ||
| static void lcd_control_volumetric_menu(); | ||
|
|
||
| static void lcd_change_filament_menu(); | ||
| static void lcd_retract_filament(); | ||
| static void lcd_insert_filament_menu(); | ||
| static void lcd_insert_filament(); | ||
| static void lcd_insert_filament_slow(); | ||
| #if ENABLED(HAS_LCD_CONTRAST) | ||
| static void lcd_set_contrast(); | ||
| #endif | ||
|
|
@@ -495,6 +503,7 @@ inline void line_to_current(AxisEnum axis) { | |
| static void lcd_main_menu() { | ||
| START_MENU(); | ||
| MENU_ITEM(back, MSG_WATCH); | ||
| MENU_ITEM(submenu, MSG_CHANGE_FILAMENT, lcd_change_filament_menu); | ||
| if (movesplanned() || IS_SD_PRINTING) { | ||
| MENU_ITEM(submenu, MSG_TUNE, lcd_tune_menu); | ||
| } | ||
|
|
@@ -1081,6 +1090,51 @@ void lcd_cooldown() { | |
|
|
||
| #endif // MANUAL_BED_LEVELING | ||
|
|
||
| /** | ||
| * | ||
| * "Change Filament" submenu | ||
| * | ||
| */ | ||
| static void lcd_change_filament_menu() { | ||
| START_MENU(); | ||
| MENU_ITEM(back, MSG_MAIN); | ||
| MENU_ITEM(function, MSG_REMOVE_FILAMENT , lcd_retract_filament); | ||
| MENU_ITEM(submenu, MSG_INSERT_FILAMENT , lcd_insert_filament_menu); | ||
| END_MENU(); | ||
| } | ||
|
|
||
| static void lcd_insert_filament_menu() { | ||
| START_MENU(); | ||
| MENU_ITEM(back, MSG_CHANGE_FILAMENT); | ||
| MENU_ITEM_EDIT_CALLBACK(bool, MSG_INSERT_FILAMENT_SLOW ,&filamentSlowInsert ,lcd_insert_filament_slow); | ||
| if(!filamentSlowInsert) | ||
| MENU_ITEM(function, MSG_INSERT_FILAMENT , lcd_insert_filament); | ||
| END_MENU(); | ||
| } | ||
|
|
||
| static void lcd_insert_filament_slow(){ | ||
| while (filamentSlowInsert) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes i have trouble doing this work ate ultralcp.cpp, i'd rather write this piece at marlin_main, because there i saw less problem at it. But as @jbrazio told me that is better to make it here. This was a thing i was about to ask.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After mulling it over, I think recursing into the menus isn't so bad. It eats 2 bytes of stack space, but otherwise it's not problematic. The only danger is accidentally making some code that could keep recursing and blow the stack. Not a problem with your code here at all. I did a patch-up of this PR to illustrate the "Marlin way" to put together all the bits that you're bringing together. Check out #3605 and see if it makes sense to you how I've reworked the code to be more in the idiom that (for better or worse) has been established for lcd menus and optional features.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes i'm looking there. Thanks, i just have one thing to say.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I see. I had been thinking of the slow-insert as being useful, after initial quick insertion, to purge filament. But a slow option to align the filament with the nozzle and get the gear to catch it is also useful. I also think the SLOW option should be available for eject, actually. This can work a lot better for a cooled-down (~170°) extruder, because at first the filament just stretches before it starts to eject from the hot end. The nozzle will be cooled down sometimes, when users want to do a "cold pull" to clean the nozzle or see the shape of the interior in the filament they pull out. On my own printer I just use SD Card files for eject or insert. This has some advantages, such as using The other thing my GCode does is start the eject slow and then it gradually speeds up. For a direct-drive extruder, this is less important, and it doesn't end up moving very fast. With a Bowden, it would be possible to eject a nozzle's length of filament at one speed, then the rest of the filament at maximum speed. I have some thoughts on the speed of "slow" where it might be based on the user's settings. The speed you're setting is based on percentage, but I think it should probably be based on mm/s instead. In other words, first figure out what the printer's 100% extruder speed actually comes out to be in mm/s. Then use that to figure out the exact percentage needed to get a slow speed like 0.5mm/s or 1mm/s. I can post a code example later to make it clearer, but I've got to run right now! |
||
| //While the selection at menu is true it keeps slowing insert till the filament in on the tube | ||
| current_position[E_AXIS] += 1.0; | ||
| plan_buffer_line(current_position[(X_AXIS)], current_position[(Y_AXIS)], current_position[(Z_AXIS)], current_position[E_AXIS], FILAMENTCOMPLETCHANGE_SLOW_FEEDRATE, active_extruder); | ||
| st_synchronize(); | ||
| } | ||
| } | ||
|
|
||
| static void lcd_retract_filament() { | ||
| //This value must be setted according the size you have at your printer | ||
| current_position[E_AXIS] -= FILAMENTCOMPLETCHANGE_SIZE; | ||
| plan_buffer_line(current_position[(X_AXIS)], current_position[(Y_AXIS)], current_position[(Z_AXIS)], current_position[E_AXIS], FILAMENTCOMPLETCHANGE_FAST_FEEDRATE, active_extruder); | ||
| st_synchronize(); | ||
| } | ||
|
|
||
| static void lcd_insert_filament(){ | ||
| //This value must be setted according the size you have at your printer | ||
| current_position[E_AXIS] += FILAMENTCOMPLETCHANGE_SIZE; | ||
| plan_buffer_line(current_position[(X_AXIS)], current_position[(Y_AXIS)], current_position[(Z_AXIS)], current_position[E_AXIS], FILAMENTCOMPLETCHANGE_FAST_FEEDRATE, active_extruder); | ||
| st_synchronize(); | ||
| } | ||
|
|
||
| /** | ||
| * | ||
| * "Prepare" submenu | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
Why do we have that strange
#ifndef#endifstructures around the definitions in the English language file?Do you see any warnings about redefined strings?
What language do you see for the new entries on your display if you set the language to pt-br?
Uh oh!
There was an error while loading. Please reload this page.
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.
Are these rhetorical questions you are asking? Your sarcasm doesn't necessarily translate. (But the contempt is loud and clear.)
Simple
straightforwardness
is
better.
Even better: just patch it up and submit a PR to his branch.
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.
@Blue-Marlin i only have pasted my 4 variables at the end of the file i havent done any ifndef. ALso o see no warnings and i have done this 4 lines in pt-br file also, so i see it at my language.
@thinkyhead it was for me or for @Blue-Marlin? The question about sacarsm
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.
Yes " rhetorical questions" and "sarcasm" have been addressed to me.
Ehhh, 'variables'?
No warnings?
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.
Yes, no warnings as you can see
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.
Do you want to return to my first (rhetorical) question or do you want fotos from your pt-br - en mix?
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.
okay i have to make the "ifndef" in english file, got it.