Skip to content

Limit switches

Pascal Roobrouck edited this page Jun 27, 2017 · 7 revisions

Limit Switches

Limit Switches indicate to the controller that (one or more of the Axis of) the machine is trying to move beyond its limits. As an axis has two ends, you need two limit-switches per axis. If it is not important to know in which direction the axis exceeds its limits, those two switches may be connected 'in parallel' (logical OR), reducing the number of inputs to the controller.

Homing

Limit switches have another important use : Homing of the machine. As most machines have an open-loop control, and no absolute position feedback, at time of powering on, the Controller has no idea where all the axis are. In order to find out where the axis are, the Controller will 'slowly' move all the axis, one-by-one until a limit switch triggers. Then the Controller will set it's Machine Coordinates to zero.

This movement is typically done 'slowly' because the axis has limited travel beyond the limit switch (so-called 'post-travel'), and at the same time the axis has a limited maximum deceleration (it cannot stop 'immediately'). So the speed has to be reduced in order to allow the axis to stop within the travel distance beyond the closed limit switch. Otherwise the axis or limit-switch may be damaged.

Homing can easily be observed in devices such as printers, scanners, etc.

Accurate Homing

Homing sets the absolute Machine Coordinates, and all later movements of the machine will be relative to that Machine Coordinates Origin, it is important that this position is found with good repeatability: if the production of an item requires several operations, (eg milling, drilling, ...) and in-between those different operations the machine is homed (eg. because you powered it down to safely replace a tool), it is important that the found Machine Coordinates Origin is the same physical position after every homing cycle.

This requires that the limit switches used for homing to open and close at exactly the same physical position. Some examples of this repeatability:

Reliable Limit Switches

For a reliable operation of your machine, its limit switches need to be realiable as well:

  • if a limit switch would miss an axis moving beyond its limits, this can damage the machine. (false negative)
  • if a limit switch triggers without a real problem, the Controller will raise a false alarm and abort the operation. (false positive) It will not damage the machine, but you need to restart the operation. Too many false alarms can result in not being able to finish the production of the item.

To avoid false negatives (real problems not being detected), the limit-switch circuit needs to be setup in such a way that any failure (no power, broken wire, ..) will result in a limit-switch trigger. This can be done by having the Controller input active-high with a pullup resistor. An inactive limit switch requires the switch to actively pull down the signal.

False positives (false alarm) are mainly caused by electromagnetic interference : with its many powerful motors moving all at the same time, a CNC is an electromagnetically noisy environment. This electromagnetic interference may cause voltage glitches on the limit-switch input wire, fooling the Controller into detecting a limit switch trigger. In order to prevent against this, following measures can be taken:

  • Keep wires as short as possible, eg. have the triggering 'finger' moving, and the switch itself stationary:
    • Z-axis : have 'fingers' moving up/down with the Z-axis, and have the switch(es) itself fixed on the Y carriage
    • Y-axis : have 'fingers' moving with the Y-axis, and have the switch(es) itself fixed on the X gantry
    • X-axis : have the finger on the gantry, and the switch on the base of the machine.
  • Use shielded wires, if possible.

Mechanical vs Optical vs Magnetic limit switches

Because of the gooed repeatability and the 'unlimited' post-travel, I selected optical switches such as OMRON's EE-SX-670 family:

  • They can be used with 5 to 24 Vdc
  • They can provide Normal Closed (NC) or Normal Open (NO) signal, so no need to invert the signal further down the processing.
  • They provide an optical indication of their state
  • They have good repeatability (0.05 mm) so they will provide accurate homing. One disadvantage is that they may give a false trigger due to dust or chips, so they may need regular cleaning.