G20 and G21 : Inches and Metric
Overview
- These G-Codes specify the dimension unit for the input data between "inches" (G20) and “mm” (G21) used for positioning commands.
Command Format
-
Syntax:
G20
or
G21
- G20 - Inch Mode
- Feed (G1, G2, G3) and Rapid (G0) moves are interpreted in
inches
- Feed Rates are
inches per minute
- G21 - Metric Mode
- Feed (G1, G2, G3) and Rapid (G0) moves are interpreted in
millimeters
after this command
- Feed Rates are
mm per minute
Examples
G21 // set program to millimeters
G01 X25.4 F1000
The G-code above will move X to 25.4
mm
at 1000
mm/min
Details
- The default value at startup is G21
- Best Practices
- Put this command on its own line.
- Specify it at the start of the program, or whenever you’re unsure which units are currently active.