RepRap Firmware G-Codes

From RepRap
Revision as of 13:03, 30 April 2016 by PRZ (talk | contribs) (continued)
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 heaters and ?? for Hotend heaters - not adjustable
  • Thermistors - all- ( M305): T100000 B4138 R1000 L0 H0 X3
  • 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
  • Time allowed to get to temperature on hotend heaters (M570): 150 seconds.
  • Filament (M404) width: 1.75mm, nozzle diameter: 0.50mm

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

Non specific G-codes

Movement

http://reprap.org/wiki/G-code#M82:_Set_extruder_to_absolute_mode http://reprap.org/wiki/G-code#M83:_Set_extruder_to_relative_mode http://reprap.org/wiki/G-code#M114:_Get_Current_Position


Operation

http://reprap.org/wiki/G-code#M84:_Stop_idle_hold http://reprap.org/wiki/G-code#M80:_ATX_Power_On http://reprap.org/wiki/G-code#M81:_ATX_Power_Off http://reprap.org/wiki/G-code#M107:_Fan_Off http://reprap.org/wiki/G-code#M112:_Emergency_Stop http://reprap.org/wiki/G-code#M116:_Wait

probing

Printing

Physical interface

http://reprap.org/wiki/G-code#M119:_Get_Endstop_Status

Heating

http://reprap.org/wiki/G-code#M104:_Set_Extruder_Temperature http://reprap.org/wiki/G-code#M105:_Get_Extruder_Temperature http://reprap.org/wiki/G-code#M109:_Set_Extruder_Temperature_and_Wait http://reprap.org/wiki/G-code#M140:_Set_Bed_Temperature_.28Fast.29 http://reprap.org/wiki/G-code#M141:_Set_Chamber_Temperature_.28Fast.29 http://reprap.org/wiki/G-code#M190:_Wait_for_bed_temperature_to_reach_target_temp


Useful G-codes

  • M206 Set home offset. Could be used to adjust head above bed during printing. M206 Z0.1 move up by 0.1mm

Miscellaneous

http://reprap.org/wiki/G-code#M110:_Set_Current_Line_Number http://reprap.org/wiki/G-code#M111:_Set_Debug_Level http://reprap.org/wiki/G-code#M115:_Get_Firmware_Version_and_Capabilities http://reprap.org/wiki/G-code#M117:_Display_Message http://reprap.org/wiki/G-code#M120:_Push http://reprap.org/wiki/G-code#M121:_Pop