PrusaSlicer icon indicating copy to clipboard operation
PrusaSlicer copied to clipboard

Fixed issue #1207 - MMU - Change Temperature/Material Purge Order Issue

Open amatulic opened this issue 2 years ago • 89 comments

This PR fixes issue #1207 and others closed as duplicates (#8201 and #8702). The tool temperature changes have been corrected so that the purge on the wipe tower occurs at the higher of the two temperatures between the current filament and next filament.

This PR affects only single-extruder configurations. Multi-extruder configurations remain unchanged.

This change allows the MMU to be a true multi-material unit, making it possible to print PLA with PETG supports without nozzle jams due to too-early cooling, or mix together PLA and high-temperature PLA+.

Specifically:

  • If changing to a hotter filament, the temperature change is started when the cooler filament unloads and the new hotter filament loads, as has always been the case. But then it waits (if needed) for the temperature to be reached before starting the wipe on the wipe tower. After the wipe tower purge is done, the print resumes.
  • If changing to a cooler filament, there is no temperature change during unloading and loading; the temperature is kept hot. The lower temperature target is set only when about 40% of the top of the tower is complete (which is where the color visually changes to the new color), so that the nozzle purges most of the leftover hot filament at a higher temperature and cools as the new material reaches the nozzle. When the wipe is done, it waits (if needed) for the lower temperature to stabilize before the print resumes.

This PR includes three kinds of changes in the file WipeTower.cpp, all minor:

  • better management of the existing m_old_temperature variable
  • adding temperature controls in WipeTower::toolchange_Wipe() (which required adding one small change to WipeTower.hpp)
  • modifying some existing g-code comments to add temperature values, for easier g-code reading

I made sure that these modifications affect only the single-extruder MMU configuration, not configurations with multiple extruders.

I tested this fix two ways: by examining the g-code generated for a simple cube with two tool changes, and printing a somewhat more complex 3D model using PLA (205°) and PLA+ (220°) for the part and PETG (215°) for support structure. Each test performed as expected.

Update 2023-03-09: I have since been printing extensively with multiple materials of different temperatures and this fix has been working flawlessly.

Update September 2023: Based on feedback below, I have changed the cooldown to start when the purge completes instead of when the purge begins, but still before the final wipe. This prevents jamming in fast-cooling hotends. With my slow-cooling stock MK3S hotend, this results in a pause for a couple of seconds to wait for the final temperature, and then printing resumes at the new cooler temperature.

Update 2024-05-16: Based on further feedback below, I have modified the logic so that the cooldown starts after 50% of the wiping on the tower has completed. This is a happy medium between starting the cooldown early (which risks jamming a fast-cooling extruder) and starting the cooldown too late (which risks a blob forming if the nozzle must pause for a few seconds waiting for the final temperature before resuming the print). This PR has always included g-code to wait at the end anyway if needed, but the idea is to start the cooldown after most of the hot material is purged so that waiting shouldn't be necessary.

Update 2024-06-03: I made a further refinement after observing that the color change during a wipe appears complete after about 40% of the top of the wipe tower is covered. About 20% of the top of the wipe tower coverage comes from the inital cooling moves, which suggests that another 20% is needed to purge most of the old material using the default purge volume in PrusaSlicer. The new lower temperature is now set at 30% of the wipe (instead of 50% from the prior commit). This corresponds to about 50% of the total top of the wipe tower, a bit past the point where the new color is fully visible. Because the temperature change occurs a bit earlier, it has more time to stabilize, allowing the elimination of the final wait (and potential glob) at the end of the wipe for the final temperature, which should be close enough.

Download Windows binary: Because people have asked, I am placing my Windows builds with this fix into the releases in my GitHub repository here: https://github.com/amatulic/PrusaSlicer/releases/tag/wipetower -- the zip file contains drop-in replacements for the .exe and .dll files.

amatulic avatar Feb 16 '23 01:02 amatulic

We definitely would like to see this change implemented. We run into problems with temps changing too quickly on silk filaments and on Prusament Galaxy Black which has led to bad tips and/or breakage of the Prusament which in turn has led to numerous jams.

RickM777 avatar Aug 06 '23 19:08 RickM777

Upvote. We need this

Mirarkitty avatar Aug 07 '23 05:08 Mirarkitty

Another upvote. How can this be missed?

