Door Switch and Limit Switch Inspection: CNC Safety Guide
Master door switch and limit switch inspection on Fanuc, Siemens, and Mitsubishi CNC controls to prevent hard collisions and resolve safety interlock alarms.
Introduction
A sudden hydraulic pressure loss or timing fault during a high-speed tool change can instantly release a rotary turret, shifting a critical workpiece and driving the spindle directly into a physical hardware limit switch. When an axis impacts these hard boundaries, the control unit revokes the drive enables and triggers emergency braking, which can freeze a tool bound inside a heavy cut. Attempting an unmonitored manual retraction under these conditions often results in a violent hard collision against physical components like a vise jaw, chuck, clamp, or turret, instantly ruining the workpiece to generate a scrap part. To maintain shop safety and prevent catastrophic machine damage, operators and programmers must understand the specific electrical, mechanical, and software interlocks that govern door switches and limit switches across modern CNC systems.
Technical Summary
| Parameter/Feature | Specification |
|---|---|
| Command Codes | G22, G23, G27, G28, G74, REPOS, WAITP |
| Modal Group | Motion and Safety Check / Modal & Non-Modal |
| Supported Brands | Fanuc, Siemens, Mitsubishi |
| Critical Parameters | Fanuc No. 3004 (OTH) & No. 1300 (BFA); Siemens MD36600 & MD36100; Mitsubishi #1349 DOOR_1 & #7503 |
| Main Constraint | Bypassing safety switches is strictly forbidden; manual axis Jog retraction is required to clear limit errors; open door states must halt or safely decelerate servo feeds. |
Quick Read
- Redundant safety relies on a two-stage physical limit switch hierarchy (LS1 for deceleration, LS2 for hard emergency stop) to prevent mechanical crashes.
- Open protective doors must immediately interrupt automatic operations by halting or safely decelerating servo feeds to protect the operator.
- Toggling between the 1st and 2nd software limit switch sets dynamically restricts the work envelope when oversized fixtures are active.
- Verification of switch status is possible directly from HMI diagnostic screens or PMC registers before performing mechanical maintenance.
- Manual axis jog retraction in the safe reverse direction must be performed to recover from physical overtravel alarms.
- Setting safety parameters like Mitsubishi #1349 to dummy values permanently blinds the PLC and risks severe mechanical damage.
Basic Concepts
Physical limit switches are installed on the extreme ends of each axis travel path to prevent structural crashes and protect expensive servo motors. These mechanical devices act as the absolute line of defense against coordinate setting errors or program malfunctions. By monitoring these sensor states in real-time, the CNC controller ensures that any axis moving beyond its safe physical boundaries is instantly brought to a controlled halt before damaging the machine frame.
Enclosure door switches form the core of the machine interlock network, protecting human operators from high-speed spindles and flying chips. Modern CNC units route these safety switches through redundant dual-circuit paths. If a safety door is opened while automatic operations are active, the machine initiates an immediate stop sequence, preventing any cutting motion from occurring until the workspace is fully secured again. For systematic troubleshooting of interlock faults, technicians should implement 7-step diagnostic method.
Software stroke limits serve as a primary, virtual boundary layer positioned just within the range of the physical hardware switches. These coordinate boundaries are calculated during the controller's block preparation phase. By preemptively verifying program commands against these parameters, the CNC system halts motion and triggers an alarm prior to physical travel, saving valuable setup time and preventing physical wear on the mechanical switches.
Command Structure
Part program execution depends on specific safety codes that activate, deactivate, or verify coordinate zones and reference positions. Standard motion codes like G00 and G01 constantly check their destination coordinates against active boundaries to verify travel is safe. G-code functions like G22 and G23 determine whether the system actively compares coordinate commands against software boundaries prior to axis execution. In addition, G28 and G74 coordinate return commands navigate axes back to their mechanical origins, utilizing near-point deceleration switches to establish precise machine coordinates.
Advanced control features use specific commands to coordinate axis-specific safety status and positioning. Commands such as WAITP suspend program block execution until a designated positioning axis has fully completed its motion and confirmed its coordinate state. If manual adjustments or program stops occur, REPOS commands allow the tool to safely return to the interrupted contour, avoiding collisions by verifying that active axes do not cross restricted safety zones during the repositioning path.
; Fanuc software limit command syntax G22 (Enables stored stroke limit check) G23 (Disables stored stroke limit check); Siemens reference and positioning axis commands G74 X1=0 Y1=0 Z1=0 (Home position approach using hardware dogs) WAITP(X) (Suspends NC channel processing until X-axis positioning completes)
; Mitsubishi stroke boundary verification G22 X_ Y_ Z_ (Enables stroke boundary checks before travel commences) G23 (Disables travel stroke boundaries) G28 X_ Y_ Z_ (Automatic reference point return using near-point deceleration dogs)
| Brand | Parameter | Description | Value Range |
|---|---|---|---|
| Fanuc | Parameter 3004 (Bit 5 - OTH) | Specifies whether the hardware overtravel limit signal is checked. | 0 (Checked - default/safety), 1 (Not checked) |
| Fanuc | Parameter 1300 (Bit 7 - BFA) | Determines if a stroke limit check alarm is generated before or after entering. | 0 (After entering), 1 (Before entering) |
| Fanuc | Parameter 0057 (Bit 5 - HOT3) | Determines whether the hardware OT signals mapped to X020 are disabled or enabled. | 0 (Disabled), 1 (Enabled) |
| Siemens | MD36600 $MA_BRAKE_MODE_CHOICE | Braking behavior choice when a hardware limit switch responds. | 0 (Braking characteristic maintained), 1 (Fast braking with setpoint "0") |
| Siemens | MD36100 $MA_POS_LIMIT_MINUS | 1st software limit switch negative position boundary. | Machine coordinate value (mm/inch) |
| Siemens | MD36110 $MA_POS_LIMIT_PLUS | 1st software limit switch positive position boundary. | Machine coordinate value (mm/inch) |
| Siemens | MD14512 [12].2 and [12].3 | Default PLC safety door selection and auto-activation by M01/M02. | 0 (Do not use), 1 (Use) |
| Mitsubishi | #1349 DOOR_1 | Sets remote I/O device address to input the door sensor signal. | 0000 to 03FF (Hexadecimal; 0 forces open state) |
| Mitsubishi | #1510 DOOR_H | Shortens door interlock II axis stop time when a door is opened. | 0 (Conventional axis stop time), 1 (Shortened stop time) |
| Mitsubishi | #7503 PSW1 dog2 / #7504 PSW1 check | Position of imaginary dog and check method for software position switch. | Position: -99999.999 to 99999.999 (mm) |
Brand Applications
Fanuc
Fanuc controls utilize dedicated PMC diagnostic input addresses to monitor physical boundaries. The system uses parameter 3004 to verify hardware overtravel checks and parameter 1300 to control alarm timing relative to boundary lines.
G-code blocks configure software envelopes by activating or deactivating stored stroke checks. G22 enables the active boundaries while G23 turns off the stroke checks during special setup operations.
| Aspect | Details |
|---|---|
| Parameters | Parameter No. 3004 (Bit 5 - OTH) for hardware OT check, Parameter No. 1300 (Bit 7 - BFA) for alarm timing, Parameter No. 0057 (Bit 5 - HOT3) for X020 hardware OT mapping. |
| Alarms | OT0506 (+ OVERTRAVEL HARD) / OT007, OT0507 (- OVERTRAVEL HARD) / OT008. |
| Versions & Series | Lathes (T series) use stored stroke limit 3 alarms (504/505) and Alarm 520 for Z-axis hardware OT, while M series (machining centers) use Alarms 530/531 for Z-axis and 540/541 for 4th axis. |
Bypassing the hardware limit switch checks or neglecting PMC diagnostic address monitoring can lead to high-velocity overtravel that easily crashes the turret into the tailstock.
Siemens
Siemens controllers monitor safety boundaries through NC/PLC interface bytes. The system relies on machine data MD36600 to manage emergency braking behavior and MD36100 to configure software coordinates.
G-code programs establish safe reference coordinates using G74 and synchronize safety status using WAITP to block motion execution until the target axis is fully positioned. Siemens users facing safety interlock faults can refer to the Siemens PLC safety guidelines.
| Aspect | Details |
|---|---|
| Parameters | MD36600 $MA_BRAKE_MODE_CHOICE for braking, MD36100 $MA_POS_LIMIT_MINUS & MD36110 $MA_POS_LIMIT_PLUS for 1st software limit, MD14512 [12].2 and [12].3 for safety door selection. |
| Alarms | Alarm 21614 (Hardware limit switch +/-), Alarm 10720 / 10722 (Software limit switch violated), Alarm 700032 (Safety Door Open). |
| Versions & Series | Standard software limit violations generate Alarm 10720, but setting MD11411 bit 11 dynamically upgrades it to Alarm 10722 (requires ALUN* files on HMI). Firmware versions 4.7.1 onwards support extended PLC user alarms (701000 to 701999). |
Opening safety doors without Safety Integrated setup mode active triggers immediate NC stops that can cause tool binding and ruin the workpiece.
Mitsubishi
Mitsubishi CNC systems map real-time safety statuses to hexadecimal PLC devices. The control uses parameter #1349 to track safety door connections and parameter #1510 to shorten stop times when interlocks open.
Executing G22 activates axis-specific boundary checks before travel begins, whereas G28 commands reference return sequences using physical near-point deceleration dogs.
| Aspect | Details |
|---|---|
| Parameters | Parameter #1349 DOOR_1 for safety door remote I/O address, Parameter #1510 DOOR_H for door interlock axis stop speed, Parameter #7503 PSW1 dog2 / #7504 PSW1 check for software position switches. |
| Alarms | Y20 0005 (Door signal: Input mismatch), M01 0006 (H/W stroke end axis exists), M01 0001 (Dog overrun). |
| Versions & Series | Standard M800V series features fully integrated smart safety observation functions, whereas the M80V series strictly requires an external Functional Safety Expansion Unit. |
Assigning a dummy value or a zero address to #1349 DOOR_1 forces the NC to perpetually believe the door is open, blinding safety logic and risking tool crashes.
Brand Comparison
| Topic | Fanuc | Siemens | Mitsubishi |
|---|---|---|---|
| Dual-circuit Door Monitoring | Supported via standard PMC inputs (e.g., G114/G116, X020). | Evaluated redundantly via PROFIsafe & Safety Integrated (SLS bits via $A_OUTSI). | Dual monitoring by NC and Drive; mismatch >500ms triggers Y20 emergency stop. |
| Virtual Limits / Soft Switches | Up to 4 Stored Stroke Limits configured via parameters 1300+. | 1st and 2nd sets of software limit switches dynamically toggled via PLC (DB380x). | Position Switch (PSW) logic maps up to 24 imaginary dogs to PLC addresses X1D00-X1D17. |
| Diagnostic Interface | PMC screen address state check. | Granular block-specific distance-to-go diagnostics via HMI and alarm mask MD11411. | Dedicated "Smart Safety Observation" screens (Config, Signal, Drive) directly on HMI. |
| Safety Observation Options | Standard safety interlocks. | Safety Integrated SLS/SOS zones. | Standard on M800V; M80V requires Functional Safety Expansion Unit. |
Technical Analysis
The physical limit mechanisms and real-time status diagnostics differ significantly across the three major CNC manufacturers. Fanuc employs a classic dual-switch configuration per axis, separating mechanical deceleration limits (LS1) from absolute emergency power cutoffs (LS2), with a dedicated physical "2nd L.S. REMOVE" override button to restore power. Siemens bypasses hard-wired override switches by managing limit states dynamically inside NC/PLC interface blocks, utilizing axis-specific bytes. Mitsubishi routes both safety doors and hardware limit signals through high-speed hexadecimal PLC bit registers (X000 to X1FFF), relying on independent NC and drive-side safety monitoring. Intermittent input mismatch alarms (like Y20 0005) are frequently caused by cable and connector faults in the feedback loop.
Virtual boundaries represent another architectural divergence. Fanuc uses stored stroke limit parameters to define static rectangular boundary zones that prevent travel before an axis enters the zone. Siemens allows dynamic software boundary toggling via active PLC inputs (DB380x), allowing on-the-fly adjustment of the working envelope during tool-change or loading cycles. Mitsubishi provides unmatched zone-control granularity through Position Switch (PSW) logic, allowing up to 24 virtual dog sensors to be dynamically simulated and mapped directly to internal PLC devices based on actual machine coordinates.
Operator visualization and diagnostic architectures reflect distinct developer philosophies. Fanuc provides direct visibility of binary switch states through diagnostic PMC addresses (like G114/G116 and X020) on the main control unit screen. Siemens relies on programmable bit masks to upgrade basic overtravel alarms into precise, distance-to-go contour data. Mitsubishi features a dedicated "Smart Safety Observation" page directly inside the standard HMI, allowing maintenance engineers to diagnose hardware switch loops, drive-side interlock states, and redundant door circuitry without an external programming laptop.
Program Examples
Fanuc Program Example
%
O1001 (FANUC OVERTRAVEL TEST)
G90 G54 (Absolute coordinates, work offset 54)
G00 X1500.0 (Command rapid travel toward positive stroke limit)
G01 Z-800.0 F250.0 (Command cutting feed toward negative hardware limit)
G23 (Disable stored stroke limit checks)
M30 (End of program)
%
Dry Run Analysis (Fanuc)
- Block
G90 G54: The CNC system loads absolute coordinates and activates the primary work coordinate system offset. - Block
G00 X1500.0: The tool travels at rapid feed towardX1500.0. If this position violates the active stored stroke limit, the control generates Alarm 500 (Overtravel) before axis travel begins. If software boundaries are disabled, the axis will strike the first physical switch (LS1), decelerating to a halt and triggering Alarm OT0506. - Block
G01 Z-800.0 F250.0: The machine feeds at 250 mm/min towardZ-800.0. Striking the Z-axis hardware switch halts all axis movement immediately. - Block
G23: The command deactivates stored stroke checks, removing software boundary protection. - Block
M30: The program terminates and resets the active controller buffer.
Siemens Program Example
; SIEMENS AXIS LIMIT AND SAFETY TEST
G90 G54 ; Absolute positioning and active work coordinate system
G74 X1=0 Y1=0 Z1=0 ; Reference point return using hardware dog switches
WAITP(X) ; Wait for X-axis positioning to complete
MSG("Safety verification active - Check doors") ; Output operator message
M30 ; Program end and reset
Dry Run Analysis (Siemens)
- Block
G90 G54: The system establishes absolute coordinates and loads the default coordinate frame. - Block
G74 X1=0 Y1=0 Z1=0: The axes traverse toward the machine reference point. The control monitors hardware dog inputs (DB380x.DBX1000.1/.0). Striking a dog initiates deceleration to establish the machine zero coordinate. - Block
WAITP(X): Channel processing suspends until the X-axis completes its reference point return and is recognized as a positioning axis. If the axis is not defined as a positioning axis, Alarm 14092 triggers. - Block
MSG(...): Displays the specified string on the HMI screen to alert the operator. - Block
M30: NC channel resets, releasing active coordinate overlays.
Mitsubishi Program Example
%
O2002 (MITSUBISHI BOUNDARY CHECK)
G90 G54 (Absolute mode, activate primary coordinate system)
G22 X100. Y100. Z100. (Enable pre-travel stroke limit checks)
G28 X0. Y0. Z0. (Execute reference return via near-point dog switches)
G23 (Disable travel stroke check function)
M30 (Program end)
%
Dry Run Analysis (Mitsubishi)
- Block
G90 G54: Activates absolute coordinate system and coordinates tool reference frames. - Block
G22 X100. Y100. Z100.: The CNC checks the target coordinates against software boundaries. If the tool path enters a prohibited limit zone, the controller stops travel before the command starts, outputting an alarm. - Block
G28 X0. Y0. Z0.: Initiates reference return. The axes traverse at rapid speed until they strike the near-point deceleration dogs, slowing down to locate the encoder zero marker. If the dog is overrun, Alarm M01 0001 triggers. - Block
G23: Deactivates the pre-travel stroke check, returning boundary safety entirely to hardware limit switches. - Block
M30: Resets the controller and clears active system data.
Error Analysis
| Brand | Alarm Code | Trigger Condition | Operator Symptom | Root Cause / Fix |
|---|---|---|---|---|
| Fanuc | OT0506 / OT007 | Physical stroke limit switch in the positive direction is pressed. | Active axes motion halts immediately; positive overtravel alarm is displayed on the screen. | Axis traveled past machine coordinate limits. Fix: Manually jog the affected axis in the negative direction to clear the switch; verify program coordinates. |
| Fanuc | OT0507 / OT008 | Physical stroke limit switch in the negative direction is pressed. | Active axes motion halts immediately; negative overtravel alarm is displayed on the screen. | Axis traveled past machine coordinate limits. Fix: Manually jog the affected axis in the positive direction to clear the switch; verify program coordinates. |
| Siemens | Alarm 21614 | Actuated hardware limit switch (DB380x.DBX1000.1 or .0 set to 1). | Axis deceleration begins immediately with fast braking according to MD36600; NC Stop occurs. | Machine axis hit the physical limit switch due to incorrect coordinates. Fix: Jog the axis in the opposite direction; review active work offsets. |
| Siemens | Alarm 10720 / 10722 | Programmed path violates active software limit switch in block preparation. | Block execution is suspended; NC interpreter halts before physical movement begins. | Programmed coordinate coordinates exceed the software limits defined in MD36100 or MD36110. Fix: Check coordinate shifts, DRF handwheel offsets, or frame transformations. |
| Siemens | Alarm 700032 | Safety door is opened while hazardous functions are active. | NC Stop is triggered; spindle and axis feeds decelerate to a complete stop. | Enclosure door opened during automatic cycle without setup mode active. Fix: Close safety door or toggle Safety Integrated setup mode. |
| Mitsubishi | Y20 0005 | Door state signals on the NC side and drive side mismatch for >= 500 ms. | Immediate Emergency Stop is triggered; servo motors are de-energized. | Broken sensor cable, faulty mechanical door switch, or mismatched input timing. Fix: Check safety switch wiring, measure signal voltage, or replace drive unit. |
| Mitsubishi | M01 0006 | Hardware stroke end switch signal turned OFF (switch hit). | Operation error halts all automatic movement; axis enters stroke end status. | The physical limit switch was actuated during motion. Fix: Switch to JOG mode and carefully backup the axis in the opposite direction. |
| Mitsubishi | M01 0001 | Deceleration near-point dog was overrun during reference position return. | Operational alarm is displayed; axis fails to find reference zero. | Near-point switch failed to actuate or dog was positioned incorrectly. Fix: Clean chips/coolant from switch, verify alignment, and re-run referencing. |
Application Note
A high-velocity tool impact with a vise jaw, chuck, clamp, or turret will result if maintenance technicians bypass safety switches or input dummy parameters into CNC registers. For instance, setting Mitsubishi parameter #1349 DOOR_1 to '0' permanently blinds the NC to the state of the protective enclosure, allowing automatic operation with an open door. If a mechanical switch fails or a chip buildup prevents a limit switch from actuating, the lack of spatial feedback results in a hard collision. Technicians must utilize integrated diagnostics, such as Fanuc PMC addresses X020 or G114/G116, or the Mitsubishi Smart Safety Observation interface, to verify signal status before operating axes. In emergency overtravel recovery, operators must use correct overrides like the Fanuc '2nd L.S. REMOVE' button or Siemens dynamic software limit selection via DB380x PLC markers rather than forcing machine movement, ensuring that axis retraction is performed strictly in the safe, reverse direction.
Related Command Network
- G22 / G23: These commands enable and disable the stored stroke check function to activate or suspend software-based zone verification before axis travel commences.
- G28: This reference return command automatically moves the axes back to their mechanical origins using near-point deceleration dog switches.
- G74: Siemens systems execute this command to approach the machine reference coordinate system and synchronize physical switch offsets.
- WAITP: This positioning command suspends program block processing in Siemens controls until a designated positioning axis completes its motion and safety check.
- REPOS: This Siemens repositioning command allows the tool to safely re-enter the cutting contour after manual retraction or an interlock-induced halt.
Conclusion
Maintaining robust CNC limit safety requires a systematic inspection routine that validates both physical sensors and software parameters. Operators must regularly test deceleration switches, verify redundant dual-circuit door interlocks, and confirm that machine coordinate offsets reflect correct physical limits. Standardizing on-screen diagnostics and using manufacturer-approved recovery methods during overtravel events ensures maximum machine uptime while completely eliminating mechanical crash risks.
FAQ
How do you bypass a physical limit switch to recover an overtravel axis?
Physical limit switches should never be mechanically bypassed or shorted out. Instead, utilize the machine panel's override buttons, such as the Fanuc '2nd L.S. REMOVE' button, which temporarily energizes the servo drives. Switch the controller to JOG mode and carefully move the axis in the opposite, safe direction until the switch is cleared, then verify that the active work coordinates are correct before resuming automatic operation.
What causes a Siemens Alarm 10720 software limit violation when the tool is physically inside bounds?
This mismatch occurs because the software limits are checked during block preparation against active offsets rather than the tool's physical coordinate. A handwheel DRF offset, active coordinate transformation frame, or temporary tool length compensation value may have pushed the logical target coordinate beyond the MD36100 or MD36110 software limit coordinates. Reset the CNC channel to clear active offsets, inspect the HMI's active frame status, and correct the tool compensation paths before executing the block.
Why does the Mitsubishi control trigger a Y20 0005 door signal mismatch alarm?
The Y20 mismatch indicates that the independent safety circuits monitored by the NC unit and the servo drive do not agree, which prevents single-point switch failures from compromising operator safety. This disagreement usually points to a broken cable, dirty switch contact, or a hardware timing delay exceeding 500 milliseconds. Inspect the safety switch wiring, clean the mechanical switch housings from coolant/chips, and verify real-time inputs on the Smart Safety Observation screen before replacing the drive.
Still not resolved?
Ask our AI assistant about this topic in natural language. Grounded in verified sources, no hallucinations.

