Wrong Retract Mode (G98 vs G99): The Canned-Cycle Mistake That Drives the Tool Through Your Clamp | Eureka 3X Pro

Wrong Retract Mode (G98 vs G99): The Canned-Cycle Mistake That Clips Your Clamp

The holes were right. The retract between them wasn't.

Canned cycles are a gift — one line drills a hole, and the cycle repeats it across every position you list. But that convenience hides a decision most programmers set once and rarely think about again: where does the tool go between holes? That's the job of the retract mode, and getting it wrong is one of the most common canned-cycle mistakes on the floor — because the program runs, the holes come out fine, and the crash happens in between.

  • G98 retracts to the initial level — the Z height the tool was at when the cycle started, safely above everything.
  • G99 retracts only to the R plane — a height just above the hole, set for speed.

G99 is faster and perfectly safe on flat, open stock. But the moment there's something standing above the R plane between two holes — a clamp, a fixture rib, a raised feature, a previously placed part — the tool retracts to the low R plane, traverses at that height, and drives straight into the obstacle on its way to the next hole. Same cycle, same holes, one wrong mode word, and you've hit a clamp at rapid.


Why this one is so easy to get wrong

The retract mode error is common precisely because it's invisible in the part. Every hole is drilled to the correct depth in either mode — the finished holes are identical. The difference is only in the transit moves between them, which don't show up as a feature and don't announce themselves in a listing.

It creeps in through the usual routes:

  • A modal setting carried over. G98/G99 is modal — set it once and it stays until changed. A G99 left active from an earlier operation on open stock silently governs a later operation run over clamps.
  • Post-processor default. A post that outputs G99 by default (for speed) produces programs that are fine on open fixtures and dangerous the day the setup has raised clamps.
  • Hand edits and copied cycles. A cycle copied from a program that ran on flat stock, pasted into one that doesn't, brings the wrong retract mode with it.
  • R plane set too low. Even with the mode right, an R plane below the top of a clamp makes G99 traverse straight into it.

The tool clears the holes perfectly. It's the space between the holes the programmer didn't picture.


Why crash detection catches it only sometimes — and simulation always should

This is a genuine collision, so in principle crash detection can catch it — if the fixture is modeled. That's the catch. The retract-mode crash only happens because of what's standing above the R plane: the clamp, the fixture, the raised feature. If your verification doesn't include an accurate model of the fixture in the right place, there's nothing for the tool to collide with in the simulation, and the crash that will happen on the real machine simply doesn't appear.

And a CAM simulation, driven by its own toolpath and its own assumptions about the setup, may not represent the real fixture — or may not reflect the retract mode the posted program actually contains after edits. The retract behavior that matters is the one the control executes on the real program, over the real fixture.

So catching this reliably needs two things together: the actual program executed the way the control runs it, and the real fixture in place. Miss either, and the between-holes crash stays hidden until the tool finds the clamp.


Where Eureka 3X Pro fits

Eureka 3X Pro simulates the posted or hand-written program against a controller-accurate twin — executing the canned cycle, and its G98/G99 retract behavior, exactly as the control will — with your real fixtures and clamps in the scene. For a Fusion or Mastercam user, that fixture and setup come across automatically through the cascade post, so the tool is retracting over the real clamps, not an empty table. The wrong-retract crash that would hit a fixture between holes shows up on the twin, before the tool ever transits at the low R plane on the real machine.

Because it runs the actual cycle over the actual fixture, it catches all the flavors of this mistake in one check: the modal G99 carried over from a previous operation, the post's default that's fine until it isn't, the copied cycle that brought the wrong mode, and the R plane set below the top of a clamp. It's the difference between "the holes are in the right places" and "the tool got to every hole without hitting anything on the way."

Take a drilling program that runs over clamps or a tall fixture — anywhere something stands above the stock between holes — and run it through Eureka 3X Pro with your fixture in place. Watching how the tool retracts and transits between holes, before it does it for real, is how you catch the clamp it was about to clip.

Eureka 3X Pro — 30-day free trial, no credit card required.


FAQ

What's the difference between G98 and G99? In a canned cycle, G98 retracts the tool to the initial level — the Z height at the start of the cycle, above the fixture — while G99 retracts only to the R plane, just above the hole. G99 is faster; G98 is safer when anything stands above the R plane between holes.

Why does my drill crash between holes when every hole is correct? Almost always a wrong retract mode. In G99 the tool retracts only to the low R plane and traverses at that height to the next hole — so if a clamp or fixture sits above the R plane, it drives into it, even though every hole itself is drilled correctly.

Is G98 or G99 the "right" one? Neither universally. G99 is fine and faster on flat, open stock. Use G98 (or a high enough R plane) whenever there are clamps, fixtures, or raised features the tool must clear as it moves between holes.

Why might my simulation miss this crash? Because the crash depends on the fixture. If the fixture or clamps aren't modeled in the right place, there's nothing in the simulation for the tool to hit — so the between-holes collision that will happen on the machine doesn't appear. Eureka 3X Pro runs the real cycle with your real fixtures in place.

Does it catch a wrong retract mode in hand-edited programs? Yes. It reads the actual .nc and executes the canned cycle the way the control will, so a modal G99 carried over or a copied cycle with the wrong mode is caught regardless of how the program was produced.


Run every G-code program risk-free — before it touches your machine.

Try Eureka 3X Pro Risk-Free

Run every G-code program risk-free — before it touches your machine.