Skip to content

Instantly share code, notes, and snippets.

@majabojarska
Last active January 3, 2026 08:32
Show Gist options
  • Select an option

  • Save majabojarska/ab621b1598fb618090dc1bb583c1b0bc to your computer and use it in GitHub Desktop.

Select an option

Save majabojarska/ab621b1598fb618090dc1bb583c1b0bc to your computer and use it in GitHub Desktop.
Creality Ender 3 custom start and end G-codes
; Ender 3 custom end GCode
G91 ;Relative positioning
G1 E-2 F2700 ;Retract a bit
G1 E-2 Z0.2 F2400 ;Retract and raise Z
G1 X5 Y5 F3000 ;Wipe out
G1 Z10 ;Raise Z more
G90 ;Absolute positioning
G1 X0 Y{machine_depth} ;Present print
M106 S0 ;Turn-off fan
M104 S0 ;Turn-off hotend
M140 S0 ;Turn-off bed
M84 X Y E ;Disable all steppers but Z
; Ender 3 Custom End G-code
M400 ; Wait for current moves to finish
M220 S100 ; Reset Speed factor override percentage to default (100%)
M221 S100 ; Reset Extrude factor override percentage to default (100%)
G91 ; Set coordinates to relative
G1 E-2 F2700 ;Retract a bit
G1 E-2 Z0.2 F2400 ;Retract and raise Z
G1 X5 Y5 F3000 ;Wipe out
G0 F5000 Z20 ; Move Z Axis up 20mm to allow filament ooze freely
G90 ; Set coordinates to absolute
G0 X0 Y235 F5000 ; Move Heat Bed to the front for easy print removal
M106 S0 ;Turn-off fan
M104 S0 ;Turn-off hotend
M140 S0 ;Turn-off bed
M84 ; Disable stepper motors
; End of custom end GCode
; Ender 3 Custom Start G-code
; Set initial bed temperature
M140 S{material_bed_temperature_layer_0} ; Set target initial bed temperature
M104 S130.0; Set initial Extruder temperature
; Homing
G28 ; Home all axes
G29 ; Auto bed-level (BL-Touch)
M420 S1; Enable bed leveling
G1 X0.1 Y20 Z10 F5000.0 ; Move to start position
G92 E0 ; Reset Extruder
M190 S{material_bed_temperature_layer_0} ; Wait for target bed temperature
M109 S{material_print_temperature_layer_0} ; Wait for target Extruder temperature
; End of custom start GCode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment