Notifications
Clear all

Custom g code to adjust layer temperature  

  RSS
buckeyestargazer
(@buckeyestargazer)
Estimable Member
Custom g code to adjust layer temperature

I'd like to play around with print temps a little bit but I don't have a good grasp of altering the gcode so could use a little help.

For info, in the Filament Settings the first layer temperature is set at 230C, and other layers if 230C.  

What I want to happen is that right after the intro line/prime line is printed the nozzle temp goes up to 250C, then after the first layer the temp goes back down to 230C.  I have my reasons for wanting to do it this way vs just setting the first layer temp in the filament settings.

I worked out setting the temp to 250C after the prime line (M104 S250 ; set extruder temp).

What I can't figure out is how to set the temp back to 230 after the first layer.  

Thanks in advance.

Posted : 10/11/2021 7:16 pm
bobstro
(@bobstro)
Illustrious Member
Temperature tower with a twist?

This is pretty common with temperature towers. I have a documented example here that might be useful.

From what you're describing, it sounds like you want the 1st layer to complete, then on layer change, reduce the temperature and wait for it to cool down before printing the 2nd layer. Is that correct? Replacing M104 with M109 and using [layer_num] instead of [layer_z] should work in that case, but you'll want to move the nozzle away from the print while it cools. If you really want the prime line to print at 230C, you can insert the change to 250C after the line prints in your start gcode.

If you'd care to elaborate on your reasons for doing so, there might be some other good suggestions.

My notes and disclaimers on 3D printing

and miscellaneous other tech projects
He is intelligent, but not experienced. His pattern indicates two dimensional thinking. -- Spock in Star Trek: The Wrath of Khan

Posted : 10/11/2021 7:33 pm
buckeyestargazer
(@buckeyestargazer)
Estimable Member
Topic starter answered:
RE: Custom g code to adjust layer temperature

 

Posted by: @bobstro

This is pretty common with temperature towers. I have a documented example here that might be useful.

From what you're describing, it sounds like you want the 1st layer to complete, then on layer change, reduce the temperature and wait for it to cool down before printing the 2nd layer. Is that correct? Replacing M104 with M109 and using [layer_num] instead of [layer_z] should work in that case, but you'll want to move the nozzle away from the print while it cools. If you really want the prime line to print at 230C, you can insert the change to 250C after the line prints in your start gcode.

If you'd care to elaborate on your reasons for doing so, there might be some other good suggestions.

Actually I don't need to wait for it to cool before layer 2 starts.  I just want the temp to go where the Filament Settings/Other Layers is set after the first layer.  If I use M104 to set the layer 2 temp, then wouldn't that render the Filament Settings irrelevant?  In that case, if I later change the the temp in Filament Settings it will have no effect.

As for why...
1.  I have found that setting the nozzle temp at 230C results in much less oozing before the print starts.  But...
2.  I have found that printing at 250C for the first layer results in a much better and more consistent first layer.  But...
3.  I have found that printing the whole model at 250C results in more stringing.

So if I set the first layer at 250C and the nozzle heats up to that before any printing starts I get a fair bit of oozing.  (Note that I have the nozzle heat to 160C and wait until the bed heats up, then after mesh bed leveling the nozzle heats up fully.)

Posted : 10/11/2021 7:47 pm
bobstro
(@bobstro)
Illustrious Member
Tweaking start gcode should work
Posted by: @buckeyestargazer

 Actually I don't need to wait for it to cool before layer 2 starts.  I just want the temp to go where the Filament Settings/Other Layers is set after the first layer.

That simplifies things then. You can just use before layer change gcode.

  If I use M104 to set the layer 2 temp, then wouldn't that render the Filament Settings irrelevant?  In that case, if I later change the the temp in Filament Settings it will have no effect.

It's really a question of how elaborate you want to get. You could use something like M104 S[temperature] to set the nozzle to your normal (non-1st layer) temp in the gcode (assuming you're using PrusaSlicer).

As for why...
1.  I have found that setting the nozzle temp at 230C results in much less oozing before the print starts.  But...

Ah. Are you familiar with the "2 step" warmup procedure to avoid nozzle ooze during mesh bed leveling? There are lots of variations, but I have an example here that shows the approach.

2.  I have found that printing at 250C for the first layer results in a much better and more consistent first layer.  But...
3.  I have found that printing the whole model at 250C results in more stringing.

So if I set the first layer at 250C and the nozzle heats up to that before any printing starts I get a fair bit of oozing.  (Note that I have the nozzle heat to 160C and wait until the bed heats up, then after mesh bed leveling the nozzle heats up fully.)

Sounds like you are doing a 2 step warmup... so it's stringing from the prime line to the print at 250C that is the problem? I put a little non-extruding "wipe" move at the end of my prime line to trap this sort of ooze.

By default, the start gcode sets the nozzle to your first layer temp and prints the prime line. There's no reason you can't customize it (see examples) to print the prime line at your non-first layer temp, then raise nozzle temp to print 1st layer.

 

My notes and disclaimers on 3D printing

and miscellaneous other tech projects
He is intelligent, but not experienced. His pattern indicates two dimensional thinking. -- Spock in Star Trek: The Wrath of Khan

Posted : 10/11/2021 8:05 pm
buckeyestargazer
(@buckeyestargazer)
Estimable Member
Topic starter answered:
RE: Custom g code to adjust layer temperature

Sounds like you are doing a 2 step warmup... so it's stringing from the prime line to the print at 250C that is the problem? I put a little non-extruding "wipe" move at the end of my prime line to trap this sort of ooze.

Yes, I'm doing a two step warm up.  It's not just stringing from the prime line to the print.  Before that, as the nozzle heats up, I get a lot of oozing out of the nozzle before the prime line.  If I keep the nozzle at 230C before the prime line I don't get nearly as much.  Do you have an example of your "non-extruding wipe"?  

By default, the start gcode sets the nozzle to your first layer temp and prints the prime line. There's no reason you can't customize it (see examples) to print the prime line at your non-first layer temp, then raise nozzle temp to print 1st layer.

In my first attempt I simply put M104 S250 after the prime line.  That resulted in the prime line printing at 230C (I had set the first layer temp AND other layers temp in Filament Settings, BOTH at 230C), and then the nozzle heated up to 250C after the prime line.  The problem was that after the first layer the nozzle stayed at 250C, rather than go back to 230C.  However I have since discovered that as long as I don't have the same temp in First layer and Other layers, the nozzle temp will go back to the Other layers temp after the first layer. 

Examples:
1. g code includes M104 S250 after the prime line
Filament Settings/First layer set to 230C
Filament Settings/Other layers set to 230C
In this scenario the prime line is printed at 230C, the nozzle heats up to 250C after the prime line, but the nozzle does not go to 230C after the first layer. 

2. g code includes M104 S250 after the prime line
Filament Settings/First layer set to 231C
Filament Settings/Other layers set to 230C
In this scenario the prime line is printed at 231C, the nozzle heats up to 250C after the prime line, and does go to 230C after the first layer. 

This is a clunky way to do what I'm after, but it works.  

Posted : 10/11/2021 9:30 pm
Share: