SINUMERIK Turning Programming
Turning on a SINUMERIK 828D or 840D sl uses the same NC language as milling — the same named programs, R-parameters, frames (TRANS/AROT), system variables, and MCALL mechanics covered in Sinumerik Programming Basics. What a lathe adds on top: diameter programming, constant surface speed with a proper rpm clamp, the turning cycle family (stock removal, grooving, undercuts, threading), tool nose radius compensation keyed to a cutting-edge position, and the TRANSMIT/TRACYL transformations for live tooling. This page covers the lathe-specific layer.
Default plane on a lathe is G18 (Z/X), and Z runs along the spindle. Everything below applies to both the 828D and the 840D sl — they share the programming language; the 840D sl simply scales to more channels, spindles, and axes. For Fanuc lathe hands, the quick vocabulary map:
| Task | Fanuc lathe | SINUMERIK |
|---|---|---|
| Diameter vs radius in X | Parameter setting | DIAMON / DIAMOF / DIAM90 in the program |
| Constant surface speed | G96 / G97 | G96 / G97 (same) |
| Max spindle speed clamp | G50 S… | LIMS= (with G96) |
| Contour roughing / finishing | G71 / G70 | CYCLE95 (one cycle, VARI selects) |
| Grooving | G75 | CYCLE93 |
| Threading cycle | G76 | CYCLE97 |
| Single threading pass | G32 | G33 |
| Nose radius comp | G41/G42 + T-page tip number | G41/G42 + cutting-edge position in tool data |
| Live-tool face / wrap milling | Polar interpolation G12.1 / cylindrical G7.1 | TRANSMIT / TRACYL |
Diameter Programming: DIAMON / DIAMOF / DIAM90
On Fanuc, whether X means diameter or radius is buried in a parameter you hope was set at the factory. Siemens makes it three modal G-language commands you can see, switch, and read back:
| Command | X in absolute (G90) | X in incremental (G91) | Actual-value display |
|---|---|---|---|
DIAMON | Diameter | Diameter | Diameter |
DIAM90 | Diameter | Radius | Diameter |
DIAMOF | Radius | Radius | Radius |
DIAMON is the machine-data default on virtually every lathe and is what the turning cycles expect. DIAM90 is the interesting one: absolute X words stay diameters (matching the print), while incremental moves become true radius distances — handy when you want "one more 0.2 mm depth of cut" to actually mean 0.2 mm at the tool. Diameter mode affects only the transverse axis's programmed and displayed values; values that are geometrically radii stay radii — tool offsets, the nose radius, interpolation parameters, and cycle inputs like the CYCLE95 infeed depth MID are radius values regardless of mode. Watch the same distinction when reading positions back in code: check whether the value you read is the diameter-mode WCS position or a radius-based machine value before doing arithmetic with it.
DIAMON
G0 X50 Z2 ; Dia 50 - tool tip is 25 mm off centerline
G1 Z-40 F0.25 ; turn Dia 50 for 40 mm
G91 G1 X2 ; DIAMON incremental: grows the DIAMETER 2 mm (tool moves 1 mm)
G90 DIAM90
G91 G1 X0.2 ; DIAM90 incremental: tool really moves 0.2 mm (0.4 on diameter)
G90 DIAMON ; back to the normal state before any cycle calls
Spindle: G96, G97, LIMS
G96 S… switches to constant surface speed — S is now surface speed (m/min under metric, ft/min under G700) and the control continuously adjusts rpm as X changes. Activating G96 also switches the feed to G95 (mm/rev) automatically. The critical companion is LIMS=, the rpm clamp: facing to center under G96 sends rpm toward the spindle's maximum, and with an out-of-balance part or chuck jaws at their grip limit that is how parts leave the machine. G97 cancels CSS and makes S plain rpm again — mandatory for threading and center-line drilling.
G96 S240 LIMS=2500 M3 M8 ; CSS 240 m/min, never exceed 2500 rpm
G1 X0 F0.2 ; facing cut - rpm climbs toward center, stops at 2500
G97 S800 ; freeze to direct rpm (threading, drilling on center)
Two refinements worth knowing exist in the same G-group: G961 is constant surface speed with linear feed (G94-type) instead of feed per rev, and G971 freezes the spindle speed while keeping the G94-type feed — the G96/G97 pair for the rare jobs where you want mm/min on a lathe.
On multi-spindle machines (main + counter spindle, live-tool spindle), S, M3/M4/M5, and G96 always address the master spindle. SETMS(n) declares spindle n the master — hand the part to the counter spindle, make it the master, and the same G96/LIMS code runs unchanged; SETMS alone reverts to the machine-data default. Individual spindles can also be addressed directly by number (S2=…, and spindle-specific M-functions) without changing the master.
Stock Removal: CYCLE95 (and Friends)
CYCLE95 is the contour-roughing workhorse — the Siemens answer to Fanuc's G71/G70 pair, except one cycle does both jobs. You describe the finished contour once, either in its own subprogram or as a labeled section of the calling program, and pass its name to the cycle. The machining-type parameter then selects roughing, finishing, or complete machining; longitudinal or face; external or internal. The cycle computes the paraxial roughing passes against the blank itself, follows the contour to clean up the steps, and (for finishing) traces the contour with the programmed allowances removed.
Key parameters, in call order:
| Parameter | Meaning |
|---|---|
NPP | Contour: subprogram name ("CONTOUR1") or a label range in the calling program ("START:END") |
MID | Roughing infeed depth (a radius value, even under DIAMON) |
FALZ / FALX | Finishing allowance in Z / in X (axis-specific) |
FAL | Contour-parallel finishing allowance (use either FAL or the FALZ/FALX pair) |
FF1 / FF2 / FF3 | Feedrate for roughing / for plunging into relief-cut elements / for finishing |
VARI | Machining type 1–12: roughing (1–4), finishing (5–8), complete (9–12), each block ordered longitudinal-external, transverse-external, longitudinal-internal, transverse-internal |
DT / DAM | Dwell time / path interval for chip breaking during roughing |
VRT | Lift-off distance from the contour when retracting between roughing passes |
Contour rules: program the contour in the direction the finish pass should run, using plain G1/G2/G3 with RND= and CHR= for radii and chamfers. Relief cuts (diameters that dip and come back) are allowed — that is what FF2 is for. A complete rough + finish job:
;CONTOUR1.SPF - finished profile, front to back
G0 X20 Z1 ; start above the face at the first diameter
G1 Z-25 F0.15 ; Dia 20 land
X36 Z-32 ; taper up to Dia 36
Z-45 RND=3 ; Dia 36 land, 3 mm corner radius
X50 CHR=1.5 ; step to Dia 50, 1.5 mm chamfer
Z-70 ; Dia 50 land
X64 ; up past stock diameter
M17
;SHAFT_OP10.MPF
G54 G18 G90 G95 DIAMON
T="ROUGH_80" D1 M6 ; 80-deg roughing insert
G96 S240 LIMS=2500 M3 M8
G0 X66 Z2 ; cycle start point, clear of Dia 62 stock
CYCLE95("CONTOUR1",2.5,0.2,0.4,,0.3,0.15,0.1,1,,,0.5)
; contour MID FALZ FALX FF1 FF2 FF3 VARI=1: rough, longitudinal, external
G0 X150 Z100
T="FINISH_35" D1 M6 ; 35-deg finishing insert
G96 S280 LIMS=3000 M3
G0 X66 Z2
CYCLE95("CONTOUR1",2.5,0.2,0.4,,0.3,0.15,0.1,5,,,0.5)
; VARI=5: finish, longitudinal, external
G0 X150 Z100 M9
M30
Same contour string, one digit changed — that is the whole rough/finish relationship. Note the allowances and feeds are still passed on the finish call; VARI=5 simply machines to final size in one contour-following pass. On controls running current SINUMERIK Operate, the "Stock removal" input screens generate the newer CYCLE952 (contour turning) instead, but CYCLE95 remains supported and is what most CAM posts and legacy programs use — you need to read both.
Related standard cycles: CYCLE94 cuts DIN 509 form E/F undercuts at a shoulder, and CYCLE96 cuts DIN 76 thread undercuts sized automatically from the thread's nominal diameter and pitch. The turning cycle family at a glance, classic call vs. what current Operate screens generate:
| Job | Classic cycle | Operate screens generate |
|---|---|---|
| Stock removal against a contour | CYCLE95 | CYCLE952 (contour turning) |
| Simple straight stock removal | — | CYCLE951 |
| Grooving | CYCLE93 | CYCLE930 |
| Undercuts (DIN 509, DIN 76) | CYCLE94 / CYCLE96 | CYCLE940 |
| Thread cutting | CYCLE97 (chained: CYCLE98) | CYCLE99 |
| Cut-off / parting | — | CYCLE92 |
Both generations run on current controls; the classic calls are what CAM posts overwhelmingly emit, the Operate calls are what you get when a step is built at the control — and like every Siemens cycle, opening the call in the editor retranslates it back into its input screen.
Threading: CYCLE97
CYCLE97 cuts cylindrical and tapered threads with automatic pass distribution — the G76 of the Siemens world. Key parameters, in call order:
| Parameter | Meaning |
|---|---|
PIT / MPIT | Pitch as a value / thread size as a metric nominal (e.g. 24 for M24 — pitch looked up); program one or the other |
SPL / FPL | Thread start / end point in the longitudinal axis |
DM1 / DM2 | Thread diameter at start / end — equal for a straight thread, different for a taper |
APP / ROP | Run-in / run-out path (acceleration room so the pitch is true over SPL–FPL) |
TDEP / FAL | Total thread depth / finishing allowance |
IANG | Infeed angle: positive = single-flank infeed, 0 = radial, negative = alternating flanks |
NSP | Starting-point angle offset for the first thread turn |
NRC / NID | Number of roughing passes / idle (spring) passes |
VARI | Machining type: external/internal × constant infeed per pass or constant chip cross-section (degressive) |
NUMT | Number of thread starts (multi-start threads) |
;M24 x 2.0 external thread, 30 mm long
G97 S800 M3 ; fixed rpm - never thread under G96
T="THREAD_EXT" D1 M6
G0 X28 Z8 ; clear of Dia 24 and the 3 mm run-in
CYCLE97(2,,0,-30,24,24,3,2,1.23,0.05,30,0,7,2,3,1,0.5)
; PIT=2 SPL=0 FPL=-30 DM1=DM2=24 APP=3 ROP=2
; TDEP=1.23 (0.613 x P) FAL=0.05 IANG=30 flank infeed
; NRC=7 roughing + NID=2 spring passes
; VARI=3: external, constant chip cross-section NUMT=1
G0 X150 Z100
M30
The cycle repeats identically on every run, so a scrapped insert mid-thread is recoverable — re-run with the same NSP and the passes land in the existing groove. Longhand threading exists too: G33 cuts one spindle-synchronized threading pass per block — K is the pitch for longitudinal threads, I for face threads — and you manage infeed and pass distribution yourself. Worth knowing for reading old programs and for odd multi-section threads:
G97 S800 M3
G0 X23.4 Z8 ; first pass depth, ahead of the run-in
G33 Z-30 K2 ; one synchronized pass, 2 mm pitch
G0 X28 ; retract
Z8 ; back to start - repeat deeper until at size
For tapping with live tools, G331/G332 are the rigid-tapping (interpolated tapping in/out) pair, and CYCLE84 wraps them the same way it does on the mill.
Tool Nose Compensation and Cutting-Edge Position
G41/G42/G40 work as expected, and as on the mill there is no D word in the comp call — the radius comes from the active tool edge's offset data. But a turning tool needs one more piece of information than an end mill: the cutting-edge position (positions 1–9), stored in the tool offset data alongside lengths and nose radius. It tells the control which way the imaginary tool point sits relative to the nose-radius center — position 9 means the tip is the radius center. Without it the control cannot know which direction to push the path off the contour, which is why a wrong edge-position entry produces the classic tapers-and-radii-off-by-the-nose-radius parts even though "comp is on." The theory is identical to Fanuc's imaginary tool tip — see Fanuc Turning Programming for the full treatment; on Siemens you simply set the position number in the tool data instead of a T-series offset field. Practical rule: run G42 when cutting toward the chuck on an OD with a normal rear-turret setup, verify the first part's taper and corner radii, and suspect the edge-position entry before the geometry offsets.
Live Tooling: TRANSMIT and TRACYL
Milling on a lathe means borrowing the spindle as a rotary axis. TRANSMIT maps Cartesian X/Y programming onto the part face (polar transformation); TRACYL(d) maps a flat X/Y program onto the unwrapped cylinder surface at working diameter d. The theory, data sets, pole behavior, and machine-data side are covered in Sinumerik Transformations — here is the lathe-side usage pattern:
SPOS=0 ; main spindle to position control
TRANSMIT ; face transformation on - X/Y are Cartesian now
G17 G94 ; milling plane, feed per minute for the live tool
T="MILL_D8" D1 M6
MCALL CYCLE82(5,0,1,-6,,0,0,1,12)
X15 Y0 ; 3-hole pattern in plain X/Y - the control
X-7.5 Y13 ; rotates C underneath
X-7.5 Y-13
MCALL
TRAFOOF ; transformation off
G18 G95 ; back to turning plane and feed per rev
A TRACYL job looks the same with TRACYL(60) in place of TRANSMIT — then Y is distance along the unwrapped 60 mm circumference, and a straight G1 in Y becomes a wrapped groove. In both cases: tool radius comp off before selecting or deselecting, and remember the transformation drops the active frame.
ShopTurn in One Paragraph
ShopTurn is to the lathe what ShopMill is to the mill: a conversational machining-step layer where a program is a work plan — header (blank, retract, speed limit), linked machining steps built through input screens (stock removal, grooving, threading, drilling on the face or periphery), and an end block. Shops use it for the daily bread of turning — shafts, flanges, bushings programmed at the control in minutes — and drop to DIN/G-code for posted CAM work, multi-channel synchronization, and anything a step screen can't express. The two mix: G-code blocks can be inserted inside a ShopTurn work plan, and everything in this article stays readable because ShopTurn's step screens are generating calls into the same cycle machinery underneath.
See Also
Sinumerik Programming Basics for the shared language (tools, frames, cycles, subprograms) · Sinumerik Transformations for TRANSMIT/TRACYL internals and 5-axis TRAORI · Fanuc Turning Programming for the G71/G76 world this maps from · Threading & Rigid Tapping for thread math and tapping across controls.
References
- Siemens, SINUMERIK 840D sl / 828D Turning Operating Manual, 08/2018.
- Siemens, SINUMERIK 840D sl / 828D NC Programming Programming Manual (Fundamentals / Work preparation), 06/2019, A5E47432823B AA.
- Siemens, SINUMERIK Cycles Programming Manual (standard cycles: CYCLE94/95/96/97).
Have a question or want to contribute?
Contact us with corrections, additions, or topics you'd like covered.
Get in Touch