• Models
  • Contests
  • Slicer
  • Login
  • Start Here
    thingiverse-iconprintables-iconcults3d-iconmakerworld-iconmyminifactory-icon

    3D GO

    3D ModelsContestsCollectionsSaved ModelsOn a mobile device?

3D GO

Privacy Policy
Temperature Tower auto g-code insertion to set temps automatically - Tune PETG for no stringing 3D Printer File Image 1
Temperature Tower auto g-code insertion to set temps automatically - Tune PETG for no stringing 3D Printer File Image 2
Temperature Tower auto g-code insertion to set temps automatically - Tune PETG for no stringing 3D Printer File Thumbnail 1
Temperature Tower auto g-code insertion to set temps automatically - Tune PETG for no stringing 3D Printer File Thumbnail 2

Temperature Tower auto g-code insertion to set temps automatically - Tune PETG for no stringing

DockGuy avatarDockGuy

March 12, 2026

printables-icon
DescriptionCommentsTags

Description

Rather than setting layer temperatures manually for a temp tower, just include one line of G-custom code in PrusaSlicer's “before layer change G-code" section to do it automatically. You can use the attached .3mf file as a starting point for PLA, ABS, and PETG. Or manually import an .stl file and modify the G-code per the guide below. 

Todo: use Prusaslicer v2.9.4 to automatically add debossed identification text to the model rather than use preconfigured .stls.

;Dockguy's temp tower layer height generator for PrusaSlicer
;
;Add the following to the Prusaslicer setting "Before layer change G-code" on the advanced printer settings tab:
;
;M109 S{d - (a * int((layer_z - b) / c))}
;
;where
; a == temperature step down per level (°C)
; b == thickness of bottom platform before the temp tower (mm) (1mm in example stl)
; c == thickness of each temp tower level (mm) (6.8mm in example .stl)
; d == maximum temperature to print (°C)
;
;
;Example for PLA course tuning 220->180°C:
M109 S{220-(5*int((layer_z-1)/6.8))}
;
;Example for PLA fine tuning where 210 was the best, test 218->202 in 2° steps:
M109 S{218-(2*int((layer_z-1)/6.8))}
;
;
;Example for PETG course tuning 260->220°C:
M109 S{260-(5*int((layer_z-1)/6.8))}
;
;Example for PETG fine tuning where 230 was the best, test 238->222 in 2° steps:
M109 S{238-(2*int((layer_z-1)/6.8))}
;
;
;Example for ABS/ASA course tuning 260->230°C:
M109 S{260-(5*int((layer_z-1)/6.8))}
;
;Example for ABS/ASA fine tuning where 240 was the best, test 248->232 in 2° steps:
M109 S{248-(2*int((layer_z-1)/6.8))}
;
;
;
;M104 vs M109
;
; M109 can have negative side effects on consistency since there may be a short pause before each layer. If you notice this, you can use M104 instead.
;
;G-code block that accounts for multiple filament types:
;
{if filament_type[0]=~/.*PLA.*/} M109 S{220-(5*int((layer_z -1)/6.8))}
{elsif filament_type[0]=~/.*PETG.*/} M109 S{260-(5*int((layer_z-1)/6.8))}
{elsif filament_type[0]=~/.*ABS.*/} M109 S{260-(5*int((layer_z-1)/6.8))}
{else} M109 S{250-(5*int((layer_z-1)/6.8))}
{endif}

License:

Creative Commons — Attribution — Noncommercial — Share Alike

Related Models

#3DBenchy - The jolly 3D printing torture-test by CreativeTools.se preview image

#3DBenchy - The jolly 3D printing torture-test by CreativeTools.se

CreativeTools profile image

CreativeTools

90,836

Important information sign for 3D printers / Wichtiges Hinweisschild für 3D-Drucker :) preview image

Important information sign for 3D printers / Wichtiges Hinweisschild für 3D-Drucker :)

Pat_S profile image

Pat_S

sign: don't touch my 3d printer preview image

sign: don't touch my 3d printer

Izzodesign74 profile image

Izzodesign74

554

Self-Watering Planter (Small) preview image

Self-Watering Planter (Small)

parallelgoods profile image

parallelgoods

73,105

X, Y and Z calibration tool for IDEX / dual extruder / dual color 3D printers preview image

X, Y and Z calibration tool for IDEX / dual extruder / dual color 3D printers

Voxel3D_NL profile image

Voxel3D_NL

202

Gift Box preview image

Gift Box

roby85r profile image

roby85r

1,498

All In One 3D Printer test preview image

All In One 3D Printer test

majda107 profile image

majda107

64,457

axes calibrage cube-xyz for 3d printers preview image

axes calibrage cube-xyz for 3d printers

H- printed profile image

H- printed

9

7