Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
supported-g-codes [2018/03/05 15:48]
93.36.188.172 [G codes]
supported-g-codes [2019/03/06 22:25] (current)
wolfmanjm
Line 20: Line 20:
 | [[G10]] | Do firmware extruder retract | <​kbd>​G10</​kbd>​ | | [[G10]] | Do firmware extruder retract | <​kbd>​G10</​kbd>​ |
 | [[G11]] | Do firmware extruder un-retract | <​kbd>​G11</​kbd>​ | | [[G11]] | Do firmware extruder un-retract | <​kbd>​G11</​kbd>​ |
-| G10 L2 G10 L20 | set workspace coordinates http://​linuxcnc.org/​docs/​html/​gcode/​coordinates.html and http://​linuxcnc.org/​docs/​html/​gcode/​g-code.html#​gcode:​g10-l2| <​kbd>​G10 L2 P1 X0</​kbd>​ |+| G10 L2 G10 L20 | Set workspace coordinates http://​linuxcnc.org/​docs/​html/​gcode/​coordinates.html and http://​linuxcnc.org/​docs/​html/​gcode/​g-code.html#​gcode:​g10-l2| <​kbd>​G10 L2 P1 X0</​kbd>​ |
 | [[G17]] | Select XYZ plane (command is modal)| <​kbd>​G17</​kbd>​ | | [[G17]] | Select XYZ plane (command is modal)| <​kbd>​G17</​kbd>​ |
 | [[G18]] | Select XZY plane (command is modal)| <​kbd>​G18</​kbd>​ | | [[G18]] | Select XZY plane (command is modal)| <​kbd>​G18</​kbd>​ |
Line 31: Line 31:
 | G28.3 | Manual Homing - This allows you to set a home position manually without moving to limit switches | <​kbd>​G28.3</​kbd>​ | | G28.3 | Manual Homing - This allows you to set a home position manually without moving to limit switches | <​kbd>​G28.3</​kbd>​ |
 | G28.4 | Manual Homing based on actuator position- This allows you to set a home position manually based on actuator position (used for rotary delta) | <​kbd>​G28.4</​kbd>​ | | G28.4 | Manual Homing based on actuator position- This allows you to set a home position manually based on actuator position (used for rotary delta) | <​kbd>​G28.4</​kbd>​ |
