Different temperature for first (few) layer

To improve bed adhesion it is often useful to print the first few layers with a slightly warmer hotend and bed.

In other slicers this is generally just applied to the first layer, but having the number of layers configurable would be nice.

This seems like it would be covered by the settings by layer grouping request.

Hi! We’ve put this off because we’re still working on how we want to handle slicing settings changing per Z-height and per region of the model. Eventually we want all slicing settings to be editable for practically any part of the print, but it’ll take some time to get there.

In the meantime, you can change printing temperatures at different layer heights by adding something like the following to your layer change gcode:

{# Adjust nozzle temp for layer 2 #}
{% if state/Z == 0.4 %}
M104 S210 ; Set nozzle temp to 210C
{% endif %}

You can add one of those for each z-height that you want to change the temperature at. Sorry, I know it’s not the most elegant solution, especially since you’re using Z-height and not layer number, which means if you change layer height you’ll need to adjust the script. I’ll see about adding layer numbers as a variable in the scripting…

1 Like

Gabe no worries. The fact that I can actually script this is quite extraordinary.

Just FYI the example script under conditions is misleading as it states that state/Z == 10 is layer 10. https://docs.pathio.xyz/pathio/latest/features/scripting.html#conditions

Any plans for arithmetic eg.

{{ nozzle_temp_0+5 }}

?

Good catch, thanks. I’ll update the docs. I’m still learning all of the ins and outs of scripting, and we keep updating it to make it better :joy:.

(For example I just learned that you can do {# A comment #} and it won’t actually go in your gocde, it’s a comment to the scripting engine!)

As for maths, yes, you can do them currently in a round-about way:

M104 S{{ addition(nozzle_temp_0, 10) }} ; Increase HotEnd temperature by 10 deg
G1 X10 Y10                              ; Move to a spot
G1 E10                                  ; Extrude a little bit
M104 S{{ subtract(nozzle_temp_0, 25) }} ; Set a lower-than-normal temperature while wiping the nozzle
G1 X25                                  ; Wipe nozzle
M104 S{{ nozzle_temp_0 }}               ; Set HotEnd temperature back to normal