G28
Return to the machine reference point (often “G91 G28 Z0” to clear Z first).
Mini simulator
━ rapid · ━ cutting
Sample program
% O1000 G21 G17 G40 G49 G80 G90 T1 M06 G54 G00 X0 Y0 S1200 M03 G43 Z5 H1 M08 G01 Z-1 F150 G01 X20 F300 G91 G28 Z0 G90 G00 Z50 M05 M09 M30 %
Line by line
O1000: Program number: O1000.G21 G17 G40 G49 G80 G90: Dimensions in millimetres. XY working plane (milling). Cancels tool radius compensation. Cancels tool length compensation. Cancels the active drilling cycle. Absolute positioning: relative to the work zero.T1 M06: Tool change: tool no. 1 goes into the spindle.G54 G00 X0 Y0 S1200 M03: Work offset no. 1 (G55 to G59: offsets 2 to 6). Rapid move to X=0, Y=0. Spindle speed: 1200 rpm. Spindle on, clockwise.G43 Z5 H1 M08: Activates tool length compensation (H). Rapid move to Z=5. Coolant on.G01 Z-1 F150: Straight-line feed to Z=-1, at 150 mm/min.G01 X20 F300: Straight-line feed to X=20, at 300 mm/min.G91 G28 Z0: Incremental positioning: from the current position. Return to the machine reference point (often “G91 G28 Z0” to clear Z first).G90: Absolute positioning: relative to the work zero.G00 Z50: Rapid move to Z=50.M05 M09: Spindle stop. Coolant off.M30: End of program, rewind to the start.
Common mistakes
Writing “G90 G28 Z0”: the machine first goes through Z0 of the PART, often into it. Write “G91 G28 Z0”.
Free training, on phone or computer, in 5 languages.