Tapered threads on a CNC lathe: NPT, BSPT, calculation and G-code in LinuxCNC
· ~9 min read
A tapered thread is cut on a cone instead of a cylinder. Its main job is sealing: as it is screwed in, the threads wedge together on the taper and seal the joint. That is why you find it on pipes, fittings, hydraulic and pneumatic plugs and grease nipples. On a CNC lathe a tapered thread is cut the same way as a straight one, except that on every pass the tool follows a sloped line. Here are the standards, the calculation and the G-code for LinuxCNC.
Contents
- Main tapered thread standards
- The 1:16 taper and its geometry
- How a tapered thread is cut on CNC
- Calculating the taper line and passes
- G33 with X and Z in LinuxCNC
- Why not G76
- Sample program
- Internal tapered threads
- Checking and common mistakes
- Tapered threads in Turn G-code
Main tapered thread standards
| Thread | Standard | Profile angle | Taper | Where it is used |
|---|---|---|---|---|
| NPT | ANSI/ASME B1.20.1 | 60° | 1:16 | USA, Canada, hydraulics and pneumatics |
| NPTF (Dryseal) | ANSI B1.20.3 | 60° | 1:16 | Seals without sealant: fuel and oil lines |
| BSPT, R / Rc | ISO 7-1, EN 10226 | 55° | 1:16 | Europe, Asia, water and gas |
| Pipe taper (Russian GOST) | GOST 6211 | 55° | 1:16 | Equivalent of BSPT |
| Inch taper 60° (Russian GOST) | GOST 6111 | 60° | 1:16 | Equivalent of NPT: plugs, grease nipples, fuel equipment |
| Metric taper MK | GOST 25229 | 60° | 1:16 | Plugs and fittings with a metric pitch |
Pipe thread pitches are given in threads per inch (TPI):
| Size | NPT, TPI | BSPT, TPI |
|---|---|---|
| 1/8” | 27 | 28 |
| 1/4”, 3/8” | 18 | 19 |
| 1/2”, 3/4” | 14 | 14 |
| 1” - 2” | 11.5 | 11 |
Pitch in millimeters: P = 25.4 / TPI. For example, 14 TPI is 1.814 mm. NPT and BSPT are not interchangeable: they have different profile angles and pitches (except 1/2” and 3/4”, where only the pitch matches). The “1/2 inch” of a pipe thread is the nominal pipe size, not the thread diameter - take exact diameters from the standard’s tables.
The 1:16 taper and its geometry
A 1:16 taper means the diameter changes by 1 mm over 16 mm of length. So:
- per 1 mm of length the diameter changes by 1/16 = 0.0625 mm;
- the radius changes by half of that, 0.03125 mm;
- the angle between the cone surface and the axis is 1°47′24″, the full included angle is 3°34′48″.
Two important features of tapered threads:
- Pitch is measured along the axis, not along the cone surface.
- The profile bisector is perpendicular to the axis, not to the cone surface. The tool is set the same way as for a straight thread: square to the part axis with a gauge.
How a tapered thread is cut on CNC
On a manual lathe tapered threads are cut with a taper attachment or by offsetting the tailstock. On CNC it is easier: the control drives the tool in X and Z at the same time while staying synchronized with the spindle.
The usual order:
- Turn the taper for the thread (external or internal) - for example, with the Taper cycle.
- Cut the thread in several passes: each next pass follows a line parallel to the previous one, shifted deeper.
- Check it with a gauge or the mating part.
Calculating the taper line and passes
Each threading pass is a line from a start point (in front of the face, including run-in) to the end of the thread. Both points lie on the same sloped line.
Say the thread starts at the face (Z0) with radius R₀, length L, and radius slope k (0.03125 for 1:16). Then:
- radius at the end of the thread: R_L = R₀ − k·L (for an external thread narrowing toward the chuck - the sign depends on the taper direction);
- extend the line for the run-in: if the pass starts at Z = +a in front of the face, the radius there is R₀ + k·a. Otherwise the tool follows a different line during run-in, and the first turns are “off the taper”;
- pass depth: the whole line shifts by the pass depth in X - from the touch line down to the full profile depth (about 0.8·P for NPT, 0.64·P for BSPT), with decreasing depth, just like a straight thread.
The exact numbers are easier to leave to a program: one wrong sign in the slope and the taper goes the other way.
G33 with X and Z in LinuxCNC
In LinuxCNC the G33 threading move accepts both X and Z:
G0 X10.3 Z3 (start of the line, 3 mm run-in)
G33 X8 Z-20 K1.5 (pass along the taper, 1.5 mm pitch)
G0 X15 (retract)
G0 Z3 (return)
- K - pitch per revolution along the Z axis;
- the tool moves from the current point to X, Z in a straight line, synchronized with the spindle;
- every pass must start from the same Z to follow the same groove - LinuxCNC aligns the start with the spindle index pulse.
About the X mode: in the example above X is the radius (G8). In diameter mode (G7) the same points are written with doubled numbers. More in G7 and G8: diameter or radius.
Why not G76
The LinuxCNC G76 cycle only cuts threads along the Z axis: its E
and L parameters add tapers only at the ends of the thread, not a
taper along its whole length. So in LinuxCNC tapered threads are written
as G33 X… Z… K… passes.
Fanuc is different: its G92 and G76 cycles have an R address - the radius difference between start and end - so a tapered thread is one cycle line. Such a program cannot be moved to LinuxCNC as is. More on G33 and G76 in Threading in LinuxCNC.
Sample program
Real output of the Turn G-code Taper threading cycle: external right-hand thread, 1.5 mm pitch, on a taper from Ø20 (Z0) to Ø16 (Z−20), 0.75 mm deep per side, G8 mode. It is a demonstration example with a 1:5 taper so that the slope is easy to see, not a specific pipe thread standard.
G21 G18 G90 G8 G40 G80
G54
G97 S50 M3
G0 Z3.0000
G0 X15.0000
(Pass 1 of 10)
G0 Z3.0000
G0 X10.3000
G33 X8.0000 Z-20.0000 K1.5000
G0 X15.0000
(Pass 2 of 10)
G0 Z3.0000
G0 X10.2167
G33 X7.9167 Z-20.0000 K1.5000
G0 X15.0000
X10.3at Z3 is the taper line extended beyond the face: the slope is 0.1 mm of radius per 1 mm of length, so 3 mm of run-in adds 0.3.- Each next pass is the same line shifted about 0.083 mm deeper.
- The tenth pass reaches X9.55 → X7.25, the full 0.75 mm below the touch line, followed by a finishing pass on the same profile.
The full program, explained line by line, is on the Taper threading page.
Internal tapered threads
- First bore the tapered hole for the thread (Rc, internal NPT).
- Passes go outward from the centerline: each next one at a larger radius.
- The retract is toward the centerline, inside the bore. Make sure the threading bar fits in the narrowest part of the taper, including the retract.
- The taper runs the opposite way to an external thread: the hole narrows going in.
Checking and common mistakes
Checking. Tapered threads are checked with taper gauges (ring and plug) by where the part’s face sits relative to the gauge step, or with the mating part: for NPT/BSPT what matters is the hand-tight engagement and the wrench make-up, not just “it screws on”.
Common mistakes:
- Run-in not on the taper line. The pass starts at the face radius instead of the extended line - the first turns come out at the wrong depth.
- Slope reversed. A wrong sign - the taper widens toward the chuck instead of narrowing.
- Diameter slope used as radius slope. 1:16 is the change in diameter; the radius changes half as much.
- NPT instead of BSPT (or vice versa). 60° instead of 55° and a different pitch - the joint leaks.
- Tool set along the cone surface instead of square to the axis.
- G96 instead of G97. The diameter changes along a taper, so with constant surface speed the RPM drifts within a pass.
- Fanuc code with G92 R or G76 R, not rewritten for G33.
Tapered threads in Turn G-code
In Turn G-code the Taper threading cycle is a form with fields:
- start and end diameters of the taper and the length - the program calculates the slope and extends the line for the run-in;
- pitch, number of starts, right- or left-hand, external or internal;
- number of roughing and finishing passes, run-in and run-out;
- move syntax: G33 or G32, pitch letter K, I or F;
- G7/G8 mode - one button for all cycles.
Every pass is visible in the 2D simulator before the file is generated. To be upfront about its status: this cycle has so far been verified by “cutting air” on the author’s machine, not yet by cutting metal. Straight threads are handled by the Threading cycle, which has been verified by real cuts.
Download Turn G-code - 15 days free, no key needed.
