Most people do not need to learn G-code. This is why we have a slicer to do all of the work. However, there are a handful of G-code commands that are useful to know. All of these commands are useful while printing and can be entered by way of the host command line. Refer to the following commands:
G1
: This command designates a controlled move. Here's an example of theG1
command-line syntax:G1 X200 Y200 Z100 F500
. The X and Y motors should move the extruder 200 mm from the home position and at 500 mm/min (F500). We'll see shortly how this command is a useful one.M302
: This command disables the cold extrusion prevention. This is very useful when testing the extruder movement without heating the filament. This allows the extruder motor to run when the hot end is colder than a firmware-specified temperature.M106
: This command turns the cooling fan on. When used with anS
parameter between 0-255, the speed can be adjusted. Here's an example of theM106
command-line syntax:M106 S127
.M503
: This command echoes the current settings from memory (not from EEPROM). This is very useful when you need to see the current calibration settings stored in the firmware.M501
: This command echoes the current settings from EEPROM (if you need to reset them after you changed them temporarily).M92
: This command setsaxis_steps_per_unit
to the same parameters as entered in the firmware. This is a good way to tweak the axes and E-motor calibration on the fly. Here's an example of theM92
command-line syntax:M92 X80 Y80 Z3200 E945
.M303
: This command is the PID autotune. This generates the Proportional, Integral, and Derivative (PID) values for the hot end. Run this test every time you make a temperature change. The variables C = number of cycles to run test and S = target temperature. Here's an example of theM303
command-line syntax:M303 C8 S220
. Testing should be started with a cold hot end.
More commands can be found at http://reprap.org/wiki/G-code and http://www.thingiverse.com/thing:21546/.