Skip to content

Instantly share code, notes, and snippets.

@randy3k
Created June 12, 2025 21:40
Show Gist options
  • Save randy3k/615f19167f13bf41b1ccbd883b5631bb to your computer and use it in GitHub Desktop.
Save randy3k/615f19167f13bf41b1ccbd883b5631bb to your computer and use it in GitHub Desktop.

Start G-code

G90 ; use absolute coordinates
M83 ; extruder relative mode

M140 S{first_layer_bed_temperature[0]} ; set final bed temp
M104 S{first_layer_temperature[0]} ; set final nozzle temp

G28 ; home all axis

M190 S{first_layer_bed_temperature[0]} ; wait for bed temp to stabilize
M109 S{first_layer_temperature[0]} ; wait for nozzle temp to stabilize

G29 ; Perform ABL with CR Touch (after both bed and nozzle are at temp)

G1 Z50 F240 ; (Optional: raise nozzle after probing for clearance)
G1 X2.0 Y10 F3000
G1 Z0.28 F240
G92 E0
G1 X2.0 Y140 E10 F1500 ; prime the nozzle
G1 X2.3 Y140 F5000
G92 E0
G1 X2.3 Y10 E10 F1200 ; prime the nozzle
G92 E0

End G-code

G91 ; Use relative positioning for Z move
G1 Z5 F600 ; Move print bed down 5mm (relative to current position)
G90 ; Switch back to absolute positioning
G28 X Y ; Home X and Y axes (moves nozzle to X0 Y0)
M140 S0 ; Turn off heatbed
M104 S0 ; Turn off nozzle temperature
M107 ; Turn off part cooling fan
M84 X Y E ; Disable X, Y, and Extruder motors (Z motor typically stays enabled)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment