You must supply MFM a file containing a minimal toolchange G-code sequence for your printer.
This toolchange is used when a toolchange is needed but the existing Prime Tower and toolchange G-code cannot be located or used.
Note: Premade minimal toolchanges' temperatures are set up for PLA material. Modify the
M104
,M109
, andM620.1
command temperature parameters with your material temperature settings.
Premade minimal toolchange files can be downloaded from the minimal_toolchanges
directory.
Current premade printer toolchanges:
- Generic (firmware managed tool change with
T
) - Generic Manual (manual filament swap, requires
M600
filament change support in firmware) - Bambu X1/P1 series
- Latest Recommended:
- Long retract on cut enabled -
bambu-x1-p1-series-long-retraction-107mm3-flush.gcode
- No long retract -
bambu-x1-p1-series-107mm3-flush.gcode
- Long retract on cut enabled -
- Latest Recommended:
- Bambu A1
- Bambu A1 mini
- Prusa XL
Every 3D printer is different and you should manually verify that the provided G-code is compatible with your printer. I recommend you create your own minimal toolchange G-code using the information in the below section and the premade G-code as a reference.
-
The location for next tool index (the tool/filament/color being switched to) must be replaced with
XX
in this text file. MFM will replace all instances ofXX
with the next tool index. E.g. When switching to extruder 1,TXX
will becomeT1
-
The location for the previous tool index must be replaced with
YY
in this text file. This is only needed for G-code that needs the previous tool index e.g.M620.11
. -
MFM will insert extra purge G-code if needed after any occurance of
; EXTRA_PURGE_INSERTION
. -
It is recommended to convert movement coordinates that change depending on the current print progress from absolute to relative.
-
All movements that are specific to a specific model must be removed or generalized to not interfere with printed models possibly being located anywhere in the print volume.
-
If possible, it is recommended to restore the printing state's original Z coordinate at the end of the minimal toolchange. MFM will add G-code to restore the original X/Y/Z position and acceleration values after the toolchange.
TODO: Fan speed is currently hardcoded to 78% at the end of the X1/P1 minimal toolchange. I may track fan speed to be restored in the future.
The movement commands to perform the toolchange can be set and managed within firmware or the slicer.
I highly recommend setting your toolchange G-code within firmware as a macro in Marlin or Klipper. The firmware will handle both the hotend offset and toolchange which simplifies the process. Then all you need to do to perform a toolchange is write/send the T
command with the extruder index after it like T0
or T1
.
With toolchange movements properly setup in firmware, a toolchange becomes as simple as the below.
; Single-extruder Toolchange
TXX
; Multi-extruder Toolchange
M104 S170 ; Set the active hotend to the standby temperature
M104 S210 TXX ; Set the next hotend index to the print/purge temperature
TXX ; Execute the tool change
M109 S210 ; Wait for next (now active) hotend to warm up
A properly set up tool change g-code in firmware example for a multi-extruder 3D printer can be seen for the Ultimaker DXUv2 here.
If you would like to contribute your tested toolchange G-Code or have feedback, please make an issue or pull request on this Github repo.