G codes

Once converted to G codes a small micro controller is able to autonomously read the G code from a memory card and print the 3D object without the need of a PC.


G code is not interchangeable between different 3D printers models. When adjusting the z-axis resulting in an other gap, then also the G code needs to be regenerated. Conclusion: Do not store, publish or archive G code.

For details on G code see http://reprap.org/wiki/G-code.

A simple test is connect the printer to a terminal (set the baudrate) and pressing reset. ASCII text should appear during the boot test.

Then try to read the temperature: M105 and press enter.

Or M115 to see what printer you got.

M119 to see end stop status.

M114 to see actual coordinates.

M106 turns the fan on M107 turns it off.

The following is advised after a firmware update: M502 loads the default values and M500 stores them to EEPROM

The fundamental G-Code instruction is

G1 X<aa.bb> Y<aa.bb> F<speed>

Where <aa.bb> is a mm dimension and speed the speed to go there. X,Y,Z (and F) are optional, when missing the actual position stays.

;  this is a comment line

For python there is https://github.com/jminardi/mecode that creates G code. http://reprap.org/wiki/Pronterface can also be used to learn, test and simulate application.

M117 Printing started 

sends any text to the printers display (or print servers gui). It is therefore nice or worth to add such lines to gcode files at places where the slicer, printer server or any other tools allow it. If it does not work, test it when the printer is not printing and use for example Octoprints terminal. During print it might happen that other tasks write to the display and therefore overwrite your custom message.

Linurs Hosttech startpage