LinuxCNC G99

G99 is a LinuxCNC G-code that sets the retract level used by canned cycles. With G99 active, the tool retracts to the position given by the R word of the canned cycle rather than to the Z position that was in effect before the cycle started. G98 and G99 can be switched between during a series of cycles.

Source checked3/3 values · 2026-10-26

Specification

1 source
Languagegcode
CodeG99
Groupcanned cycle return level
SyntaxG99
DialectLinuxCNC

Study notes

  • G98 is the alternative: it retracts to the position the axis was in just before the series of contiguous canned cycles started, provided that position is higher than the R value; otherwise the R value is used.
  • The meaning of the R word differs between absolute distance mode and incremental distance mode.
  • The initial (G98) plane is reset any time cycle motion mode is abandoned, either explicitly with G80 or implicitly by any motion code that is not a cycle.
  • Switching among cycle modes (for example G81 to G83) does not reset the initial plane.
  • G99 is part of the canned cycle group G80-G89 described in the LinuxCNC G-code reference.

Safety

  • In a canned cycle with the XY plane active, it is an error if the R number is less than the Z number.
  • It is an error if a canned cycle is run with inverse time feed rate active or with cutter compensation active.
↑↓ navigate↵ openesc close