← Back to CNC Programming

Diagnosing Program Problems

When the machine does something unexpected, systematic diagnosis beats trial and error. This page covers common symptoms, where to look, and how to fix each category of programming error without compounding the problem.

Level: KScope: Machine-neutral concepts; controller-specific examples are labelledPrerequisite: Program Verification and First-Article Checks
After this lesson, you can:

Concept

Program problems fall into four categories: motion errors (tool goes where it should not), dimension errors (part size is wrong), alarm errors (machine stops with a fault), and surface errors (finish or tool condition is poor). Each category has a diagnostic path: read the alarm, check the modal state, verify coordinates on paper, then make one change and observe.

Why It Matters

The #1 debugging mistake is changing a random line and re-running. This compounds errors: you fix one symptom but break another, and you lose track of what actually caused the problem. Systematic diagnosis — read, check one thing at a time, change one variable — is the engineering habit that prevents crashes and scrap.

How It Works

Symptom → Cause → Check Table

Symptom → Cause → Check Table
SymptomLikely CauseWhat to Check
Tool goes wrong directionG90/G91 distance modeIs absolute or incremental active?
Dimensions off by 25.4×Units mismatchG20 (inch) vs G21 (metric)
Hole at wrong positionWork offset wrongIs G54 X/Y correct? Accidentally on G55?
Arc alarm or wrong geometryCenter/radius inconsistencyCheck S/E/C radii; on Haas G17, I/J are increments from start
Cycle drills extra holesMissing G80Was the cycle cancelled after the pattern?
Tool crashes at cut depthNo Z retract before XY moveWas G00 Z50 before any XY move?
Tool cuts at wrong diameterX treated as radius on latheX is diameter; radial depth = (X1-X2)/2
Dimension off by tool radiusCutter comp not activeIs G41/G42 on? Is D offset correct?
Spindle wrong directionM03/M04 reversedCheck the S line and M03/M04
Feed too fast/slowG94 vs G95 modeF in mm/min vs mm/rev

Diagnosis Procedure

  1. Read the alarm — the alarm number and message tell you what the controller thinks is wrong. Do not clear it before reading it.
  2. Check modal state — on the controller, display active G codes. Is G90 or G91 active? G20 or G21? G41 or G40? G80 or a cycle?
  3. Verify on paper — trace the program from the start. Where should the tool be at each line? Compare to where it actually is.
  4. Make one change — fix one thing, then run again. Do not change three lines at once.
  5. Observe — use single-block mode and dry run to watch the corrected motion before full cut.
Illustration for Diagnosis Procedure. Its dimensions and assumptions are explained in the adjacent lesson text.Diagnosis Procedure Symptom Read Alarm Check State One Fix Observe Done
Systematic diagnosis: symptom → read alarm → check modal state → one fix → observe. Never change multiple lines at once.

Example

Scenario (Case A): Program hole at X30 Y10. Expected machine position with G54=(-300,-200) is (-270,-190). If measured hole lands 20 mm in +X, check whether G54 X was entered as -280 instead of -300:

  1. Is G90 (absolute) active? Check the modal display. If G91 (incremental) is active, X30 means "move 30 mm from current position," not "go to X30."
  2. Measure the actual hole position relative to the part datum first.
  3. Check G54 display: if X origin was entered as -280 instead of -300, the hole shifts +20 mm.
  4. Are you running the correct program? Check the O number on the controller display. Machine shops have dozens of similar programs.

Under the no-rotation/no-scale/no-additional-offset assumption, if measurement confirms a constant +20 mm X shift and the controller G54 X is indeed -280, correct it to -300. Multiple shifted holes alone do not prove this; verify the actual datum.

Unexpected Tool Motion

If the tool moves where you did not expect, suspect modal state: leftover G91, active G81, wrong plane G18/G19, or inherited G41/G42. Check the modal display on the controller, not just the current line.

Wrong Direction or Wrong Coordinates

A part cut on the wrong side usually means G90/G91 confusion, wrong work offset (G54 vs G55), or mirrored axes. Re-measure, re-check offsets, and verify the part zero matches the drawing datum.

Tool Wear and Surface Finish

Poor finish, chatter marks, or dimensional drift all point to tool wear or rigidity. Replace the insert, check overhang, and confirm the workholding before blaming the program.

Illustration for Tool Wear and Surface Finish. Its dimensions and assumptions are explained in the adjacent lesson text.Tool Wear and Surface Finish correct (-270,-190) wrong (-250,-190) +20 mm X Case A: G54 X off by 20 mm
Case A: correct vs wrong machine position; hole shifts +20 mm in X.

Chatter and Vibration

Chatter leaves a wave pattern on the surface. Causes include tool overhang, weak workholding, spindle speed near resonance, or worn inserts. Reduce overhang, increase rigidity, and change speed before changing feed.

Dimensional Drift

If parts start on-size and drift over a shift, suspect thermal growth, tool wear, or workholding loosening. Warm up the spindle, re-check offsets, and monitor temperature.

Chip Control Problems

Long birds' nests wrap around the tool or part. Adjust feed and speed, use a chip breaker geometry, or add pecking. Chips that do not evacuate scratch the finish and can break the tool.

Alarm Codes

Treat alarm codes as clues, not as instructions. Look up the code in the machine manual, understand the condition, and clear it. Resetting repeatedly without understanding damages the machine and the part.

Separating Program Errors from Setup Errors

A part dimension that is consistently off by the same amount points to an offset error. A dimension that varies between parts points to workholding, tool wear, or thermal growth. A move that goes the wrong way points to a program or modal error. Diagnose the pattern before changing code.

Wrong Tool Offset Sign

