All printing G-code must use Relative Positioning for Extrusion.
Printhead XYZE absolute positioning mode can be set with G91
and only the Extruder (E) can be set to relative positioning with M83
. If too little/too much filament is extruded, check to see if your extrusion positioning is incorrectly set to absolute in the slicer.
Add markers in your slicer software G-code for the end of new layer change and start and end of toolchange.
Save the printer profile with a new name and select the new printer profile for your prints.
-
Printer > Settings > Custom G-code / Machine G-code
-
Add
; MFM LAYER CHANGE END
on a new line at the end of After layer change G-code / Layer change G-code. -
Add
; MFM TOOLCHANGE START
on a new line at the beginning of Tool change G-code / Change filament G-code. -
Add
; MFM TOOLCHANGE END
on a new line at the end of Tool change G-code / Change filament G-code. -
If you do not have the Bambu specific Long retraction when cut
long_retractions_when_cut
option enabled for any of the used filament profiles, skip to last step. -
Long retraction only: Add
; EXTRA_PURGE_INSERTION
on a new line after the last{if flush_length_4 > 1}...{endif}
block. The added new line must be before the last occurance of; FLUSH_START
. -
The resulting settings text fields should have an order like below
; Existing layer change G-code stays HERE
; MFM LAYER CHANGE END
; MFM TOOLCHANGE START
; Existing toolchange G-code stays HERE
; MFM TOOLCHANGE END
; MFM TOOLCHANGE START ; <-- Add this line
; Existing toolchange G-code stays HERE
{if flush_length_4 > 1} ; <-- This should be the last high extruding flush
... <-- Last extruding flush G-code
{endif}
; EXTRA_PURGE_INSERTION ; <-- Add this line
; FLUSH_START <-- This is a short flush that does not extrude much
M400
...
; Existing toolchange G-code stays HERE
; MFM TOOLCHANGE END ; <-- Add this line
Bambu Slicer and Orca Slicer have a conditional section in the toolchange that uses a proprietary G-code M620.11
to perform a longer retraction before cutting filament. This can reduce purged filament by 20-30% on average.
For every filament used:
-
Filament > Setting Overrides
-
Check or Uncheck
Long retraction when cut
respectively if you want Long retraction when cut enabled or disabled.
M620.11
command parameter asks for the previous extruder index for some movements that strictly speaking, should not need it. MFM is compatible withM620.11
and can do long retractions by tracking the previous tool.
Add MFM as a post-processing script if you want to automatically run MFM in your Slicer.
If you plan to do the processing through the standalone MFM GUI app, you can skip this step.
-
Set the settings view to Expert Mode in the upper right.
-
Print Settings > Output options > Post-processing scripts
-
Enable Advanced view for Process
-
Process > Others > Post-processing scripts
-
Create the MFM command text as described in MFM Command Setup
-
Add the final command text to Post-processing scripts
If you intend to add isolines and using Ironing on the top surface, the standard ironing inset will cover up the isoline color on the outer wall.
Set Ironing inset to your line width (nozzle diameter) multiplied between 1 and 1.25 to not obscure the isolines.
Slicer generated toolchange flushing volumes are readily mixed between all tools when processed with MFM so it is recommended to set all flushing volumes to the minimum amount needed between all colors (e.g. 107mm³) for consistency.
-
Determine the flushing volume between your 4 colors by running this calibration.
-
Find the minimum flushing volume needed for any color change. This should be ~107mm³.
-
If any color requires extra flushing volume beyond the minimum flushing volume, add that color index to the comma separated array for the key
extraPurgePreviousColors
the MFM Config Option JSON file. This will add an additional 150mm³ of flushing volume which can be increased by modifying the hard-coded flushing G-code inmfm/extra_purge.py
.