AutomateDirectUSAMotion LibraryIndustrial monitors & PCs

Troubleshooting

Why a Shared Limit Input Blocks Jogging in Both Directions

Servo and stepper motion Published 8 min read By AutomateDirectUSA engineering team

Short answer

Both limit directions on each axis point at one physical input, so a hit on either end asserts both limits at once and no jog direction is legal; the console then logs a positive and a negative limit stop for the same hit. Wire one input per end of travel, or keep the single switch and latch a virtual limit bit by direction of motion.

On this page
  1. Why does my axis stop at the limit switch and refuse to jog in either direction?
  2. Why does the console report a positive and a negative limit stop for the same hit?
  3. Why do the axes stay enabled and why does feed hold do nothing?
  4. What should I check first when jogging is blocked on a limit?
  5. How do I fix a shared limit input by wiring separate inputs per end?
  6. Can I keep one limit switch per axis and use virtual limit bits?
  7. How do I verify the limit fix at both ends of travel?
  8. Which fix should I choose for my machine?
  9. Questions asked

When a jog into the (+) limit switch stops the axis and the reverse jog reports a negative limit stop instead of moving, the two ends of travel share one input: the channel's negative and positive limit fields both point at the same bit, so an active switch asserts both limits at once and no commanded direction is legal. Wire one input per end of travel to fix it outright. Where rewiring must wait, a small resident routine can latch one of two virtual limit bits by direction of motion and restore jogging on the existing single-switch wiring.

Why does my axis stop at the limit switch and refuse to jog in either direction? #

The lockout is self-inflicted by the configuration: one physical input is assigned to both the positive and the negative limit, so the hit on the positive limit also asserts the negative limit and every jog direction points into an active limit.

A controller with separate positive and negative limit inputs normally lets you jog off an asserted limit: it blocks motion toward the asserted end and permits motion away from it. The lockout appears only when both directions test the same bit. In the program that produced this symptom, each axis channel assigned one physical input to both limit fields, so the bit that went active on the positive hit also satisfied the negative check.

Channel Negative limit bit Positive limit bit Result while the bit is active
0 136 136 Both jog directions blocked
1 137 137 Both jog directions blocked
2 138 138 Both jog directions blocked
3 139 139 Both jog directions blocked

That mapping comes from the init program that produced the fault, not from any default. The giveaway in a similar setup is LimitSwitchNegBit equal to LimitSwitchPosBit in the channel configuration. Retrofit machines arrive this way often: this one carried a single switch per axis, struck by adjustable bumpers at each end of travel, an arrangement inherited from the machine's original control.

Why does the console report a positive and a negative limit stop for the same hit? #

The pair of messages is the fingerprint of the shared input: the console reported Pos Limit Stop Axis:0 when the axis reached the positive switch, and Neg Limit Stop Axis:0 when the jog reversed, because both limits are the same bit.

Follow the check the controller makes for each commanded direction, using channel 0 of that program:

  • Commanded direction +1: the controller tests the positive limit field, which points at bit 136. The bit is active, motion stops, and the console logs Pos Limit Stop Axis:0.
  • Commanded direction -1: the controller tests the negative limit field, which also points at bit 136. The bit is still active, motion stops again, and the console logs Neg Limit Stop Axis:0.

Two commanded directions against two asserted limits leaves zero permitted directions — the arithmetic that turns one switch hit into a full jog lockout. The LimitSwitchOptions word 0x12f selected the stop-movement response, which is why the stop is clean and repeatable instead of a fault that drops the channel.

Why do the axes stay enabled and why does feed hold do nothing? #

The stop-movement limit response halts motion without disabling the channel, so the axes stay enabled, and feed hold is a host-side command that cannot change the limit input state or split the two limit directions, so it releases nothing.

A stop-movement response pauses motion while the limit bit is asserted; it does not mark the channel disabled. Anything keyed on channel-enabled state therefore never fires — in that program, the logic that drives the enable output to the drives holds it on as long as every axis channel stays enabled, so no power was removed during the whole lockout.

Feed hold is a host-side motion state. It can pause a program or a feedrate override, but it cannot change the electrical state of the limit input, reassign a limit bit, or split one shared bit into two directions. While the shared bit reads active, the next jog produces another directional limit stop, which is exactly what repeated feed-hold attempts showed.

What should I check first when jogging is blocked on a limit? #

Check the channel configuration first because it costs nothing: read the two limit bit numbers for the axis, press each end switch by hand while watching the raw input bit, and only then trace the series wiring between the switches.

Work from the desk outward:

  1. Read the two limit bit numbers for the channel. Free and instant: if the negative and positive fields hold the same number, the shared-input fault is confirmed without touching the machine.
  2. Watch the raw input bit with both switches released. A bit that reads active with the switches clear points to a stuck switch, a misadjusted bumper or a polarity mismatch — a different fault with its own fix.
  3. Press each end switch by hand and read the bit. If the single input changes state for both switches, the series wiring between the two ends is confirmed as the carrier of the fault.
  4. Count the free inputs. The permanent fix needs one spare input per end of travel, so confirm the input budget before promising a rewire.

A blocked-but-enabled axis has other causes too: a low limit latched after an E-stop holds jogging the same way through a different mechanism, as covered in why a stepper axis stays blocked on a low limit after an E-stop.

How do I fix a shared limit input by wiring separate inputs per end? #

Separate inputs are the reliable fix: give each end of travel its own input bit, assign one to the positive limit and the other to the negative limit, and the controller then blocks only the direction that actually ran into a switch.

Assign one bit to LimitSwitchNegBit and the other to LimitSwitchPosBit, and leave the option word's polarity expectation the same for both. The controller then permits the jog away from an asserted limit, which is the behavior of any normally wired axis.

On a machine that predates the retrofit — this one ran a single switch per axis against adjustable end bumpers under its original control — the rewire adds one switch and one input run per axis. Plan the new run with the machine's other signal work, the same retrofit cabling job described in servo drive pulse and direction wiring on a retrofit. Decision: rewire whenever a spare input exists for each end.

Can I keep one limit switch per axis and use virtual limit bits? #

One shared switch can be kept working by software: the program watches the physical bit, latches the virtual limit bit that matches the direction the axis was moving when the switch closed, and points the channel's two limit fields at those virtual bits.

Reassign the channel's two limit fields to two free virtual bits — for example 49 as the positive limit and 50 as the negative limit for channel 0 — and keep the stop-movement response so the controller still stops on them. A resident routine then watches the shared physical bit, 136 for channel 0 in the example program, and latches exactly one virtual bit from the direction of motion:

#include "KMotionDef.h"

void SimulateLimits(CHAN *ch, int bit, int limit_polarity);

void main()
{
    for (;;) // loop forever
    {
        SimulateLimits(ch0, 136, 1); // example: shared input bit 136, active high
    }
}

void SimulateLimits(CHAN *ch, int bit, int limit_polarity)
{
    if (ReadBit(bit) == limit_polarity)
    {
        if (!ReadBit(ch->LimitSwitchPosBit) && !ReadBit(ch->LimitSwitchNegBit))
        {
            if (ch->DirectionOfMotion == 1)
                SetBit(ch->LimitSwitchPosBit);  // entered moving positive
            if (ch->DirectionOfMotion == -1)
                SetBit(ch->LimitSwitchNegBit); // entered moving negative
        }
    }
    else
    {
        ClearBit(ch->LimitSwitchPosBit);
        ClearBit(ch->LimitSwitchNegBit);
    }
}

The function and field names are the controller's script API; the bit numbers are this example's values, so use the axis's own shared input bit and any two free virtual bits. The routine works in five steps:

  1. Read the shared physical input and compare it with the configured active polarity.
  2. On first entry, when neither virtual limit is set, set the positive virtual bit if the direction of motion is +1.
  3. On first entry moving -1, set the negative virtual bit instead.
  4. Hold that single directional limit while the physical switch stays active, leaving the direction away from the switch unblocked.
  5. Clear both virtual bits once the physical input leaves its active state.

Two constraints decide whether this method is acceptable. Each channel needs its own pair of virtual bits and its own call to the routine. And if the controller starts with the axis already sitting on the switch, the single input cannot identify which end closed it — the routine assigns the limit from the first direction moved, so the power-up state stays ambiguous until the switch is cleared.

How do I verify the limit fix at both ends of travel? #

Prove the correction with a supervised approach to each end: one virtual limit should set for the approach direction, motion further into that end must stop, the reverse jog must back the axis off, and both virtual bits must clear once the switch opens.

Run the proof at reduced speed:

  1. Approach one end of travel slowly and confirm that only the virtual limit matching the approach direction sets.
  2. Command motion further into that end and confirm the axis stops with a limit message for that end.
  3. Jog the opposite direction and confirm the axis backs off the switch.
  4. Let the switch clear and confirm both virtual bits clear and normal bidirectional jogging returns.
  5. Repeat at the other end, where only the opposite virtual bit should set.
  6. Repeat for every axis that shares a limit input, and once more after a power cycle, since the restart re-runs the program that assigns the limit fields.

While there, confirm the limit still actually stops the axis: the opposite fault, an axis that keeps moving past the limit after hardware changes, is diagnosed in why a servo axis runs past the limit switch after a drive swap.

Which fix should I choose for my machine? #

Wire separate inputs whenever a spare input exists for each end: the fix is unambiguous at power-up, needs no resident code, survives a controller restart, and restores the normal jog-off-a-limit behavior. Keep the virtual-bit method only where the legacy one-switch hardware cannot be changed and its startup ambiguity is accepted.

End-of-travel switches protect the machine's mechanics, not the operator, and they are not guarding or an interlock. Verify any change to limit behavior against the machine's risk assessment before running production, and make every verification approach at reduced speed. Separate inputs remove the fault class entirely; the virtual bits are the configuration change that keeps a legacy one-switch machine moving until the rewire happens.

Questions asked

Does a shared limit input also block homing moves?

Yes. With both limit bits asserted, a homing search toward either end is motion into an asserted limit, so the search stops immediately and the axis never reaches a reference. Clear the lockout first — rewire to separate inputs or clear the latched virtual limits — and then run the homing cycle. Homing that must start with the axis already on a switch is a second reason separate inputs are the durable choice.

What does the polarity argument in the limit routine do?

The third argument of the routine is the active state of the watched bit: a 1 means the limit is considered active when the bit reads high. It must match how the input actually reads the switch, which the desk checks confirm by watching the raw bit while each switch is pressed by hand. A mismatch makes the routine latch limits from a switch that never closed.

Can two axes share one pair of virtual limit bits?

No. Each axis needs its own pair because the latch is per direction and per axis: two channels pointed at the same virtual bits would block each other's recovery direction the moment either switch closed. Give every channel distinct positive and negative virtual bits and call the routine once per channel with that channel's own shared input bit.

How many inputs does a two-end limit scheme need per axis?

Two per axis, one switch and one input at each end of travel, plus a third if the axis uses a separate home or reference switch. The machine in this fault used one input per axis for both ends — channels 0 through 3 each carried one shared bit — which is exactly the arrangement that locks jogging in both directions.

Keep reading

  • Selection guide

    Reading a handwheel MPG on a PLC without a motion controller

    You do not need a servo motion CPU to bring an operator handwheel into a PLC that commands stepper drives by pulse train. Read both A and B phases on a pulse-input or high-speed-counter module, and pick that module by the handwheel's electrical output: a 5 VDC handwheel needs an input range that reaches down to 5 V, which rules out counter modules rated from 9 VDC up.

    Servo and stepper motion

  • Troubleshooting

    Why a Servo Axis Runs Past the Limit Switch After a Drive Swap

    When a servo axis reaches the homing limit switch, changes speed slightly and keeps moving into an overload alarm, the switch input is confirmed good and the fault is downstream in the homing sequence. After a drive swap, check the replacement drive's input function assignment, then the homing method and direction, then firmware-dependent settings a parameter copy cannot carry — and clear the supply overvoltage before any retry.

    Servo and stepper motion

  • Troubleshooting

    Why a Stepper Axis Stays Blocked on a Low Limit After E-Stop

    The axis blocks on three stacked conditions: motion permission removed by the E-stop, a latched low-limit error, and a Homed status that disabling the axis erases. Recover in that order — safety reset, enable the axis, MC_Reset to acknowledge the error, then MC_Home so the axis moves away from the active limit. On a reported S7-1214C DC/DC/DC at firmware V4.2, that sequence cleared the alarm with no manual move.

    Servo and stepper motion