Jackjan4 avatar Aug 07 '23 06:08 Jackjan4

+1

Sebastian1989101 avatar Aug 07 '23 07:08 Sebastian1989101

+1

yahbluez avatar Aug 07 '23 07:08 yahbluez

Upvote.

3Delights avatar Aug 07 '23 15:08 3Delights

Please merge this request. It would be helpful to several who are commenting here.

doug006 avatar Aug 08 '23 06:08 doug006

+1

pgilfernandez avatar Aug 08 '23 07:08 pgilfernandez

+1 for making the MMU2S / MMU3 great!

kazibole avatar Aug 09 '23 02:08 kazibole

It would be wonderful to get this merged.

/cc @lukasmatena @bubnikv @enricoturri1966 @alranel

Skaronator avatar Aug 09 '23 13:08 Skaronator

we hope it will be implemented soon

Sionree avatar Aug 12 '23 15:08 Sionree

+1

SalmonSays avatar Aug 18 '23 03:08 SalmonSays

Please Implement, helps use of MM multi-material.

paulcopping avatar Aug 20 '23 07:08 paulcopping

+1

beavis69 avatar Aug 20 '23 10:08 beavis69

For extruders that cool quickly this fix does not work 100% of the time. I still jam up. It should remain at the higher temperature until the wipe is done. Then pause for the cool down. Or give an option to switch between the methods.

Does not work for my setup.

LostFool avatar Sep 10 '23 16:09 LostFool

For extruders that cool quickly this fix does not work 100% of the time. I still jam up. It should remain at the higher temperature until the wipe is done. Then pause for the cool down. Or give an option to switch between the methods.

Good point. I'm curious, what extruder cools so quickly?

This is trival to fix. A line of code just has to be moved from before the wipe to after the wipe (or middle of wipe). It already waits for the cooler temperature before resuming printing, but this wait never happens in my case because the correct temperature is already there by the time the wipe is done.

amatulic avatar Sep 13 '23 19:09 amatulic

I run the following extruder on my voron 2.4 with stealth burner hotend.

Upgrade High Temperature 24V 115W Ceramic Heating Red Lizard K1 UHF Hotend CHC Pro High Flow Compatible with Voron V2.4 0.1, V6 Dragon Hotend Prusa i3 MK3 MK3S Titan Extruder 3D Printer(K1 UHF) https://a.co/d/9I9s51E

From what digging I did in the code it seems the temperature should remain the high temperature until the second part of the wipe. Where the order is wipe current > swap > wipe new > cool down. At most mid second wipe cooling can begin. Alternatively adding a toggle option for one of two methods would work to.

My solution for now has been to just have filament start gcode set the high temperature. In my current super sliced setup, the gcode adjusts the temperature back before the actual print. Not certain what toggles it. I swapped to superslicer because it was the best option for all not working options. Also I have to manually set one more gcode line to swap temperature to appropriate for the very beginning of the actual print else the first filament used will be at the high temperature.

I'd love for the functionality to be in prusaslicer so I can switch back.

On Wed, Sep 13, 2023, 2:41 PM Alex Matulich @.***> wrote:

For extruders that cool quickly this fix does not work 100% of the time. I still jam up. It should remain at the higher temperature until the wipe is done. Then pause for the cool down. Or give an option to switch between the methods.

Good point. I'm curious, what extruder cools so quickly?

This is trival to fix. A line of code just has to be moved from before the wipe to after the wipe (or middle of wipe). It already waits for the cooler temperature before resuming printing, but this wait never happens in my case because the correct temperature is already there by the time the wipe is done.

— Reply to this email directly, view it on GitHub https://github.com/prusa3d/PrusaSlicer/pull/9737#issuecomment-1718214168, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIIPGWPG6HL25JVEVJN7HOLX2ID6FANCNFSM6AAAAAAU5RX3LU . You are receiving this because you commented.Message ID: @.***>

LostFool avatar Sep 13 '23 19:09 LostFool

it seems the temperature should remain the high temperature until the second part of the wipe. Where the order is wipe current > swap > wipe new > cool down. At most mid second wipe cooling can begin.

I just fixed this. The change is in WipeTower::toolchange_Wipe() in the file WipeTower.cpp. I need to test it on a couple of prints before modifying this pull request. Just two lines of code, though: one changed line and one new line.

