Chapter 6: Supported G-Code Commands

Within a DED process simulation, we use G-Code commands to create clusters of elements that represent the building sequence of the part. Since G-Code can contain extensions and variations specific to machine tool manufacturers and control manufacturers, we focus on basic commands for linear movement (G00 and G01) and circular movement (CIP), and assume a planar tool path in the X-Y, X-Z, or Y-Z plane, normal to print direction. The following table shows supported G-Code commands:

CommandFunction and ParameterVisualizationUI OptionsExamples
Arbitrary commandSwitch Laser OnN/ALaser On Commands to specify one or more commands, comma separatedG01

M24

Arbitrary commandSwitch Laser OffN/ALaser Off Commands to specify one or more commands, comma separatedG00

M28

Arbitrary commandMovement X0.0 Y0.0 Z0.0If previous command is Laser Off: Blue line from last position

If previous command is Laser On: Green line from last position

Move Commands to specify one or more commands, comma separated

Extrusion Tag option to On if E-Parameter is defined

Show Positioning Lines option to Off to suppress visualization

G00 X1.0 Y0.0 Z0.0 G01 X1.0 Y0.0

G01 X1.0 Y0.0 E1.0

CIPCircle defined by intermediate position (I, J, K) and end position (X, Y, Z)Green line segmentsShow Positioning Lines option to Off to suppress visualizationCIP I1=1.0 J1=1.0 K1=0.0 X2.0 Y0.0 Z0.0
XLinear movement X0.0If previous command is Laser Off: Blue line from last position

If previous command is Laser On: Green line from last position

Show Positioning Lines option to Off to suppress visualizationX1.0 Y0.0
YLinear movement Y0.0If previous command is Laser Off: Blue line from last position

If previous command is Laser On: Green line from last position

Show Positioning Lines option to Off to suppress visualizationY1.0
ZLinear movement Z0.0If previous command is Laser Off: Blue line from last position

If previous command is Laser On: Green line from last position

Show Positioning Lines option to Off to suppress visualizationZ1.0
G90Switch to absolute positioning for the following commandsN/ADefaultG90

G01 X1.0

G01 X2.0

G90 G01 X1.0 Z1.0

G91Switch to relative positioning for the following commandsN/ADefaultG91

G01 X1.0

G01 X2.0

G91 G01 X1.0 Z1.0

FFeed RateN/A F200
TPreheat TemperatureN/A  
G4Dwell Time

The following variations, as used in various machines, are supported:

  • G4 Fnnn (nnn in seconds)

  • G4 Xnnn (nnn in seconds)

  • G4 Unnn (nnn in seconds)

  • G4 Snnn (nnn in seconds)

  • G4 Pnnn (nnn in milliseconds)

N/A G4 P700

A G-Code file must be in ASCII format. Following is an example of a G-Code text file from the racetrack example used throughout this document.

