G32

LatheModal, group 01

Threading (feed for one pass)

Format and notes

G32 X(U)_ Z(W)_ F_ (F is the lead. For multi-start threads, Q_ gives the start angle)

Example

G97 S600 M03 ;        (constant spindle speed. Do not use G96)
G00 X25. Z5. ;        (5 mm in front of the end face = run-up δ1)
X19.4 ;               (1st infeed)
G32 Z-22. F1.5 ;      (one threading pass. Into the relief groove = δ2)
G00 X25. ;            (retract)
Z5. ;                 (return)
X18.9 ;               (2nd infeed)
G32 Z-22. ;           (F stays at the previous value)
G00 X25. ;
Z5. ;
X18.16 ;              (finish: root diameter ≈ 20 − 2×0.6134×1.5)
G32 Z-22. ;
G00 X25. ;
Z5. ;

An example of an M20×1.5 external thread (G-code system A) written by Kezuriba. For illustration, there are only 3 infeeds. In practice, the thread is divided into 6–10 passes, with each infeed made slightly smaller than the last.

Diagram: G32 (lathe): one threading pass and the incomplete thread

Rapid (G00)Threading (G32)ChuckCenter line①② G32 Z_ F_ (F = lead)③④Start pointFeed starts on theonce-per-rev signalδ2Required thread lengthδ1Undercutδ1: run-up (accel.)δ2: run-out (decel.)ZX
G32 handles only move ②. You write ① infeed, ③ retract and ④ return yourself with G00. At the start and end of the thread the feed cannot keep up with the spindle and the lead is off, so command the required thread length plus the run-up δ1 and the run-out δ2. Every pass waits for the spindle's once-per-revolution signal before feeding, so the tool enters the same groove even when the depth of cut changes.

Diagram: start angle Q of a multi-start thread (seen from the end face)

2-start threadOnce-per-revolution signal position = 0°0°180°Start angles 0° and 180°Siemens: Q0 Q180.Haas: Q0 Q1800003-start threadOnce-per-revolution signal position = 0°0°120°240°Start angles 0°, 120°, 240°Siemens: Q120. Q240.Haas: Q120000 Q240000
For the k-th start of an n-start thread, repeat the same G32 shifted by the start angle Q = 360 × (k − 1) ÷ n. F is the lead (pitch × number of starts), not the pitch. How Q is written is the exact opposite depending on the model: the Siemens ISO dialect writes it in degrees with a decimal point (Q180.), and Haas writes it as an integer in 0.001° units (Q180000).

Calculator: maximum spindle speed for threading and start angle Q for multi-start threads

Max. speed F ÷ L—min⁻¹
Pitch (L ÷ n)—mm
StartStart angleSiemens ISO dialect (with decimal point)Haas (integer, 0.001° units)

Max. speed R = max. cutting feedrate ÷ lead (constraint in the Mitsubishi Electric manual) Start angle Q = 360 × (k − 1) ÷ n

The speed is also limited by the spindle encoder and the chuck. Use whichever is lower. The larger the lead, the lower the speed you can use. How the start angle is written (with or without a decimal point, which unit) is opposite on different controls, so do not mix up the two right-hand columns.

Check: F 5000 mm/min, L 1.5 mm → 3333 min⁻¹. L 3 mm (2-start, pitch 1.5) → 1667 min⁻¹. 2-start: second start at 180°; 3-start: 0°, 120°, 240°.

Differences between controls and machines

The same code can be written or assigned differently depending on the CNC control and the machine builder. Always check your machine’s manual.

“One source / reference” rows were confirmed in only one source. “CAM post output / reference” rows show what a CAM post processor outputs and could not be confirmed in the control maker’s own public documents.

SourceMachineItemDetail
Siemens (ISO dialect)LatheCodeG32 in G-code system A, G33 in systems B and C
Mitsubishi ElectricLatheCodeG32 in G-code lists 2, 4 and 6; G33 in lists 3, 5 and 7
Siemens (native)LatheFormatG33 Z_ K_ (K is the lead). For multi-start threads, SF= (start angle)
LinuxCNCLatheFormatG33 Z_ K_ (K is the travel per spindle revolution)
HaasLatheFormatQ is an integer in units of 0.001° and takes no decimal point (180° is Q180000). Q is not modal, so write it every time. G99 is required
Siemens (ISO dialect)LatheFormatQ is in degrees, written with a decimal point (least increment 0.001°; the second start of a 2-start thread is Q180.)
Mitsubishi ElectricLatheFormatQ (start angle) is 0.001–360.000°
HaasLatheNotesSingle block stop and feed hold are delayed until the last line of the run of G32 blocks. M23 and M24 (switching the chamfer at the end of the thread) have no effect on G32
Siemens (ISO dialect)LatheNotesCommanding it while still in feed per minute (G94) gives an alarm
Mitsubishi ElectricLatheNotesSpindle speed R must satisfy “1 ≤ R ≤ maximum cutting feed rate ÷ lead” and must also be at or below the permitted speed of the spindle encoderOne source / reference

Sources

The meaning of this code agrees in two or more sources from different publishers. Explanations are written in our own words.

  1. Siemens AG — SINUMERIK 802D sl/840D/840D sl/840Di/840Di sl/810D Programming Manual ISO Turning, 04.2007 Edition cache.industry.siemens.com
  2. Mitsubishi Electric — MITSUBISHI CNC 700/70 Series Programming Manual (Lathe System) (IB-1500057) mitsubishielectric.com
  3. Haas Automation, Inc. — G32 Thread Cutting (Group 01) (lathe, per-code explanation page) haascnc.com
  4. Siemens AG — SINUMERIK 840D sl/840D/840Di sl/810D Fundamentals, Programming Manual, Edition 08/2005 (6FC5398-1BP10-0BA0) cache.industry.siemens.com
  5. LinuxCNC project — G-Codes (LinuxCNC Documentation) linuxcnc.org