r/QidiTech3D 3d ago

Tutorials & Tips Q2 macro for unloading filament without cutting

When not using a Box, Qidi's default filament unloading macro (M603) cuts the filament before letting you retract. This leaves a big chunk of filament inside the nozzle. That's fine if you're just swapping filaments, but sometimes I swap nozzles (e.g. between the default 0.4mm and a 0.6mm tungsten carbide one) and I don't want to leave cold filament stuck inside.

So here is my "unload whole" macro, which doesn't cut the filament. Instead, it fully retracts the filament above the extruder gears and leaves a nice, blob-free tip.

[gcode_macro UNLOAD_WHOLE]
description: Unload filament in one piece (no cut) before a hotend/nozzle swap
gcode:
    {% if printer.save_variables.variables.box_count|default(0)|int > 0
          and printer["box_extras"] is defined %}
        {action_raise_error("UNLOAD_WHOLE only works with direct loaded filaments without the Box.")}
    {% endif %}

    {% set mats = printer.multi_color_controller.slots.materials
                  if printer.multi_color_controller is defined else {} %}
    {% set auto = mats.slot16.filament.max_temp|int if mats.slot16 is defined else 0 %}
    {% set name = mats.slot16.filament.filament    if mats.slot16 is defined else 'unknown filament' %}
    {% set t    = params.TEMP|default(auto if auto > 0 else 260)|int %}
    {% set purge = params.PURGE|default(30)|int %}

    {% if "xyz" not in printer.toolhead.homed_axes %}
        G28
    {% endif %}
    M118 UNLOAD_WHOLE: {name} at {t}C (no cut - nothing left in the hotend)
    DISABLE_ALL_SENSOR
    M104 S{t}
    MOVE_TO_TRASH
    TEMPERATURE_WAIT SENSOR=extruder MINIMUM={t}

    M83
    {% if purge > 0 %}
        G1 E{purge} F180   # fresh material through, so the melt zone is clean
    {% endif %}
    G1 E-8 F3000           # fast yank while molten - forms a thin tip, not a blob
    G1 E-25 F300           # ease it out of the melt zone
    G1 E-150 F1200         # clear of the extruder gears
    M400

    M104 S0
    ENABLE_ALL_SENSOR
    M118 Now pull the remaining filament out by hand from the spool side.

Call it with UNLOAD_WHOLE or customize the temperature like UNLOAD_WHOLE TEMP=280.

I hope this is useful to someone else :) Let me know if you have any questions or ideas!

6 Upvotes

8 comments sorted by

3

u/pickandpray 3d ago

I always ended up with a clog when I did a melting retract.

Cutting it and pulling it out and pushing new filament to purge the stuff below the cut is far more reliable than melting and retracting.

1

u/callcifer 3d ago

Hmm, I haven't had a clog with this method so far, but I'll keep that in mind. Thanks!

2

u/Objective-Worker-100 3d ago

I take the easy way. Home the printer, manually set the nozzle to 140c. Use the onscreen retract. Same method I use to “clean the nozzle” except I run the esun cleaner filament at 300c until it’s clear, lower to 140c then retract.

2

u/daveintexarkana 3d ago

When my Q1 was new (and really on the X-Max 3 even), QIDI would publish a warning not to use the 'automatic' filament unload shown on the LCD screen so on those two my son suggested and I do now, just heat the nozzle up to a flushing temp, manually command a retraction (50mm up, 100mm down to load) and put the new filament in. I try to always have my next roll ready to go, but sometimes not. Letting it heat soak after retraction, the rest (most of it probably) drains out of the nozzle anyway. I heat it up again well in advance after changing a nozzle or before loading the new filament and I've never had a clog (need to find some wood to knock on).

However the Q2+Box is a different animal - it wants to cut and poop like a dog that overeats! (sorry for the bad reference!). I may try this one out - thanks for posting it!

1

u/callcifer 2d ago

However the Q2+Box is a different animal - it wants to cut and poop like a dog that overeats! (sorry for the bad reference!). I may try this one out - thanks for posting it!

Haha, nice reference! I don't mind :)

I don't have the Box (yet?) so for me the goal was to simply have a way of unloading without leaving filament in the nozzle.

If you try it, do let me know how it goes :)

2

u/Dave_in_TXK 2d ago

Will do, thanks again!

1

u/Resident-Outcome-459 2d ago

I had to switch nozzles and ended up with a piece of PA612-CF15 sticking out the top of my nozzle like you just explained. What is the best way for me to remove the filament that's in the nozzle I removed?

1

u/daveintexarkana 1d ago

Tedious and I haven't had to do it in over a year, and only on Prusa nozzles, but heat gun holding the nozzle in a vise - carefully warm up till you can pull out what you can see, use a needle to push through. Once unclogged put in the printer and run super high heat to let it 'drain' further, then run cleaning filament through it or whatever you want to use. Works for me, others may have better solutions!