How to unload filament as cleanly as possible using the extruder motor? I usually unload filament using the extruder motor, with the nozzle around 30&nbsp;°C below the filament's print temperature. Despite this, often a significant amount of filament is left in the nozzle, and the filament comes out with a long stringy tip.


Does this suggest that the procedure might be leaving deposits of melted filament outside of the melt zone (potentially leading to blockages)? and if so,
What sequence of temperature/movement controls would be most likely to remove or mitigate the risk of deposits?


I am familiar with the “cold pull” technique, but I am looking for the best strategy for a solution using the printer's controls.

I usually extrude a quantity of cleaning filament when changing filaments, though I'm not sure whether this would also clean any deposits outside the melt zone.

I have seen a procedure called “cooling moves” in the Prusa Slicer code. I understand this is intended to produce a cleaner filament tip upon unloading in a multi-material scenario, and I wonder whether a similar strategy should be employed for regular unloading, although I am unable to tell from the code what exactly is happening.

I am using a genuine E3D V6 hotend and a Bondtech BMG Extruder.
There's a bit of a compromise here:

Filament cohesion in the nozzle isn't strong enough to remove all residue at higher temperature

Extruder motors can't get sufficient grip / don't have sufficient torque for filament extraction at lower temperatures

That means you'll always have to purge some of the old filament when changing to a new filament.
To easily remove the old filament, you'd want to fill the nozzle, so that there's no large plug of filament that might get stuck in the Bowden tube (as suggested in a comment by Rosalie W), then pull the old filament out; and then purge the nozzle after inserting the new filament.
How much you'll need to purge depends a bit on the filament and its color, but I'd guess 50&nbsp;mm should be sufficient in most cases.

As G-code, this might look something like that:

;Unloading
G91 ;relative movement
G1 E5 F300 ;fill nozzle
G1 E-300 F3000 ;unload filament, 300 = Bowden length + hotend length
G90 ;absolute movement

;Loading
G91 ;relative movement
G1 E295 F3000 ;load filament
G1 E55 F200 ; purge filament
G90 ;absolute movement