RepRap Firmware G-Codes

From RepRap
Revision as of 10:01, 30 April 2016 by PRZ (talk | contribs) (Default values: add ref to fork)
Jump to: navigation, search

The RepRap Firmware (abbreviated RRF) does use more G-codes than other firmwares notably because all configuration is done with G-Codes. Another reason is that it does have extended functionalities.

What is presently listed in this page is not the exhaustive list of G-codes interpreted by RepRap Firmware, only the G-Codes which are specific (yet). This list cover DC42 and Chrishamm fork, which are more complete than the original version. Some G-Codes are common between RepRap Firmware and other firmwares, but with extended syntax or specific interpretation. They are listed in a specific paragraph.

With RepRap firmware, everything is G-code

The RepRap Firmware philosophy is that every operation is done with G-code, notably all configuration, which is mainly stored in config.g file, called at board start-up. A set of standard or specifically crafted G-codes macros is written for all commons printer operation.

All G-codes or macros could be send to the board while operating the printer, allowing instant feed-back for any configuration modification. As interactive modifications are lost at next board start-up, the successfully tested G-Codes shall be manually introduced in the configuration file.

This interactive configuration makes the printer tuning easier than with other firmware.

Typical parameters

Most commands (M or G) are associated with parameters, typically Pnnn, Paaa or Xnnn. It shall be noted that the parameter qualifying letter is NOT part of the parameter, e.g. parameter PMyName is "MyName".

Commonly used parameter qualifiers are :

  • Pnnn or Paaa - Main parameter
  • Rnnn - other parameter
  • Snnn - other parameter, also often used to modify command behaviour (S0~S9)
  • Tnnn - typically Tool number, trigger number for M581 and M582
  • Xnnn, Ynnn, Znnn - parameter associated with an axis
  • Fnnn - feedrate
  • Hnnn or Hn:n:n - Height or Heater/sensor number
  • En or En:n:n - Parameter associated with extruder 0,1, etc. to 5
  • Dn or Dn:n:n - Hardware drive reference defaults are 0:X; 1:Y; 2:Z; 3:E0; 4:E1; 5:E2; 6:E3; 7:E4; 8:E5
  • Rn - enable value - for different hardware needing positive or negative signal to be enabled - M569
  • Bnnn - Safe printing radius (M665), baud rate (M575)

Sometimes a "-1" value is used to cancel a command.

It shall be noted that Extruder number, Tool number, Heater number and Drive number are separated entities which need to be associated one with the other. There are default associations between drives and movement/extruder axis.

Default values

Most configuration G-codes have default values, and if the default are acceptable, you don't need to enter the G-Code, so config.g could be for some printers very simple.

However, sometimes the default values got modified in firmware update, so it is wise to explicitly define all your parameters, to avoid troubles while updating. Some default values (DC42 fork rev 1.11):

  • Default PID parameters (M301)for a hotend heater : P10 I0.1 D100 T0.4 W180 B30
  • Default control Bang-bang for bed (P-1),else : I5 D500 T2.7 W255 B5 - using PID, you may start with P=85
  • PWM frequency 10Hz for Bed and chamber and ?? for Hotend heaters - not adjustable
  • Steps/mm (M92): X200 Y200 Z200 E304.5:304.5:420:420:420:420
  • Maximum feedrates (M203): X25000 Y25000 Z25000 E8000:8000:1200:1200:1200:1200
  • Accelerations(M201): X500 Y500 Z20 E250:250:250:250:250:250
  • Maximum jerk rates (M566): X1200 Y1200 Z800 E500:500:120:120:120:120

Codes specific to RepRap Firmware

Macros and physical interfacing

Heaters

Ethernet communication

Miscellaneous Configuration

Web control (DWC)

Firmware configuration

Reporting - also used by DWC

Geometry

Miscellaneous commands

Specialised machines

G-codes with specific or extended syntax

Useful G-codes