Hangar CNC

G and M codes explained

G71

Rough turning cycle (passes along Z).

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
G71 U2 R0.5
G71 P10 Q20 U0.4 W0.1 F0.25
N10 G00 X30
G01 Z-20 F0.15
N20 X52
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. G71 U2 R0.5 : Rough turning cycle (passes along Z). Parameters: U2 R0.5.
  8. G71 P10 Q20 U0.4 W0.1 F0.25 : Rough turning cycle (passes along Z). Parameters: P10 Q20 U0.4 W0.1 F0.25. Feed set to 0.25 mm/rev.
  9. N10 G00 X30 : Rapid move to X=30.
  10. G01 Z-20 F0.15 : Straight-line feed to Z=-20, at 0.15 mm/rev.
  11. N20 X52 : Straight-line feed to X=52.
  12. G00 X100 Z100 : Rapid move to X=100, Z=100.
  13. M05 M09 : Spindle stop. Coolant off.
  14. M30 : End of program, rewind to the start.

Common mistakes

A forgotten U or W allowance: the G70 finish has nothing, or too much, to remove.

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

Learn this code in 10 minutes