# LinuxCNC G76

Instructions · `G76` · verification: source checked

G76 is a multi-pass lathe threading cycle in LinuxCNC. The tool starts from an initial X and Z position, follows a drive line through the initial X parallel to Z, and cuts a thread using pitch, thread peak offset, initial cut depth, full thread depth, and optional degression, compound slide angle, spring pass, taper, and spindle settings. At the end of the cycle the tool is at the specified Z position.

## Specification

| Property | Value |
|---|---|
| Language | gcode |
| Code | G76 |
| Group | threading |
| Syntax | G76 P- Z- I- J- R- K- Q- H- E- L- $- |
| Dialect | LinuxCNC |

### Parameters

| Name | Description |
|---|---|
| P | The thread pitch in distance per revolution. |
| Z | The final position of threads; at the end of the cycle the tool will be at this Z position. |
| I | The thread peak offset from the drive line. Negative I values are external threads, and positive I values are internal threads. |
| J | A positive value specifying the initial cut depth; the first threading cut will be J beyond the thread peak position. |
| K | A positive value specifying the full thread depth; the final threading cut will be K beyond the thread peak position. |
| R | The depth degression. R1.0 selects constant depth on successive threading passes. R2.0 selects constant area. Values between 1.0 and 2.0 select decreasing depth but increasing area. Values above 2.0 select decreasing area. |
| Q | The compound slide angle in degrees describing to what extent successive passes should be offset along the drive line. A positive Q value causes the leading edge of the tool to cut more heavily. Typical values are 29, 29.5 or 30. |
| H | The number of spring passes; spring passes are additional passes at full thread depth. Program H0 if no additional passes are desired. |
| E | Specifies the distance along the drive line used for the taper. For a 45 degree taper program E the same as K. |
| L | Specifies which ends of the thread get the taper: L0 no taper (the default), L1 entry taper, L2 exit taper, or L3 both entry and exit tapers. |
| $ | The spindle number to which the motion will be synchronised (default 0). |

## Safety

- A relief groove is required at the entry unless the beginning of the thread is past the end of the material or an entry taper is used, because the tool pauses briefly for synchronization before each threading pass.
- Unless using an exit taper, the exit move is not synchronized to the spindle speed and is a rapid move.
- With a slow spindle, the exit move might take only a small fraction of a revolution; increasing spindle speed after several passes can produce a very heavy cut during the exit move. This can be avoided by providing a relief groove at the exit or by not changing the spindle speed while threading.
- The final position of the tool is at the end of the drive line; a safe Z move is needed with an internal thread to remove the tool from the hole.
- Operating limits: the active plane must be the ZX plane; other axis words such as X or Y must not be specified; R degression must be at least 1.0; all required words must be specified; P, J, K and H must not be negative; E must not be greater than half the drive line length.

## Study notes

- Drive line: a line through the initial X position parallel to Z.
- The tool is moved to the initial X and Z positions before G76 is issued; X is the drive line and Z is the start of the threads.
- When G7 lathe diameter mode is active, I, J and K values are diameter measurements; when G8 lathe radius mode is active, they are radius measurements.
- G76 is a canned cycle based on G33 spindle synchronized motion.
- The sample program g76.ngc demonstrates the G76 canned cycle and can be previewed and executed on any machine using the sim/lathe.ini configuration.
- HAL pins spindle.N.at-speed and encoder.n.phase-Z for the spindle must be connected before G76 will work.
- The final position of the tool is at the end of the drive line.

## Sources

1. [G-Codes](https://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g76) (accessed 2026-10-26)

---

Source page: https://machineschema.com/instruction/gcode-g76  
JSON: https://machineschema.com/instruction/gcode-g76.json  
License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Cite Machine Schema and the original sources.
