Skip to content

G76: multi-pass threading cycle on the lathe

G76 cuts threads on the lathe by splitting the total thread depth into several passes the control works out on its own, with the spindle synchronized to the carriage feed so every pass lands in exactly the same thread. You give it the root diameter, the thread height, the depth of the first pass and the pitch; the cycle takes care of the entry, the infeed along a single flank and the chamfered pull-out. It is the most widely used threading code on the lathe because it saves you from writing by hand the ten or twelve passes you would need with G32 or G92.

For reference only: syntax changes with the control, the post-processor and the machine parameters. Check the official manual and run a simulation before cutting. Legal notice.

The brands and control names mentioned belong to their owners and are used only to identify the equipment. GetGCode is not affiliated with or endorsed by any manufacturer, ISO or ASME: this is our own content, not official documentation. Legal notice.

Family
Lathe cycles
Machine
Turning, Mill-turn
Risk
High
Example
G76 P020060 Q100 R0.05

Syntax by control

Fanuc series 0/16/18/21/30 (two-line format)
G76 P010060 Q50 R0.05 ; G76 X14.16 Z-28. P920 Q300 F1.5
This is the most common format and it goes in two consecutive blocks. The first line defines how the thread is cut and the second defines where. The P on the first line is six digits in three pairs; the P and Q on the second line are in microns, with no decimal point. This is where most people go wrong.
Fanuc series 10/11/15 and compatibles (single line)
G76 X14.16 Z-28. I0 K920 D300 A60 P1 F1.5
One-line format with letters instead of packed digits: K is the thread height, D the first pass, A the angle and P the infeed type. Not every Fanuc accepts it: yours takes one format or the other, not both. Check the G-code list in your control's manual to see which one.
Haas (lathe)
G76 X14.16 Z-28. K0.92 D0.3 F1.5 A60 P1
Haas uses the one-line format with normal decimal values, not microns. K is the thread height in radius and D the depth of the first pass. That is the biggest practical difference from Fanuc: here K0.92 is 0.92 mm, and on Fanuc P920 is those same 920 microns.
Siemens 840D / 828D
CYCLE97(1.5,,0,-28,16,16,2,1,0.92,0,0.05,4,0,0,1,1)
Siemens has no G76: it uses CYCLE97 for threads on a cylinder or a taper and CYCLE99 for the screen-based variant. The order and number of parameters change between software versions, so you fill it in from the cycle screen, not from memory.
Fagor 8055 / 8065
Model-specific longitudinal threading canned cycle
Fagor has its own threading cycle, with parameters that differ by model and version. There is no letter-for-letter match with Fanuc here: see the lathe canned cycles chapter in your control's manual.

Address letters used with it

LetterWhat it setsUnit
P (first line, two-line format)Six digits in three pairs: the first two are the number of finishing passes, the next two the length of the pull-out chamfer in tenths of the pitch, and the last two the thread angle (60, 55, 30, 29 or 00). P010060 is one finishing pass, no chamfer (00; a 0.1-pitch chamfer would be 01) and 60 degrees.six digits, no decimal point
Q (first line)Minimum depth of cut, in microns and in radius. It keeps the last passes, which the cycle makes thinner and thinner, from dwindling to nothing and leaving the insert rubbing instead of cutting.microns, in radius
R (first line)Stock reserved for the finishing passes, in millimeters and in radius. Typical values run from 0.02 to 0.08 mm.mm, in radius
X / U (second line)Diameter at the root of the thread when it is finished, not the outside diameter of the part. U is the same dimension expressed incrementally from the start point.mm, in diameter
Z / W (second line)Final position of the thread on the Z axis. It has to land where the carriage can stop: if the thread dies into a shoulder, you need a relief groove.mm
R (second line)Difference in radius between the start and the end of the thread: 0 or omitted for a straight thread, and a signed value for a tapered thread such as NPT or BSPT.mm, in radius
P (second line)Total thread height, in microns and in radius. On an external metric thread it comes to roughly 0.613 times the pitch, but the number to trust is the one in the insert catalog.microns, in radius
Q (second line)Depth of the first pass, in microns and in radius. This is what decides how many passes the cycle will take, because the split that follows is calculated from it.microns, in radius
FThread pitch. With the spindle synchronized, the carriage feed per revolution is exactly the pitch: F1.5 on a metric thread with a 1.5 pitch.mm/rev (inches/rev with G20)
K / D / A (one-line format and Haas)K is the thread height, D the depth of the first pass and A the thread angle. On Haas they are in decimal millimeters; in the one-line Fanuc format, check the units in the manual before you key them in.mm / degrees

Worked example

External metric M16x1.5 thread on a steel shaft already turned to Ø15.9 mm, with a relief groove machined at Z-28 and a 60-degree full-profile insert. The root diameter and the thread height are taken from the insert catalog. The cycle starts from Z+3 so the carriage has an acceleration run before the first thread.

