GCode

G-code is the most-used programming language for controlling industrial and hobby machines, such as vinyl cutters, mills, laser cutters, and 3D printers. The G-code “tells” the computerized machines how to make things by specifying coordinates in the X, Y, and Z planes. It instructs the machines where to move, how fast to move, and when to engage the tool. - all3dp / RepRap doc

Simulator

G code stack

Klipper

  1. [homing_override] (G28)
 ; G0  Z10              ; lift nozzle to clear bed hardware
 ; lift nozzle to clear bed hardware (safely)
 FORCE_MOVE STEPPER=stepper_z DISTANCE=10 VELOCITY=5
 G28 X0
 G28 Y0
 G1 X10 Y175            ; a place for 2 probing
 G28 Z0

Octoprint

  1. Before print job starts
  2. After print job completes
  3. After print job is cancelled
G91
G1 Z10 ;  move head
G1 X0 Y 190
M104 S0     ;extruder heater off
M106 S255   ;start fan full power
M107 ; nose fan off
G90
  1. After print job is paused
  2. Before print job is resumed
  3. After connection to printer is established

Cura

Preferences/Configure Cura/Printers/Machine settings

  1. Start Code
;Gcode by Cura
G90 ;absolute positioning
M106 S250 ;fan on for the palpeur

M109 S{print_temperature} ; set temperature (wait)
; M140 S{material_bed_temperature}

;Activation palpeur
BED_MESH_CALIBRATE  ; includes homing

; first point contact
; M107 ;start with the fan off
G1 X190 Y10 F3000     ; landing point
G1 Z0.5               ; safe height => need to be adjusted

M82 ;set extruder to absolute mode
G92 E0 ;zero the extruded length
G1 F200 E10 ;extrude 10mm of feed stock
G92 E0 ;zero the extruded length again
G1 Z3
G1 F3000
  1. End Code
M104 S0     ;extruder heater off
M106 S255   ;start fan full power
;M140 S0   ;heated bed heater off (if you have it)
;Home machine
G91   ;relative positioning
G1 E-1 F{retraction_speed} ;retract the filament a bit before lifting the nozzle, to release some of the pressure
G1 Z+3 F3000  ;move Z up a bit and retract filament even more
G90
G28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way
;Ventilation forcee
G4 P360000 ; wait 6min 
M107    ;stop fan
;Shut down motor
M84   ;shut down motors
Written on September 8, 2018, Last update on November 16, 2021
3dprint lang gcode