# Prusaslicer 2.5.0 Startup GCODE for varying material types

**URL:** <https://forum.lulzbot.com/t/prusaslicer-2-5-0-startup-gcode-for-varying-material-types/25055>\
**Category:** Software\
**Created:** [November 25, 2022, 8:43pm UTC](https://forum.lulzbot.com/t/prusaslicer-2-5-0-startup-gcode-for-varying-material-types/25055 "2022-11-25T20:43:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wrathernaut](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.lulzbot.com/wrathernaut/32/13542_2.png) [@Wrathernaut](https://forum.lulzbot.com/u/Wrathernaut)\
**Post date:** [November 25, 2022, 8:43pm UTC](https://forum.lulzbot.com/t/prusaslicer-2-5-0-startup-gcode-for-varying-material-types/25055/1 "2022-11-25T20:43:31Z")

</div>

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:

```auto
M109 R{material_soften_temperature} ; soften filament before homing Z

```

With this block:

```auto
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:

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

```

With this block:

```auto
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:

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

```

With this block:

```auto
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}

```

---

<div class="post-metadata">

**Author:** ![b-morgan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.lulzbot.com/b-morgan/32/11517_2.png) [@b-morgan](https://forum.lulzbot.com/u/b-morgan)\
**Post date:** [November 26, 2022, 2:48pm UTC](https://forum.lulzbot.com/t/prusaslicer-2-5-0-startup-gcode-for-varying-material-types/25055/2 "2022-11-26T14:48:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Wrathernaut](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.lulzbot.com/wrathernaut/32/13542_2.png) [@Wrathernaut](https://forum.lulzbot.com/u/Wrathernaut)\
**Post date:** [November 26, 2022, 4:34pm UTC](https://forum.lulzbot.com/t/prusaslicer-2-5-0-startup-gcode-for-varying-material-types/25055/3 "2022-11-26T16:34:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![DanBouchee](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@DanBouchee](https://forum.lulzbot.com/u/DanBouchee)\
**Post date:** [March 23, 2023, 5:17pm UTC](https://forum.lulzbot.com/t/prusaslicer-2-5-0-startup-gcode-for-varying-material-types/25055/4 "2023-03-23T17:17:05Z")

</div>

Greetings,  
I am a school teacher new to 3D printing but have been doing a lot lately. We have several Mini’s an Mini 2’s to use. Could you send a screenshot of what this code looks like in Prusa Slicer for PLA (for example)? I am currently using CURA LE but would love to try Prusa as well

Thank you

---

<div class="post-metadata">

**Author:** ![Wrathernaut](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.lulzbot.com/wrathernaut/32/13542_2.png) [@Wrathernaut](https://forum.lulzbot.com/u/Wrathernaut)\
**Post date:** [March 23, 2023, 8:10pm UTC](https://forum.lulzbot.com/t/prusaslicer-2-5-0-startup-gcode-for-varying-material-types/25055/5 "2023-03-23T20:10:27Z")

</div>

The code is all on the original post, you will just open up the printer settings → custom gcode section and look for the M109 commands in the startup gcode section.

Swap them out for the more complex code, and that’s all.

This screenshot is from an older version, but it shows you where you’re going for the edits. You may have to be in “expert” settings mode to see it.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/lulzbot/original/2X/3/347605cb58eaaea4919261fa15ebdb94cc9e7df5.jpeg)
