The submitted lathe program runs the contour left to right, puts the groove inside the roughing cycle, and uses cycle parameters that do not match the contour it is meant to cut. Three changes fix it: flip the contour so it runs small diameter to large diameter, take the groove out of the roughing contour, and make the cycle end reference point at the last contour block. The reference block below is written in Fanuc G71 format. The reviewed program may have been written for a Sinumerik-style control, so every cycle parameter must be checked against your own control's manual.
Three ways to program this part, compared
The review produced three candidate approaches. Only one fits a chuck-held part on a conventional lathe.
| Criterion | A: as submitted | B: flipped contour, groove separate | C: Swiss-type machine |
|---|---|---|---|
| Contour direction | Left to right, large to small | Small diameter at Z0 end, growing toward the chuck | Bar feeds out in +Z past tools that mainly move in X |
| Work holding | Largest diameter not necessarily in the chuck | Largest flange in the chuck | Bar held by the sliding headstock |
| Z sign toward the part | Z- | Z- | Z+ (parting cut is also made at Z+) |
| Groove at diameter 70 | Inside the G71 contour | Separate grooving tool and separate block | Per the machine's own tooling and manual |
| Holder clearance | Holder back side interferes when cutting big to small | Holder clears the shoulder that was already cut | Not addressed by the review |
| Cycle parameters |
Q not at the last contour block, depth of cut too large |
P100/Q200 bracket the contour, about 1 mm depth of cut |
Check the control's manual |
Recommendation: use approach B on any lathe that holds the part in a chuck. Use approach C only after confirming the machine is a Swiss-type. The rest of this reference follows B.
Deciding the Z direction for your machine
Z- toward the workpiece is normal on chuck lathes, and the review reports the same on Sinumerik 840D lathes and turning centers. A two-spindle machine with both spindles on the same Z axis cuts the left part in Z- and the right part in Z+. A Swiss-type behaves differently: the bar stock moves in +Z through the tool zone, the turning tools move only in X, and the parting cut is made at Z+. If the programmer says the machine "makes a piece along the Z axis", the machine type has not been established yet.
- Read the machine nameplate or manual and record whether it is a chuck lathe, a two-spindle machine, or a Swiss-type. Gate: the type is written down before any coordinates are chosen.
- Jog Z in the minus direction with the tool near the part in MPG or handwheel mode. Gate: the tool moves toward the chuck (chuck lathe) or the axis direction matches the manual for your machine type.
- Set the Z sign for the whole program from that reading. Do not mix signs inside one contour.
Reference roughing block with the contour running small to large
The block below is the corrected Fanuc-format reference. The paste it came from had lost its line breaks, so the line layout here is reconstructed. The coordinates belong to an example part, so replace them with drawing values.
G71 U1.0 R0.5
G71 P100 Q200 U2.0 W0.1 F0.25
N100 G0 G42 X22.0
G1 Z2.0
X30.0 Z-2.0
Z-60.0
X40.0
X60.0 Z-100.0
Z-105.0
G2 X70.0 Z-110.0 R5.0
G1 X80.0
G3 X100.0 Z-120.0 R10.0
G1 Z-200.0
N200 G1 X110.0
G0 G40 Z5.0
Read the block for these features:
- X grows and Z decreases monotonically from the small end at Z2 to the chuck end at Z-200. Roughing cycles of this type need a monotonic contour. This one has no undercut and no groove.
- The first contour block,
N100, carries only an X move. The Z approach follows in the next block. - Both arcs carry an end diameter, an end length, and a radius. The
G2arc goes from X60 Z-105 to X70 Z-110 with R5. TheG3arc goes from X80 Z-110 to X100 Z-120 with R10. The original program's R10 segment lacked its end diameter and length. -
P100andQ200bracket the contour exactly.Qnames the last contour block, which is why theNnumbers must stay in the program even though other line numbers are optional. -
U1.0in the first line is the depth of cut, 1 mm here. Confirm on your control whether that value is radial or diametral. - The roughing cycle leaves
U2.0 W0.1of stock. A finish pass over the sameP/Qrange (G70 P100 Q200) belongs after the cycle. The reference block does not include it, so add it and confirm the finishing tool number and offsets.
Corrections mapped to the symptoms they fix
| Item in the submitted program | Problem | Correction |
|---|---|---|
Row N40
|
Redundant, because N60 switches from constant spindle speed to constant surface cutting speed and overrides it |
Delete N40. Keep the spindle mode change at N60
|
Row N70
|
Looks wrong; the reviewer asked for a second opinion | Compare it against your control's manual before any cut |
Q reference at the cycle call |
Points somewhere other than the last contour block. The contour runs N100 to N210, so Q should be Q210
|
Set Q to the last block of the contour. Recheck the same reference at N230
|
D10 depth of cut |
10 mm is too much for a roughing pass | Use about 1 mm |
N95 to N100 entry |
Starts cutting directly at the contour | Position at the correct diameter first, with a length offset. Example: X102 Z2 then X100 Z0.5
|
| Contour direction | Left to right, large to small | Flip it. Clamp on the largest diameter and cut small to large |
Contour from N160 to N180
|
Missing end diameter and length for the R10 arc. The R5 blend must follow, then a straight line, then a cone from diameter 60 to 40, then a straight line to diameter 26 | Rebuild that segment with explicit end points for each element |
| Groove at diameter 70 inside the cycle | The holder back side hits the part, and no single tool known to the reviewer cuts the whole contour plus the groove | Remove the groove from the roughing contour and cut it with a second tool |
Grooving tool, holder clearance, and tooling knowledge
The insert sits in a holder, and the holder's back side is wider than the cutting edge. On a big-to-small cut the shoulder that was cut first sits behind the insert, and the holder collides with it. The same collision happens if the groove is programmed into the G71 contour, because the cycle plunges into the groove and retracts along the wall. Cut the roughing contour with a turning tool that clears the shoulders, and cut the groove afterward with a grooving tool that has its own tool number, offset, and block.
Work out the tooling before writing coordinates. Confirm insert geometry, holder clearance angle, and grooving insert width against the drawing. G-code cannot correct a tool that does not fit the profile. An approach that also works is to start with the small side of the part and leave the groove out of the first program. Prove the outer contour, then add the groove as its own operation.
Line numbers and cycle references
Advice to remove all line numbers is only partly right. Numbers on ordinary blocks are optional. The N numbers named by P and Q are not: the cycle finds the contour by those sequence numbers. Keep N100 and N200 in the reference block, and drop the others if they add clutter. If the program is edited later, renumber only after confirming that P and Q still point at the first and last contour blocks.
Commissioning procedure for the corrected program
- Set the work offset and tool offsets for the turning tool and the grooving tool. Gate: touching off on the stock diameter and face reproduces the X and Z values displayed on the offset page.
- Load the program and run graphic simulation. Gate: the roughing paths run parallel to Z, step by the depth of cut, and stop at the finish allowance
U2.0 W0.1. - Check the contour against the drawing. Gate: every arc has an end diameter, an end length, and a radius, and the largest diameter is at the chuck end.
- Check
PandQ. Gate:Pequals the number of the first contour block andQequals the number of the last contour block. - Check the depth-of-cut value at the cycle call. Gate: it reads about 1 mm, not 10 mm.
- Run the first pass in single block with feed override reduced and the distance-to-go display visible. Gate: the entry move lands at the correct diameter with the length offset (for example
X100 Z0.5) before any cut begins. - Add the finish pass, then add the groove as its own operation with the second tool. Gate: the holder does not touch any shoulder in simulation or in single-block motion.
FAQ
How do I choose the Z direction on my lathe?
On a chuck lathe program Z- toward the workpiece, and jog the axis in the minus direction to confirm the tool moves toward the chuck. On a Swiss-type machine the bar moves in +Z and the parting cut is made at Z+, so confirm the machine type first.
How do I stop the tool holder from hitting the part during roughing?
Cut the contour from small diameter to large diameter, with the largest flange in the chuck. Cutting big to small puts the holder back side against the shoulder that was already cut.
How do I set P and Q on the G71 cycle?
Set P to the first contour block and Q to the last. In the reference program those are P100 and Q200, and the program in review needed Q210 to match its own last contour block.
How do I program the groove at diameter 70?
Leave the groove out of the G71 contour and cut it with a separate grooving tool. Give it its own tool number, offset, and blocks after the roughing and finishing passes.
How do I verify the corrected program before cutting metal?
Confirm that P and Q match the first and last contour blocks and that the depth of cut is about 1 mm. Then run single block with reduced feed override, and confirm the entry move stops at the offset diameter (for example X100 Z0.5) before the first cut.