G-code Basics & Features
G-code is the language used to control CNC machines. This trainer supports several commands and modes:
-
G0 / G1: Linear move commands.
-
In Absolute Mode (G90): Coordinates (X, Y) are interpreted as offsets from the grid origin (the center).
-
In Relative Mode (G91): Coordinates are interpreted relative to the current position.
-
G2 / G3: Arc move commands.
- G2: Clockwise arc.
- G3: Counter-clockwise arc.
-
Parameters:
- X and Y: Destination coordinates (processed according to the current mode).
- I and J: Offsets from the start position to the arc’s center (always incremental).
- Optional feed rate F is parsed but does not affect simulation speed.
-
G90: Switch to Absolute Mode (default).
-
G91: Switch to Relative Mode.
-
You can enter multiple commands by separating them with newlines.
Examples:
G90 – Set absolute mode.
G1 X50 Y100 – Move linearly to 50 right and 100 up from origin (absolute mode).
G91 – Set relative mode.
G1 X10 Y-20 – Move 10 right and 20 down relative to the current position (relative mode).
-
G2 X50 Y0 I0 J-25 – Create a clockwise arc to the specified destination.