G-code is the standard programming language for 3D printers. It is used to control print head movement, media advance, and other print settings. Below is a list of the most common G-code commands for 3D printers:
1. G0/G1 - movement along the X, Y, Z axes with given coordinates
G0 and G1 are two commands that are used to move the print head along the X, Y and Z axes. They differ only in the speed of movement. G0 moves the head at the maximum speed, and G1 moves at the set speed, which is specified with an F code.
An example of using the command:
G1 X10 Y20 Z0.2 F1000
This command will move the head 10mm in the X-axis, 20mm in the Y-axis, and 0.2mm in the Z-axis at a speed of 1000mm/min.
2. G28 - move to the starting point (home)
The G28 command is used to move the print head to the starting point. This can be a position that was set as the starting point before printing began, or a position that was saved with the G92 command.
An example of using the command:
G28 This command will move the head to the starting point.
3. G29 - start automatic table calibration
The G29 command is used to start automatic table calibration. This allows the printer to determine the exact position of the table and correct it during printing.
An example of using the command:
G29 This command will start automatic table calibration.
4. G90 - setting absolute coordinates
The G90 command is used to set absolute coordinates. This means that all head movements will be relative to the start point that was set before printing began.
An example of using the command:
G90 This command will set absolute coordinates.
5. G91 - setting relative coordinates
The G91 command is used to set relative coordinates. This means that all head movements will be relative to the current head position.
An example of using the command:
G91 This command will set relative coordinates.
6. G92 - setting the current position as the initial
The G92 command is used to set the current head position as the starting point. This can be useful if the print head has been misaligned during printing and needs to be returned to its original position.
An example of using the command:
G92 X0 Y0 Z0 This command will set the current head position to the start point (0, 0, 0) along the X, Y and Z axes.
7. G-code to control the speed of the print head (F-code)
The F-code is used to control the speed of the print head. This command specifies the travel speed in mm/min.
An example of using the command:
G1 X10 Y20 Z0.2 F1000 This command will move the head 10mm in the X-axis, 20mm in the Y-axis, and 0.2mm in the Z-axis at a speed of 1000mm/min.
8. G-code for material feed control (M-code)
An M code is used to control the material feed. For example, M109 is used to set the print head heating temperature and wait until it reaches the set temperature.
An example of using the command:
M109 S200 This command will set the print head temperature to 200 degrees and wait for it to reach that temperature.
9. G-code to change the heating temperature of the print head or table (M104, M140)
M104 is used to set the print head heating temperature, and M140 is used to set the platen heating temperature.
An example of using the command:
M104 S200 This command will set the print head temperature to 200 degrees.
10. G-code to stop printing (M0, M1, M2, M112)
M codes can also be used to stop printing. For example, M0 is used to stop printing and display a message on the screen.
An example of using the command:
M0 This command will stop printing and display a message on the screen.
Author: Natalia Kamonichkina
More articles from Natalia Kamonichkina