Home/Articles/G76 Threading Cycle (Turning): CNC Programming & Setup Guide
G76 · TURNING

G76 Threading Cycle (Turning): CNC Programming & Setup Guide

ProgrammingFanucSiemensMitsubishi·Updated Jul 23, 2026·14 min read
Quick answer

How do you program the G76 threading cycle on a CNC lathe To program G76, call G76 P(m)(r)(a) Q(dmin) R(d) followed by the coordinate block G76 X_ Z_ P(k) Q(d) F_ to automate constant-volume threading passes. Deactivate cutter compensation with G40 to prevent Alarm 61815 and write P and Q as positive integers on Fanuc.

Introduction

An incorrectly configured zero offset or tool offset during a G76 threading cycle drives the indexable threading tool carrier on the turret or tool post directly into physical workholding components under high feedrate command. Bypassing software-defined stroke limits, the tool nose impacts the rotating jaws of the spindle chuck, a table-mounted vise jaw, or table clamps at full speed. The setup operator is met with a sudden, violent crash that shatters the carbide insert, damages the ball screws, triggers a high-current axis-overload alarm (such as Operation Error M01 0107), and converts the raw casting or billet into ruined scrap. Properly establishing safety clearances, verifying coordinate offsets, and conducting single-block dry runs are mandatory practices to prevent catastrophic damage to the machine spindle and main structural components.

Technical Summary

Technical Attribute Specification
Command Code G76 (Fanuc, Siemens G291 ISO Dialect, Mitsubishi), CYCLE99 (Siemens G290 Native)
Modal Group Group 00 / Non-modal (Fanuc, Siemens G291, Mitsubishi)
Supported Brands Fanuc, Siemens, Mitsubishi
Critical Parameters Fanuc: Parameter 5142 (default finishing reps), Parameter 5130 (default chamfer width); Siemens: _ZSFI[1] (default finishing cuts), _ZSFI[2] (default chamfer width); Mitsubishi: Parameter #1265 (format switch), Parameter #1222 (strict check).
Main Constraint Cutter radius compensation (G41/G42) must be inactive (deactivate using G40) before G76 to avoid Alarm 61815. Spindle rotation must be active (M03/M04) before starting the cycle (Alarm 61102). Radial parameters (P, Q, K, D) must be positive integers representing microns without decimal points on Fanuc and Mitsubishi.

Quick Read

  • Deactivate Radius Compensation: Deactivate tool nose radius compensation (G40) and constant surface speed (G96) before executing G76 to prevent Alarm 61815 or trajectory calculation errors.
  • Avoid Decimal Points: Program the thread height (P or K) and first-pass depth (Q or D) strictly as positive integers representing least command increments (microns) on Fanuc and Mitsubishi controls.
  • Verify Spindle Rotation: Ensure spindle rotation is active with a commanded M03 or M04 and rotational speed before calling G76 to avoid a spindle stationary error (such as Siemens Alarm 61102).
  • Match Program Format: Set Mitsubishi parameter #1265 (ext01/bit0) to 0 for standard two-block format or 1 for single-block Special format, and verify compatibility using parameter #1222.
  • Configure Siemens Language: Set Siemens machine data parameter MD 18800 to enable the external language option before switching to G291 ISO Dialect mode.
  • Dry-Run the First Pass: Execute G76 in single-block mode with the spindle running to visually verify clearance planes on the HMI coordinate screen before cutting raw stock.

Basic Concepts

The G76 multiple-repetitive threading cycle is utilized to machine high-precision cylindrical or tapered threads on turning centers. Its primary programmatic advantage over basic threading codes is that it automatically calculates the diminishing depth of each successive pass, ensuring that the volume of material removed (and the corresponding cutting torque load on the tool tip) remains constant across all roughing passes. During these passes, the tool advances at a coordinated feedrate equivalent to the thread lead, utilizing rapid traverse moves for approach and retraction.

Rather than placing an extreme, uniform infeed load on the insert tip across all cuts, G76 automatically calculates the progressively decreasing depth of each successive pass. This strategy distributes the cutting forces and thermal loads evenly across the indexable threading insert, preventing premature tool failure and maximizing tool life. Under these conditions, the tool advances at a coordinated feedrate equivalent to the thread lead, utilizing rapid traverse moves for approach and retraction.

Command Structure

The G76 cycle requires a specific command structure to define the geometry of the thread and the cutting passes. On controls using the two-block format, the first block defines the overall cycle parameters, including the number of finishing passes, the chamfer width (or thread roll-out amount), the thread angle, the minimum cut depth, and the finishing allowance. This first block instructs the control's preprocessor on how to divide the thread depth into individual cuts.

