G98: Canned cycle return to initial point (mill) or Feed per minute (lathe)
G98 on a mill: Canned cycle return to initial point
With G98, a canned cycle retracts to the initial Z (where the tool was before the cycle) between holes. It is the safe choice when clamps or bosses stand between holes. On a lathe with system A, G98 means feed per minute instead.
| Type | G-code |
|---|---|
| Machine | Mill |
| Group | Cycle return |
| Modal | Yes: stays active until replaced by another code from the same group |
G98 example (mill)
G98 G81 X0. Y0. Z-5. R2. F100. Drill, return to the starting height.
| Word | What it means here |
|---|---|
G98 | Canned cycle return to initial point |
G81 | Drilling cycle (spot drill) |
X0. | X axis target (on a lathe, the diameter) |
Y0. | Y axis target |
Z-5. | Z axis target or depth |
R2. | arc radius, or the R plane (retract height) in a drilling cycle, or a cycle setting |
F100. | feed rate (on threading codes, the lead) |
Codes people confuse with G98 on a mill
| Code | What it does instead |
|---|---|
G99 | Canned cycle return to R plane. Between holes, the tool returns only to the R plane. |
G98 (lathe) | Feed per minute (lathe). On a system A lathe, F is read per minute. |
Memory hook: G98 = back to the start height; G99 = back to R.
Other codes in the cycle return group
Only one code from a modal group is active at a time. Programming any of these replaces G98.
G99Canned cycle return to R plane
G98 on a lathe: Feed per minute
On a lathe with G-code system A, G98 sets feed per minute, used mostly for live tooling. Turning normally runs in G99, feed per revolution.
| Type | G-code |
|---|---|
| Machine | Lathe (G-code system A) |
| Group | Feed mode |
| Modal | Yes: stays active until replaced by another code from the same group |
G98 example (lathe)
G98 G01 Z-10. F100. Feed at 100 mm per minute.
| Word | What it means here |
|---|---|
G98 | Feed per minute (lathe) |
G01 | Linear interpolation (feed move) |
Z-10. | Z axis target or depth |
F100. | feed rate (on threading codes, the lead) |
Codes people confuse with G98 on a lathe
| Code | What it does instead |
|---|---|
G99 | Feed per revolution (lathe). On a system A lathe, F is read per spindle revolution. The normal turning mode. |
G98 (mill) | Canned cycle return to initial point. Between holes, the tool returns to the height it started the cycle from. |
Other codes in the feed mode group
Only one code from a modal group is active at a time. Programming any of these replaces G98.
G99Feed per revolution (lathe)
Meanings follow the common Fanuc-style standard that Haas, Okuma (EIA mode), Mitsubishi, LinuxCNC and most other controls share for this code. Options and parameters change details from machine to machine, so check the manual for your control.
Quick check: G98
-
What does
G98do? (Lathe) -
What does
G98do? (Mill) -
Which code: Between holes, the tool returns to the height it started the cycle from.(Mill)
Show the answers
- On a system A lathe, F is read per minute.
- Between holes, the tool returns to the height it started the cycle from.
- G98
Frequently asked questions
- What does G98 mean in CNC programming?
- On a mill: Canned cycle return to initial point. Between holes, the tool returns to the height it started the cycle from. On a lathe: Feed per minute (lathe). On a system A lathe, F is read per minute.
- Is G98 modal?
- Yes. G98 belongs to the cycle return group and stays active until another code from that group is programmed.
- What is the difference between G98 and G99?
- G98 (canned cycle return to initial point): between holes, the tool returns to the height it started the cycle from. G99 (canned cycle return to R plane): between holes, the tool returns only to the R plane. A way to remember it: g98 = back to the start height; G99 = back to R.
G-Code Sprint is an educational practice tool only. It is not a CNC simulator, machine controller, safety manual, or replacement for instruction. Always follow your instructor, employer, machine manual, and shop procedures.