prusa3d / PrusaSlicer

G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)
https://www.prusa3d.com/prusaslicer/
GNU Affero General Public License v3.0
7.76k stars 1.93k forks source link

Temperature for second layer is emitted at wrong place #9899

Open NeilW999 opened 1 year ago

NeilW999 commented 1 year ago

Description of the bug

I would expect the "Other_layers" tempertaure which effects all layers after the first to be emmited before or between custom G-code for layer changes. Interestingly this differs from the behavior of Slic3r which emits the temperature change before both of the custom G-code for layer change.

I have a Revo nozzle and want to always print at a slightly higher temperature for all filaments. It is easy to change the first layer temperature in the custom "Start G-code". However I can't change the temperature of the second layer because Prusaslicer outputs the "Other layer" temperature after the custom G-code for layer changes. My initial approach was to add the following line to the "After layer change G-code":

;AFTER_LAYER_CHANGE ; Z [layer_z] N [layer_num] H1=[first_layer_height] HN=[layer_height] {if layer_z > first_layer_height }M104 S{temperature[0]+10} ; set Nozzletemp Add 10 for Revo{endif}

This results in the following output at the second layer change.

Screenshot Body1 Gcode

Project file & How to reproduce

To reproduce. Add custom code to the "After layer custom G-code" and set the "Other layers temperature" to a different value to the "First layers temperature".

Body1.zip

Checklist of files included above

Version of PrusaSlicer

2.5.0+win64 and 2.6.0-alpha4+win64

Operating system

Windows 10

Printer model

Prusa MK3S+

tjhalva commented 1 year ago

Might be related to: https://github.com/prusa3d/PrusaSlicer/issues/8911

NeilW999 commented 1 year ago

Might be related to: #8911

I looked at this before posting this issue and I think this issue is quite different. If "Other layer temperature" is different to first layer then the G-code to change temperature is emmited at the wrong point, which is after both custom G-codes for layer change. The temperature should be written between or before the custom G-codes for layer change so the user can overide it.

It is not ignoring the temperature as #8911 states. This is about when the temperate G-code is output for the second layer.