G0 & G1 - Linear Movement Commands
Description
G0 and G1 are the fundamental linear movement commands in G-code. Both commands move the tool in a straight line from the current position to the specified target position. The key difference between them is the speed at which the movement is executed:
- G0 (Rapid Linear Move): Uses the machine's rapid speed setting for fast positioning moves
- G1 (Linear Move): Uses the specified feedrate for controlled cutting or drawing operations
These commands form the foundation of most CNC operations, enabling precise positioning and controlled material removal or deposition.
Syntax
Parameters
Parameter | Description | Example |
---|---|---|
X | Target X-axis position | X10.5 |
Y | Target Y-axis position | Y25.0 |
Z | Target Z-axis position | Z5.0 |
F | Feedrate (units per minute) | F1000 |
Note: All parameters are optional. If a coordinate is not specified, the machine will maintain its current position on that axis.
Feedrate Behavior
G0 Feedrate Handling
When an F parameter is specified with G0, it sets the feedrate for future G0 commands. This allows you to control the speed of rapid moves when the default rapid speed is too fast for your application.
G1 Feedrate Handling
When an F parameter is specified with G1, it sets the feedrate for future G1 commands. This feedrate remains active until explicitly changed by another F parameter.
Independent Feedrates
G0 and G1 commands maintain separate feedrate settings. Setting the feedrate for G0 does not affect G1 feedrate, and vice versa.