Clear the Clearance Error with the Machining Program
A size error that grows each time the tool reverses direction is usually backlash, not a worn machine. This page shows how to use the machining program to clear the clearance error before you call a service technician. Written for programmers and setup engineers running lathes and 3-axis mills.

Clear the clearance error: symptoms, causes, and action
Match what you see on the part or the control screen to the most likely cause. Work down the left column.
| Symptom | Likely cause | Action |
|---|---|---|
| Bore oversize after a direction reversal | Backlash in the X or Z ballscrew | Cut a two-direction test circle, then set backlash comp |
| Size drifts across one batch | Thermal growth, no warm-up cycle | Run a 20–30 minute warm-up program first |
| Taper on a straight turned surface | Bed twist or tailstock offset | Level the bed, then recheck with a test bar |
| Corner radius wrong only on inside corners | Cutter comp value taken from the wrong offset | Verify the D number and the radius in the offset page |
| First part good, tenth part out of tolerance | Tool wear, no wear offset update | Add a wear offset step between parts |
| Alarm on a G41/G42 block | Comp move shorter than the tool radius | Lengthen the lead-in move or cut comp in two blocks |
| Chamfer size shifts at each Z reversal | Servo lag, not backlash | Lower the feed rate in the reversal block |
| Size correct in X, wrong in Z only | Worn Z thrust bearing | Check thrust bearing before touching the program |
Measure the gap before you edit the G-code
Most clearance errors come from mechanical play, not from the program. Run the two-direction test first, then decide whether the fix belongs in the parameter page or in the service call.
Why a clearance error looks like a program problem
Clearance error is the gap between the position the control commands and the position the slide actually reaches. Every mechanical drive has some. Ballscrews have axial play, thrust bearings compress, and the servo loop closes with a small following error. When the tool changes direction, that gap appears on the part as a step, a taper, or a bore that measures large on one side.
The reason this gets blamed on the program is that the error only shows up on some features. A roughing pass hides it. A finishing pass at 0.1 mm depth of cut exposes it, because the cutting force is low and the slide moves into the gap instead of pushing through it.
So the first job is not to edit the program. It is to prove where the error comes from. A test cut you write yourself will tell you more in ten minutes than an hour of reading the G-code. Once you know the number, the machining program to clear the clearance error is a short set of moves, not a rewrite.
Programmers at GreatLight run this check on every new job that holds ±0.005 mm, because the same error that ruins a bearing bore will pass unnoticed on a bracket. The difference is the tolerance band, not the machine.
- 1Direction reversalThe single most common trigger for a clearance error.
- 2Light finishing passesLow cutting force lets the slide sit inside the gap.
- 3Tight tolerance bandsA 0.02 mm gap is invisible on a ±0.1 mm part.
Write a test program that measures backlash in one cut
You need one part, one boring bar or end mill, and a dial indicator. Face and turn a short cylinder, then take two finish passes at the same diameter from opposite directions. Measure both. The difference between the two readings is the backlash on that axis, and it is usually 0.005 to 0.03 mm on a well-kept lathe.
Repeat the cut with the indicator on the slide instead of on the part. If the indicator shows the same gap, the fault is mechanical. If the slide moves the full commanded distance and the part still comes out wrong, the fault is in the offset data or in the program.
Run the same test on X and Z separately. Never accept a single number for both axes. X backlash and Z backlash come from different parts of the machine and one can be three times the other.
Write the numbers down on the setup sheet. When the same job comes back in six months, you will know whether the machine moved or the part changed.
- 1Cut from both directionsSame diameter, same feed, same depth of cut.
- 2Indicator on the slideSeparates mechanical play from offset error.
- 3Test X and Z apartOne number per axis, always.
Correct the clearance error in the program, not the machine
If the test shows real backlash, the control can compensate it. On most turning centers this is the backlash compensation parameter per axis, entered in millimeters or inches. Set it to the measured value, then cut the test part again. Do not add a fudge factor on top of an already compensated axis.
If the backlash changes between a cold and a warm machine, compensation alone will not hold the tolerance. In that case, keep the reversal moves out of the finishing pass. Cut the finish pass in one continuous direction where the geometry allows it. On a bore, that means entering at the bottom and pulling out, instead of plunging and reversing.
Cutter compensation is the other half. A D offset that is 0.01 mm too large will push a bore undersize by 0.02 mm on diameter. Check the radius in the offset page against the tool you actually loaded, then let the control do the math.
On a mill, keep the lead-in move at least 1.5 times the tool radius. A lead-in shorter than the radius makes the control alarm out, or worse, drops the comp without telling you.
- 1One direction finishingRemoves the reversal, removes the step.
- 2Check the D valueRadius error doubles on diameter.
- 3Lead-in ≥ 1.5 × radiusShort moves break comp quietly.
Four steps to clear the clearance error
- 1Run a warm-up cycleSpindle 2,000 rpm, axes moving through their normal travel, 20 to 30 minutes. A cold machine can read 0.01 mm different from a warm one on the same part.
- 2Cut the two-direction testTurn or bore the same diameter from both directions at 0.1 mm depth of cut and 0.1 mm/rev feed. Measure both results with a micrometer, not calipers.
- 3Enter the measured value as backlash compSet the per-axis parameter to the measured gap. Values above 0.05 mm usually mean a mechanical repair, not a compensation entry.
- 4Re-cut and re-measureRun the same test. If the two readings now match within 0.005 mm, write the parameters on the setup sheet and release the job. If they do not, move to the thrust bearing and coupling check.
Clear the clearance error: common questions
Can backlash compensation hide a worn ballscrew?
It can hide it for a while. Compensation tells the control to add extra travel when the axis reverses. If the screw or nut is worn unevenly, the gap is different at each position along the travel, and one fixed number cannot cover it.
A quick check: run the two-direction test at three positions along the axis. If the numbers differ by more than 0.01 mm, plan a mechanical repair instead of chasing parameters.
Does the clearance error show on a part that is only cut in one direction?
No, and that is useful. A part finished in a single continuous direction will hold size even on a machine with visible backlash. If that part is still out of tolerance, the cause is thermal growth, tool wear, or an offset error, not clearance.
How much backlash is acceptable on a CNC lathe?
For work inside ±0.005 mm, keep the measured gap at or below 0.01 mm per axis after compensation. Between 0.01 and 0.03 mm you can still hold ±0.02 mm on most features. Above 0.05 mm, compensation starts to affect surface finish because the axis snaps across the gap.
Does cutter compensation affect the clearance error?
They are separate, but they look the same on the part. Cutter comp changes the path by a fixed tool radius; clearance error changes the path only when the axis reverses. Cut the same feature twice from opposite directions to tell them apart. If both cuts match and both are wrong, it is comp. If they differ, it is clearance.
Do I need to recheck after a tool change?
Yes. A new insert can shift the effective radius by a few thousandths of a millimeter, and a new holder can shift it more. Re-cut a short test feature, check the size, and adjust the wear offset before running the batch.
Send us the drawing and the tolerance band
Tell us the feature that keeps drifting and the tolerance you need. We quote and return a free DFM analysis within 12 hours.
12-hour quote100% inspectionNo minimum order