G98 and G99 — Initial Plane vs R-Plane Return in Canned Cycles

Every canned cycle — drilling, tapping, boring — ends with a retract move. After completing the operation at depth, the tool needs to rise clear of the workpiece before moving to the next hole. G98 and G99 control where the tool retracts to between holes.

This seems like a minor detail, but choosing the wrong return plane is one of the most reliable ways to drag a tool across a clamp or crash into a raised workpiece feature.

The Two Return Planes

R-plane — a clearance height defined in the canned cycle block with the R word. It sits just above the part surface (typically 2–5mm). The tool feeds from the R-plane down to the hole depth.

Initial plane — the Z height the tool was at when the canned cycle was first called. This is whatever Z position was active before the G81/G83/G84 block executed.

G99 returns to the R-plane between holes. G98 returns to the initial plane.

G99 — Return to R-Plane

After completing each hole, the tool retracts to the R-plane and then rapids to the next XY position before drilling again. This is faster because the retract distance is short — just above the part surface.

G0 Z50.                        (initial plane: Z50)
G99 G81 Z-15. R3. F250        (drill — retract to R3 between holes)
X30. Y0.                       (tool rapids at R3 height)
X60. Y0.                       (still at R3)
G80

Use G99 when all holes are at the same level and there are no obstructions between them — no clamps, no raised bosses, no steps on the part.

G98 — Return to Initial Plane

After completing each hole, the tool retracts to the initial plane — the Z height active when the canned cycle was called. The tool then rapids to the next XY position at this higher clearance height.

G0 Z50.                        (initial plane: Z50)
G98 G81 Z-15. R3. F250        (drill — retract to Z50 between holes)
X30. Y0.                       (tool rapids at Z50)
X60. Y0.                       (still at Z50)
G80

Use G98 when there are obstacles between holes — clamps, fixture plates, steps in the part, or whenever the R-plane height is not sufficient to clear features between drilling positions.

Practical Example: Drilling Two Hole Groups at Different Heights

When a part has raised bosses or stepped surfaces, different holes may need different R-planes. G98 ensures the tool clears between groups by returning to the higher initial plane.

G0 Z80.                           (set initial plane high enough to clear all features)

(first group — holes on lower surface)
G98 G83 Z-30. R5. Q5. F180
X10. Y10.
X50. Y10.
G80

(second group — holes on raised boss, R-plane higher)
G0 X100. Y50.
G98 G83 Z-20. R55. Q4. F180      (R55 clears the boss surface)
X120. Y50.
G80

With G98 active, the tool returns to Z80 between holes in each group — clearing the boss between groups without needing to manually cancel and re-call the cycle.

What Happens at the End of the Last Hole

At the last hole in a canned cycle sequence, G98 and G99 behave identically: after the final operation completes, the tool retracts to the return plane (R or initial) and stays there. The G80 cancel command does not move the tool — it only cancels the cycle mode.

G99 G81 Z-12. R3. F300
X10. Y0.
X30. Y0.
X50. Y0.        (last hole — tool retracts to R3)
G80             (cycle cancelled — tool stays at R3)
G0 Z50.         (now manually retract to safe height)

After G80, always add an explicit G0 to a safe Z height before the next operation.

G98/G99 and the Initial Plane Value

The initial plane is not a value you program explicitly — it is whatever Z position the tool occupied when the canned cycle was first activated. If you position to Z2 before calling the cycle, the initial plane is Z2 — which may not clear anything. If you position to Z100, the initial plane is Z100 — safe but slow.

The right approach is to position to a meaningful clearance height before the cycle:

G0 Z50.             (deliberate initial plane — enough to clear fixtures)
G98 G84 Z-20. R3. F600

Quick Reference

ConditionUse
Flat part, no obstructions between holesG99 (faster)
Clamps, bosses, or steps between holesG98 (safer)
Holes on different surfacesG98 with appropriate initial plane
UnsureG98 (never hurts, only costs cycle time)

When in doubt, G98 is always the safer choice. The cycle time difference is rarely significant, and a tool dragged across a clamp ruins the part and potentially the tool.

Verify Clearance in Simulation

The R-plane and initial plane heights are invisible in a G-code listing — you cannot tell by reading the code whether the retract height clears the fixtures. Eureka3X simulates the complete canned cycle behavior including retract moves, so you can verify clearance visually on the 3D machine model before cutting.

Try Eureka3X free for 30 days →

Related Articles

Start verifying your real G-code today.

Ensure your programs are safe and accurate with Eureka 3X Pro.

Start 30-Day Free Trial