Getting with the program

Dec. 1, 2006
Limit switches turn outputs on or off at setpoints. Traditional limit switches are all mechanical, most often consisting of cams that run into electromechanical

Limit switches turn outputs on or off at setpoints. Traditional limit switches are all mechanical, most often consisting of cams that run into electromechanical bumper switches to generate output. They exhibit mechanical wear, complicated resetting, and contact bounce.

In more robust electronic limit switch systems, the camshaft is replaced by a position sensing transducer and a switch controller uses this transducer to determine shaft position. The controller then compares this position to its programmed setpoints, and determines if its outputs should be on or off.

Contact bounce and mechanical wear are eliminated. Too, because electronic limit switch controllers are programmable, setpoint changes are entered into a keypad — much simpler than adjusting mechanical parts. Programmable limit switches also perform machine logic by using inputs to enable outputs; sometimes this is referred to as internal high-speed logic. How does a programmable limit switch emulate the logical sequences of a PLC without their complex programs? It allows users to assign a number of outputs to a Group: A set of actions triggered by an input. Controllers can operate one or several Groups.

Modes of operation are preprogrammed logical sequences that are built into switch firmware. Each of these modes (except the default mode, which we'll discuss shortly) is based on the operation of an input terminal, with its status determining the operation of outputs within the Group. PLCs, on the other hand, look down ladder logic rungs for instructions assigned to each input and output. The process of examining every input, output, and the conditions required to operate them, introduces time delay.

Modes can be thought of as canned subroutines that require only a single bit to turn them on. By limiting the information being processed, they keep scan times to a minimum; grouping output circuits and assigning them different modes of operation reduces the work the switch digital processor has to do. That said, the logical processes of group-and-mode programmable switch operation still give power and flexibility to operation.

Where they're useful

For example, by enabling glue guns to operate only when a product is present, modes conserve adhesive and reduce mess and cleanup. Programmable limit switches also increase productivity: When used to compensate for phase adjustments between machine sections, operating modes can improve the high-speed accuracy of machine functions. Offloading these high-speed logic functions from the PLC to a programmable limit switch helps maintain reasonable PLC scan times — and higher machine speeds and product quality.

This use of a single input allows programmable limit switches to respond to real-world machine conditions in one of a couple of ways. First, it allows conditional operation — controlling operation if and only if certain conditions are met, or for phase adjustment. Second, it allows operation markers to reset processes.

Typical programs

Preprogrammed logical subroutines (in the form of output Groups and operating modes) make for high-speed programmable limit switches — leaving PLCs and other high-level controls to do what they do best — supervisory control of multiple control schemes.

Let's look at how six modes of operation establish logical machine operations without complex programming.

  • Groups assigned to a default mode — let's call it Mode 0 — always have their outputs enabled. They are not affected by the operation of the enable input for the Group. So, when the rotation of the limit switch reaches the programmed setpoint, switching occurs. This is commonly referred to as straight cam logic.

  • Mode 1. In another arrangement, Groups of outputs assigned to Mode 1 are enabled to always turn on at their setpoints. When the Group enable-input trigger turns on, the start position for every Group output resets, using an offset function. The enable input has no further effect on outputs until it turns off — at which time, it's rearmed by a pulse programmed for the Group in the Group channel. (The Group channel is an enable-input channel associated with a Group, and its setpoints do not activate any real-world device, but rather, are configured to control internal timing.) This operates straight cam logic until the input is received, and then reset. Within all modes of operation, enable-input channels are used to establish windows of opportunity, or in some cases to rearm enable points.

    Let's look at an example to clarify how Group 1 operation affects outputs. Say a single controller and resolver control three sections of an adjustable phase-converting machine. Groups 1, 2, and 3 all operate in Mode 1. The position of each Group is reset with preset value when the Group's sensor detects a registration mark on the shaft for the corresponding machine section. This keeps the electrical control signals properly synchronized to the mechanical devices in each section when phase adjustments are made. Conveniently, one resolver provides the position information needed for all sections of the machine, regardless of their phase relationship.

  • Mode 2. Outputs in a Mode 2 Group are disabled until the Group enable input turns on. Then they're turned on at their programmed setpoints for one machine cycle only. As in Mode 1, the instant the Group input turns on, the Group start position resets through an offset function. To use our glue gun example, say two glue heads at different locations on a conveyor are controlled independently by a single controller and resolver — and the spacing between parts being glued is random. Sensors can be connected to the input terminals for the corresponding Groups. Then when a sensor detects a product, it resets the corresponding Group position to the preset values, and enables the Group outputs to dispense glue at the correct setpoints. When parts are not present, the outputs are inactive.

  • Mode 3. Outputs for a Group in Mode 3 turn on at their programmed setpoints only when the Group enable input is on. This program is particularly helpful in situations where output operation is only needed when the input sensors see something — like a product on a conveyor, or a machine component placement. The Group position does not reset, and operates like Mode 0, with the addition of the logic function. In this case, our example glue head operates only while the photoeye sees the top edge of a carton. Gluing is halted on crushed or improperly erected cartons when the eye loses sight of the top edge.

    Mode 3 operation eliminates the need to hardwire photoeyes and other sensors in series with corresponding controller outputs. Instead, the sensor is an and program with the output.

  • Mode 4. Appropriate for flight bar conveyors and rotary index tables, outputs grouped in Mode 4 turn on at programmed setpoints for one machine cycle — but only if the Group enable input switches are on within a programmed window of the cycle. The Group position does not reset, and operates the same as Mode 0, with the addition of the logic function. Inputs are edge-triggered in this mode — for example, by the leading edge of a carton. So if a carton is missing or incorrectly positioned, our example glue gun will not activate.

  • Mode 5. Outputs are enabled to turn on at their programmed setpoints — for one machine cycle only — if the Group enable input is on for any portion of a programmed window of the cycle. This might sounds similar to Mode 4, but is different. How so? In Mode 4 the input signal must start within the preprogrammed segment of rotation. In contrast, in Mode 5, whenever input is on within that window of opportunity, it triggers the outputs. This makes for level-triggered functionality.

Once rotation stops in Mode 5, all outputs are immediately disabled. If input is on when the machine stops, operation is resumed by energizing the switch first-cycle-enable terminal, allowing suspended operations to resume. The Group position does not reset, and operates the same as Mode 0 with the addition of the logic function. To use our example again, a glue gun switched in Mode 5 is enabled for one machine cycle if the sensor sees a carton during the pulse programmed into the group channel. Otherwise, the glue gun will not activate. If the line stops, the glue gun is disabled immediately, and must be reenabled.

For more information, visit or e-mail the editor at [email protected].


Channels: Each Channel in a programmable limit switch controller includes on and off setpoints for one 360° revolution of the resolver/encoder shaft. Channels are one of two types. Output channels are used to control machine functions based on shaft position. The output turns on when shaft position is within the bounds of a pulse that has been programmed into the channel. Enable input channels act as enable points or windows for an input received from a sensor or other controlling device.

Cycle: One complete sequence of events on an automated machine. Typically, on a rotary motion machine, one revolution of the encoder/resolver shaft equals one cycle.

Edge-triggered input: Activates an event when the input goes from false to true within a preprogrammed window.

Encoder: A position-sensing device that can be classified incremental/absolute, linear/rotary, or optical/magnetic.

Group logic inputs: Signals from external sensors or switches that are accepted into controllers and associated with Groups of outputs as part of the internal high speed logic feature.

Inputs: Signals from external sources accepted into a programmable limit switch controller which can be sent from a position transducer (encoder/resolver) or other external sensor or switch.

Internal high-speed logic: In certain controllers, this allows division of outputs into Groups — each of which can be controlled by assigned inputs.

Level-triggered input: Activates an event when the input is true within the preprogrammed window. Input may change from false to true prior to the window, but must remain true in some portion of the window.

Mode: A type of operation in which a group of outputs function.

Program: Allows users to store channel on/off setpoints for specific machine set-ups. By selecting different programs, product changeovers can easily be made without reprogramming individual setpoints.

Pulses: A pulse begins at the on setpoint and ends at the off setpoint. The on setpoint is the leading edge of the pulse, and the off setpoint is the trailing edge. When multiple pairs of setpoints are programmed into one channel, the channel is said to have multiple pulses.

Resolver: A magnetic type encoder that converts shaft position to an electrical signal that can be read by the controller. Some resolver-based controllers utilize ratiometric resolver-to-digital (R/D) converters for noise-immune data transmission over long distances.

Scale factor: Allows users to program the number of increments per revolution on resolver-based units. For example, to make the controller display position in degrees, a scale factor of 360 is used.

Setpoints: Points within one rotation of the resolver/encoder at which a channel turns on or off. Setpoints can be programmed into a channel through the keypad/display. Any given channel can turn on and off multiple times within one rotation.

Window: A user-defined (programmable) pulse within a machine cycle where input signals are accepted.

Sponsored Recommendations

From concept to consumption: Optimizing success in food and beverage

April 9, 2024
Identifying opportunities and solutions for plant floor optimization has never been easier. Download our visual guide to quickly and efficiently pinpoint areas for operational...

A closer look at modern design considerations for food and beverage

April 9, 2024
With new and changing safety and hygiene regulations at top of mind, its easy to understand how other crucial aspects of machine design can get pushed aside. Our whitepaper explores...

Cybersecurity and the Medical Manufacturing Industry

April 9, 2024
Learn about medical manufacturing cybersecurity risks, costs, and threats as well as effective cybersecurity strategies and essential solutions.

Condition Monitoring for Energy and Utilities Assets

April 9, 2024
Condition monitoring is an essential element of asset management in the energy and utilities industry. The American oil and gas, water and wastewater, and electrical grid sectors...

Voice your opinion!

To join the conversation, and become an exclusive member of Machine Design, create an account today!