codes

F

codes

G-commands

Movement Commands

  • G0: Rapid move
  • G1: Controlled linear move

Arc Move Commands

  • G2: Clockwise arc move
  • G3: Counter-clockwise arc move

Dwell Command

  • G4: Pause the machine for a period of time, in milliseconds or seconds

Tool Temperature Setting

  • G10: (P parameter with R or S parameter) Sets active and standby tool temperatures

Set Tool Offset or Coordinate System Origin

  • G10: (XYZUVWABC and L parameters) Sets tool offset or coordinate system origin (absolute or relative current position) for specific tool

Retract and Unretract

  • G10: (no parameters) Retracts filament then performs any zlift/hop according to settings of M207
  • G11: Unretracts/recovers filament after undoing any zlift/hop according to settings of M207

Select Plane for Arc Moves

  • G17: Sets XY as the active plane for interpreting the tool path of an arc (G2 or G3)
  • G18: Sets XZ as the active plane for interpreting the tool path of an arc (G2 or G3)
  • G19: Sets YZ as the active plane for interpreting the tool path of an arc (G2 or G3)

Set Units

  • G20: Units from this command onwards are in inches
  • G21: Units from this command onwards are in millimeters

Home Command

  • G28: Move all axes, or the specified ones, to establish a known position for them, for example by moving an axis motor until an endstop switch is triggered

Mesh Bed Probe

  • G29: Uses a Z probe to measure the bed height at 4 or more points to determine its tilt and overall flatness, then enables mesh compensation so that the nozzle will remain parallel to the bed

Single Z-Probe

  • G30: Uses a Z probe to measure bed height at a single point

Set or Report Current Probe Status

  • G31: Sets Z probe parameters or reports status

Run Bed.g Macro

  • G32: Runs macro file bed.g. This macro can be used to probe the bed and then perform auto calibration of a delta printer, perform bed levelling by moving the Z leadscrews independently, or display the manual corrections needed to the bed levelling screws

Straight Probe

  • G38.2: Probe toward workpiece, stop on contact, signal error if failure
  • G38.3: Probe toward workpiece, stop on contact
  • G38.4: Probe away from workpiece, stop on loss of contact, signal error if failure
  • G38.5: Probe away from workpiece, stop on loss of contact

Use Machine Coordinates

  • G53: Causes all coordinates in movement commands on the remainder of the current line of GCode to be interpreted as machine coordinates, ignoring any coordinate offset of the workplace coordinate system currently in use, and also ignoring any tool offsets

Select Coordinate System

  • G54: selects coordinate system 1
  • G55: selects coordinate system 2
  • G56: selects coordinate system 3
  • G57: selects coordinate system 4
  • G58: selects coordinate system 5
  • G59: selects coordinate system 6
  • G59.1: selects coordinate system 7
  • G59.2: selects coordinate system 8
  • G59.3: selects coordinate system 9

Save Current Position to Slot

  • G60: Saves current position to slots 0, 1 or 2

Set to Absolute Positioning

  • G90: All coordinates from this command onwards are absolute, relative to the origin of the machine

Set to Relative Positioning

  • G91: All coordinates from this command onwards are relative to the last position

Set Position

  • G92: Sets position of axes by manually specifying values for the axis positions

M-commands

Stop or Unconditional Stop

  • M0: After finishing any moves left in buffer, runs either cancel.g or stop.g, then sets motors to idle and turns heaters off (unless specified not to)

Sleep or Conditional Stop

  • M1: After finishing any moves left in buffer, runs either cancel.g or sleep.g, then turns off all motors and heaters

Spindle On, Clockwise (CNC specific)/ Laser on (Laser specific)

  • M3: In CNC mode turns on spindle clockwise, in Laser mode turns on laser power

Spindle On, Counterclockwise (CNC specific)

  • M4: Turns on spindle counterclockwise

Spindle Off (CNC specific), laser off (Laser specific)

  • M5: In CNC mode turns off spindle, in Laser mode turns off laser power

Enable All Stepper Motors

  • M17: Enables all stepper motors when used without parameters, or use axes parameters to enable selectively

Disable All Stepper Motors

  • M18: Disables all stepper motors when used without parameters, or use axes parameters to enable selectively

List SD Card

  • M20: Lists files on the SD card. Use parameters to list files in subdirectories or on secondary SD card

Initialize SD Card

  • M21: The specified SD card is initialized. If an SD card is loaded when the machine is switched on, this will happen by default. SD card must be initialized for the other SD functions to work

Release SD Card

  • M22: The specified SD card is released, so further (accidental) attempts to read from it are guaranteed to fail. Helpful, but not mandatory before removing the card physically

Select SD File

  • M23: The specified file is selected ready for printing

Start/Resume SD Print

  • M24: The machine prints from the file selected with the M23 command. If the print was previously paused with M25, printing is resumed from that point

Pause SD Print

  • M25: The machine pauses printing at the current position within the file

Set SD Position

  • M26: Set the file offset in bytes from the start of the SD card file selected by M23

Report SD Print Status

  • M27: Reports the number of bytes processed in the format bytes processed / bytes total in file

Begin Write to SD Card

  • M28: Begin write to SD card

Want to join the discussion? Create a free account to reply and post.

Join ForumLA Free →