Example program · 3D printing

Marlin End G-code: Retract, Park and Cool Down — G-Code Example

An end code that lifts away from the part without leaving a blob, presents the bed and turns everything off.

By cnccode · Updated
On this page
  1. Program
  2. How it works
  3. Codes used in this program
  4. More 3D printing programs

An end code that lifts away from the part without leaving a blob, presents the bed and turns everything off.

ItemValue
Machine3D printer (Marlin)
UnitsMetric
Lines11

Program

G-code
; --- end (Marlin) ---
G91                 ; relative
G1 E-2 F2700        ; retract
G1 Z5 F600          ; lift
G90                 ; absolute
G1 X0 Y200 F6000    ; present the bed (check your bed size)
M106 S0             ; fan off
M104 S0             ; nozzle off
M140 S0             ; bed off
M84 X Y E           ; motors off, keep Z
M300 S880 P200      ; beep

▶ Check it in the 3D printer simulator

How it works

  • G91 makes the lift relative, so it works at any print height.
  • Z stays powered so a heavy gantry does not drop onto the part.

Codes used in this program

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

Was this page helpful?