O0760 (ROSCA M16X1.5 CON G76)
( Program header. )
G21 G40 G99
( Millimeters, no tool nose radius compensation and feed per revolution, which is what threading calls for. )
T0505
( Tool 5 with offset 5: full-profile external threading insert. )
G97 S900 M03
( Constant RPM, not constant surface speed. Threading is done at fixed RPM: with G96 the spindle would keep changing speed during the thread. )
G00 X20. Z3. M08
( Rapid approach above the outside diameter and 3 mm ahead of the face. Those 3 mm are the carriage's acceleration run. )
G76 P010060 Q50 R0.05
( First line of the cycle: 01 finishing pass, no pull-out chamfer (00), which is not needed because there is a relief groove, and a 60-degree thread. Q50 sets a 50-micron floor on the minimum pass and R0.05 reserves 0.05 mm for finishing. )
G76 X14.16 Z-28. P920 Q300 F1.5
( Second line: thread root at Ø14.16, end at Z-28 inside the relief groove, 920-micron thread height, 300-micron first pass and 1.5 mm pitch. With those numbers the cycle comes up with around eight or nine passes plus the finishing pass. )
G00 X100. Z50. M09
( Retract to a safe position and coolant off. The cycle has already brought the tool back to the start point. )
M05
( Stops the spindle. )
M30
( End of program. )
Open the simulator to check the example

Practical keys to using G76 in the workshop

How G76 splits up the passes

The cycle does not divide the thread height into equal parts: it applies the constant-area rule, so pass number n goes in to a depth proportional to the square root of n times the depth of the first pass. That makes the first pass the heaviest and the ones after it progressively lighter, and the chip removed on each one is similar, which is what a threading insert handles well. That is why the value that decides the number of passes is the Q on the second line: raise it and you get fewer, more aggressive passes; lower it and you get more, gentler passes. The Q on the first line sets the floor so the last ones do not end up rubbing.

Spindle-feed synchronization and why you use G97

In threading the control does not command a feed in mm/min: it couples the carriage to the spindle encoder so that it advances exactly one pitch per revolution. That coupling always starts at the same encoder mark, which is why every pass lands in the same thread. The practical consequence is that threading is programmed with G97 and fixed RPM: with G96 the spindle would change speed as the diameter changes, which would complicate the synchronization and the flank finish. During the cycle, feed override is also ignored on most controls, precisely so that nobody breaks the synchronization by turning a knob.

Flank infeed and the thread angle

The last two digits of the P on the first line give the thread angle, and from that the cycle decides how the insert goes in. With 60 degrees the infeed is along a single flank, so only one side of the edge does the work and the chip comes off clean; with 00 the infeed is radial and the insert cuts on both flanks at once, something that only holds up on small pitches or soft materials. The usual values are 60 for metric and unified threads, 55 for Whitworth and BSP, 30 for trapezoidal and 29 for Acme. An angle that does not match the insert leaves the flank badly loaded and wears the edge unevenly.

Mistakes that cost you a part (or a tool)

  • Writing the P and Q on the second line with a decimal point: in the two-line Fanuc format they are in microns with no point, so P0.92 reads as a ridiculous thread height and the thread comes out with no depth.
  • Programming the outside diameter of the part in X instead of the root diameter of the thread: the cycle cuts nothing or barely scratches the surface.
  • Starting the cycle right up against the face, without two or three millimeters of acceleration run: the first threads come out with a short pitch.
  • Threading into a shoulder with no relief groove: the insert reaches the final position still cutting, and it either breaks or leaves the last thread crushed.
  • Using G96 instead of G97: constant surface speed changes the RPM during the thread and ruins both the synchronization and the flank.
  • Copying a G76 from a Haas to a Fanuc without converting the format: K0.92 and D0.3 mean nothing in the two-line format, and neither do P920 Q300 in the one-line format.
  • Leaving tool nose radius compensation on during the cycle: G76 already accounts for the thread geometry, and the compensation throws the profile off.

Frequently asked questions

What diameter do I put in the X of G76?

The root diameter of the finished thread, not the outside diameter of the part. With a full-profile insert the number to trust is the one in that insert's catalog, because the tool itself forms the rounded root. Program that value, measure the first part with a ring gauge and adjust with the X wear offset, which is what you do in production.

How many passes does G76 take?

As many as it takes to split the thread height using the constant-area rule, starting from the first-pass depth you give in Q. With a 920-micron thread height and a 300-micron first pass you get around eight or nine, plus the finishing passes you asked for in P. If you want fewer passes, raise Q; if the insert is struggling or chattering, lower it.

Why does my thread come out with the wrong pitch?

Almost always because the feed mode is not per revolution or because F is not the pitch. In threading, F is the pitch in millimeters per revolution, not a feed in mm/min. It also happens when the control is in inches with G20 and someone keys in the metric pitch, or when the spindle encoder is not accurate and the machine loses synchronization between passes.

Does G76 work for tapered threads such as NPT?

Yes. The R on the second line is the difference in radius between the start and the end of the thread, and with a signed value the cycle generates the taper. The sign depends on the direction you thread in and on whether the thread is internal or external, so it is worth simulating it first: put it in backwards and the taper comes out reversed and the part goes in the scrap bin.

What is the difference between G76, G92 and G32?

G32 is single-pass threading: you write every pass and every retract by hand. G92 is a simple cycle that does one complete pass, going in, retracting and coming back, so you repeat the block changing the X. G76 is the full multi-pass cycle, which calculates the split and feeds in along the flank. In production you use G76; G32 is left for unusual threads, multi-start threads or profiles the cycle does not cover.

Related codes

Other codes in Lathe cycles

See the full list of G and M codes

Related apps