Skip to content
Snippets Groups Projects
Select Git revision
  • 2.0.x default protected
  • 2.0.9.2
  • 2.0.9.1
  • 2.0.9
  • 2.0.8.2
  • 2.0.8.1
  • 2.0.8
  • 2.0.7.2
  • 2.0.7.1
  • 2.0.7
  • 2.0.6.1
  • 2.0.6
  • 2.0.5.4
  • 1.1.9.1
  • 2.0.5.3
  • 2.0.5.2
  • 2.0.5.1
  • 2.0.5
  • 2.0.4.4
  • 2.0.4.3
  • 2.0.4.2
21 results

GCodes.md

Blame
  • GCodes.md 8.63 KiB

    Implemented G Codes

    Movement G and M Codes

    G0   -> G1
    G1   - Coordinated Movement X Y Z E
    G2   - CW ARC
    G3   - CCW ARC
    G4   - Dwell S[seconds] or P[milliseconds]
    G92  - Set the "current position" to coordinates: X<xpos> Y<ypos> Z<zpos> E<epos>
    M0   - Wait for user, with optional prompt message (requires LCD controller)
           M0 Click When Ready ; show "Click When Ready" until the button is pressed.
    M1   - Same as M0
    M400 - Finish all moves
    M999 - Restart after being stopped by error

    SD Card M Codes

    M20  - List SD card
    M21  - Init SD card
    M22  - Release SD card
    M23  - Select SD file (M23 filename.g)
    M24  - Start/resume SD print
    M25  - Pause SD print
    M26  - Set SD position in bytes (M26 S12345)
    M27  - Report SD print status
    M28  - Start SD write (M28 filename.g)
    M29  - Stop SD write
    M30  - Delete file from SD (M30 filename.g)
    M31  - Output time since last M109 or SD card start to serial
    M32  - Select file and start SD print (Can be used _while_ printing from SD card files):
           syntax "M32 /path/filename#", or "M32 S<startpos bytes> !filename#"
           Call gcode file : "M32 P !filename#" and return to caller file after finishing (similar to #include).
           The '#' is necessary when calling from within sd files, as it stops buffer prereading
    M540 - Enable/Disable "Stop SD Print on Endstop Hit" (req. ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
           M540 S<0|1>
    M928 - Start SD logging (M928 filename.g) - ended by M29

    Hardware Control

    M42  - Change pin status via gcode: P<pin> S<value>. If P is omitted the onboard LED pin will be used.
           M42 P9 S1 ; set PIN 9 to 1. 
    M80  - Turn on Power Supply
    M81  - Turn off Power Supply
    M84  - Disable steppers until next move,
           or use S<seconds> to specify an inactivity timeout, after which the steppers will be disabled.  S0 to disable the timeout.
    M85  - Set inactivity shutdown timer with parameter S<seconds>. Disable with "M85" or "M85 S0".
    M112 - Emergency stop. Requires hardware reset!!
    M226 - Wait for a pin to be in some state: P<pin number> S<pin state>

    Temperature M Codes

    M104 - Set extruder target temp
    M105 - Read current temp
    M106 - Fan on
    M107 - Fan off
    M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
           Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
           IF AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
    M140 - Set bed target temp
    M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating
           Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
    M301 - Set PID parameters P I and D
    M302 - Allow cold extrudes, or set the minimum extrude S<temperature>.
    M303 - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
    M304 - Set bed PID parameters P I and D

    Message M Codes