From the course: G-Code Programming for CNC Foundations

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

G20 and G21: Unit system selection

G20 and G21: Unit system selection - G-Code Tutorial

From the course: G-Code Programming for CNC Foundations

Start my 1-month free trial

G20 and G21: Unit system selection

- [Instructor] The G20 or the G21 commands specify whether we're working in inches or in metric, which is specified in millimeters. So G20 equals inches and G21 equals metric in millimeters. Now most machines will be set from the factory with a default unit system. If you're in the United States more than likely it's going to be working in inches, and if you're pretty much anywhere else in the world, you're probably working in metric, so make sure that your CAM software is set up to be outputting the correct values. And then verify that by going in and looking at the G-Code that's output from that software, and make sure that if you're in inches you're getting a G20 at the beginning of your program, and if you're in metric you're getting a G21. Another thing I want to point out, and this is a common mistake, is not using a dot or a period in your values. So let me give you an example. Here's a line of code, so G01 X10. That's not the same as X10 point. The point is specifying that…

Contents