Prusa Slicer: How to Increase Initial Purge Line Length
I primarily print single color prints but I have a MMU3 installed atop my Core One via a CoreBoxx because I like to use it as a color selector for keeping 5 of my most used filaments loaded.
Overall, this works nicely but I’ve been running into an issue where the color of a previous print will bleed into the next one because the printer isn’t purging enough before starting the print. This primarily happens when the previously printed part was black.
PrusaSlicer has a lot of awesome config options available including the ability to customize purge amount for the purge tower (for mid print color changes) but surprisingly as of 2.9.4, there’s no config for controlling the initial purge line. The good news is that PrusaSlicer supports customizing the printer’s gcode including it’s start gcode so with a bit of fiddling we can customize the purge line ourselves.
Modifying The Start G-Code
Open up PrusaSlicer and navigate to Printers -> Custom G-Code and look for the “Extrude purge line” gcode in the Start G-code section.
You may need to scroll down to find it, it should look something like the following.
;
; Extrude purge line
;
G92 E0 ; reset extruder position
G1 E{(filament_type[initial_tool] == "FLEX" ? 4 : 2)} F2400 ; deretraction after the initial one before nozzle cleaning
G0 E5 X235 Z0.2 F500 ; purge
G0 X145 E36 F500 ; purge
G0 X135 E4 F500 ; purge
G0 X125 E4 F650 ; purge
G0 X122 Z0.05 F8000 ; wipe, move close to the bed
G0 X119 Z0.2 F8000 ; wipe, move quickly away from the bed
The following lines are of interest:
G0 X145 E36 F500 ; purge
G0 X135 E4 F500 ; purge
G0 X125 E4 F650 ; purge
G0 X122 Z0.05 F8000 ; wipe, move close to the bed
G0 X119 Z0.2 F8000 ; wipe, move quickly away from the bed
G0 is the rapid move instruction and we can interpret the lines as:
- Move the printer to X 145 with a feed rate (travel speed) of 500mm/s while extruding 36mm of filament.
- Move the printer to X 135 with a feed rate of 500mm/s while extruding 4mm of filament.
- Move the printer to X 125 with a feed rate of 650mm/s while extruding 4mm of filament.
- Move the printer to X 122 and Z 0.5 (move it up further from the bed)with a feed rate of 8000mm/s
- Move the printer to x 119 and Z 0.2 with a feed rate of 8000mm/s
For my needs, I want to increase the length of the purge line by about 20mm because I’m only seeing a touch of color bleeding into the start of my prints.
The first step is going to be to adjust the X coordinate of each instruction by 20mm.
G0 X125 E36 F500 ; purge
G0 X115 E4 F500 ; purge
G0 X105 E4 F650 ; purge
G0 X102 Z0.05 F8000 ; wipe, move close to the bed
G0 X99 Z0.2 F8000 ; wipe, move quickly away from the bed
Then we’ll want to increase the amount of filament extruded in the first line since the travel distance has gone from 90mm to 110mm (the printer started from X 235). I’m going to up the filament to 44mm because the stock setup was extruding 4mm of filament per 10mm of travel (90mm travel / 36mm filament = 4mm filament per 10mm travel)
The first instruction will now be: G0 X125 E44 F500 ; purge
Bringing it all together now:
G0 X125 E44 F500 ; purge
G0 X115 E4 F500 ; purge
G0 X105 E4 F650 ; purge
G0 X102 Z0.05 F8000 ; wipe, move close to the bed
G0 X99 Z0.2 F8000 ; wipe, move quickly away from the bed
And just like that the purge line is now 20mm longer. If you don’t already have a custom printer profile setup I’d suggest creating one now, and saving the g code to it. You’ll also need to reslice every file that needs the longer purge line.
Testing the Change
This is a pretty simple change so I felt safe running it on my printer (while supervising it) but if you’re worried about it you can always slice a test file and review the G code steps in Prusa’s GCode Viewer.
Normally the purge line stops at the edge of the Prusa logo on the bed sheet but now it travels almost completely across the logo due to the extra 20mm. I can also confirm this fixed my color bleed issue.