When switching from a hotter to a cooler filament, it now waits until the end of the new wipe tower layer before setting the cooler temperature. Then the final step is to wipe the nozzle (this takes very little time) while cooling; the old hot filament is completely purged by then. Then it waits until the new temperature is reached before resuming the print.

I could also have it change to a cooler temperature mid-wipe, but that complicates the code due to needing two checks inside the loop that does the wipe: one to check if half the wipe is done, and another to check if the new temperature hasn't already been set within that loop.

amatulic avatar Sep 13 '23 22:09 amatulic

Cool beans. I'll give it a try this weekend!

On Wed, Sep 13, 2023, 5:08 PM Alex Matulich @.***> wrote:

it seems the temperature should remain the high temperature until the second part of the wipe. Where the order is wipe current > swap > wipe new

cool down. At most mid second wipe cooling can begin.

I just fixed this. The change is in WipeTower::toolchange_Wipe() in the file `WipeTower.cpp'. I need to test it on a couple of prints before modifying this pull request. Just two lines of code, though: one changed line and one new line.

When switching from a hotter to a cooler filament, it now waits until the end of the new wipe tower layer before setting the cooler temperature. Then the final step is to wipe the nozzle (this takes very little time) while cooling; the old hot filament is completely purged by then. Then it waits until the new temperature is reached before resuming the print.

I could also have it change to a cooler temperature mid-wipe, but that complicates the code due to needing two checks inside the loop that does the wipe: one to check if half the wipe is done, and another to check if the new temperature hasn't already been set within that loop.

— Reply to this email directly, view it on GitHub https://github.com/prusa3d/PrusaSlicer/pull/9737#issuecomment-1718380173, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIIPGWNUSOCQSMVPMFYWBDTX2IVHJANCNFSM6AAAAAAU5RX3LU . You are receiving this because you commented.Message ID: @.***>

LostFool avatar Sep 13 '23 22:09 LostFool

Nice addition. I had wondered about the timing of the temp change myself. I would be testing this ... but after trying to figure out how to utilize this branch I concluded my complete lack of technical skill would likely result in me messing up our system. So hoping PrusaSlicer devs add this soon !!

Good job guys!

RickM777 avatar Sep 14 '23 16:09 RickM777

Cool beans. I'll give it a try this weekend!

I think I messed up something with git. I can code just fine, been coding for 30+ years in C++, but coding has never been my profession (I was a researcher and technicacl program manager before I retired, doing coding for freelance side projects), and git confuses me.

I have ended up somehow with my fork at https://github.com/amatulic/PrusaSlicer having its master branch being the current version with my updated fix for fast-cooling extruders, but the fix-wipe-tower-mmu branch did not get updated, and neither did this PR.

I tried rebasing the master onto it, but that didn't seem to work. The commits in this PR didn't get updated. If you want to test this fix, compile from my master branch on my fork, not fix-wipe-tower-mmu.

It would be great if I could get on a live chat with someone to walk me through the mechanics of updating a PR for PrusaSlicer. This PR is minor, just two files with small changes. I just changed a couple of lines in one file two days ago and I've been struggling with Git since then. How would I repair this situation? Delete my fork, close this PR, and start over clean?

amatulic avatar Sep 16 '23 16:09 amatulic

I'm no programmer, just took some introduction courses but to compile it the first time I just grabbed your two files and dropped them into the main branch when I compiled haha. So I'll probably just do that again

On Sat, Sep 16, 2023, 11:42 AM Alex Matulich @.***> wrote:

Cool beans. I'll give it a try this weekend!

I think I messed up something with git. I can code just fine, been coding for 30+ years in C++, but coding has never been my profession, and git confuses me.

I have ended up somehow with my fork at https://github.com/amatulic/PrusaSlicer having its master branch being the current version with my updated fix for fast-cooling extruders, but the fix-wipe-tower-mmu branch did not get updated.

I tried rebasing the master onto it, but that didn't seem to work. And the commits in this PR didn't get updated. If you want to test this fix, compile from my master branch on my fork, not fix-wipe-tower-mmu.

It would be great if I could get on a live chat with someone to walk me through the mechanics of updating a PR for PrusaSlicer. This PR is minor, just two files with small changes. I just changed a couple of lines in one file two days ago and I've been struggling with Git since then. How would I repair this situation? Delete my fork, close this PR, and start over clean?

— Reply to this email directly, view it on GitHub https://github.com/prusa3d/PrusaSlicer/pull/9737#issuecomment-1722267664, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIIPGWKXOPKAAN547X47B7LX2XJHPANCNFSM6AAAAAAU5RX3LU . You are receiving this because you commented.Message ID: @.***>

LostFool avatar Sep 16 '23 16:09 LostFool

I have ended up somehow with my fork at https://github.com/amatulic/PrusaSlicer having its master branch being the current version with my updated fix for fast-cooling extruders, but the fix-wipe-tower-mmu branch did not get updated, and neither did this PR.

@amatulic From what I can see (at a very cursory glance) your current master branch (on GitHub) is exactly what you want to have on the fix-wipe-tower-mmu branch. Correct?

If so, try this in your working copy (a backup of it beforehand might be an idea):

  1. git checkout fix-wipe-tower-mmu
  2. git reset --hard master
  3. git push --force-with-lease

firetech avatar Sep 16 '23 16:09 firetech

@amatulic From what I can see (at a very cursory glance) your current master branch (on GitHub) is exactly what you want to have on the fix-wipe-tower-mmu branch. Correct?

Yes. My master branch is up to date. It has the most current version of src/libslic3r/Gcode/WipeTower.cpp. The fix-wipe-tower-mmu branch is 3 days old and has an older version of that file. This PR is also not up to date and I cannot figure out how to get it there.

amatulic avatar Sep 16 '23 17:09 amatulic

@amatulic From what I can see (at a very cursory glance) your current master branch (on GitHub) is exactly what you want to have on the fix-wipe-tower-mmu branch. Correct?

Yes. My master branch is up to date. It has the most current version of src/libslic3r/Gcode/WipeTower.cpp. The fix-wipe-tower-mmu branch is 3 days old and has an older version of that file. This PR is also not up to date and I cannot figure out how to get it there.

Seems like you got it fixed. :)

firetech avatar Sep 16 '23 17:09 firetech

Seems like you got it fixed. :)

Yes, your suggestion seemed to do what I needed. Everything looks up to date now. Thanks!

amatulic avatar Sep 16 '23 17:09 amatulic

@LostFool - OK, it should work for fast-cooling extruders now. I moved the change to a lower temperature after the wipe.

Testing it, I observed that the temperature stayed high while the nozzle was wiping back and forth on the tower, then switched to the lower temperature about 4 or 5 wipes before it was done, then paused a few seconds on the wipe tower while the nozzle cooled the rest of the way.

Try it out with your fast-cooling extruder and let me know how it works. For those of us with stock Prusa extruders, waiting an extra few seconds at the end of a tool change for the temperature to cool extends the print time somewhat, so I'm considering moving the change to the middle of the wipe, even though it would complicate the code a bit.

amatulic avatar Sep 16 '23 17:09 amatulic

Awesome I'll try it as soon as my afternoon frees up. Thanks!

On Sat, Sep 16, 2023, 12:22 PM Alex Matulich @.***> wrote:

@LostFool https://github.com/LostFool - OK, it should work for fast-cooling extruders now. I moved the change to a lower temperature after the wipe.

Testing it, I observed that the temperature stayed high while the nozzle was wiping back and forth on the tower, then switched to the lower temperature about 4 or 5 wipes after it was done, then paused a few seconds on the wipe tower while the nozzle cooled the rest of the way.

Try it out with your fast-cooling extruder and let me know how it works. For those of us with stock Prusa extruders, waiting an extra few seconds at the end of a tool change for the temperature to cool extends the print time a bit.

— Reply to this email directly, view it on GitHub https://github.com/prusa3d/PrusaSlicer/pull/9737#issuecomment-1722275772, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIIPGWPGL22SHVNQVQMRCQDX2XN57ANCNFSM6AAAAAAU5RX3LU . You are receiving this because you were mentioned.Message ID: @.***>

LostFool avatar Sep 16 '23 17:09 LostFool

Forgive me for the delay. I am working on getting my machine back into a running state after some other mods and waiting on a part for two weeks. I will update as soon as I try the change.

LostFool avatar Sep 26 '23 22:09 LostFool

@amatulic My first test worked. I had some other issues that are my own doing (tip forming). So I will do another more thorough test when I can.

Thanks for your work :)

LostFool avatar Sep 30 '23 19:09 LostFool