Okuma OSP Turning (Lathe) Programming
Okuma builds its own control — the OSP — and roughly half of the Okuma machines in the field are lathes: LB-series, Genos L-series, and the Multus multitasking machines. If you arrive from a Fanuc lathe, the first surprise is that OSP is not a Fanuc clone with different alarm numbers. It is its own language family: variables have names (VC100, DPTH) instead of #-numbers, subprograms are invoked with CALL and MODIN instead of M98, several one-shot G-codes live at different numbers, and turning work is organized around two idioms Fanuc simply does not have: the per-setup zero offset and the LAP contour-roughing system. This page covers the lathe-specific side; the variable language itself is covered in Okuma Variable Types and Okuma Argument & Local Variables.
One accuracy note up front: OSP details shift between control generations (OSP-P200L, P300L, P500). Cycle word letters, option availability, and offset-set counts all vary. Everything below is the standard structure from the OSP lathe programming manual, but confirm the exact words against the manual for your control generation before running metal.
The program-structure vocabulary carries over from the mill-side OSP articles unchanged, and it is worth having in hand before the lathe-specific material:
| Construct | What it does |
|---|---|
CALL O_ [args] | Subprogram call with named arguments, e.g. CALL OPKT DPTH=0.3 — the OSP replacement for M98 P_ |
RTS | Return from subprogram (the M99 role) |
MODIN O_ / MODOUT | Modal subprogram: after MODIN, the subprogram re-executes at each subsequent positioning block until MODOUT — the G66/G67 role |
IF [cond] N_ / GOTO N_ | Conditional / unconditional jump to an N-label; loops are built from these |
VC1–VC200 | Common variables — keep their value across programs and power-off |
Named locals (DPTH, PA12) | Created by assignment or CALL arguments; P-prefixed ones can be tested with EQ EMPTY |
Work Setup: Zero Offsets, Not G54
A Fanuc lathe programmer reaches for the G54–G59 bank by reflex. An Okuma lathe does not work that way. The machine coordinate system is fixed at the home position, and you establish the program origin by setting a zero offset for each axis — the distance from machine zero to your part zero — through the control’s zero-set operation (touch the face, tell the control that point is Z0). The zero offset belongs to the setup and turret, not to a modal G-code you switch mid-program; a typical single-spindle job has exactly one work zero, which is honestly how most lathe jobs behave anyway. Multiple selectable work coordinate systems exist on newer OSP generations as an option, but the default idiom is: set the zero offset at setup, and the program just starts cutting from it.
In practice the setup sequence looks like this: home the machine, index the reference tool, touch the finished face of the workpiece, and use the control’s zero-set function to declare that touch point as Z0. X is normally established through tool geometry — the master tool’s X offset is measured to the spindle centerline, so X0 is the centerline by construction and every other tool’s X offset is relative to that. From then on, program coordinates are simply part coordinates: X values are diameters measured from the centerline, Z0 is your finished face, negative Z goes into the part. There is no offset-selection code to forget at the top of the program — and no way to crash by activating the wrong one, which is a genuine argument for the Okuma way. What you trade away is the Fanuc trick of running several distinct fixtures from one program by hopping offsets; on an OSP lathe with the base configuration, a new part zero means a new zero-set, not a different G-code.
Where the setup data lives, at a glance:
| Data | Where it lives | Set how |
|---|---|---|
| Work zero (program origin) | Zero offset data, per axis (and per turret on multi-turret machines) | Zero-set operation at setup |
| Tool X/Z geometry offsets | Tool data pages, per offset number | Touch-off or tool presetter/gauging |
| Nose radius + tip point (1–9) | Tool data pages, alongside the offsets | Entered from the insert spec; read by G41/G42 |
| Max spindle speed clamp | The program itself | G50 S_ near the top |
Two of those rows deserve a closer look:
G50 S_— maximum spindle speed clamp. Put it near the top of every program that uses constant surface speed (see below). On OSP,G50is the speed clamp; it is not the Fanuc-style coordinate-system-set command.- Tool data pages — each turret station’s tool carries its X/Z offset, its nose radius, and its tip point number (1–9, the imaginary tool-nose direction) in the control’s tool data. Nose-radius compensation (
G41/G42/G40) reads the radius and tip point from there. The tool call is theTword — commonly written with paired digits selecting the turret station and its offset (many shops simply make them match, e.g. station 1 / offset 1); the exact digit grouping varies by machine configuration, so check how your machine’s T word is mapped.
The LAP Cycles
LAP (Lathe Auto-Programming) is Okuma’s signature contour-roughing system and the single biggest quality-of-life difference from Fanuc’s G71/G70. The idea is the same — define the finished contour once, let the control generate the roughing passes — but the structure is cleaner: the contour is a named block of ordinary motion code bracketed by G81 (definition start, longitudinal) and G80 (definition end), and separate one-line calls rough and finish against it.
| Code | Role in LAP |
|---|---|
G81 | Contour definition start — longitudinal (turning) shape |
G82 | Contour definition start — transverse (facing) shape |
G80 | Contour definition end |
G85 N_ | Rough-cutting call, bar-turning pattern, against the contour named by N |
G86 N_ | Rough-cutting call, copy-turning pattern (passes parallel to the contour — castings/forgings) |
G87 N_ | Finish call — one pass along the defined contour |
G84 | Change of cutting conditions partway through a LAP contour |
The rough call carries the cutting conditions — depth of cut per pass and roughing feed, plus finish stock left in X and Z. On current manuals these ride on words like D (depth of cut), F (feed), U/W (X/Z finish stock), but word letters are exactly the kind of detail that moves between control generations — the structure below is standard OSP; confirm the call words per your manual.
( ===== OD CONTOUR: ROUGH WITH G85, FINISH WITH G87 ===== )
G50 S3500 ( CLAMP MAX SPINDLE SPEED FIRST )
G00 X20. Z20. ( SAFE INDEX POSITION )
T0101 ( ROUGH TOOL - STATION 1 / OFFSET 1 )
G96 S600 M03 M08 ( CONSTANT SURFACE SPEED ON )
G00 X3.2 Z0.1 ( APPROACH ABOVE STOCK )
G85 NLP1 D0.150 F0.012 U0.020 W0.005 ( ROUGH THE CONTOUR NAMED NLP1 )
NLP1 G81 ( CONTOUR DEFINITION START )
G00 X1.000 Z0.1 ( CONTOUR ENTRY POINT )
G01 Z-1.000 F0.006 ( 1.000 DIA LAND )
X1.500 Z-1.500 ( TAPER UP TO 1.500 )
Z-2.500 ( 1.500 DIA LAND )
X3.000 ( FACE OUT TO STOCK )
G80 ( CONTOUR DEFINITION END )
G00 X20. Z20. ( RETRACT AND SWAP TOOLS )
T0202 ( FINISH TOOL )
G96 S800 M03
G00 X3.2 Z0.1
G87 NLP1 ( FINISH PASS ALONG THE SAME CONTOUR )
G00 X20. Z20. M09
M05
M02
Read the flow carefully: the G85 call names the contour (NLP1), the definition follows immediately as a bracketed block, and the control generates all the roughing passes from it — the G01/G00 moves inside the brackets describe the finished shape, not toolpath the rough tool takes literally. Later, G87 NLP1 reuses the very same definition for the finish pass. One contour, written once, drives both operations — change a diameter and rough and finish both follow. That is the whole point of LAP.
Three variations round out the family. For facing-direction work — a shape that is mostly diameter change rather than length — open the definition with G82 instead of G81 and the roughing runs in the transverse pattern. For pre-shaped blanks (castings, forgings) where bar-pattern roughing would waste time cutting air, call G86 instead of G85: the passes step over parallel to the contour instead of running straight cuts across the whole envelope. And when one region of a contour needs different conditions than the rest — a heavier feed across a face, a slower feed into a shoulder — a G84 block inside the definition changes the cutting conditions from that point in the shape onward, so you do not have to split one contour into two.
Habits that keep LAP predictable:
- Start the contour definition with a positioning move to the contour entry point — the definition describes the shape from a known corner, and the roughing envelope is derived from it.
- Keep the definition strictly the finished geometry. Retracts, coolant codes, and tool changes belong outside the
G81…G80brackets. - Name contours meaningfully (
NLP1,NOD1,NFACE) — the rough and finish calls reference the name, and a mistyped name is a search failure at run time, not a syntax error at load time. - Leave finish stock in the rough call, not by fudging the contour — the whole benefit is that
G87runs the true geometry.
Spindle Control: G96 / G97 and the G50 Clamp
Constant surface speed works the way a Fanuc programmer expects: G96 S_ holds the programmed surface speed as X changes (units follow the active inch/metric mode), and G97 S_ commands direct RPM — which you must switch to for threading and center-line drilling, where a fixed spindle speed matters. The non-negotiable habit: command G50 S_ before G96. As the tool feeds toward the centerline under constant surface speed, commanded RPM climbs toward infinity; the G50 clamp is what keeps a facing cut from over-speeding the chuck. Okuma’s manuals treat the clamp as part of the program header, and so should you.
G50 S3000 ( NEVER EXCEED 3000 RPM )
G96 S650 M03 ( 650 SURFACE SPEED, SPINDLE FORWARD )
...
G97 S800 ( FIXED 800 RPM FOR THE THREADING PASSES )
Two practical notes. First, on geared-headstock machines the gear-range M-codes (commonly the M41/M42-family) are machine-configured, not defined by the OSP language — take them from the machine’s own documentation, the same rule as any builder M-code. Second, when a program alternates between G96 turning and G97 threading, put the G97 S_ before positioning to the thread start: the spindle needs to settle at the fixed RPM before the first G33 pass synchronizes to it, and switching a block too late is a classic source of a bad first pass.
Threading
G33 is OSP’s longhand thread-cutting move: a single spindle-synchronized pass with the lead on the F word. OSP also has a compound fixed threading cycle that generates the full pass sequence in one call — and here is the number collision that catches every Fanuc convert: on OSP lathes that cycle family sits at G71 (longitudinal), the very number Fanuc uses for rough turning. Its word list varies enough by generation that you should build it from your machine’s manual page, not from memory or from this article.
The fully portable alternative — and a genuinely idiomatic OSP one — is G33 longhand with the pass sequence built from VC common variables and an IF/GOTO loop. Everything in this example is plain OSP that runs on any generation:
( ===== 3/4-10 OD THREAD - G33 LONGHAND WITH A VC PASS LOOP ===== )
G97 S800 M03 ( FIXED RPM FOR THREADING )
G00 X0.9 Z0.3 ( START POINT - CLEAR OF THE OD )
VC110=0.750 ( MAJOR DIAMETER )
VC111=0.065 ( TOTAL THREAD DEPTH ON DIAMETER )
VC112=0.012 ( DEPTH PER PASS ON DIAMETER )
VC113=VC112 ( CUMULATIVE DEPTH SO FAR )
N100 VC114=VC110-VC113 ( DIAMETER FOR THIS PASS )
G00 X=VC114 ( PLUNGE TO PASS DEPTH )
G33 Z-1.0 F0.100 ( THREAD PASS - F IS THE LEAD, 10 TPI )
G00 X0.9 ( RETRACT CLEAR OF THE THREAD )
Z0.3 ( BACK TO THE START )
VC113=VC113+VC112 ( STEP THE DEPTH )
IF [VC113 LE VC111] N100 ( MORE DEPTH LEFT? LOOP AGAIN )
VC114=VC110-VC111 ( SPRING PASS AT FULL DEPTH )
G00 X=VC114
G33 Z-1.0 F0.100
G00 X0.9 Z0.3
M05
M02
Because G33 synchronizes to the spindle encoder, every pass picks up the same thread as long as the Z start point and lead do not change between passes — which is exactly why the loop always returns to Z0.3 before plunging. Refinements like flank infeed or degressive depth are two-line changes to the same skeleton. For example, feeding in along the 29° flank instead of straight in is one extra variable — shift the Z start point in proportion to the depth:
( INSIDE THE LOOP, BEFORE THE PLUNGE: )
VC115=0.3+VC113/2*TAN[29] ( Z START SHIFTED ALONG THE FLANK )
G00 X=VC114 Z=VC115 ( PLUNGE AT THE SHIFTED START POINT )
G33 Z-1.0 F0.100
(Check the trig-function spelling and argument units against your generation’s manual — function vocabularies are one of the details that drift between OSP versions.)
OSP Variables Do Turning Work
The variable language documented in Okuma Variable Types is not a mill-only feature — it is how OSP lathe programs absorb the real world. The example below is a finishing pass with an operator-entered wear trim: instead of walking to the offset page after each measurement, the operator drops the measured oversize into a common variable and the program compensates itself. VC150 is a common variable, so per that article it survives program end and even a power cycle — the trim persists across parts until someone changes it.
( ===== FINISH PASS WITH VC-DRIVEN WEAR TRIM ===== )
( OPERATOR SETS VC150 TO THE MEASURED OVERSIZE ON DIAMETER )
( E.G. PART MIKES 1.2508 AGAINST A 1.2500 TARGET -> VC150=0.0008 )
VC151=1.2500-VC150 ( TRIMMED TARGET DIAMETER )
IF [VC150 LE 0.005] N110 ( SANITY CHECK - TRIM UNDER 0.005? )
M00 ( STOP - TRIM TOO BIG, PROBABLY A TYPO )
N110 G50 S3000
G96 S700 M03 M08
G00 Z0.1
X=VC151 ( APPROACH AT THE TRIMMED DIAMETER )
G01 Z-2.000 F0.006 ( FINISH THE LAND )
X=VC151+0.2 ( PULL OFF THE DIAMETER )
G00 Z0.3 M09
M05
M02
The same pattern drives geometry, not just compensation. Here is a taper cut where the end diameter is computed instead of typed — change the taper rate or length and the program re-derives everything:
( ===== TAPER FROM VC MATH - 0.100 PER INCH ON DIAMETER ===== )
VC120=2.000 ( LARGE-END DIAMETER )
VC121=1.500 ( TAPER LENGTH )
VC122=0.100 ( TAPER PER INCH, ON DIAMETER )
VC123=VC120-VC122*VC121 ( SMALL-END DIAMETER = 1.850 )
G50 S3000
G96 S650 M03 M08
G00 Z0.1
X=VC123 ( START AT THE SMALL END, OFF THE FACE )
G01 Z0 F0.008 ( TOUCH THE FACE )
VC124=-VC121 ( Z AT THE BIG END )
X=VC120 Z=VC124 ( ONE STRAIGHT MOVE CUTS THE TAPER )
G00 X2.2 Z0.3 M09
M05
M02
Families of parts fall out of the same idea — one program, a handful of VC dimensions at the top — and so do probing feedback loops. Note the named system variables from the variable-types article are readable in a program too — for example VNOSER[n] returns the stored nose radius for tool-offset number n, which lets a program verify that the tool data matches what the contour math assumed before it cuts (IF the radius is wrong, M00 and say so). Index ranges and which offset variables exist per axis depend on the OSP version — check your machine’s system-variable list before writing offsets programmatically.
Coming from Fanuc: a Translation Table
| Fanuc habit | OSP equivalent | Note |
|---|---|---|
G71 rough turning | G85 N_ LAP rough call + G81…G80 contour | Contour is a named block, defined once |
G70 finish | G87 N_ LAP finish call | Reuses the same contour definition |
G76 threading cycle | OSP compound threading cycle (G71 on OSP) or G33 longhand | Number collision: OSP G71 = threading, not roughing |
#100 | VC100 | VC common variables persist through power-off |
#0 (null) test | IF [PA12 EQ EMPTY] | Optional CALL arguments start with P |
M98 P1234 | CALL O1234 | CALL passes named arguments: CALL O1234 DPTH=0.3 |
M99 | RTS | Return from subprogram |
G65/G66 macro call | CALL / MODIN…MODOUT | Arguments arrive as named local variables, not #1–#33 |
WHILE […] DO1 | IF […] N100 / GOTO N100 | Loops are built from conditional jumps to N-labels |
G54–G59 | Zero offset set at setup | One work zero per setup is the default idiom |
G50 S_ / G92 S_ clamp | G50 S_ | Same job; on OSP, G50 is only the speed clamp |
G96/G97 | G96/G97 | Constant surface speed works the same way |
#5221-style offset reads | Named system variables (e.g. VNOSER[n]) | See Okuma Variable Types; ranges vary by OSP version |
▶ Open the Macro Playground — pick the Okuma control and run VC-variable math like the threading and wear-trim loops above in your browser, with live variable values as the program executes.
See also: Okuma Variable Types for VC/VS variables and the named system variables, Okuma Argument & Local Variables for CALL arguments and EMPTY checks, Fanuc Turning Programming for the control you are translating from, and Threading & Rigid Tapping for thread fundamentals.
References
- Okuma, OSP Programming Manual (Lathe), Okuma Corporation.
Have a question or want to contribute?
Contact us with corrections, additions, or topics you'd like covered.
Get in Touch