Accessing G-Code files
G-code files are saved as plain text files. Therefore, they can be edited with any plain text editor.
M104 and M109 – Extruder Heating Commands
These commands set the temperature of your extruder. The M104 command starts heating the extruder, but then allows you to run other commands immediately afterwards. The M109 command will actually wait until the desired temperature is reached before allowing any other commands to run. For this reason, you will frequently see an M109 at the top of the gcode files, as this allows the extruder to reach the necessary temperature before the print begins.
The S value specifies the extruder temperature in degrees Celsius. The T value can be used if you have more than one extruder, as it allows you to specify which exact extruder temperature you want to set.
Example usage:M104 S190 T0 ; start heating T0 to 190 degrees Celsius
G28 X0 ; home the X axis while the extruder is still heating
M109 S190 T0 ; wait for T0 to reach 190 degrees before continuing with any other commands
M140 and M190 – Bed Heating Commands
These commands to set the temperature of your heated build platform. The syntax is very similar to the M104 and M109 commands mentioned above.
Example usage:M140 S50 ; start heating the bed to 50 degrees Celsius
G28 ; home all 3 axes while the bed is still heating
M190 S50 ; wait until the bed reaches 50 degrees before continuing
M106 Set Fan Speed
This command allows you to set the speed of your printer’s part cooling fan. This is an external cooling fan that is pointed towards the part that you are printing. Keep in mind that your printer may also have an extruder fan that helps cool the extruder drive mechanism, so make sure you are looking at the correct fan first. While most printers have an external cooling fan, there are a few exceptions, so check your machine first to make sure it has an external cooling fan that you can control.
Speed, from 0 to 255. S255 provides 100% duty cycle; S0 produces 0%; S128 produces 50%.