The second block specifies the target coordinates of the thread end point, the taper value (if machining tapered threads), the total thread height, the depth of the first cutting pass, and the thread lead or pitch. By separating these values, the control can dynamically compute the trajectory and decrease infeed for each pass. For Siemens controls operating in native mode, the cycle is programmed using the CYCLE99 macro, which accepts these variables as parameters rather than G-code addresses.

Syntax Details

  • Fanuc / Mitsubishi Two-Block Format:
    G76 P(m)(r)(a) Q(Δdmin) R(d) ;
    G76 X(U)_ Z(W)_ R(i) P(k) Q(Δd) F(L) ;
  • Siemens G291 ISO Dialect Format:
    G291 ;
    G76 P(m)(r)(a) Q(Δdmin) R(d) ;
    G76 X(U)_ Z(W)_ R(i) P(k) Q(Δd) F(L) ;
  • Siemens CYCLE99 Native Format:
    CYCLE99 (SPL, DM1, FPL, DM2, APP, ROP, TDEP, FAL, IANG, NSP, NRC, NID, VARI, NUMT, ...)
  • Mitsubishi Special Single-Block Format:
    G76 X(U)_ Z(W)_ I_ K_ D_ F_ A_ Q_ P_ ;

Parameter Specifications

Parameter Brand Description Value Range
P (Block 1) Fanuc / Mitsubishi Multi-digit parameter: m (finishing reps), r (chamfer factor), a (tool nose angle) 6-digit integer (e.g. 011060)
Q (Block 1) Fanuc / Mitsubishi Minimum cutting depth during roughing passes (in microns) Positive integer (no decimal)
R (Block 1) Fanuc / Mitsubishi Finishing allowance remaining stock Positive real number
X, Z Fanuc / Mitsubishi Target coordinates of the thread end point Real numbers
R (Block 2) Fanuc / Mitsubishi Taper value (height difference over the thread length) Real number
P (Block 2) Fanuc / Mitsubishi Total thread height (depth of thread, in microns) Positive integer (no decimal)
Q (Block 2) Fanuc / Mitsubishi First cut depth (in microns) Positive integer (no decimal)
F (Block 2) Fanuc / Mitsubishi Thread lead or pitch Positive real number

Brand Applications

Fanuc

On Fanuc controls, G76 is processed by the preprocessor as a Group 00 non-modal cycle. The default parameters for finishing cuts are managed through Parameter 5142 and Parameter 5130.

The modern double-block G76 command defines the roughing pass parameters in the first block, and the coordinate endpoints and depth values in the second block:

G76 P011060 Q100 R200 ;
G76 X60.64 Z25.0 P3680 Q1800 F6.0 ;
Category Fanuc Specifications
Key Parameters Parameter 5142 (default finishing reps), Parameter 5130 (default chamfer width)
Common Alarms Alarm PS0050 (chamfer or corner rounding programmed inside G76), Alarm PS0429 (axis mismatch)
Version Differences One-block legacy format (Fanuc 10T/11T/15T) vs. modern two-block format (Fanuc 0T/16T/18T/21T)
WARNINGSpecifying decimals in the thread height P or first cut Q on Fanuc will cause the controller to read the value in least input increments (microns), resulting in microscopic depth passes, severe tool rubbing, and a scrapped workpiece.

Siemens

Siemens controls support bimodal programming, switching between native G290 mode and external bilingual interpreter G291 mode. The default settings for finishing cuts are managed via the array parameter _ZSFI[1] and the chamfer width parameter _ZSFI[2].

To execute ISO G76 turning cycles on Siemens, the control must first be switched to external mode using G291, followed by the double-block cycle format:

G291 ;
G76 P011060 Q100 R0.1 ;
G76 X60.64 Z-25.0 P3680 Q1800 F6.0 ;
Category Siemens Specifications
Key Parameters _ZSFI[1] (default finishing cuts), _ZSFI[2] (default chamfer width), MD 18800 (external language toggle)
Common Alarms Alarm 61815 (G41/G42 active during G76), Alarm 61001 (thread lead PIT omitted or zero), Alarm 61102 (stationary spindle execution)
Version Differences 840D sl supports multi-edge turning G51.2/G50.2, while 802D sl lacks this support and has write-protected G-code reset values (MD 20154)
WARNINGRunning G76 while cutter radius compensation G41 or G42 is active will trigger Alarm 61815, stopping axis movement instantly.

Mitsubishi

Mitsubishi controls parse G76 as a non-modal cycle. The default number of passes is managed by Parameter #8058, while the finishing allowance is set in Parameter #8057.

Mitsubishi supports standard double-block G76 syntax, but can collapse the instruction into a single block if the special format is enabled:

G76 P011560 R0.2 ;
G76 U-28.0 W-46.0 R-9.0 P6.0 Q3.5 F4.0 ;
Category Mitsubishi Specifications
Key Parameters Parameter #1265 (format switch bit), Parameter #1222 (strict syntax checking), Parameter #8014 (thread pull-out gradual amount)
Common Alarms Program Error P33 (format mismatch), Program Error P32 (invalid address R in single-block format), Program Error P35 (start shift angle Q > 360.0)
Version Differences System C maps G76 to end-face peck grooving and threading to G78 (configured via parameter #1037), while System A/B uses G76 for threading
WARNINGIf a program format mismatch occurs while strict checking parameter #1222 is active, the control aborts with Program Error P33.

Brand Comparison

Feature / Behavior Fanuc Siemens Mitsubishi
Dynamic Compiler Format Switch None None G188/G189 program format switch
Feed Hold Retract Safety Rapid retract safety routine during feed hold Handled by general system decel parameters Rapid retract safety routine during feed hold
Parameter Decimal Parsing Strict integer microns, no decimals in P/Q Natively parsed in native mode (decimals allowed) Strict integer microns, no decimals in P/K/Q/D
Multi-part System Synchronized Cycles None Managed in CYCLE99 without hardware G-codes G76.1 / G76.2 multi-part system codes
Safety Boundary Management Group 04 modal G22/G23 chuck/tailstock barriers Text-based commands WALIMON / WALIMOF Chuck barrier/tailstock barrier NC screen

Technical Analysis

Three distinct programmatic and coordinate behaviors clearly distinguish Fanuc's G76 threading cycle and preprocessor handling from Siemens and Mitsubishi controls. First, Fanuc incorporates an integrated "thread cutting cycle retract" (thread pullout) preprocessor safety routine during feed hold. If an operator presses the feed hold button during a roughing pass in G76, the control does not stop the axis immediately inside the cut, which would otherwise strip the thread and shatter the tool. Instead, the preprocessor instantly triggers a rapid, chamfer-angled retraction to exit the cut and returns the turret directly to the cycle start point. Once cycle start is triggered again, G76 automatically resumes from the interrupted pass. Siemens and Mitsubishi controls manage feed hold interruptions via general system parameters and deceleration ramps that do not feature this exact automated cycle-resumption macro sequence natively.

Second, Fanuc interprets thread height (P) and first-pass depth (Q) strictly as positive integer values representing least command increments (microns or ten-thousandths of an inch) with no decimal points allowed. Siemens and Mitsubishi controls, conversely, natively parse decimal formats directly in their cycle blocks. Transferring a Fanuc program containing P3680 or Q1800 directly to a Siemens control without converting them to decimals will cause a compiler failure or dangerously miscalculated paths.

Third, Siemens completely decouples thread profiling from G-code cycle blocks in its native mode, utilizing technology cycles like CYCLE99. While Fanuc maps multi-pass threading to G76 and requires all coordinate parameters to be programmed inline, Siemens native mode (G290) replaces G-code structures with the parametric cycle CYCLE99. Under native Siemens mode, G75 is reallocated as a non-modal coordinate positioning command, while thread turning, lead variations, and multi-start shifts are managed on ShopTurn template screens, eliminating G-code syntax conflicts.

Program Examples

Fanuc G-Code Example

G00 X80.0 Z130.0 ; Traverse to safe startup point before calling G76
G76 P011060 Q100 R200 ; Block 1: 1 finish pass, 1.0L chamfer, 60 deg angle, Q0.1mm min cut, R0.2mm finish stock
G76 X60.64 Z25.0 P3680 Q1800 F6.0 ; Block 2: cut to root X60.64, Z25.0, 3.68mm thread height, 1.8mm first cut

dry run

To execute a dry run of the Fanuc code, set the machine controller to single-block mode and activate the dry run switch on the operator panel. During execution, the turret moves to the safe start coordinate of X80.0 Z130.0 and stops. Once the operator presses cycle start again, the preprocessor evaluates the G76 parameters. The turret performs the threading passes without feeding into physical raw stock, allowing the operator to verify on the HMI coordinate screen that the paths remain clear of the spindle chuck jaws.

Siemens G-Code Example

G291 ; Switch bilingual interpreter to ISO Dialect Mode to parse G76 turning cycle
G76 P011060 Q100 R0.1 ; First block: 1 finish pass, 1.0L chamfer, 60 deg angle, Q0.1mm min cut, R0.1mm finish stock
G76 X60.64 Z-25.0 P3680 Q1800 F6.0 ; Second block: root X60.64, Z-25.0, 3.68mm thread depth (P3680), 1.8mm first cut (Q1800), 6.0mm lead

dry run

To perform a dry run of the Siemens program, select single-block mode and activate the dry run feedrate on the SINUMERIK control panel. Execute the G291 command to switch the interpreter. The control processes the G76 blocks, allowing the operator to monitor the coordinates on the screen. The axis moves through the threading passes above the workpiece, ensuring the toolpost maintains clearance from table-mounted fixture clamps.

Mitsubishi G-Code Example

G76 P011560 R0.2 ;
G76 U-28.0 W-46.0 R-9.0 P6.0 Q3.5 F4.0 ; Normal format G76

dry run

To dry-run the Mitsubishi G76 program, switch the control panel to single-block execution and enable dry run mode. The control processes the first G76 block to load finishing parameters and pauses. Pressing cycle start again executes the motion block. The tool moves through the simulated threading path in the air, permitting the operator to verify that the tool does not breach the chuck barrier safety envelope defined on the NC screens.

Error Analysis

Brand Alarm Code Trigger Condition Operator Symptom Root Cause / Fix
Fanuc Alarm PS0050 Chamfering (C) or corner rounding (R) programmed within G76 block. Execution halts immediately before starting the thread cycle. Remove the chamfer/corner blend from the G76 block.
Siemens Alarm 61815 Cutter/tool nose radius compensation (G41 or G42) active during G76. The control displays Alarm 61815 and halts block execution. Deactivate compensation using G40 before calling the G76 cycle.
Siemens Alarm 61001 Thread lead/pitch parameter PIT omitted, set to zero, or size conflict. Cycle fails to execute, and an error message is generated. Check and verify the PIT/MPIT parameters in the cycle call.
Mitsubishi Program Error (P33) G76 format mismatch while check parameter #1222 is active. Program execution aborts with a P33 alarm code. Align program format (single vs. two-block) with parameter #1265.
Mitsubishi Program Error (P32) Commands invalid address R in single-block Special format. System registers a P32 error and stops cycle start. Change R to I for the taper height component in the special format.

Application Note

A catastrophic machine crash, shattered carbide tool, and bent ball screw are the direct consequences of executing a G76 threading cycle under incorrectly registered workpiece coordinate zero offsets. If the operator begins automatic execution without performing a dry run, the tool nose will bypass soft software boundaries and drive the turning tool directly into the rotating jaws of the spindle chuck, a table-mounted vise jaw, or table clamps at high feedrate. The operator is met with a sudden hard crash that shatters the indexable carbide insert, bends the axis ball screws, halts the machine with a high-current axis-overload alarm code, and converts the raw casting into scrap. To prevent this, setup operators must dry-run G76 programs in single-block mode and verify the active clearance planes on the coordinate screen before letting the tool touch the workpiece.

  • G70 Finishing Cycle: Used to perform the final finishing passes on a turned profile after roughing cycles.
  • G74 End Face Peck Drilling/Grooving: A canned cycle used for axial grooving or peck drilling on the workpiece face.
  • G75 Fixed Point Approach: A non-modal command in Siemens controls used to retract the axis directly to a pre-defined machine coordinate.
  • G32 / G33: Constant lead thread cutting commands used for single-pass threading paths.
  • G34: Variable-lead threading cycle command for threads with changing pitch.

Conclusion

Achieving consistent thread quality and avoiding structural damage requires strict verification of parameter units and active coordinate states. Operators must verify that all radius compensation codes are canceled and that positive integers are used for radial depths on compatible controls before initiating threading cycles.

FAQ

Why does programming a decimal point in Fanuc G76 depth values cause tool rubbing?

Fanuc controls interpret decimal values in G76 P and Q addresses as least input increments (microns or ten-thousandths of an inch). A value written as Q1.8 is parsed as 1 or 2 microns rather than 1.8 millimeters, causing the tool to perform microscopic cuts that rub against the metal, heat up the carbide tip, glaze the surface, and scrap the part. Always write these addresses as positive integers without decimals, such as Q1800 for a 1.8 mm cut depth.

How do you resolve Siemens Alarm 61815 during the threading cycle?

This alarm is triggered when cutter radius compensation (G41 or G42) is active during G76 cycle execution, which is forbidden because the control cannot calculate compensated coordinates for threading paths. Insert a G40 command in the block immediately preceding the G76 cycle to deactivate radius compensation.

What is the safety risk of altering WCS offsets during a single-block stop?

Changing offset values on the control panel screen during a single-block stop does not apply the shift immediately. On Mitsubishi controls, the new offset only becomes valid in the subsequent program block, so resuming execution immediately causes the tool to travel along the old offset path. Programmers must include an explicit block stop or dummy motion block after any offset update to force the controller to load the new values before the tool approaches workholding.

HG

Hakan Gündoğdu

CNC CARE CO-FOUNDER

CNC uzmanı, 25+ yıl saha tecrübesi, Mitsubishi Electric Türkiye geçmişi.