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:
G20orG21
Examples
|
Note
G21 // set program to millimeters G01 X25.4 F1000``` - The G-code above will move to **25.4 mm** at **1000mm/min** |
Details
- The default value at startup is 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
- Best Practices
- Always keep this command on its own line
- Always specify at the top of the program or when in doubt of what the current active units are
See Also:
- G-Code Command Priority G-Code Command Priority