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 - G-Code Tutorial
From the course: G-Code Programming for CNC Foundations
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
G00: Rapid moves5m 44s
-
G01: Feed moves4m 17s
-
G02 and G03: Circular interpolation8m 11s
-
G04: Dwell3m 39s
-
G17, G18, and G19: Plane selection3m 7s
-
G20 and G21: Unit system selection1m 55s
-
G28: Return to machine zero position4m 52s
-
G53: Machine coordinate system selection5m 2s
-
G41, G42, and G40: Cutter compensation7m 44s
-
G81, G82, and G80: Drilling canned cycle6m 16s
-
G83: Peck drilling cycle6m 8s
-
G84: Tapping4m 10s
-
-
-
-