Why lathe X is a diameter: diameter programming, U/W incremental moves and the G18 plane
Explains why the X value in a CNC lathe program means a diameter rather than a radius, why it appears as a radius in the screen drawing, and U/W incremental commands and the G18 ZX plane, using a chamfering example.
Drawings and measurements use diameters
Most parts made on a lathe are rotational. Drawings give diameters such as Ø30 or Ø24, and operators measure diameters with micrometers or vernier calipers. That is why most lathe controllers use diameter programming, where the X value is read as a diameter, by default. Writing X30. means the tool tip goes to a point 15 mm from the spindle center.
This lets you copy drawing dimensions directly, but you must always keep in mind that the machine actually moves half that distance. Changing X by 1 mm moves the tool only 0.5 mm and changes the diameter by 1 mm.
Why the screen drawing shows radii
When a path is drawn as a section, the vertical axis is the distance from the spindle center, in other words the radius. CNC Path Analyzer also halves the X command values in lathe mode. In the example, X30. appears at height 15 in the drawing and X60. at height 30. It is normal for the program values and the drawing scale to look different.
G18: the default plane of the lathe
A lathe tool moves along two axes, Z (spindle direction) and X (diameter direction), so arcs and compensation are calculated in the ZX plane. The code that selects it is G18. Lathe controllers are usually in G18 at power-on, but on multitasking machines with milling functions a program can end with G17 or G19 still active, so it is a good habit to state it at the start.
Example and path
A short turning program that cuts a C2 chamfer on a Ø30 OD and makes a step with U/W incremental moves
O2003
T0101
G21 G90 G18 G40 G99
G97 S1500 M03
G00 X32. Z2.
G01 X26. F0.15
Z0.
X30. Z-2.
Z-25.
U4.
W-10.
G00 X60. Z50.
M30The figure above is the CNC Path Analyzer result for this program (linear cutting 6 segments, rapid 1 segments).
Reading the example
| Block | Meaning in diameter terms | Radius (drawing) position |
|---|---|---|
G00 X32. Z2. | Rapid approach to Ø32, 2 mm in front of the face | Height 16, Z2 |
G01 X26. F0.15 | Feeds in to the chamfer start diameter Ø26 | Height 13 |
Z0. | Feeds to the face of the workpiece | Z0 |
X30. Z-2. | Diameter +4 mm over a length of 2 mm → C2 chamfer | Height 15, Z-2 |
Z-25. | Turns the Ø30 OD to a length of 25 mm | Z-25 |
U4. | Increases the current diameter by 4 mm → Ø34 step | Height 17 |
W-10. | Moves 10 mm further from the current Z → Z-35 | Z-35 |
U and W: incremental commands on the lathe
Machining centers switch on incremental mode with G91, but the standard G-code system of FANUC lathes (system A) instead distinguishes absolute and incremental by the address letter. X/Z are absolute coordinates and U/W are increments in X and Z respectively. They can even be mixed in one block, as in X30. W-5..
U is also a diameter value. U4. moves the tool 2 mm outward in radius, enlarging the diameter by 4 mm. If you forget this and write U thinking in radius terms, the step height ends up half or double what you intended.
Why spindle speed must change when the diameter changes
The relationship between cutting speed V (m/min) and spindle speed N (rpm) is N = 1000 × V ÷ (π × D). At the same 1,500 rpm, the cutting speed is about 141 m/min at Ø30 but drops to 47 m/min at Ø10. If the spindle speed is fixed during work where the diameter keeps shrinking, such as facing, the surface becomes rougher toward the center.
That is why, when V is specified with G96 (constant surface speed control), the lathe automatically changes the spindle speed to suit the current X diameter. The fact that X is a diameter is used directly in this calculation. Cutting Ø30 at V160 gives about 1,698 rpm, and at Ø10 it would rise to about 5,093 rpm, so the maximum spindle speed is limited with something like G50 S2000 to protect the chuck and the workpiece.
| Diameter | Spindle speed at V=160 | With G50 S2000 |
|---|---|---|
| Ø60 | About 849 rpm | 849 rpm |
| Ø30 | About 1,698 rpm | 1,698 rpm |
| Ø20 | About 2,546 rpm | Limited to 2,000 rpm |
| Ø10 | About 5,093 rpm | Limited to 2,000 rpm |
Common mistakes with diameter programming
- Chamfer calculation: a C2 chamfer is 2 mm long and 2 mm in radius, so it is a 4 mm difference in diameter. In the example, X26 → X30 and Z0 → Z-2 show exactly this relationship.
- Tool wear offset: if the OD comes out 0.02 mm oversize, enter -0.02 (a diameter value) as the X wear offset. Entering -0.01 by mistakenly thinking in radius corrects only half.
- U in cycles: U in the first block of G71 is a depth of cut in radius, so it must be read differently from the diameter habit.
- Thread root diameter: in G76, X is the root diameter (a diameter) while P is the thread depth (a radius), so the reference is mixed.
Frequently asked questions
Are U and W incremental on machines using G-code system B or C too?
G90/G91 as on a machining center, and U and W may have other meanings. Check the machine's G-code system setting first.