Understanding G27, G28, G29 And G30 - Modern Machine Shop
- Toolholders 20 Feb 2026 When ‘U’ Want to Turn on a Mill
- How I Made It 18 Feb 2026 How I Made It: Clint Smith
- Turn/Mill 16 Feb 2026 Multitasking Machines Scale Up Setup
- Basics 13 Feb 2026 7 Steps to Optimize Aggressive Roughing Operations
- Economics 11 Feb 2026 Metalworking Index Surges Into Expansion
- Basics 9 Feb 2026 Why Manufacturing Leaders Shouldn't Wait for “Normal” to Come Back
- Basics 6 Feb 2026 Defining Key Concepts of Smart Manufacturing
- Workforce Development 4 Feb 2026 How Manufacturing CEOs Are Rebuilding Strategy Amid Tariffs and Talent Gaps
- Measurement 2 Feb 2026 How Confocal Technology Revolutionizes Optical Metrology
- Turning Tools 30 Jan 2026 Durable Tooling Cuts Cycle Times for Tough Turn-Peeling Job
Take a closer look at these reference position commands.
- Software
- CNC Tech Talks
- Basics
- CNC & Machine Controls
Mike Lynch Founder and President, CNC Concepts Inc. Share
VISIT SITE VISIT SHOWROOM Komo Machine, Inc.
Komo Machine, Inc. is a leading U.S. manufacturer of advanced, precision CNC machining systems engineered for demanding manufacturing applications. Wi...READ MORE
Featured Content
View MoreFeatured Videos
View More
VISIT SITE VISIT SHOWROOM Jergens, Inc.
Manufacturing Efficiency for 75 Years In 1942, Jergens Inc. opened its doors and began its journey to grow into one of the world’s largest m...READ MORE
Featured Content
View MoreFeatured Videos
View More
VISIT SITE VISIT SHOWROOM Phillips Corporation
Featured Content
View More
VISIT SITE VISIT SHOWROOM GROB Systems, Inc.
For almost 100 years, GROB has been known worldwide for the development and manufacturing of machines and production lines. GROB is a family-owned com...READ MORE
Featured Content
View MoreFeatured Videos
View More
VISIT SITE VISIT SHOWROOM Mayfran International
Mayfran International is the world’s leading provider of quality material handling, filtration, and chip removal solutions. With an unrivaled...READ MORE
Featured Content
View MoreFeatured Videos
View More
VISIT SITE VISIT SHOWROOM PrecisionX Group
PrecisionX Group is a leading custom contract manufacturer specializing in precision metal fabrication for critical-use applications across growth-ori...READ MORE
Featured Content
View More
VISIT SITE VISIT SHOWROOM Haitian Precision USA
Haitian Precision USA has been selling industrial machine tools since 2000 under the Absolute Group of Companies. Absolute started by selling and s...READ MORE
Featured Content
View MoreFeatured Videos
View More
VISIT SITE VISIT SHOWROOM Phillips Corporation - Education
Featured Content
View More
Photo Credit: Getty Images A few months ago I compared using the return to reference (zero return) position (G28) to the motion relative to the machine coordinate system command (G53). I received a few questions regarding other commands related to a machine’s reference position, and I’d like to explain them here.
In order to understand G27, G29 and G30, you must have a firm understanding of G28. This return to reference position is a two-step command. Indeed, if the single block switch is turned on, you must press the cycle start button twice to fully execute a G28 command.
Featured Content
For any axis letter addresses included in the G28 command, the machine first will move (at rapid) to an intermediate position in those axes. Then, it will rapid to the zero return position in the commanded axes. Consider this G28 command:
G91 G28 X1.0 Y2.0 Z1.5
First, the machine will simultaneously move 1.0 (plus) in X, 2.0 (plus) in Y and 1.5 (plus) in Z. This is the intermediate position. Next, all three axes will simultaneously move to the zero return position. A special light—the axis origin light—will be illuminated as each axis reaches the zero return position.
Since most programmers want the machine to go straight to the zero return position, they give this command:
G91 G28 X0 Y0 Z0
Now the intermediate position is nothing in each axis from the current position (incremental motion of zero in each axis), so the machine stays put during the first step of G28. In the second step, all three axes will simultaneously move to the zero return position for each axis.
G27 – Reference position (zero) return check
This command tests whether a positioning movement ends at the zero return position. Consider this command:
G27 G00 X9.5373
If the positioning movement ends with the X axis at its zero return position, the X axis origin light will be lit and the machine will continue. If not, an alarm will be sounded.
I don’t see much need for this command any more. Prior to fixture offsets on machining centers and geometry offsets on turning centers, G92 and G50 were used to assign program zero. With old machines made prior to about 1982, the machine had to be in its planned position in each axis before the cycle could be activated. Many programmers chose the zero return position as the planned starting point.
It was also often important to confirm that a positioning movement truly ended at the zero return position. Consider these commands:
G50 X8.3765 Z10.3776 (Assign program zero; machine is at zero return position) T0101 (Index to station one, invoke offset one) (Machine with this tool) G00 G27 X8.3765 Z10.3776 T0100 (Move to turret index position)
In this example, G27 is being used to confirm that the machine truly ended up at the same position that it started (X and Z values match G50 command and tool offset was canceled).
G29 – Return from reference position
G29 is also a two-step command. First, it causes the machine to move (in the axes commanded) to the intermediate position used in the most recent G28 command. Second, it causes the machine to move to the position included in the G29 command. Consider this command:
G90 G29 X1.0 Y1.0
The machine will first simultaneously move in X and Y to the intermediate position of the most recent G28 command. Then it will simultaneously move to X1.0 and Y1.0 (relative to program zero).
While this could be helpful when you must avoid some kind of obstruction, you must be very careful when using G29. If the intermediate position changes from tool to tool, and if tools are run out of sequence (as is often necessary when rerunning tools), a tool may not move to its expected intermediate position. For this reason, I recommend programming any obstruction-clearing motions with basic positioning commands (G00, G01, etc.), and avoiding G29.
G30 – Return to second reference position
G30 is an optional feature and may not be included on your machines. It works much like G28, except the ending position is now definable through parameter settings. G30 is often used when a machine tool builder must define a special position in each axis, such as with pallet changers on machining centers. The zero return position may not make a good pallet-change position, so the builder may incorporate a second reference position for X and Y. Then, a G30 command is given when a pallet change is required:
G91 G30 X0 Y0
G30 is programmed just like G28. First, the machine moves to an intermediate position (zero from the current position in X and Y, in our case). Second, the machine rapids simultaneously in X and Y to the second reference position.
Again, the physical location for the second reference position is set in parameters, so if you should ever need to incorporate a special reference position, you will be able to do so with G30.
Related Content
SolidCAM iMachining and Technology Wizard: Faster Machining and Longer Tool Life
Smarter toolpaths to tackle modern machining challenges.
Read MoreHow a Family-Owned Tooling Company Competes with Global Giants (Includes Video)
Not ready to go digital? Consider this: With Siemens NX ecosystem, precision shop D’Andrea cut its programming time by 50% and is able to compete globally—even against industry giants.
Read MoreCutting Part Programming Times Through AI
CAM Assist cuts repetition from part programming — early users say it cuts tribal knowledge and could be a useful tool for training new programmers.
Read More4 Commonly Misapplied CNC Features
Misapplication of these important CNC features will result in wasted time, wasted or duplicated effort and/or wasted material.
Read MoreRead Next
Modern Machine Shop’s 2026 Top Shops Benchmarking Survey Goes Live Feb. 1
Modern Machine Shop is proud to announce the 2026 Top Shops Benchmarking Survey, opening February 1 through March 31, 2026.
Read More
Loading Why am I seeing this?
The page you’re on features premium MMS editorial content.
To continue enjoying the articles, videos and podcasts from the MMS editorial team, please key in your name and email address, as well as your company and title info. Doing so unlocks MMS’ premium web content on this device.
Why does the gate appear repeatedly for me? If the gate continues to show up on premium content after you’ve already provided your information, it could be for one of these reasons:
- Your cookie settings: Please allow cookies for www.mmsonline.com
- You’re browsing in incognito mode. Switching out of private browsing mode may help.
- You are viewing on a different device or browser. Your login is connected to the browser and device on which you originally unlocked MMS’ premium web content.
Welcome! You’ve unlocked premium content.
If you have time, please tell us a little more about yourself.
Country
Select a country United States of America Canada Mexico OtherIndustries Served
Aerospace/Aviation Appliance Automotive/Transportation Die/Mold Computers / Electrical / Electronics Industrial Machinery & Equipment Medical/Dental Military/Defense Offroad/Construction/Agricultural Oil & Gas Pumps & Valves Renewable EnergyOperations Performed
3DP/Additive Manufacturing CAD/CAM CNC Operations Drilling EDM Five-Axis Machining Gear Cutting & Rolling Grinding High Speed Machining Inspection Laser Cutting Micro Machining Milling Multitasking Machines Robotics & Automation Titanium Machining Turning Waterjet Machining SubmitWelcome to Modern Machine Shop!
Unlimited access to our free premium content requires a little more information from you.
Please enter authentic details to continue
First Name Last Name Job Title Company Email Also, please subscribe me to the MMS Extra and MMS The Shop e-newsletters! Registering RegisterYour email address will be used to communicate with you about Modern Machine Shop subscription offers, related products and services. Refer to our Privacy Policy for more information. Wondering why you’re seeing this? Read more here.
Từ khóa » G28 X0 Y0 G29 Z0
-
Autolevel?? - 3D Printing Forum
-
Start GCode Routines - RepRap
-
G-code - RepRap
-
How To Configure The BLTouch Start And End G-Codes?
-
Need Help With Creality BLTouch On Ender 3 Pro : R/ender3 - Reddit
-
Does G28 Reset The G29 Probe Calibration? - Thingiverse
-
Beginners Guide To 3D Printer Auto Bed Leveling - Simplify3D
-
Change Cura Start Gcode For Add-ons To Build Plate - 3D Hubs
-
G-code Print Issue...i Think - 3D Hubs
-
The G29 Command Only Runs The Z-probe 10 Mm Torwards The Bed.
-
[PDF] BLtouch Creality For Creality V1 安装说明书 20181113v1
-
G28 Return To Machine Zero Point (Group 00) - Haas Automation Inc.
-
D3D Automatic Bed Leveling - Open Source Ecology - Wiki