G-code

From Open Source Ecology
Jump to: navigation, search


HintLightbulb.png Hint: This is the main page for G-code

Key Concept

  • Move in X Y Z directions. Ex: G0 X100 Y100 Z100
  • To use Marlin - observe what happens in Start Gcode in Cura - and then add your commands in a Gcode file.
  • Do an exercise: get out a text editor, and move your machine around. Move up so you don't hit anything. On Universal, stay within 100 mm just to get the hang of it.

Widely Used in Marlin Firmware

  • G1 E10 - spit 10 mm of filament
  • M92 - sets feed rate, such as extruder - M92 E408. Set this in Start G-Code to avoid any software ambiguity
  • G92 - resets coordinates to given values [1]
  • G90 - set absolute positioning
  • G91 - set relative positioning
  • M106 - Turn fan on. 0-255 for fan speed. No argument means turn it on. M107 to turn fan off.
  • Homing - G28 ; home all axes (X, Y, and Z); G28 X Y ; home X and Y axes; G28 Z ; home Z axis only
  • M18 - disable steppers
  • G code cheatsheet - [2]

Status Codes

  • M119 - status of endstops (triggered, not triggered)
  • M503 - Print the current settings – Not the settings stored in EEPROM.
  • M501 Read all parameters from EEPROM. (Or, undo changes.). Note that EEPROM must be enabled for EEPROM values to be used. See EEPROM Settings

Filament

  • M404 N2.85 D1.0 - 2.85 mm filament and nozzle Diameter of 1.0 mm

EEPROM

  • M501 Read all parameters from EEPROM.
  • M503 Print the current settings – note: NOT the settings stored in EEPROM.
  • M501 Read all parameters from EEPROM.
  • M502 Reset current settings to defaults, as set in Configurations.h
  • M851 Z probe offset from Extruder

Notes

  • When moving printer in the Cura command line - use G92 without parameters to set all axes to zero
  • G1 will always work when coordinates are reset to zero, otherwise if you are alraedy at say E25, G1 E25 will not move the extruder.

Links