Can't change temperature for the Second Layer
 
Notifications
Clear all

Can't change temperature for the Second Layer  

  RSS
Neil
 Neil
(@neil-4)
Active Member
Can't change temperature for the Second Layer

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"

{if layer_num == 1 }M104 S{temperature[0]+10} ; set extruder temp Add 10 for Revo{endif}

The resultsing G-code is:

;AFTER_LAYER_CHANGE
;0.4
M104 S220 ; set extruder temp Add 10 for Revo
M104 S210 ; set temperature
; printing object Body1.stl id:0 copy 0

Does anyone have any idea how I might automatically change the second layer temperature through custom G-code?

Posted : 27/02/2023 9:44 am
Stefan
(@stefan-3)
Estimable Member
RE: Can't change temperature for the Second Layer

automatically change the second layer temperature

one simple solution would be to modify the default filament profile and save it with a new name like "..._Revo". Increase the temperature for "other layers" and save it as a own custom preset.

Posted : 27/02/2023 10:22 am
fuchsr
(@fuchsr)
Famed Member
RE:

@stefan, I don't think that's what the OP wants. If I understand correctly, he'd like to use gcode to automagically up *any* filament profile by 10 degrees.

@neil, I don't see how you can use before or after layer gcode to make it happen. However, one idea is to use the "template custom gcode" field. Add this to the template custom gcode field and save the new printer profile:

M104 S{temperature[0]+10} ; set extruder temp Add 10 for Revo

Then in slicer preview, in the vertical scroll bar go to layer 2, right click (or control-click) on the plus button and select Add custom template (basically like a color change or pause but using. the code from the template field). 

If you check the resulting gcode, it will first set it to the 2nd layer temp per the filament settings, and then set it to 10 degrees higher per your template gcode. 

It's an extra step to add that extra template gcode at layer 2 in the slicer preview but it is the best I can think of to get you to where you want to be.

This post was modified 1 year ago by fuchsr
Posted : 28/02/2023 2:54 am
Neil
 Neil
(@neil-4)
Active Member
Topic starter answered:
RE: Can't change temperature for the Second Layer

Thanks, I will give that a try. I used to do a lot of printing with a hardened steel nozzle and had a similar problem. I made custom filaments as Stefan suggested but it became difficult to manage and I was frequently forgetting to select the correct filament.

I feel that the second layer nozzle ( and presumably bed } temperature should really be emitted by Prusaslicer between the "Before layer" and "After layer" custom G-codes. However there might be a good reason why they aren't?

If nobody knows maybe I should raise an issue on GitHub for Prusaslicer to get an answer?

Posted : 28/02/2023 10:23 am
Neil
 Neil
(@neil-4)
Active Member
Topic starter answered:
RE: Can't change temperature for the Second Layer

I tried inserting custom G-code and after a bit of fiddling with the mouse it worked. So for my second attempt I tried a real example where I tried to print two objects out with sequential printing. I immediatly hit two problems. Prusaslicer won't let you insert custom G-code when doing sequential printing and my initial attempt at G-code doesn't work because layer_num does not reset with with each object.

Therefore I rewrote G-code to work on layer_z:

;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}

So at least I get the right temperature for every layer other than the second. Sadly it looks like I'm going to have to go down the custom filament route instead.

Posted : 01/03/2023 9:45 am
Beeker
(@beeker)
Active Member
RE:

I'm trying to switch to PrusaSlicer from Ideamaker for a Raise3d Pro3. I'm not sure I understand the drawback of inserting the tool number [T0] in the M104 line when outputing to Marlin? It works if you "fake" another extruder to be in use in the print, but it seems to be trying to be too clever and removes it if only one tool is used. It does it correctly when you output into Reprap but it uses the G10 code (G10 P0 S210 ; set temperature) which seems to be ignored by the borked version in use by Raise3d. 

I haven't tested other layer changes to temperature which I will desperately need printing thin nylon objects, but I assume the behaviour will be the same....

This post was modified 1 year ago by Beeker
Posted : 08/03/2023 9:32 pm
Share: