Top CNC Alarm Codes, G-Code Mistakes, and Programming Errors: The Ultimate 2025 Troubleshooting Guide for Fanuc, Haas, and Siemens Controls
CNC machines do not fail silently. When something goes wrong, they shout about it with alarm codes, axis faults, overtravel errors, and mysterious messages that stop production at the worst possible moment. The difference between a beginner and a professional in 2025 is not who never sees alarms, but who can read them, understand them, and fix the root cause quickly without damaging the machine, the tool, or the part.
This guide is designed as an evergreen troubleshooting reference for Fanuc, Haas, and Siemens users. It focuses on three areas that cause the majority of shop-floor downtime: CNC alarm codes, G-code programming mistakes (including dangerous G00 Z moves), and logic errors in part programs and CAM outputs.
1. Why CNC Alarms Are Your Best Friends (Not Your Enemies)
CNC alarms exist to protect three things:
- The machine structure and axes
- The cutting tools and spindle
- The workpiece and fixture
An emergency stop, overtravel, or servo alarm is often the only thing preventing a crash. Modern controls are built around safety logic: when something is detected outside safe limits, motion is stopped and an error message is displayed. Ignoring or forcing through alarms is one of the fastest ways to destroy a spindle, bend a ball screw, or scrap high-value aerospace parts.
Good practice in 2025 is to treat every alarm as a diagnostic clue, not an obstacle. The correct response is always: read, interpret, trace, and only then reset and rerun.
2. The Major Types of CNC Alarm Codes
Although Fanuc, Haas, and Siemens use different numbering systems and wording, most alarms fall into a few universal categories:
- Axis travel and overtravel problems
- Reference return and homing errors
- Spindle and servo drive faults
- Program structure and G-code logic errors
- Tool and offset related issues
- External IO, sensor, or safety circuit errors
- Communication and file problems
If you can mentally classify an alarm into one of these groups, you are already halfway to the solution.
3. High-Impact Alarm Types and Real Causes
3.1 Overtravel and Soft Limit Alarms
These are some of the most common and dangerous alarms. An overtravel means the CNC has reached or attempted to reach a position beyond its configured travel envelope. Soft limits are software-defined limits inside that envelope used to keep the tool away from chucks, vises, rotary tables, or other hardware.
Typical real causes include:
- G-code using absolute coordinates that exceed machine travel
- Work offset (G54–G59 or G54.1) set incorrectly, shifting the part into a bad region
- Wrong sign in a move: G00 Z-100 instead of G00 Z100 on a mill, or the opposite on a lathe
- Tool length or wear offsets with wrong values (for example, a missing decimal: 200 instead of 20.0)
- Incorrect use of G28 or G30 without safe intermediate positions
On machines with stroke protection commands like G22, soft limits can be deliberately tightened to avoid collisions with fixtures. If your program suddenly starts hitting these limits, the safe-box may be configured too aggressively or the work offset may have changed.
3.2 Reference Return and Homing Problems
Many Fanuc, Haas, and Siemens machines require axes to be referenced or homed before cutting. If the machine loses reference (after power loss, servo error, or encoder issue), moves based on G54 or other offsets can no longer be trusted.
Symptoms include:
- Alarm after power-up when trying to jog an axis
- Homing sequence stopping before reaching reference
- Inability to call G28 or G30 reliably
- Parts coming out dimensionally wrong after a crash or power issue
The correct response is:
- Follow the exact reference return procedure from the builder
- Home each axis in the recommended order (often Z, then X and Y, then rotary axes)
- Inspect for physical obstruction, loose couplings, or encoder/cable issues if homing fails repeatedly
3.3 Servo and Spindle Drive Alarms
Servo and spindle drive alarms often come with specific codes from the drive itself. Common real-world causes include:
- Excessive mechanical load (tool buried too deep, wrong feed, chip packing)
- Damaged ball screw, bearing, or coupling causing high torque requirements
- Spindle overload due to wrong tool, dull insert, or incorrect cutting data
- Bad encoder feedback or broken motor cable
- Incorrect or missing lubrication on axis ways and screws
Blindly resetting these alarms without investigating load, cutting parameters, and mechanical condition is dangerous. Overheated drives and motors are expensive to replace.
4. The Most Expensive G-Code Mistakes (Including G00 Z Moves)
Some of the most costly CNC crashes come from perfectly valid G-code that is logically wrong. The control happily executes what it is told, even if that means driving a tool straight through a vise jaw.
Below are several high-risk patterns that every programmer must recognize.
4.1 Dangerous G00 Z Moves (G00 Z100 vs G00 Z-100)
Rapid moves in Z are critical. On a vertical mill:
- Positive Z usually retracts away from the table
- Negative Z plunges toward the table and part
A classic and expensive mistake is mixing signs or reference frames:
- Safe intention: G00 Z100 to retract above the part
- Wrong sign: G00 Z-100 drives straight into the table
- Wrong reference: work offset or fixture shifted, so Z100 is actually below the part surface
Other high-risk patterns include:
- Using G00 directly after a tool length offset change without confirming safe Z
- Using machine coordinates incorrectly (for example, combining G53 with wrong Z value)
- Calling G28 Z0 or G30 without moving first to a safe clearance in incremental mode
Best practices to avoid rapid Z crashes:
- Always retract to a known safe retract plane (R-level) before XY repositioning
- Use consistent and conservative Z-safe values in your CAM templates
- On Fanuc/Haas-style machines, use sequences such as G91 G28 Z0 followed by G90 to ensure predictable retract behavior
- Never rely on a single G00 Z move in a new program without dry-run and single-block verification
4.2 Absolute vs Incremental Programming Confusion
Mixing G90 (absolute) and G91 (incremental) incorrectly is a major source of programming errors.
Common issues:
- Leaving the machine in G91 and issuing what you think is an absolute retract, causing large unexpected motion
- Writing a subprogram in incremental but calling it with offsets that assume absolute movement
- Using G91 with G28 or G30 incorrectly and sending the axis the wrong way
To prevent this:
- Clearly label mode changes in your header comments
- Always set G90 somewhere near the start of each program and subprogram unless incremental is strictly required
- For macros, explicitly switch back to G90 before returning to the caller
4.3 Wrong Plane Selection (G17, G18, G19)
On mills, the active machining plane defines how arcs and canned cycles behave. Typical mistakes include:
- Using G18 or G19 plane accidentally when running a G02/G03 arc meant for G17 plane
- Probing or drilling cycles configured for the wrong plane, causing alarms or unexpected motion
- Rotary axis programming depending on the wrong plane definition
Symptoms:
- Arc radius alarms
- Circular moves cutting in the wrong orientation
- Hole patterns shifted or rotated unexpectedly
Professional habit:
- Always activate the correct plane in the header before any tool motion
- Repeat the plane selection after tool changes for safety, even if redundant
4.4 Misused Tool Length and Radius Compensation
Incorrect H or D offset numbers and wrong sign are common causes of dimensional errors and crashes:
- Using the wrong H value for G43
- Forgetting to cancel or properly handle cutter comp when using G41/G42
- Entering tool length with wrong units or missing decimal
- Sharing offsets among tools unintentionally
Resulting problems include:
- Tools cutting too deep or too shallow
- Profile oversize or undersize
- Collisions with fixtures on long tools
To avoid this:
- Keep a clean tool-offset table with clear tool-to-offset mapping
- Use one H and one D per tool whenever possible
- Lock down manual editing of offsets in high-automation environments
5. Program Structure Errors That Cause Alarms
Many CNC errors arise not from physics but from program structure itself.
5.1 Missing or Incorrect End of Program
Typical problems:
- Forgetting M30 or M02 at the end of the program
- Jumping into a subprogram (M98/M97) that never returns with M99
- Using GOTO or macro jumps that bypass necessary resets
This can leave:
- Coolant running
- Spindle turning
- Weird modal states (compensation, planes, feed modes) active when the next program starts
Best practice is to always end with a known safe state: motion stopped, spindle off, coolant off, offset cancels as needed, and tool retracted.
5.2 Incorrect Subprogram Calling (M98/M99 or M198)
Typical errors:
- Calling a subprogram number that does not exist
- Infinite recursion by accidentally making a subprogram call itself
- Incorrect L count that repeats too many times
- On controls supporting M198 (USB program call), pointing to a missing or mismatched external file
This often results in program alarms, endless loops, or program aborts. On high-volume production, a simple typo in a subprogram number can stop the entire line.
5.3 Feedrate and Spindle Mode Errors
Feed and spindle modes must always match the type of motion:
- Using G94 (feed per minute) in a lathe threading move that should use G95 (feed per revolution)
- Attempting inverse time mode (G93) without correct post processor support
- Changing spindle speed during rigid tapping without proper synchronization
- Using G96 (constant surface speed) in situations that require G97 (fixed RPM), leading to very high or very low spindle speeds at small or large diameters
All of these can trigger alarms, poor surface finish, or tool breakage.
6. Control-Specific Alarm Behavior: Fanuc, Haas, Siemens
6.1 Fanuc
Fanuc controls tend to display:
- Alarm number
- Short text description
- Sometimes additional parameter info
Fanuc alarm culture is very parameter-driven. Many deeper issues require checking servo and spindle amplifier manuals, parameter lists, and sometimes OEM-specific diagnostic pages.
Key habits for Fanuc users:
- Learn the difference between system alarms, servo alarms, and overtravel alarms
- Use diagnostic pages and keep a backup of parameters and offsets
- Do not change parameters casually without a documented cause and rollback plan
6.2 Haas
Haas controls are known for more descriptive alarms and operator-friendly messages. However, they can still be cryptic when it comes to high-speed machining, rotary configurations, or TCP/DWO usage.
Typical Haas themes:
- G187 tolerance and smoothing related issues
- DWO/TCP (G234) misconfiguration causing position errors
- Probe macros failing due to missing setup parameters or wrong work offsets
- Alarm sequences triggered by improper M130, M198, or media/USB file usage
Best practice is to keep probing templates, DWO/TCP calibration, and tool libraries consistent across all Haas machines in the shop.
6.3 Siemens
Siemens Sinumerik controls are powerful but more complex. Alarm messages often come with a diagnostic ID, a class, and hints pointing to specific machine data or channel configuration.
Typical categories of Siemens-related issues:
- Channel configuration and coordinate system conflicts
- Tool management and magazine indexing logic
- Kinematic and transformation (TRAORI) misconfiguration in 5-axis setups
- PLC-related alarms that involve machine builder logic rather than core control
For Siemens, the ability to read and interpret diagnostic text is essential; guessing rarely works.
7. Professional-Level Troubleshooting Workflow
Instead of randomly resetting and trying again, a professional CNC programmer follows a consistent workflow:
- Read the full alarm message and code carefully.
- Classify the alarm (overtravel, servo, logic, IO, etc.).
- Identify whether the cause is mechanical, electrical, or program logic.
- Check the last executed block and modal states (G90/G91, G54+, plane, tool offsets).
- Review offsets (work and tool) and compare to expected values.
- If motion-related, simulate the move in graphics / dry run / single block with feed override low.
- If electrical or servo-related, inspect drives, cables, lubrication, and load conditions before resetting.
- Document the root cause and long-term fix so it does not happen again.
Shops that adopt this troubleshooting discipline see dramatically fewer crashes and more stable production.
8. Preventive Strategies: How to Avoid Alarms Before They Happen
Alarm codes are useful, but preventing them is even better. High-level preventive strategies include:
- Standardized program headers that always set mode, plane, offsets, feed, and safety codes explicitly
- Verified CAM postprocessors tuned for each machine and control version
- Mandatory dry-run with high Z clearance and feed override on new or modified programs
- Routine backup of parameters, offsets, and tool data
- Probing and G10/G54 automation to remove manual offset entry
- Clear operator documentation with visual aids, not just text
- Regular mechanical inspection: way lube, ball screws, drawbar, rotary backlash
- Training operators to stop at the first sign of abnormal noise, vibration, or alarm clusters
9. Conclusion: Turning Alarms into an Asset, Not a Disaster
CNC alarm codes, G-code mistakes, and programming errors are not going away. Machines are faster, more complex, more connected, and more automated than ever in 2025. The shops that win are those that:
- Understand the meaning behind alarms
- Recognize risky patterns like unsafe G00 Z moves and offset mistakes
- Develop a structured troubleshooting mindset
- Use advanced tools (probing macros, programmable offsets, TCP/DWO, soft limits) intelligently instead of fearfully
Treat this guide as a living troubleshooting reference. Combined with your machine manuals, builder documentation, and real shop experience, it can help you turn alarms and errors into opportunities to harden your process, protect your equipment, and keep production running at maximum uptime.
Leave a comment