If a bore cuts too small on the inside or too deep on the outside, the offset sign may be reversed relative to the controller. Re-check the H/D value against the touch-off procedure on this specific machine.

Wrong Cutter Compensation Side

For positive cutter compensation, G41 places the tool center to the left of the programmed path, and G42 places it to the right, viewed along the direction of travel. First identify the finished boundary and the side of material to retain, then choose the required tool-center side. For example, moving along +X on Y0 with retained material at Y<0 requires the center on Y>0, the left side, so use G41. Verify the lead-in and the controller's compensation convention.

Feed or Speed Alarm

A spindle overload alarm means the cut is too heavy for the tool or machine. Reduce depth of cut, feed, or speed; do not reset and run the same cut again.

Overtravel Alarm

Overtravel usually means the program expects coordinates beyond the envelope, or a work offset sends motion into a limit. Follow the machine's recovery procedure, then verify the offset and envelope.

Surface Finish Worse Than Expected

Compare to tool condition, nose radius, feed per rev, and buildup. A worn insert or built-up edge also affects dimensions and finish; do not assume finish issues are separate from size.

Part Not Where the Drawing Says

If features are translated as a group, suspect work zero. If individual features vary, suspect tool wear or deflection. Measure before changing anything.

Bolt Hole Circle Out of Position

If a bolt circle is rotated or shifted, the center coordinate or work zero is off. Re-measure the center from the datums. Do not rotate individual holes.

Bore Size Wrong

A bore that is off size requires checking target diameter, wear, deflection, and measurement before adjusting the offset.

Thread Not Accepting the Gauge

If the GO does not enter, check depth, pitch, and spindle/feed sync. If NO-GO enters, material is already removed and the part is likely scrap.

Program Crashes on a Move That Was Fine Before

Something in the setup changed: a clamp moved, a tool got longer, or a different stock was loaded. Re-verify the changed variable, not the whole program.

Establishing a Diagnostic Habit

Write down the symptom, the suspected cause, and the actual fix after every issue. Over time this becomes the shop's troubleshooting knowledge base. Same symptom next month is no longer a mystery.

Tool Breakage

When a tool breaks, stop, inspect, and replace. Do not try to continue with a broken tool — it will wreck the part and possibly the spindle. Note the cut conditions that caused it and reduce them on the next run.

Dimensional Error That Changes Over Time

If parts drift gradually, suspect tool wear or thermal growth. Record dimensions over a batch and re-offset when drift crosses a threshold.

Surface Integrity Issues

Burn marks, white layer, or work hardening are hypotheses to verify — speed, feed, grade, and coolant all play a role. Do not assume a single cause.

Machine-Related Issues

Not every issue is a program bug. Loose belts, worn ballscrews, or faulty encoders cause real machine errors. If symptoms repeat across programs on the same machine, investigate the machine, not the code.

When to Escalate

If the cause is not identified after structured diagnosis, escalate to a more experienced operator or maintenance. Bring the symptom history, not just the latest part.

Using Data to Troubleshoot

Record dimensions across parts. Trends suggest wear, thermal growth, or workholding; outliers suggest setup or tool events. Numbers beat intuition.

When to Stop the Batch

If one part is out of spec, stop and find the cause before running more. Do not hope the next one will be fine. Scrap piles grow from ignored outliers.

Root Cause, Not Symptom

If the bore is small, adjusting the offset treats the symptom. Find out why the bore went small: tool wear? Deflection? Thermal? Fix the root cause, then adjust offset.

Documentation of Every Fix

Write down what worked. A troubleshooting fix that only lives in your head is lost when you are not at the machine. Keep a simple log on the setup sheet or in the program comments.

Common False Leads

The most obvious cause is often not the real one. Before editing the program, check the simple things: clamp tight? tool seated? offset correct? Most "program bugs" are setup errors.

Building a Troubleshooting Mindset

Every crash is a lesson. What assumption turned out to be wrong? Write it down. Over time you will recognize patterns before they become crashes.

Working with Maintenance

When the machine itself is suspect, describe symptoms precisely: alarm numbers, repeatability, sounds, dimensions. Maintenance can act on data, not on "it feels wrong."

Sharing What You Learned

Tell the next operator about the issue. A problem fixed in isolation repeats on the next shift. Communication on the shop floor prevents repeat scrap.

Summary

Good troubleshooting is systematic: observe, hypothesize, test, verify. Rushing leads to repeated scrap.

Closing the Loop

After a fix, run a few parts and confirm the symptom is gone. Do not declare victory after one good part; verify the fix is repeatable.

Arc Radius Consistency Check

For an arc from S(0,0) to E(50,0) with center C(25,0), both radii are 25 mm. If C(20,0), the two radii are 20 and 30 — inconsistent, and the controller will alarm before cutting a "lopsided" arc.

Common Mistakes

Practice

1. The part comes out 25.4× too small. What happened?

Ans

Units mismatch: the program uses mm (G21) but the machine is in inch mode (G20), or vice versa. 1 inch = 25.4 mm. Check the active units modal.

2. After drilling four holes, the next X/Y move makes an unexpected hole. Why?

Ans

Missing G80 after the hole pattern. The drilling cycle stayed modal, so the next X/Y position triggered another drill cycle. Add G80.

3. How do you verify which program is loaded on the controller?

Ans

Check the O number on the controller display. Machine shops have many programs with similar names; always confirm the O number before running.

4. Arc from S(0,0) to E(50,0) with center C(20,0). Why does the controller alarm?

Ans

Start radius from C(20,0) to S(0,0) is 20 mm; end radius to E(50,0) is 30 mm. The two endpoints are not on the same circle, so the controller alarms.

Sources