Skip to content

Instantly share code, notes, and snippets.

@mfrederickson
Last active January 10, 2024 12:07
Show Gist options
  • Star 24 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save mfrederickson/e0f18f8ce6495bb9f08030f05ec1a32b to your computer and use it in GitHub Desktop.
Save mfrederickson/e0f18f8ce6495bb9f08030f05ec1a32b to your computer and use it in GitHub Desktop.
anet a8 start/end gcode
M104 S0 ; turn off extruder
M140 S0 ; turn off heatbed
M107 ; turn off fan
G91 ; relative positioning
G1 Z25 ; raise head 25mm
G90 ; back to absolute positioning
G1 X0 Y220; home X axis and push Y forward
M84 ; disable motors
G21 ; set units to millimeters
G90 ; use absolute positioning
M82 ; absolute extrusion mode
M104 S{material_print_temperature_layer_0} ; set extruder temp
M140 S{material_bed_temperature_layer_0} ; set bed temp
G28 X0 Y0 ;move X/Y to min endstops
G28 Z0 ;move Z to min endstops
G29
M190 S{material_bed_temperature_layer_0} ; wait for bed temp
M109 S{material_print_temperature_layer_0} ; wait for extruder temp
G0 X0 Y15 F9000 ; Go to front
G0 Z0.15 ; Drop to bed
G92 E0 ; zero the extruded length
G1 X40 E25 F500 ; Extrude 25mm of filament in a 4cm line
G92 E0 ; zero the extruded length
G1 E-1 F500 ; Retract a little
G1 X80 F4000 ; Quickly wipe away from the filament line
G1 Z0.3 ; Raise and begin printing.
@baui75
Copy link

baui75 commented Apr 20, 2019

So Nice !!! Thank You

@hackerspace09
Copy link

What did you use to upload the code to your printer.

@mfrederickson
Copy link
Author

mfrederickson commented May 7, 2020

@hackerspace09 it's been a while, but I believe it was under GCODE Scripts, under OctoPrint Settings.

@ceryswatts20
Copy link

Is this the start/end gcode for the printer or extruder?

@mfrederickson
Copy link
Author

Both, I believe (based on the comments).

@amatulic
Copy link

What does "raise head 25 mm" do if the head is less than 25 mm from its maximum height?

I'd rather eliminate the relative positioning and use what Prusa does:

{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+25, max_print_height)} F720 {endif}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment