Prusaslicer 2.5.0 Startup GCODE for varying material types

I was thinking of ways around Prusaslicer 2.5.0 (still) not supporting wipe, probe, and soften temps and started diving into the fields for filament we do have.

What many of us have done is to make separate machine profiles for each filament type with hard-coded soften, wipe and probe temps, but by looking at what we can do with variables and macros in Prusaslicer 2.5.0, I’ve put together this startup code to select the correct temperatures based on the filament’s material type parameter, hopefully making it a little easier for those using this slicer. It’s not perfect, as there isn’t the fine control allowed with per-filament settings like CuraLE, but until somebody makes a plugin that puts those fields in for all filament, I think this is the best solution.

For this list, I used CuraLE’s settings for the most generic looking of the materials, and if there were multiple with varying temperatures, I just went with an average. PLA is probably the worst, since there’s sooooooooooooo many PLA variants with HT PLA, PLA+, Pro PLA, etc, with generic PLA listing the soften temp at 140 and Pro PLA at 180.

edit: Don’t forget to also change the other variable references for temperatures throughout the startup code when making your PrusaSlicer startup gcode!

When copying over from Cura LE, you’ll replace the soften temp line:

M109 R{material_soften_temperature} ; soften filament before homing Z

With this block:

M109 {if filament_type[0] == "PLA"}R160 ; {filament_type[0]} soften temp before homing Z
     {elsif filament_type[0] == "ABS"}R175 ; {filament_type[0]} soften temp before homing Z
     {elsif filament_type[0] == "ASA"}R170 ; {filament_type[0]} soften temp before homing Z
     {elsif filament_type[0] == "FLEX"}R180 ; {filament_type[0]} soften temp before homing Z
     {elsif filament_type[0] == "PET"}R170 ; {filament_type[0]} soften temp before homing Z
     {elsif filament_type[0] == "HIPS"}R170 ; {filament_type[0]} soften temp before homing Z
     {elsif filament_type[0] == "NYLON"}R185 ; {filament_type[0]} soften temp before homing Z
     {elsif filament_type[0] == "PC"}R180 ; {filament_type[0]} soften temp before homing Z
     {else}R170; unknown filament type soften temp before homing Z{endif}

and the wipe temp line:

M109 R{material_wipe_temperature}                  ; wait for extruder to reach wiping temp

With this block:

M109 {if filament_type[0] == "PLA"}R160 ; wait to reach {filament_type[0]} wiping temp
     {elsif filament_type[0] == "ABS"}R170 ; wait to reach {filament_type[0]} wiping temp
     {elsif filament_type[0] == "ASA"}R170 ; wait to reach {filament_type[0]} wiping temp
     {elsif filament_type[0] == "FLEX"}R180 ; wait to reach {filament_type[0]} wiping temp
     {elsif filament_type[0] == "PET"}R170 ; wait to reach {filament_type[0]} wiping temp
     {elsif filament_type[0] == "HIPS"}R170 ; wait to reach {filament_type[0]} wiping temp
     {elsif filament_type[0] == "NYLON"}R185 ; wait to reach {filament_type[0]} wiping temp
     {elsif filament_type[0] == "PC"}R170 ; wait to reach {filament_type[0]} wiping temp
     {else}R170; unknown filament type wiping temp{endif}

and lastly, the probe temp line:

M109 R{material_probe_temperature} ; wait for extruder to reach probe temp

With this block:

M109 {if filament_type[0] == "PLA"}R140 ; wait to reach {filament_type[0]} probe temp
     {elsif filament_type[0] == "ABS"}R170 ; wait to reach {filament_type[0]} probe temp
     {elsif filament_type[0] == "ASA"}R160 ; wait to reach {filament_type[0]} probe temp
     {elsif filament_type[0] == "FLEX"}R180 ; wait to reach {filament_type[0]} probe temp
     {elsif filament_type[0] == "PET"}R170 ; wait to reach {filament_type[0]} probe temp
     {elsif filament_type[0] == "HIPS"}R170 ; wait to reach {filament_type[0]} probe temp
     {elsif filament_type[0] == "NYLON"}R185 ; wait to reach {filament_type[0]} probe temp
     {elsif filament_type[0] == "PC"}R160 ; wait to reach {filament_type[0]} probe temp
     {else}R170; unknown filament type probe temp{endif}

Excellent work! Even if you did misplace one “{” in the last line of the probe temp block :grinning:

1 Like

Great catch. Fixed it there, and in my own machine now.

And I just tested and looks like you can type your own filament type in the filament type field in PrusaSlicer (in addition to the default filament types in the dropdown) … so I’ll add a few more types to the code (HTPLA, PLA+, etc.) and update.