LinuxCNC G98

G98 is a G-code that selects the retract level used at the end of canned cycles such as drilling and boring. In this mode the tool returns to the Z position it held just before the series of contiguous canned cycles began, if that position is higher than the R value; otherwise the R value is used. It is the alternative to G99, which always retracts to the R position.

Source checked2/2 values · 2026-10-26

Specification

1 source
Languagegcode
CodeG98
GroupCanned Cycle Return Level
DialectLinuxCNC

Study notes

  • G98 retracts to the position the axis was in just before the series of one or more contiguous canned cycles was started, provided it is higher than the R value; if lower, the R value is used.
  • G99 instead retracts to the position specified by the R word of the canned cycle.
  • G98 is also referred to in the document as OLD_Z retract mode.
  • The initial (G98) plane is reset any time cycle motion mode is abandoned, whether explicitly with G80 or implicitly with any motion code that is not a cycle.
  • Switching among cycle modes (for example G81 to G83) does not reset the initial plane.
  • It is possible to switch between G98 and G99 during a series of cycles.
  • Documented example: G0 X1 Y2 Z3 followed by G90 G98 G81 X4 Y5 Z-0.6 R1.8 F10 returns to Z3 because it is higher than the R value of 1.8.
↑↓ navigate↵ openesc close