Hangar CNC

G and M codes explained

G76

Multi-pass threading cycle.

Learn this code in 10 minutes

Mini simulator

━ rapid · ━ cutting

Sample program

%
O2000
G21 G18 G40 G99
T0101
G96 S180 M03
G50 S2500
G00 X52 Z2 M08
G00 X22 Z5
G76 P010060 Q100 R0.05
G76 X17.4 Z-20 P1300 Q400 F2
G00 X100 Z100
M05 M09
M30
%

Line by line

  1. O2000 : Program number: O2000.
  2. G21 G18 G40 G99 : Dimensions in millimetres. ZX working plane (lathe). Cancels tool radius compensation. Milling: return to the R plane after a cycle. Lathe: feed in mm per revolution.
  3. T0101 : Tool no. 1 with offset no. 1.
  4. G96 S180 M03 : Constant surface speed (S in m/min): the spindle speeds up as the diameter decreases. Constant cutting speed: 180 m/min. Spindle on, clockwise.
  5. G50 S2500 : Spindle speed limited to 2500 rpm.
  6. G00 X52 Z2 M08 : Rapid move to X=52, Z=2. Coolant on.
  7. G00 X22 Z5 : Rapid move to X=22, Z=5.
  8. G76 P010060 Q100 R0.05 : Multi-pass threading cycle. Parameters: P010060 Q100 R0.05.
  9. G76 X17.4 Z-20 P1300 Q400 F2 : Multi-pass threading cycle. Parameters: X17.4 Z-20 P1300 Q400 F2. Feed set to 2 mm/rev.
  10. G00 X100 Z100 : Rapid move to X=100, Z=100.
  11. M05 M09 : Spindle stop. Coolant off.
  12. M30 : End of program, rewind to the start.

Common mistakes

A wrong pitch F or depth: the thread fails the gauge.

Free training, on phone or computer, in 5 languages.

Learn this code in 10 minutes