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

Add "Manual filament change" option and logic #2379

Merged
merged 10 commits into from Oct 22, 2023

Conversation

Ocraftyone
Copy link
Contributor

@Ocraftyone Ocraftyone commented Oct 10, 2023

This option does a few things that make a SEMM setup where you are manually swapping the filament on pauses a bit easier

  1. disables calling the "on filament change" gcode during setup. This may be useful on a machine that can change the filament itself, but for manually changing the filament, it is an unnecessary pause. It should be assumed the first inserted filament is the first one to be used.

  2. tool change command is changed to a gcode tag. This prevents errors on machines that do not understand the command possibly resulting in a failed print (or at least error messages).

fixes #1377 and fixes #2230 and fixes #2356

@Ocraftyone
Copy link
Contributor Author

The only thing that may cause a bit of trouble on this is changing the configs to update for this. The config value is defaulted to true (as i figure a majority of printers don't have an AMS/multi extruder system) which may cause issues for edge cases. There are a few paths that I see, but I don't know which is best

  1. disable it by default
  2. change configs of affected machines to have it disable by default
  3. find a place to integrate logic that if there are multiple extruders/AMS detected, disable and set false
    LMK what you think is best and if you have any tips for the implementation

@Ocraftyone Ocraftyone force-pushed the patch-add-manual-filament-swap branch from fd7dfb4 to 120d00a Compare October 12, 2023 21:58
src/libslic3r/GCode.cpp Outdated Show resolved Hide resolved
@SoftFever
Copy link
Owner

The only thing that may cause a bit of trouble on this is changing the configs to update for this. The config value is defaulted to true (as i figure a majority of printers don't have an AMS/multi extruder system) which may cause issues for edge cases. There are a few paths that I see, but I don't know which is best

  1. disable it by default
  2. change configs of affected machines to have it disable by default
  3. find a place to integrate logic that if there are multiple extruders/AMS detected, disable and set false
    LMK what you think is best and if you have any tips for the implementation

Awesome.
Thanks for taking care of these issues 👍

I suggest we disable it by default.
The reason is it's default behavior(disabled) in other slicers.

@Ocraftyone
Copy link
Contributor Author

Ocraftyone commented Oct 18, 2023

@SoftFever just made that change

@SoftFever
Copy link
Owner

@Ocraftyone Thank you for your patience.
I made some small changes in 66707c4
Please review.
If all good, we are good to merge 👍

@Ocraftyone
Copy link
Contributor Author

I have a bit of concern about when the tag is inserted in to the code. I'll look into it a bit more later tonight.

Copy link
Contributor Author

@Ocraftyone Ocraftyone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SoftFever I just made a review with my concerns

@@ -261,7 +261,7 @@ namespace Slic3r {
Last_Line_M73_Placeholder,
Estimated_Printing_Time_Placeholder,
Total_Layer_Number_Placeholder,
Tool_Change,
MANUAL_TOOL_CHANGE,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to keep the tag variable name in camel case to match the format of the other tags? For example, Manual_Tool_Change. (To be clear, I am perfectly fine with how the tag presents in gcode)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right.
It is better to make it consistent 👍

@@ -309,7 +309,7 @@ std::string GCodeWriter::update_progress(unsigned int num, unsigned int tot, boo

std::string GCodeWriter::toolchange_prefix() const
{
return config.manual_filament_change ? ";" + GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Tool_Change) + "T" :
return config.manual_filament_change ? ";" + GCodeProcessor::reserved_tag(GCodeProcessor::ETags::MANUAL_TOOL_CHANGE):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for dropping the "T" here? The T is currently used when processing the tag as it removes the tag then passes the rest to the original process_T method (See GCodeProcessor::process_tags Line 2122). This could be modified, but I think the T also makes it a bit clearer what the number means.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't mean to delete the T, must be deleted by accident.

if (! ((m_config.manual_filament_change.value && m_toolchange_count > 0) //Orca: Ignore change_filament_gcode if is the first call for a tool change and manual_filament_change is enabled
|| change_filament_gcode.empty())) {
//Orca: Ignore change_filament_gcode if is the first call for a tool change and manual_filament_change is enabled
if (!change_filament_gcode.empty() && !(m_config.manual_filament_change.value && m_toolchange_count == 1)) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous code didn't work

@@ -3478,6 +3478,8 @@ void TabPrinter::build_unregular_pages(bool from_initial_build/* = false*/)
}
});
};
optgroup->append_single_option_line("manual_filament_change");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the option into SEMM group

@SoftFever
Copy link
Owner

@Ocraftyone
I found another bug see my comment of my new commit.
I didn't a quick test, it should work well now.
Let me know if the test go well on your side.

@SoftFever
Copy link
Owner

@Ocraftyone
Do you get the chance to review the changes?

@Ocraftyone
Copy link
Contributor Author

Sorry. Only concern I have is that I originally tried using the SEMM optgroup, but I believe the on change function has been changed and doesn't update the plate correctly. Is that working for you? (Like mark the option and it prompts you to reslice)

@SoftFever
Copy link
Owner

SoftFever commented Oct 22, 2023

Sorry. Only concern I have is that I originally tried using the SEMM optgroup, but I believe the on change function has been changed and doesn't update the plate correctly. Is that working for you? (Like mark the option and it prompts you to reslice)

Changing to other optGroup won't affect it.
It didin't invalidate the slice status properly because the PR didn't handle this new option in invalidate_state_by_config_options function
I will fix it with some other options in a separate commit.

@SoftFever SoftFever merged commit f84e94f into SoftFever:main Oct 22, 2023
4 checks passed
@cpasoft
Copy link

cpasoft commented Oct 23, 2023

Thank you for this work... I tested it and it works well...

GREAAAATTTT!!!!

@netweaver1970
Copy link

I did try it, and the printer indeed stopped at the correct layer but there was no way of 'resuming' the printing after my manual filament change. Selecting the 'Resume' command didn't work as klipper/mainsail said it wasn't in a 'pauzed' state. What did I miss?

@cpasoft
Copy link

cpasoft commented Oct 23, 2023

I did try it, and the printer indeed stopped at the correct layer but there was no way of 'resuming' the printing after my manual filament change. Selecting the 'Resume' command didn't work as klipper/mainsail said it wasn't in a 'pauzed' state. What did I miss?

You need to configure your "Change filament G-code" on the machine G-code tab and the corresponding macro on your klipper configuration. For example, I use the M600 G-code command and I have a M600 macro where I first save the position, then move the nozzle forward and unload the filament. Then I load the new filament and click resume and that's it.

@netweaver1970
Copy link

thanks

I did try it, and the printer indeed stopped at the correct layer but there was no way of 'resuming' the printing after my manual filament change. Selecting the 'Resume' command didn't work as klipper/mainsail said it wasn't in a 'pauzed' state. What did I miss?

You need to configure your "Change filament G-code" on the machine G-code tab and the corresponding macro on your klipper configuration. For example, I use the M600 G-code command and I have a M600 macro where I first save the position, then move the nozzle forward and unload the filament. Then I load the new filament and click resume and that's it.

thanks, that'll do the job. I've found a nice example M600 macro on reddit and I adjusted the pause position to the place of my purge bucket

@Luigisvc
Copy link

How can I test this before the stable release?

@Ocraftyone Ocraftyone deleted the patch-add-manual-filament-swap branch October 28, 2023 09:14
@Ocraftyone
Copy link
Contributor Author

How can I test this before the stable release?

Visit Actions > Build OrcaSlicer > Select the topmost option for the latest nightly release > download the file that matches your OS

@Luigisvc
Copy link

How can I test this before the stable release?

Visit Actions > Build OrcaSlicer > Select the topmost option for the latest nightly release > download the file that matches your OS

Thank you,

@Ltek
Copy link

Ltek commented Dec 15, 2023

Orca 1.8.1 still pauses after purge, before Layer 1 starts

@Ltek
Copy link

Ltek commented Dec 15, 2023

I did try it, and the printer indeed stopped at the correct layer but there was no way of 'resuming' the printing after my manual filament change. Selecting the 'Resume' command didn't work as klipper/mainsail said it wasn't in a 'pauzed' state. What did I miss?

You need to configure your "Change filament G-code" on the machine G-code tab and the corresponding macro on your klipper configuration. For example, I use the M600 G-code command and I have a M600 macro where I first save the position, then move the nozzle forward and unload the filament. Then I load the new filament and click resume and that's it.

Please share the macro you are using... even with 1.8.1 this is still pausing for me after purge line completes. thx!

@cpasoft
Copy link

cpasoft commented Dec 15, 2023

Orca 1.8.1 still pauses after purge, before Layer 1 starts

Have you enabled the manual change option on the printer settings??

@Ltek
Copy link

Ltek commented Dec 15, 2023

Orca 1.8.1 still pauses after purge, before Layer 1 starts

Have you enabled the manual change option on the printer settings??

thank you, found it! I have not seen this documented anywhere.

image

Do you have a macro that does a purge or extrude N mm (say 20mm) before it resumes?
... would be a REALLY nice addition to printer settings, right under the change option ;-)

@cpasoft
Copy link

cpasoft commented Dec 15, 2023

Do you have a macro that does a purge or extrude N mm (say 20mm) before it resumes? ... would be a REALLY nice addition to printer settings, right under the change option ;-)

It is not possible to do this in Orca, you will need to modify your printer's macro to do this after the filament has been changed and before printing resumes.

Ask in a forum or group for your printer

By the way, ORCA has a setting finder. It is a magnifying glass icon.
imagen

@Ltek
Copy link

Ltek commented Dec 16, 2023

By the way, ORCA has a setting finder. It is a magnifying glass icon.

Thank you for the help!

Yes but not a single search across all settings. Would love to see a single global search. Settings are divided between Printer/Machine, Filament, and 'Project' (left part of the menu that is not actually labelled). Not always obvious where to go hunting.

@dobainier
Copy link

Hello,
Thank you very much for this feature.
But I think I missed something when I tried it :
I enabled "manual filament change" in printer's parameter and added a "change filament", the filament parameter are the same but it's a different filament color in preview tab.

But when printing it didn't pause to change the filament...
Do i need to add an M600 command in the Gcode ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants