AMS Purge Calibration - V1 and new Gcode

Copyright Claim

AMS Purge Calibration - V1 and new Gcode

Boost
25
68
23

Print Profile(2)

All
X1 Carbon
P1S
P1P
X1
X1E
A1
A1 mini

1vs1 - any filament & nozzle size
1vs1 - any filament & nozzle size
Designer
16 min
1 plate
5.0(5)

1vs1 - untested - volunteers wanted
1vs1 - untested - volunteers wanted
Designer
15 min
1 plate
4.5(2)

Boost
25
68
23
0
172
82
Released

Description

What it is

V1 of my endeavour to improve multi color printing and depending on how far you choose to optimize:

  1. Basic information & why you may waste filament
  2. 3mf files to dial in flushing volumes
    • this here is V1 with flat rectangles → version 2 utilizes towers instead
  3. optionally an alternative filament change G-code that provides optimized changes and saves on filament

V1 and V2 calibration prints - advantages & disadvantages

V1

  • independent from nozzle size & filament
  • more precise measurements (2mm³ per mm)
  • currently only up to 1 fully loaded AMS
  • for Orca Slicer (Bambu Slicer only 1vs1 or diagonal)

V2

  • print profile needs to fit nozzle & filament
  • less precise measurement (50mm³ per mm)
  • calibrate up to 4 fully loaded AMS
  • Bambu Studio & Orca Slicer

The G-code is tested or reported to work with:

  • BambuStudio 1.7.7.89 and 1.8.2.56
  • OrcaSlicer 1.7.0
  • Bambu Lab X1C (P1P, P1S, X1E should work as well)

1. Basics information

The values

“Flushing Volume” set by the user in Bambu Studio specifies the amount of filament in mm³ that is to be pooped or be flushed into an object. → Attention, currently it does not go into the optional prime tower, despite that one is printing before any optional object that is bound to be flushed into!

The filament that goes into the prime tower finally is presented separately. It is an additional expense to prime the nozzle after the filament change. With a following retract and pressure advance active by default, a huge prime volume may not be needed anymore.

 

The printing sequence itself makes sense but has some consequences based on the attached calculations.

Once the filament is cut, there are around 107mm³ present between the nozzle and the cutting position and it can't be retracted by the extruder. If a secondary object to flush into “eats” more filament within the present layer than what is specified in the Flushing Volume for that change, no poop may be created. → Great to save filament via printing only a small prime tower (which is required for flush into object), but potentially not so great when it comes to reliability with losing oozed out material from the nozzle or when any retractions would have been required during the 107mm³ that followed.

 

In the Matrix

Until proper calibration prints are included in slicers, it may be useful to know what to look out for when choosing a flushing volumes calibration print.

  • Filling in all related entries in the flushing volumes matrix, according to the number of involved filaments is a must, but that is where some uploads already leave you stranded half way in - by not including all necessary combinations. Print profiles that only allow for diagonal testing with more than two filaments are of limited use.
  • Calibrating with as little filament as possible is nice. Prints that require guesswork, printing and re-printing until the outcome looks good enough are usually not very efficient nor precise. A measurable outcome ensures reliable results at little work.

2. Dialing in flushing volumes

  • Download & open the provided 3mf file from the source files with Orca Slicer (or start for a test with the 1vs1 print profile). → The calibration prints are independent of the used filament change G-code, Bambu Lab's stock filament change G-code is the preset within the files.

    The 3mf files contain multiple flat rectangles. One rectangle consumes 100mm³ of filament (which roughly equals to 42mm of filament in length). In order to print the calibration pattern, onyl Orca Slicer provides the option to reduce the extruder clearance to utilize the needed object-by-object printing sequence. → If you use Bambu Studio, currently only the provided 1vs1 print profile is useful.
  • Except for the provided 1vs1 print profile: If it isn't already set by the profile, reduce the value of your extruder clearance to 6mm or lower (Bambu Studio currently does not allow this)
  • In the Filament Tab, make the necessary changes to have it print your individual filaments.
  • In order to get repeatable and measureable results, make sure the concerned flushing volumes are set to an easy value like 50 mm³ (and for good measure the multiplier is 1.00). → A value of 50mm³ allows to observe the resulting color break / mixing of filaments from the very start but may also lead to problems. If you encounter poops dragged onto the print bed, increase the value to 100mm³.
  • It is strongly suggested to NOT alter any other settings from the provided .3mf files.
  • Print it.
  • With good lighting, find the area where the new material looks nice and pure.
  • Via measuring from the start to where a printed strip becomes visually flawless in color, the necessary amount of flushing volume for a specific change can be calculated. All roads lead to Rome, pick a formula to your liking from the following:
  • The flushing volume tested for is 4x 100mm³ = 400mm³. If you find that not to be enough, simply set an initial flushing volume appropriately higher and add it accordingly.
    • Despite setting 0 mm³ of flushing volume there still may be filament dangling from the nozzle after the new filament was pushed into the hotend. Apart from potential oozing, this seems to be a consequence of the AMS's internal code to deliver the filament to the nozzle. → There is nothing I can do about that lost approximately 5mm³ for now.
  • The newly calculated flushing volume in mm³ for the specific material change can now be set in the slicer dialogue.

3. Optimized filament change & save filament

Under “Printer settings” → “Machine G-code” → “Change filament G-code”

  • delete (maybe save it somewhere else) the old change filament G-code in the slicer
  • copy & paste the content from the AMS_filament_change_code_vX.X.X_by_AMT.txt file provided in the source files
  • hit save (as a new user preset) and restart the slicer

From now on the printer will:

  • perform faster filament changes by
    • moving directly from printing to cutting the filament
    • just heating the nozzle to the hotter printing temp of both filaments (either it already has that temp or needs it for the next filament anyway)
  • switch on the printhead light while changing, so you can see what happens back there
  • produce consecutive poops (200mm³ to 275mm³ each) if a flushing volume is greater than 400mm³
  • save a bit of filament on each filament change → please read further down in the “To snuffle a nozzle” section

If you want to know exactly what is going on in the code, what each command is supposed to do or even tweak it a bit yourself, I made lots of annotations.

 

Side note:

If you're using a small nozzle like 0.2mm, double check the set “Max. volumetric speed” (Bambu Lab's variable name, otherwise known as “max. volumetric flow rate”) of your filaments. It regularly becomes a bottleneck that adds several hours to a print.

To snuffle a nozzle

Bambu Lab understandably leaned more towards a stable process under a wide variety of circumstances rather than optimizing for filament efficiency.

Besides the filament specific flushing volumes there also is the option to reduce the constantly lost few mm³ during the filament cutting operation by retracting filament before it is cut. The maximum amount of additionally saved filament by pulling filament back from the melting zone is limited by the length of the filament that already became gooie due to the heat influx.

With a length of approximately 25mm (heated part of the stock Bambu Lab hotend + transition zone) the safe length to retain at each and every filament change could well be 20mm => 48mm³.

Because this maximum length might lead to trouble along the way, the values in the given G-code are set relatively low to:

  • 6.24mm → 15mm³ for PLA & PLA-CF,
  • 8.32mm → 20mm³ for PETG, ABS & ASA,
  • 12.47mm → 30mm³ for PA, PA-CF, PC and PET-CF
  • none for unknown types of filament

If you want to play around with these values, please go for it and report back, more feedback may result in greater savings for all.

A fair warning though: Risking molten filament becoming a problem up in the cold end is a realistic mishap and one would have to save a lot of purging material to offset even one failed print.

Yes, this additional modification is not interpreted by the slicer. The retracted amount seems to go unnoticed within the slicers estimation.

Trivia

The lower recommended flush volume of 107mm³ is based on the hotend volume from the nozzle to the filament cutting blade.

  • Formula: (PI * (1.75mm / 2) ^2) * 44.5mm = 107mm³

A good reason to not set the flushing volumes too low is the wiping process. If there is not enough mass dangling from the nozzle below the wiper, the chances of flinging that material back into the area of operation is greatly increased.

During my trials I found no noticeable difference between purging material at a constant extrusion vs. in a pulsating manner or with little pulses, so constant without slow downs it is.

Troubleshooting

If you get an error, reading something like “machine_start_gcode Parsing error at line…”, you very likely inserted the code at the wrong place. Try again by restoring the start gcode and only replace the code in the “Change filament G-codesection with the one given here.

The here suggested calibration print does the job just good enough, I would prefer a proper & more precise calibration pattern generated by the slicer as well. → If you find yourself here, that probably means still nothing better exist…

The alternative G-code does not do wonders as well, it only is an improvement in details. If your printers poop was an absolute mess before, it very likely will be that way with my code too.

If you have found a bug in my code or would want to have a certain feature, simply tell me about it. I will see what I can do.

Disclaimer

Remember, using my code happens at your own risk. There is a lot to cover when it comes to creating a reliable process over a wide range of (even seemingly identical) machines and materials. - I am not Bambu Lab, instead just a next best dork online who thinks he can improve some stuff and spare you the hassle of doing it. A future firmware or slicer update may result in this code not working properly. Keep that in mind and test/use it with care.

Comment & Rating (23)

Please fill in your opinion
(0/5000)

Hi mate, I think I found a bug but I'm not 100% sure if it's because of the modified filament change g-code. 1. Using the latest firmware for the X1C as of 15-DEC-2023 and Bambu Studio 1.8.2.56. 2. Using the external spool 3. Toolhead will print the initial line at the front and then the second line at the back as it always does. 4. Toolhead will then cut the filament and move over the poop chute. 5. Printer will throw an error - See screenshot. Once I reverted back to the stock printer's G-code, this issue was gone. What are your thoughts?
The designer has replied
0
Reply
That surely sounds like a bug. Just so I get that right: You are trying to print an object solely with the external spool – and instead of doing that, it cuts the filament and throws this error? Or You are trying to print multicolor, starting with an external filament first? - It starts with the tests, tries to change filament and fails with this message? And in case you tried, what happens when you hit Retry after pulling the external filament all the way out?
0
Reply
Replying to @AMT_MW :
Hi. I'm just printing a single color object using the external spool, no color switching is required. I simply use the X1C printer profile with your g-code as my default profile and so it happens that it's the first time I'm using your profile but printing via external spool. Hitting retry doesn't do anything. The error just pops back up again.
0
Reply
Replying to @just.gil :
Found the issue (I think). A fixed version 1.6.2 is now online. The slicer did not ignore code it should have ignored... Thanks for the report :-)
1
Reply
Hey, I love how this speeds up the process. However, when I use this GCODE (I'm using the "any filament and nozzle size" version and NOT the "untested" version), I get too much flow at the beginning after each color change. You can see the effect here on the Prime towers. When I use Bambu's default gcode, the tower is clean with no overextrusion, as seen on the left. Your gcode makes it overextrude after each color change, which you can see by how the tower on the right is bloated on one side after each color change. Do you have any idea what might be causing this? I am very interested in speeding up the color changing process, but this problem makes it so the nozzle knocks my towers over because the nozzle collides with the overextrusion.
(Edited)
The designer has replied
0
Reply
I never had that issue and oddly enough my code does not affect how the prime tower is printed. (May I ask which printer, firmware and slicer version was used?) Looking at the first white/blue and the second sections of your towers, they look identical at first glance. Only the third and fourth section differ a lot and clearly show under extrusion as well as the over extrusion that causes you trouble. Except for artefacts caused by the filament or its settings (retraction/flow dynamics calibration/…), I do have no clue how and why this would happen. – I will run some tests and keep an eye on further feedback.
1
Reply
Replying to @AMT_MW :
Thanks for the reply! I ran the print again (with the color change gcode and then again with the default) with my P1S in Orcaslicer (I'm on version 1.9.0) and got the same results. Sections 1, 3, and 4 are where every single layer has color changes. Section 2 there are no color changes in my design. Here are some more pictures (this time of the re-run with the colors the same) where you can see section 2 has no problems, which makes sense, and then neighboring sections 1 and 3 show some overextrusion. You can see it more clearly in the second picture shown on the edge. I'm wondering if the gcode makes the nozzle accidentally spit out extra filament at the beginning of each change with or without a prime tower, and because the prime tower is always the first thing printed, it shows up most clearly when prime tower is enabled. EDIT: I forgot to add that my firmware is the latest version, which is 01.05.02.00 for my P1S and 00.00.06.40 for my AMS.
(Edited)
0
Reply
Printed a few 2 color calibrations, works really well. Haven't tried any of the g-code changes though I would like to for the smart retract capabilities. Printed on A1 Mini, let me know if there is anything I can test out for you! Also, if possible being able to test at least 3 or even all 4 colors at once would be AWESOME! I know from looking at the 256x256 build plates it may not be possible on this tiny 180x180 for 4, but even 3 colors at once would be nice.
The designer has replied
0
Reply
Thanks for the offer, in around one or two weeks I may have a file to test out for you on the A1 :-) Regarding the G-code: It currently does not have a sibling for the A1 and since I do not have that machine, I am hesitating to generate code which I am unable to test/verify with at least one machine in depth.
0
Reply
Replying to @AMT_MW :
Looking forward to it!
0
Reply
Print Profile
1vs1 - any filament & nozzle size
really useful print to fine tune your purge amounts and save filament
1
Reply
Hi, i have been using your fast filament change Gcode for long time now. the latest version 1.6 seems to have some issues with your feature "produce consecutive poops (200mm³ to 275mm³ each) if a flushing volume is greater than 400mm³" I have a few flushes of 450, I get the first poop right, but the second one is just a long string and not poop. this casing eventually a build-up of poops in the back. using version 1.4 works just fine.
The designer has replied
0
Reply
Ok so I just checked it closely - the problem is that when the extruder goes back to the chute it is coming from the side instead of the front, so the latch is not closing correctly. see the video I just shot and watch the picture of what coming out. https://youtube.com/shorts/0DY38G0bOig I think it's a small fix that needs to be done on the code so it will go in front of the chute before going back there.
0
Reply
Replying to @dalet11 :
Interesting, I did not notice that behavior during my trials. -> Thanks for the info, I will look into that probably tomorrow.
1
Reply
Replying to @dalet11 :
Sorry, it took me a day longer. Your description of the reason for the problem was correct. -> A new v1.6.1 is now online. I tested it with around 80 changes over three prints with 400+ and 600+ mm³ of flushing. Seems to work fine, but I do not trust that latch to operate exactly the same for everyone... Thanks for reporting the problem & please do not hesitate to write back if the problem persists. :-)
0
Reply
Print Profile
1vs1 - any filament & nozzle size
helped me dial in some PLA+ filament swaps and saved 50% waste
1
Reply
Print Profile
1vs1 - any filament & nozzle size
Great guide for how to adjust purge settimg
0
Reply
Print Profile
1vs1 - any filament & nozzle size
1
Reply
Print Profile
1vs1 - any filament & nozzle size
1
Reply
Print Profile
1vs1 - untested - volunteers wanted
1
Reply

License

This work is licensed under a Standard Digital File License.

You shall not share, sub-license, sell, rent, host, transfer, or distribute in any way the digital or 3D printed versions of this object, nor any other derivative work of this object in its digital or physical format (including - but not limited to - remixes of this object, and hosting on other digital platforms). The objects may not be used without permission in any way whatsoever in which you charge money, or collect fees.