G-code reference

G30: Return to second reference position

G30 is return to second reference position. Like G28, but to a second stored position, often the tool-change point. It is non-modal, so it acts only on the line it is written on.

What G30 does

G30 works like G28 but goes to a second reference position stored in a parameter. Machines often use it as a tool change or part loading position.

TypeG-code
MachineMill and lathe
GroupNon-modal
ModalNo: acts only on its own line

G30 example

G91 G30 Z0.

Go to the second reference position in Z.

WordWhat it means here
G91Incremental positioning
G30Return to second reference position
Z0.Z axis target or depth

Codes people confuse with G30

CodeWhat it does instead
G28 Return to reference position. Sends the named axes home, by way of an intermediate point.

Other codes in the non-modal group

These also act only on their own line.

  • G04 Dwell
  • G09 Exact stop (one block)
  • G10 Programmable data input
  • G28 Return to reference position
  • G50 Maximum spindle speed (lathe)
  • G52 Local coordinate system
  • G53 Machine coordinate move
  • G65 Macro call
  • G92 Set coordinate system (shift)

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: G30

  1. What does G30 do? (Mill and lathe)

  2. Which code: Like G28, but to a second stored position, often the tool-change point.(Mill and lathe)

  3. What does G28 do? (Mill and lathe)

Show the answers
  1. Like G28, but to a second stored position, often the tool-change point.
  2. G30
  3. Sends the named axes home, by way of an intermediate point.

Drill this code with the rest of the core set

More practice hubs

Frequently asked questions

What does G30 mean in CNC programming?
Return to second reference position. Like G28, but to a second stored position, often the tool-change point.
Is G30 modal?
No. G30 acts only on the line where it is written; the next line goes back to whatever modal codes were already active.
What is the difference between G30 and G28?
G30 (return to second reference position): like G28, but to a second stored position, often the tool-change point. G28 (return to reference position): sends the named axes home, by way of an intermediate point.

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.

Free preview · no card Try G-Code Sprint