Example program · 3D printing
Marlin Start G-code with Mesh, Prime Line and Safe Heating — G-Code Example
A clean start code for Marlin printers with a probe: bed first, nozzle warm but not oozing while probing, then a double prime line. Replace the temperatures with your slicer placeholders.
A clean start code for Marlin printers with a probe: bed first, nozzle warm but not oozing while probing, then a double prime line. Replace the temperatures with your slicer placeholders.
| Item | Value |
|---|---|
| Machine | 3D printer (Marlin) |
| Units | Metric |
| Lines | 19 |
Program
; --- start (Marlin) ---
G21 ; mm
G90 ; absolute positions
M83 ; relative extrusion
M140 S60 ; bed: start heating
M104 S150 ; nozzle: warm, no ooze
G28 ; home
M190 S60 ; wait for bed
G29 ; probe mesh (or M420 S1 to load a saved mesh)
M109 S210 ; wait for nozzle
G1 Z2 F600
G1 X5 Y20 F6000
G1 Z0.3 F600
;TYPE:Skirt
G1 Y120 E12 F1200 ; prime line 1
G1 X5.4 F3000
G1 Y20 E12 F1200 ; prime line 2
G1 Z1 F600
G92 E0▶ Check it in the 3D printer simulator
How it works
- The nozzle stays at 150 °C until the mesh is probed, so no blob falls under the probe.
- M83 makes every E value the length of that move, which is easier to check and safer to edit.
- In PrusaSlicer use [first_layer_bed_temperature] and [first_layer_temperature] instead of 60 and 210.
Codes used in this program
- M140 — Set bed temperature (no wait)
- M104 — Set hotend temperature (no wait)
- G28 — Home axes
- M190 — Set bed temperature and wait
- G29 — Bed levelling (probe the mesh)
- M109 — Set hotend temperature and wait
- M83 — Auto Air Jet On (Haas)
- G92 — Set position (G92 E0)
Check bed size, temperatures, probe and macro names against your own printer before you use this code, and stay at the printer for the first run.
More 3D printing programs
- Marlin End G-code: Retract, Park and Cool Down
- Klipper PRINT_START Macro with Adaptive Mesh and Purge
- Klipper PRINT_END Macro That Parks Safely at Any Height
- Klipper M600 Filament Change Macro
- E-steps Calibration Sequence (Marlin)
Was this page helpful?