{"id":"gcode-g99","model_id":"G99","name":"LinuxCNC G99","summary":"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.","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_notes":["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."],"sources":[{"url":"https://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g98-g99","title":"G-Codes","accessed":"2026-10-26"}],"verification":{"status":"source_checked","checked_at":"2026-10-26","values":3,"method":"llm_source_check"},"updated_at":"2026-10-26","type":"instruction","spec":{"language":"gcode","code":"G99","group":"canned cycle return level","syntax":"G99","parameters":[],"dialect":"LinuxCNC","related":[],"standards":[]},"url":"https://machineschema.com/instruction/gcode-g99","license":"https://creativecommons.org/licenses/by/4.0/"}