G00 X-100.0 Y-83.5 Z0.0
; First layer
G00 X-54.0 Y-83.5 Z3.0
G01 X-49.9 Y-104.2 ; Circle 1
G01 X-38.2 Y-121.7
G01 X-20.7 Y-133.4
G01 X0.0 Y-137.5
G01 X20.7 Y-133.4
G01 X38.2 Y-121.7
G01 X49.9 Y-104.2
G01 X54.0 Y-83.5
G01 X54.0 Y80.2 ; Y-Line 1
G01 X49.9 Y100.9 ; Circle 2
G01 X38.2 Y118.4
G01 X20.7 Y130.1
G01 X0.0 Y134.2
G01 X-20.7 Y130.1
G01 X-38.2 Y118.4
G01 X-49.9 Y100.9
G01 X-54.0 Y80.2
G01 X-54.0 Y-83.5 ; Y-Line 2
G00 X-54.0 Y-64.6
G01 X54.0 Y-64.6 ; X-Line 1
G00 X-54.0 Y63.4
G01 X54.0 Y63.4 ; X-Line 2
; Next layer
G00 X-54.0 Y-83.5 Z6.0
G01 X-49.9 Y-104.2 ; Circle 1
G01 X-38.2 Y-121.7
G01 X-20.7 Y-133.4
G01 X0.0 Y-137.5
G01 X20.7 Y-133.4
G01 X38.2 Y-121.7
G01 X49.9 Y-104.2
G01 X54.0 Y-83.5
G01 X54.0 Y80.2 ; Y-Line 1
G01 X49.9 Y100.9 ; Circle 2
G01 X38.2 Y118.4
G01 X20.7 Y130.1
G01 X0.0 Y134.2
G01 X-20.7 Y130.1
G01 X-38.2 Y118.4
G01 X-49.9 Y100.9
G01 X-54.0 Y80.2
G01 X-54.0 Y-83.5 ; Y-Line 2
G00 X-54.0 Y-64.6
G01 X54.0 Y-64.6 ; X-Line 1
G00 X-54.0 Y63.4
G01 X54.0 Y63.4 ; X-Line 2
; Next layer
G00 X-54.0 Y-83.5 Z9.0
G01 X-49.9 Y-104.2 ; Circle 1
G01 X-38.2 Y-121.7
G01 X-20.7 Y-133.4
G01 X0.0 Y-137.5
G01 X20.7 Y-133.4
G01 X38.2 Y-121.7
G01 X49.9 Y-104.2
G01 X54.0 Y-83.5
G01 X54.0 Y80.2 ; Y-Line 1
G01 X49.9 Y100.9 ; Circle 2
G01 X38.2 Y118.4
G01 X20.7 Y130.1
G01 X0.0 Y134.2
G01 X-20.7 Y130.1
G01 X-38.2 Y118.4
G01 X-49.9 Y100.9
G01 X-54.0 Y80.2
G01 X-54.0 Y-83.5 ; Y-Line 2
G00 X-54.0 Y-64.6
G01 X54.0 Y-64.6 ; X-Line 1
G00 X-54.0 Y63.4
G01 X54.0 Y63.4 ; X-Line 2
; Next layer
G00 X-54.0 Y-83.5 Z12.0
G01 X-49.9 Y-104.2 ; Circle 1
G01 X-38.2 Y-121.7
G01 X-20.7 Y-133.4
G01 X0.0 Y-137.5
G01 X20.7 Y-133.4
G01 X38.2 Y-121.7
G01 X49.9 Y-104.2
G01 X54.0 Y-83.5
G01 X54.0 Y80.2 ; Y-Line 1
G01 X49.9 Y100.9 ; Circle 2
G01 X38.2 Y118.4
G01 X20.7 Y130.1
G01 X0.0 Y134.2
G01 X-20.7 Y130.1
G01 X-38.2 Y118.4
G01 X-49.9 Y100.9
G01 X-54.0 Y80.2
G01 X-54.0 Y-83.5 ; Y-Line 2
G00 X-54.0 Y-64.6
G01 X54.0 Y-64.6 ; X-Line 1
G00 X-54.0 Y63.4
G01 X54.0 Y63.4 ; X-Line 2

Circular Movement (CIP)

When using the CIP command for circular movement, two things are required:

  1. CIP must be added to the Laser On Commands option in the G-Code Clustering object.

  2. The circular movement must be defined correctly in the G-Code itself. Any arc can be defined by three points. Within the G-Code file, the following points define an arc:

    • Starting point—obtained from the last G-Code command position (that is, the line above CIP)

    • Intermediate point—indicated by (I,J,K) coordinates on the CIP command line

    • End point—indicated by (X,Y,Z) coordinates on the CIP command line

In the following example, the laser is off while moving to position (0,0,2), the laser is on while moving to (1,0,2), and the laser is on while moving in a circular movement from (1,0,2) up to an inflection point at (0,1,2) and to an end point of (-1,0,2).

G0 X0.0 Y0.0 Z2.0
G1 X1.0 Y0.0 Z2.0
CIP I1=0.0 J1=1.0 K1=2.0 X-1.0 Y0.0 Z2.0