- CNC CARE Co-Founder (May 2025 - Present)
- Mitsubishi Electric NC Sales & Service Section Manager (2008 - 2025)
- Reis CNC Service Engineer (2003 - 2005)
- Ören Kalıp CNC Mold Line Team Leader (1999 - 2002)
With over 25 years of experience working in all areas of the CNC machine industry, I continue my activities as a co-founder of CNC CARE, where we offer brand-independent consulting, engineering, and original spare parts services.
Related Articles
Other articles on this topic
Siemens CYCLE800 G-Code: Swivel Planes & Tool Alignment
Master Siemens CYCLE800 for 3+2 axis machining. Learn plane swiveling, tool alignment, parameter setup, and how to troubleshoot Alarm 61190 and 61153.
Siemens CYCLE72 Contour Milling: Guide to Sinumerik Path Milling
Master Siemens CYCLE72 for contour milling on Sinumerik CNC controls. Learn parameter setup, avoid simulation alarm 61123, and prevent machine collisions.
Siemens CYCLE952 Contour Turning Cycle Programming Guide
Master Siemens CYCLE952 contour turning on Sinumerik CNC controls. Learn parameter lists, resolve Alarm 61051, and configure balance cutting.
Siemens SLOT1 and SLOT2 Slot Milling Cycles Programming Guide
Master slot milling on Siemens Sinumerik controls using SLOT1 and SLOT2 cycles. Learn parameter configurations, alarm 61000 prevention, and optimal tool paths.