-| G28.5 | clears ​the homed flag for the specified axis, or all if not specifed | <​kbd>​G28.5</​kbd>​ <​kbd>​G28.5 Z0</​kbd>​ | +| G28.5 | Clears ​the homed flag for the specified axis, or all if not specifed | <​kbd>​G28.5</​kbd>​ <​kbd>​G28.5 Z0</​kbd>​ | 
-| G28.6 | shows the homing status of each axis | <​kbd>​G28.6</​kbd>​ |+| G28.6 | Shows the homing status of each axis | <​kbd>​G28.6</​kbd>​ | 
 +| G29 | Probes the bed and outputs the bed heights depending on levelling strategy selected, see [[ZProbe]] ​ | <​kbd>​G29</​kbd>​ |
 | [[G30]] | Simple Z probe at current XY, reports distance moved down until probe triggers. optional F parameter defines the speed of probing, zprobe.slow_feedrate is used when not supplied | <​kbd>​G30 - G30 F100</​kbd>​ | | [[G30]] | Simple Z probe at current XY, reports distance moved down until probe triggers. optional F parameter defines the speed of probing, zprobe.slow_feedrate is used when not supplied | <​kbd>​G30 - G30 F100</​kbd>​ |
 | G31 | Depends on levelling strategy selected, see [[ZProbe]] ​ | <​kbd>​G31</​kbd>​ | | G31 | Depends on levelling strategy selected, see [[ZProbe]] ​ | <​kbd>​G31</​kbd>​ |
 | G32 | Uses Z probe to calibrate delta endstops and arm radius, use R parameter to select only arm radius calibration and E to select only endstop calibration. I to set target precision, J to set probe_radius,​ K to keep current endstop trim settings. ​ In Zgrid module, it starts the grid probing | <​kbd>​G32 - G32 R - G32 E - G32 EK - G32 I0.02</​kbd>​ | | G32 | Uses Z probe to calibrate delta endstops and arm radius, use R parameter to select only arm radius calibration and E to select only endstop calibration. I to set target precision, J to set probe_radius,​ K to keep current endstop trim settings. ​ In Zgrid module, it starts the grid probing | <​kbd>​G32 - G32 R - G32 E - G32 EK - G32 I0.02</​kbd>​ |
 | G38.2 G38.3 | Standard probe commands implemented as documented [[http://​linuxcnc.org/​docs/​2.6/​html/​gcode/​gcode.html#​sec:​G38-probe|here]] | <​kbd>​G38.2 Z-10</​kbd>​| | G38.2 G38.3 | Standard probe commands implemented as documented [[http://​linuxcnc.org/​docs/​2.6/​html/​gcode/​gcode.html#​sec:​G38-probe|here]] | <​kbd>​G38.2 Z-10</​kbd>​|
-| G53-G59.3 | use workspace coordinates http://​linuxcnc.org/​docs/​html/​gcode/​coordinates.html and http://​linuxcnc.org/​docs/​html/​gcode/​g-code.html#​gcode:​g54-g59.3 | <​kbd>​G54</​kbd>​ | +| G53,[[G54]]-G59.3 | use workspace coordinates http://​linuxcnc.org/​docs/​html/​gcode/​coordinates.html and http://​linuxcnc.org/​docs/​html/​gcode/​g-code.html#​gcode:​g54-g59.3 | <​kbd>​G54</​kbd>​ | 
-| [[G90]] | Absolute mode ( //​default// ​) : passed coordinates will be considered absolute ( relative to 0.0.0 ) (command is modal)| <​kbd>​G90</​kbd>​ | +| [[G90]] | Absolute mode ( //default// ) (command is modal)| <​kbd>​G90</​kbd>​ | 
-| [[G91]] | Relative mode : passed coordinates will be considered relative to the current point (command is modal)| <​kbd>​G91</​kbd>​ |+| [[G91]] | Relative mode (command is modal)| <​kbd>​G91</​kbd>​ |
 | [[G92]] | Set global workspace coordinate system to specified coordinates http://​linuxcnc.org/​docs/​html/​gcode/​g-code.html#​gcode:​g92 | <​kbd>​G92 X0 Y0 Z0</​kbd>​ | | [[G92]] | Set global workspace coordinate system to specified coordinates http://​linuxcnc.org/​docs/​html/​gcode/​g-code.html#​gcode:​g92 | <​kbd>​G92 X0 Y0 Z0</​kbd>​ |
-| G92.1 | clear the G92 and G30 Znnn offsets | <​kbd>​G92.1</​kbd>​|+| G92.1 | Clear the G92 and G30 Znnn offsets | <​kbd>​G92.1</​kbd>​| 
 +| G92.4 | manually set homing (MCS) for XYZ  | <​kbd>​G92.4 X0 Y0 Z0</​kbd>​|
 |= M-Code |= Description ​  ​|= ​ | |= M-Code |= Description ​  ​|= ​ |
 | [[M3]] | Starts the spindle. Only if spindle module is enabled. The S parameter sets the speed in rotations per minute | <​kbd>​M3 S5000</​kbd>​ | | [[M3]] | Starts the spindle. Only if spindle module is enabled. The S parameter sets the speed in rotations per minute | <​kbd>​M3 S5000</​kbd>​ |
Line 67: Line 69:
 | M107 | Turn fan OFF | <​kbd>​M107</​kbd>​ | | M107 | Turn fan OFF | <​kbd>​M107</​kbd>​ |
 | M109 | Set Extruder Temperature and Wait  - S<​temperature>​ | <​kbd>​M109 S190</​kbd>​ | | M109 | Set Extruder Temperature and Wait  - S<​temperature>​ | <​kbd>​M109 S190</​kbd>​ |
-| M110 | Set current line number -N<line number> | <kbd>M110 N123</​kbd>​ |+| M110 | Set current line number -N<line number> | <​kbd>​N123 ​M110</​kbd>​ |
 | M112 | Halt all operations, turn off heaters, go into Halt state | | | M112 | Halt all operations, turn off heaters, go into Halt state | |
 | M114 | Show current position of all axes, XYZ will be the last requested position | <​kbd>​M114</​kbd>​ | | M114 | Show current position of all axes, XYZ will be the last requested position | <​kbd>​M114</​kbd>​ |
Line 80: Line 82:
 | M121 | "​Pop"​ the current feed-rate and seek-rate, see M120 | <​kbd>​M121</​kbd>​ | | M121 | "​Pop"​ the current feed-rate and seek-rate, see M120 | <​kbd>​M121</​kbd>​ |
 | M140 | Set Bed Temperature - S<​temperature>​ | <​kbd>​M140 S55</​kbd>​ | | M140 | Set Bed Temperature - S<​temperature>​ | <​kbd>​M140 S55</​kbd>​ |
 +| M143 | Set Maximum Temperature - S<heater index> P<​temperature>​ | <​kbd>​M143 S0 P300</​kbd>​ |
 | M190 | Set Bed Temperature and Wait -  S<​temperature>​ | <​kbd>​M190 S55</​kbd>​ | | M190 | Set Bed Temperature and Wait -  S<​temperature>​ | <​kbd>​M190 S55</​kbd>​ |
 | M200 | Set E units for volumetric extrusion - D<​filament diameter>​ set to 0 to disable volumetric extrusion | <​kbd>​M200 D3.0</​kbd>​ | | M200 | Set E units for volumetric extrusion - D<​filament diameter>​ set to 0 to disable volumetric extrusion | <​kbd>​M200 D3.0</​kbd>​ |
Line 88: Line 91:
 | M205 | X<​junction deviation>​ Z<z junction deviation>​ S<​minimum planner speed>, Z junction deviation only applies to z only moves, 0 disables junction deviation for Z, -1 uses global junction deviation | <​kbd>​M205 X0.05 S30.0</​kbd>​ | | M205 | X<​junction deviation>​ Z<z junction deviation>​ S<​minimum planner speed>, Z junction deviation only applies to z only moves, 0 disables junction deviation for Z, -1 uses global junction deviation | <​kbd>​M205 X0.05 S30.0</​kbd>​ |
 | M206 | Set homing offsets | <​kbd>​M206 X10 Y3 Z0.5</​kbd>​ | | M206 | Set homing offsets | <​kbd>​M206 X10 Y3 Z0.5</​kbd>​ |
-| M207 | set retract length S[[positive|mm]] F[[feedrate|mm/​min]] Z[[additional|zlift/​hop]] Q[[zlift|feedrate mm/min]] | <​kbd>​M207 S4 F30 Z1</​kbd>​ | +| M207 | Set retract length S[[positive|mm]] F[[feedrate|mm/​min]] Z[[additional|zlift/​hop]] Q[[zlift|feedrate mm/min]] | <​kbd>​M207 S4 F30 Z1</​kbd>​ | 
-| M208 | set retract recover length S[[positive|mm surplus to the M207 S*]] F[[feedrate|mm/​min]] | <​kbd>​M208 S0 F8</​kbd>​ |+| M208 | Set retract recover length S[[positive|mm surplus to the M207 S*]] F[[feedrate|mm/​min]] | <​kbd>​M208 S0 F8</​kbd>​ |
 | M220 | S<factor in percent>​- set speed factor override percentage | <​kbd>​M220 S50</​kbd>​ | | M220 | S<factor in percent>​- set speed factor override percentage | <​kbd>​M220 S50</​kbd>​ |
 | M221 | S<flow rate factor in percent>​- set flow rate factor override percentage for current extruder| <​kbd>​M221 S50</​kbd>​ | | M221 | S<flow rate factor in percent>​- set flow rate factor override percentage for current extruder| <​kbd>​M221 S50</​kbd>​ |
Line 100: Line 103:
 | M361 | Scara Morgan: Move to Theta 90 degree position. Adding P0 will save the current arm position as the Theta 90 degree position | <​kbd>​M361 or M360 P0</​kbd>​ |  | M361 | Scara Morgan: Move to Theta 90 degree position. Adding P0 will save the current arm position as the Theta 90 degree position | <​kbd>​M361 or M360 P0</​kbd>​ | 
 | M364 | Scara Morgan: M364: Move to Psi + Theta 90 degree position. Adding P0 will save the current arm position as the Psi + Theta 90 degree position | <​kbd>​M364 or M344 P0</​kbd>​ |  | M364 | Scara Morgan: M364: Move to Psi + Theta 90 degree position. Adding P0 will save the current arm position as the Psi + Theta 90 degree position | <​kbd>​M364 or M344 P0</​kbd>​ | 
-| M370 | Z grid strategy: clears the ZGrid and the bed levelling is disabled until G32 is run again. ​ ​Specify X and Y values to change grid size | <​kbd>​M370 ​ M370 X9 Y11</​kbd>​ | +| M370 | Z grid strategy: clears the ZGrid and the bed levelling is disabled until G32 is run again. | <​kbd>​M370 ​ M370</​kbd>​ | 
-M371 | Z grid strategy: ​moves the head to the next calibration ​position without saving for manual calibration | <​kbd>​M371</​kbd>​ | +M374 | Z grid strategy: ​save calibration grid| <kbd>M374</​kbd>​ | 
-| M372 | Z grid strategy: move the head to the next calibration position after saving the current probe point to memory - manual calbration ​| <kbd>M372</​kbd>​ | +M375 | Z grid strategy: ​load calibration grid. | <kbd>M375</​kbd>​ | 
-M373 | Z grid strategy: ​completes calibration and enables the Z compensation grid | <​kbd>​M373</​kbd>​ | +| M375.1 display the current ​grid   ​| <​kbd>​M375.1</​kbd>​ | 
-| M374 | Z grid strategy: save calibration grid.  ​optional S parameter saves a custom file with numerical extention ​| <kbd>M374 S123</​kbd>​ | +| M400 | Wait for the queue to be empty and the motors to stop before ​the M400 answers ok | <​kbd>​M400</​kbd>​ |
-| M375 | grid strategy: load calibration grid.  optional S Parameter loads a pre saved custom grid  ​| <​kbd>​M375 ​S123</​kbd>​ | +
-| M400 | Wait for the queue to be empty before ​answering "​OK" ​| <​kbd>​M400</​kbd>​ |+
 | M407 | Get filament detector information | <​kbd>​M407</​kbd>​ | | M407 | Get filament detector information | <​kbd>​M407</​kbd>​ |
 | M500 | Save some volatile settings to an override file | <​kbd>​M500</​kbd>​ | | M500 | Save some volatile settings to an override file | <​kbd>​M500</​kbd>​ |
Line 114: Line 115:
 | M504 | Save the settings to an override file with specified extension| <​kbd>​M504 test1</​kbd>​ - saves to config-override.test1 | | M504 | Save the settings to an override file with specified extension| <​kbd>​M504 test1</​kbd>​ - saves to config-override.test1 |
 | M557 | Defines probe points | <​kbd>​M557 P1 X30 Y40.5</​kbd>​ | | M557 | Defines probe points | <​kbd>​M557 P1 X30 Y40.5</​kbd>​ |
-| M561 | clears ​the plane and the bed leveling is disabled until G32 is run again | <​kbd>​M561</​kbd>​ | +| M561 | Clears ​the plane and the bed leveling is disabled until G32 is run again | <​kbd>​M561</​kbd>​ | 
-| M565 | defines ​the probe offsets from the nozzle or tool head | <​kbd>​M565 X3 Y4.5 Z-2.37</​kbd>​ |+| M565 | Defines ​the probe offsets from the nozzle or tool head | <​kbd>​M565 X3 Y4.5 Z-2.37</​kbd>​ |
 | M600 | Suspend print in progress (use M601 to continue) | | | M600 | Suspend print in progress (use M601 to continue) | |
 | M601 | Resume suspended print | | | M601 | Resume suspended print | |
Line 122: Line 123:
 | M670 | ZProbe feedrates Slow/​fast(K)/​Return (mm/sec) max_z (mm) height (mm) | <​kbd>​M670 S5.00 K100.00 R0.00 Z357.55 H5.00</​kbd>​ | | M670 | ZProbe feedrates Slow/​fast(K)/​Return (mm/sec) max_z (mm) height (mm) | <​kbd>​M670 S5.00 K100.00 R0.00 Z357.55 H5.00</​kbd>​ |
 | M906 | Set Current in milliamp for SPI drivers, only if the driver is handled by the motorcontrol module | <​kbd>​M906 A1000 B1100</​kbd>​ | | M906 | Set Current in milliamp for SPI drivers, only if the driver is handled by the motorcontrol module | <​kbd>​M906 A1000 B1100</​kbd>​ |
-| M907 | Set Current control via digipot for each axis (current in amps) | <​kbd>​M907 X1.0 Y1.0 Z1.0 E1.5</​kbd>​ |+| M907 | Set Current control via digipot for each axis (current in amps) | <​kbd>​M907 X1.0 Y1.0 Z1.0 A1.5</​kbd>​ |
 | M909 | Set microsteps (1/n), ONLY for advanced drivers handled by motordriver module, M909.1 will also set the steps/mm accordingly | <​kbd>​M909 A16 B64</​kbd>​ | | M909 | Set microsteps (1/n), ONLY for advanced drivers handled by motordriver module, M909.1 will also set the steps/mm accordingly | <​kbd>​M909 A16 B64</​kbd>​ |
-| M910.x | setup advanced driver chips that support SPI setup, parameters are specific to each chip see chip docs | <​kbd>​M910</​kbd>​ |+| M910.x | Setup advanced driver chips that support SPI setup, parameters are specific to each chip see chip docs | <​kbd>​M910</​kbd>​ |
 | M957 | (with Spindle module enabled) Report the current spindle speed and PWM value | <​kbd>​M957</​kbd>​ | | M957 | (with Spindle module enabled) Report the current spindle speed and PWM value | <​kbd>​M957</​kbd>​ |
 | M958 | (with Spindle module enabled) Report the current spindle PID parameters. <​kbd>​M958 Px.xx Ix.xx Dx.xx</​kbd>​ will set them (to save the new values, you need to edit config file manually). | <​kbd>​M958 P0.1</​kbd>​ | | M958 | (with Spindle module enabled) Report the current spindle PID parameters. <​kbd>​M958 Px.xx Ix.xx Dx.xx</​kbd>​ will set them (to save the new values, you need to edit config file manually). | <​kbd>​M958 P0.1</​kbd>​ |
Line 136: Line 137:
 </​code>​ </​code>​
 </​callout>​ </​callout>​
 +== Additional Codes
 +The Smoothieware configuration file permits the association of additional codes with some tool functions. ​ For example, for a [[switch|Switch module]], you can specify an arbitrary command in the '​input_on_command'​ and '​input_off_command'​. ​ This means that some additional codes may be available, depending on your specific configuration file.
 +
 +For example, if you are using servos, then you will likely have configured the following commands:
 +|= G-Code |= Description |= Example |
 +| M280 | Move servo to S<​position>​ where position is 0-100| M280 S20 ; move servo to position 20 = 20% duty cycle |
 +| M281 | Turn off servo | M281 ; Same as M280 S0 0% duty cycle, effectively off | |
 +
 +Additionally,​ in your configuration,​ you can assign sub-commands to deal with multiple tools of the same type, for example:
 +
 +|= G-Code |= Description ​ |
 +| M280.1 | Move your first servo |
 +| M280.2 | Move your second servo | |
  
 == Tool change == Tool change