Limit switch

On this page 7

A limit switch is an electromechanical sensor that opens or closes an electrical contact when a moving part physically presses its actuator at a defined position. Among sensors in robotics, it is the simplest way to answer one binary question: has this axis reached the end of its travel?

Robots and motion systems use limit switches for homing, which establishes a known reference position after power-up, and for overtravel protection, which stops an axis before it collides with its mechanical end stop. Their value lies in robustness and directness rather than resolution.

How a limit switch detects position

A limit switch detects position through direct mechanical contact: a cam, dog or part of the moving axis pushes an actuator such as a lever, roller or plunger, which moves an internal snap mechanism and changes the state of one or more contacts. The output is purely binary, either actuated or released.

Most switches use a snap-action mechanism, a spring that flips the contacts abruptly once the actuator passes a trip point. This gives a clean, fast transition regardless of how slowly the axis approaches. The switch then has hysteresis, called differential travel: it releases at a slightly different position than it trips, which prevents chatter when the axis rests near the trip point.

The table below lists the travel terms found on a typical datasheet and why each matters to a robot designer.

CharacteristicTypical valueWhy it matters
Pretravel0.5 to 4 mmDistance from rest to the trip point
Overtravel1 to 6 mmSafe motion after tripping before damage
Differential travel0.1 to 1 mmHysteresis between trip and release
RepeatabilityAbout 0.01 to 0.05 mmConsistency of the trip position
Operating force0.5 to 10 NLoad the moving part must apply
Limit switch travel characteristics

Overtravel is the safety margin. An axis that is still decelerating after the trip must stop within the overtravel distance, otherwise the moving part crushes the actuator or the switch body.

Contact configurations and wiring

A limit switch is wired as normally open (NO), normally closed (NC) or with both contacts in a changeover arrangement, and the choice determines how the controller reacts when a wire breaks. This decision is about failure behavior, not convenience.

Contact typeState at restState when actuatedBehavior on broken wire
Normally openOpen circuitClosed circuitFault looks like not reached
Normally closedClosed circuitOpen circuitFault looks like reached, axis stops
Changeover (SPDT)One path closedOther path closedFault detectable by comparing both
Positive opening NCClosed circuitForced openContacts open even if welded
Contact types and their behavior

For end-of-travel protection, normally closed wiring is the standard practice because a cut cable or loose connector stops the axis instead of silently disabling the limit. Safety-rated switches add positive opening operation, defined in IEC 60947-5-1, in which the actuator mechanically forces the contacts apart even if they have welded together.

Mechanical contacts bounce for roughly 1 to 10 ms when they change state. Microcontroller inputs therefore need hardware filtering or software debouncing, or a single trip may be counted as several events.

Limit switch roles in robot motion systems

In robots, a limit switch serves one of three roles: homing reference, software-independent overtravel limit, or presence detection of a part or tool. Each role places different demands on placement and accuracy.

  • Homing: on power-up, an axis with an incremental encoder moves slowly toward the switch, records the trip point and sets that position as zero. Accuracy improves by approaching from the same direction at low speed, and many controllers then search for the encoder index pulse.
  • Hard limits: switches at both ends of a linear axis cut the motor driver enable signal directly, providing protection that works even if the software crashes.
  • Detection: in grippers and fixtures, a switch confirms that a part is seated or a tool changer is locked before the program continues.

A common architecture combines soft limits in software with physical switches placed slightly beyond them. The software normally stops the axis first, and the switch acts only as a last line of defense.

Limit switches compared with non-contact sensors

The limit switch differs from proximity, inductive, Hall effect and photoelectric sensors mainly because it requires physical contact and has moving parts. That makes it simple and immune to many environmental effects, but it also wears out.

SensorSensing principleMechanical lifeMain advantageMain drawback
Limit switchMechanical contact1 to 30 million cyclesSimple, positive, any target materialWear, bounce, needs contact force
Inductive sensorEddy currents in metalPractically unlimitedSealed, no wearDetects metal only
Hall effect sensorMagnetic fieldPractically unlimitedCompact, fastNeeds a magnet on the axis
Photoelectric sensorInterrupted light beamPractically unlimitedLong range, high precisionSensitive to dust and alignment
Encoder indexOptical or magnetic markPractically unlimitedVery precise homingNeeds a coarse reference first
End-of-travel sensing options

Limit switches remain popular where positive mechanical confirmation is desirable, for example on safety guards, or where cost and simplicity outweigh cycle life. High-cycle axes in modern industrial robots increasingly use sensorless homing against a hard stop or absolute encoders, which remove the need for a homing switch entirely.

Selection, installation and common mistakes

Correct selection depends on actuator style, electrical rating and environmental protection. A roller lever suits a cam passing at an angle, a plunger suits straight-line contact, and a sealed housing rated IP65 or IP67 suits washdown or dusty cells.

Most field problems trace back to installation rather than to the switch itself. The following table summarizes typical faults.

SymptomLikely causeRemedy
Home position varies between runsFast approach speedTwo-stage homing at low final speed
Multiple triggers per contactContact bounceDebounce filter of a few milliseconds
Switch body crushedInsufficient overtravelReposition or reduce stopping distance
False trips near motorsElectrical noise on long cablesShielded cable, pull-up, filtering
Contacts fail earlyInductive load arcingRelay rating check, suppression diode
Typical limit switch faults

One more mistake is mounting the switch so the moving part strikes it head-on at speed. The actuator should be engaged by a ramp or cam so force builds gradually, which protects both the mechanism and the repeatability of the trip point.

A non-technical view

A limit switch is a small button that a moving machine part bumps into when it reaches the end of its path. When pressed, it tells the controller this is as far as it should go.

It works much like the light switch inside a refrigerator door. In a robot, it helps the machine find its starting point after it is switched on and keeps it from crashing into its own frame.

A concrete example

A small engineering firm builds a three-axis gantry robot that picks electronic components from trays. Each axis uses a stepper motor, a belt drive and an incremental encoder, so the robot does not know its position when powered on.

The team mounts a roller-lever limit switch at the home end of each axis, wired normally closed, and a second switch at the far end that cuts the motor driver enable line directly. The homing routine moves each axis toward its switch at 50 mm/s, backs off 3 mm and approaches again at 2 mm/s.

With the slow second approach, the measured home position repeats within about 0.02 mm, well inside the 0.1 mm tolerance needed for the trays. During commissioning, a software error once drove the Y axis past its programmed limit, and the far-end switch stopped the carriage before it reached the frame, avoiding a damaged belt.