Printed from Kezuriba (kezuriba.net/en/nc/g32/)
G32
LatheModal, group 01Threading (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)
- The feed starts in sync with the spindle's once-per-revolution signal, so the tool enters the same groove however many passes you repeat. You write the infeed, retract and return yourself with G00 (G92 is a single canned cycle that bundles the four moves, and G76 is a multiple repetitive cycle in which the NC even calculates how the infeed is divided)
- F is the lead (the distance advanced per spindle revolution). For a single-start thread it equals the pitch; for a double-start thread it is twice the pitch
- Use it after fixing the spindle speed with G97. Do not change the speed until the thread is finished (a lag between spindle and feed throws off the lead). Do not use constant surface speed (G96) even for a tapered thread
- Feed per revolution (G99) is assumed. In the Siemens ISO dialect, commanding it while still in feed per minute (G94) gives an alarm, and Haas states that G99 is required
- At the start and end of a thread the feed cannot keep up, so the lead is not correct (incomplete thread portions δ1 and δ2). Command the required thread length plus the run-up δ1 and run-out δ2
- During threading, feed override and feed hold (pausing the feed) have no effect, because stopping partway would ruin the thread form (Mitsubishi Electric). If you want to stop, wait until the run of G32 blocks ends
- If you write G32 blocks in a row, the motion does not stop at block boundaries, so you can cut a continuous thread such as “parallel thread to tapered thread”. Used for shapes that G92 and G76 cannot write, and for worms. Do not change F partway or insert M-codes (Siemens ISO dialect)
- Command the lead of a tapered thread along the longer axis direction. If the taper angle is 45° or less, it is the lead in the Z direction (Siemens ISO dialect. Haas says “the larger of the two leads”)
- G32 is modal. Cancel it with G00 when you are done. If you forget, the next “X-only line” (meant as the retract) also moves at the threading feed
- How the decimal point is written for the start angle Q of multi-start threads is the exact opposite depending on the model (the Siemens ISO dialect writes Q180. with a decimal point; Haas writes Q180000 without one)
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
Diagram: start angle Q of a multi-start thread (seen from the end face)
Calculator: maximum spindle speed for threading and start angle Q for multi-start threads
| Start | Start angle | Siemens 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°.
- CNC lathe programming basics: grooves and threads (G04, G32, G92)
- G76 multiple threading cycle (the CNC works out the infeeds)
- G92 (lathe): single threading cycle with four moves
- How values without a decimal point are read (why the Q start angle differs)
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.
| Source | Machine | Item | Detail |
|---|---|---|---|
| Siemens (ISO dialect) | Lathe | Code | G32 in G-code system A, G33 in systems B and C |
| Mitsubishi Electric | Lathe | Code | G32 in G-code lists 2, 4 and 6; G33 in lists 3, 5 and 7 |
| Siemens (native) | Lathe | Format | G33 Z_ K_ (K is the lead). For multi-start threads, SF= (start angle) |
| LinuxCNC | Lathe | Format | G33 Z_ K_ (K is the travel per spindle revolution) |
| Haas | Lathe | Format | Q 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) | Lathe | Format | Q is in degrees, written with a decimal point (least increment 0.001°; the second start of a 2-start thread is Q180.) |
| Mitsubishi Electric | Lathe | Format | Q (start angle) is 0.001–360.000° |
| Haas | Lathe | Notes | Single 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) | Lathe | Notes | Commanding it while still in feed per minute (G94) gives an alarm |
| Mitsubishi Electric | Lathe | Notes | Spindle 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.
- Siemens AG — SINUMERIK 802D sl/840D/840D sl/840Di/840Di sl/810D Programming Manual ISO Turning, 04.2007 Edition cache.industry.siemens.com
- Mitsubishi Electric — MITSUBISHI CNC 700/70 Series Programming Manual (Lathe System) (IB-1500057) mitsubishielectric.com
- Haas Automation, Inc. — G32 Thread Cutting (Group 01) (lathe, per-code explanation page) haascnc.com
- Siemens AG — SINUMERIK 840D sl/840D/840Di sl/810D Fundamentals, Programming Manual, Edition 08/2005 (6FC5398-1BP10-0BA0) cache.industry.siemens.com
- LinuxCNC project — G-Codes (LinuxCNC Documentation) linuxcnc.org