When you buy an ATC spindle, the three proximity sensors at the rear junction box are the bridge between the spindle’s mechanical safety and your controller’s digital logic. Wire them wrong, and you risk a spindle that starts without a clamped tool or a tool-change macro that crashes the Z-axis into the tool fork. This guide covers sensor roles, PNP/NPN selection, normally-closed safety wiring, controller-specific connection rules, and the PLC interlock routines that turn sensor signals into production-grade safety.
Part 1: What each sensor does — and why getting it wrong is dangerous
Every ATC spindle has three proximity sensors at the rear that detect the drawbar position and tool presence. Their signals should be treated as interlock inputs, not casual diagnostics, because they help prevent high-risk automatic tool-change failure modes.
Sensor 1 — Tool Clamped
Status: Safety-Critical
Confirms the tool holder is securely clamped in the spindle taper, with the drawbar fully retracted and Belleville springs applying full force.
Required Controller Logic: The controller must read this signal as TRUE before enabling spindle rotation. If the signal drops for more than 50ms during spindle operation, trigger an immediate E-stop.
Risk of Getting it Wrong: The spindle could start rotating with a loose or absent tool holder. At high speeds, this can create tool-ejection risk, serious machine damage, and operator safety hazards.
Typical Location: Mounted near the top of the drawbar assembly, sensing the drawbar’s retracted (clamped) position.
Sensor 2 — Tool Released
Status: Sequence-Critical
Confirms the pneumatic cylinder has pushed the drawbar forward and the gripper fingers have opened, releasing the tool holder for extraction.
Required Controller Logic: Used as a sequence gate during M6 tool changes. The Z-axis should retract only after this signal is confirmed. If not received within the configured timeout, the macro should abort and report the fault.
Risk of Getting it Wrong: If this signal is absent but the Z-axis retracts, the spindle may pull against a tool holder that is still clamped. Depending on the machine, that can bend the tool fork, damage the gripper, or overload the drawbar.
Typical Location: Sensing the drawbar’s extended (released) position, typically forward of Sensor 1.
Sensor 3 — No Tool / Drawbar Position
Status: Operational
Detects whether a tool holder is physically present in the spindle, or confirms the drawbar has returned to a safe neutral position.
Required Controller Logic: Verifies the spindle is empty before retrieving the next tool from the magazine, and prevents double-loading (picking up a tool when one is already in the spindle).
Risk of Getting it Wrong: The spindle may attempt to pick up a tool while another holder is already clamped, creating a collision risk for the magazine, fork, spindle nose, and gripper.
Typical Location: May sense at the tool holder flange or near the gripper end of the drawbar assembly.
Part 2: PNP vs. NPN: choose before you wire, not after
The single most common wiring mistake is buying the wrong sensor type. PNP sourcing sensors dominate Asian and European CNC controllers. NPN sinking sensors appear in older Japanese equipment and certain parallel-port Mach3 setups. Choosing wrong means the controller input logic is inverted — and no amount of software configuration can fix a fundamentally incompatible sensor type.
PNP (Sourcing) — Recommended for most modern CNCs
Signal: Output switches to +24V when active. The sensor sources current to the controller input. Advantage: Dominant standard in Asian and European industrial automation (Syntec, Weihong, Siemens, Omron). Most CNC breakout boards expect PNP 24V logic. Wiring: Brown (+24V), Blue (0V/GND), Black (Signal output → controller input). The controller input reads HIGH (+24V) when the sensor is triggered. Best for: Syntec, Weihong, LNC, and most Chinese/Taiwanese CNC controllers. Also preferred for direct PLC input modules with sinking (NPN) inputs.
NPN (Sinking) — Legacy Mach3 / Japanese PLCs
Signal: Output switches to 0V/GND when active. The sensor sinks current from the controller input to ground. Advantage: Common in older Japanese equipment and certain North American PLC input modules. Some Mach3 parallel-port breakout boards are designed for NPN sensors. Wiring: Brown (+24V), Blue (0V/GND), Black (Signal output → controller input). The controller input reads LOW (0V) when the sensor is triggered. Best for: Legacy Mach3 parallel-port setups, certain Mitsubishi PLC input cards, and systems where the input module provides the pull-up voltage internally.
Both types use the exact same 3-wire color code. The difference is whether the sensor outputs +24V (PNP, sourcing current into controller) or GND (NPN, sinking current from controller) when triggered.
Part 3: Normally Open vs. Normally Closed: the safety distinction that saves machines
This is not a preference — it is a safety engineering decision. A normally-closed (NC) sensor fails safe: if the wire breaks, the controller sees the signal disappear and refuses to start the spindle. A normally-open (NO) sensor fails dangerous: if the wire breaks, the controller sees the exact same state as ‘tool clamped’ and may start the spindle with a loose tool.
Normally Open (NO)
Behavior: The sensor output is OFF (0V for PNP, floating for NPN) when the target is NOT detected. Output turns ON only when the target is present.
Safety risk: If the sensor wire breaks, the controller sees a permanent OFF state — identical to ‘tool not clamped’. The controller cannot distinguish a broken wire from a genuinely unclamped tool. In this state, if the spindle starts, there is no protection.
Recommendation: Acceptable for non-safety signals like ‘Tool Released’ or ‘No Tool’, where a false-negative causes an annoyance (macro timeout) rather than a hazard.
Normally Closed (NC)
Behavior: The sensor output is ON (24V for PNP) when the target IS detected. Output turns OFF when the target moves away — or when the wire breaks.
Safety risk: If the sensor wire breaks, the controller sees an OFF state — which it interprets as ‘tool NOT clamped’. This fails SAFE: the controller refuses to start the spindle. This is why NC wiring is commonly recommended for safety-critical confirmation signals.
Recommendation: Recommended for Tool Clamped confirmation when the controller and sensor hardware support it. A broken signal wire is then more likely to be interpreted as a fault instead of a valid clamped state.
Bottom line: Configure Sensor 1 (Tool Clamped) as NC. The other two sensors can be NO without creating a hazard, but if your budget and I/O count allow, NC on all three is the most defensive posture. The incremental cost of an NC sensor over an NO sensor is typically under $3 — less than the cost of a single destroyed tool holder from an unprotected spindle start.
Part 4: Controller-specific wiring: Mach3, LinuxCNC, Syntec, and Weihong
Each CNC controller family has different input voltage levels, terminal assignments, and software configuration steps. Match your controller to the correct wiring approach before connecting any sensor.
Mach3 / Mach4 (Parallel Port)
Signal type: 5V TTL logic (0-5V). Cannot accept 24V sensor output directly.
Interface: Use a 24V-to-5V level-shifter board or optocoupler breakout board. Connect sensor signal → breakout board input → parallel port pin configured as ‘Input’ in Mach3 Ports & Pins.
Pin/terminal: Typical: Pin 10 (E-stop), Pin 11-13, 15 (general inputs). Assign ‘Tool Clamped’, ‘Tool Released’, ‘No Tool’ to three consecutive input pins.
LinuxCNC (Mesa / Parallel Port)
Signal type: Depends on interface card. Mesa 7i76e/7i96 accept 24V directly on field inputs.
Interface: For Mesa cards: connect sensor signal directly to field input terminal. For parallel port: use a 24V-to-5V optocoupler board identical to Mach3 setup.
Pin/terminal: Map sensor inputs in HAL file: net tool-clamped => hm2_5i25.0.gpio.000.in ; net tool-released => hm2_5i25.0.gpio.001.in. Use these signals in the tool-change HAL logic component.
Syntec / LNC
Signal type: 24V PNP logic, dedicated X-input terminals on the I/O board.
Interface: Wire sensor directly to X-input terminals. No level conversion needed. Configure input type and polarity in the controller’s I/O parameter page. Assign the signal to the ATC macro logic in the PLC ladder editor.
Parameter tip: Syntec: R44-R49 typically control ATC I/O mapping. LNC: Parameters 400-420 control tool-change input assignments.
Weihong (维宏) / NCStudio
Signal type: 24V PNP. Dedicated input terminals labeled on the breakout board.
Interface: Direct wire to input terminals. In NCStudio software, map inputs via ‘I/O Setup’ → assign each input terminal to ‘Tool Clamped’, ‘Tool Released’, ‘No Tool Holder’ functions. Some Weihong versions have dedicated ATC input function codes.
Parameter tip: Check the Weihong manual for ‘ATC Input Mapping’ section. Function codes 50-55 are commonly reserved for ATC sensor inputs.
Part 5: PLC safety interlock logic: three rules that prevent catastrophes
Sensor signals are useless if the controller does not enforce safety rules. These three PLC interlock routines are the minimum required logic for any ATC spindle installation. They must be implemented in your controller’s macro, ladder, or HAL layer — not just in the operator’s head.
Rule 1: Spindle Enable = Tool Clamped AND NOT Spindle Fault
Priority: CRITICAL
The spindle drive enable output must be gated by the ‘Tool Clamped’ sensor input. If Tool Clamped is FALSE for more than 50ms during operation, the spindle must enter an immediate deceleration stop (not coast-to-stop — the tool may still be partially engaged).
IF (Tool_Clamped == FALSE) THEN
Spindle_Enable := FALSE;
Alarm("Tool clamp lost during operation");
Feed_Hold := TRUE;
END_IF;
Rule 2: Tool Release = Spindle Stopped AND Speed < 50 RPM
Priority: CRITICAL
The pneumatic release solenoid valve must NEVER be energized while the spindle is rotating. Before executing M6, the controller must: (1) issue M5 spindle stop, (2) wait for spindle speed feedback < 50 RPM (or a 3-second timeout if no speed feedback), (3) then energize the release solenoid.
For the VFD speed control integration that makes this possible, see our Modbus RS485 vs. 0-10V speed control guide. Also ensure the spindle has completed its automated warm-up cycle before executing any tool change.
IF (Tool_Change_Command == TRUE) THEN
Spindle_Stop();
WHILE (Spindle_Speed > 50) AND (Timeout < 3000ms) DO
WAIT(100ms);
END_WHILE;
IF (Spindle_Speed <= 50) THEN
Release_Solenoid := TRUE;
WAIT_FOR(Tool_Released_Sensor, 2000ms);
ELSE
Alarm("Spindle not stopped — tool change aborted");
END_IF;
END_IF;
Rule 3: Z-Axis Movement Interlock After Tool Release
Priority: HIGH
After the release solenoid is energized and Tool Released is confirmed, the Z-axis may retract to extract the tool. However, the sequence should block downward Z-axis movement during or immediately after release to reduce the risk of colliding with a partially ejected tool holder.
IF (Tool_Released == TRUE) THEN
Z_Retract_Enable := TRUE;
Z_Down_Enable := FALSE;
END_IF;
WAIT_FOR(No_Tool_Present, 1000ms);
Z_Down_Enable := TRUE;
Part 6: Debug checklist: 7 steps from first power-up to verified interlock
Follow this checklist in sequence. Each step verifies one layer of the sensor chain before moving to the next. Skipping steps is the most common reason sensor problems go undetected until a crash.
| Step | Action | Tool |
|---|---|---|
| 1 | Verify sensor power: measure 24V DC between Brown and Blue at the sensor connector. If below 22V, check PSU capacity and voltage drop on long cable runs. | Multimeter |
| 2 | Test sensor output: trigger the sensor manually with a steel target (e.g., a screwdriver tip). Watch the output voltage change on the multimeter. For PNP: should swing from 0V to 24V. For NPN: should swing from 24V to 0V. | Multimeter + steel target |
| 3 | Verify sensor gap: the sensing distance to the drawbar target must be within the sensor’s rated range (typically 1-4mm for inductive proximity sensors). Too large a gap = no detection; too small = risk of mechanical collision. | Feeler gauge |
| 4 | Check controller input: With sensor triggered, verify the controller’s diagnostic page shows the corresponding input bit changing state. On Mach3, use the ‘Diagnostics’ tab. On Syntec, use the I/O monitor page. | Controller diagnostic screen |
| 5 | Confirm NC wiring for ‘Tool Clamped’: Disconnect the sensor signal wire. The controller must immediately report ‘Tool NOT Clamped’ — proving the fail-safe behavior works. Reconnect and verify the signal returns. | None — intentional disconnect test |
| 6 | Run dry tool-change cycle: With no tool holder, execute M6 and watch the sensor state sequence. Tool Clamped should go FALSE → Tool Released TRUE → No Tool TRUE. Verify timing and order match your PLC logic expectations. | Controller MDI mode |
| 7 | Test spindle enable interlock: With Tool Clamped = FALSE, attempt M3 S1000. The spindle should not start. If it does, treat the interlock as failed and fix the wiring or program before cutting. | Controller MDI mode |
Sensor wiring FAQ
Why does my controller read all sensors as triggered even when nothing is connected?
This usually means the input pins are floating (unconnected) and picking up electrical noise. For PNP sensors, the controller input must have a pull-down resistor (typically 4.7kΩ to 10kΩ) to 0V. Without it, the input floats HIGH. Check your breakout board documentation for pull-up/pull-down resistor configuration.
Can I mix PNP and NPN sensors on the same spindle?
Technically possible if your controller inputs support both types independently, but strongly discouraged. Mixed sensor types create confusion during troubleshooting and make spare part management harder. Standardize on one type — PNP is recommended for 24V industrial systems.
My Tool Clamped sensor reads TRUE but the tool holder still drops during cutting. Why?
This is a critical situation. If the sensor reads TRUE but the tool drops, either (a) the sensor target has shifted — it senses the drawbar position but the drawbar is not actually clamping, or (b) the Belleville spring stack has fatigued below the minimum clamping force. Immediately measure drawbar pull force with a pull-force gauge. Do not run the spindle until the mechanical clamping mechanism is verified.