AutomateDirectUSAMotion LibraryIndustrial monitors & PCs

Explainer

Why Servo Homing Cannot Find a Reference Switch on PLC Inputs

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

Short answer

Switch-based homing methods in MC_Home make the servo drive search for the reference switch, and the drive only samples its own inputs — a switch wired to PLC I/O is never seen. Wire the reference and over-travel switches to the drive for deterministic homing and limits, or keep the switch on the PLC and set the origin with a SetPosition block, accepting overshoot equal to homing speed times the summed input-filter, scan and bus delay.

On this page
  1. Why the drive never sees a PLC input
  2. The latency you accept with a PLC-wired switch
  3. Wire it to the drive or keep it on the PLC
  4. Homing from a PLC input with SetPosition
  5. Questions asked

If your reference switch is wired to a PLC input, no switch-based homing method will ever find it. The homing function block, such as MC_Home, does not run the search in the PLC: it commands the servo drive, and the drive executes the sequence internally, sampling only its own digital inputs. A switch that terminates at PLC I/O is simply not part of that loop. You have two workable choices: move the reference and over-travel switches to the drive's inputs, or keep them on the PLC, do the search yourself with ordinary moves, and write the origin with a SetPosition block — accepting an overshoot error you can calculate before you commit.

Why the drive never sees a PLC input #

PLCopen motion function blocks are split into two halves. The PLC issues MC_Home and then waits; the drive owns the actual sequence, watching for the reference switch edge and latching position at that instant inside its own servo loop. The PLCopen function-block specification describes this input as the signal meant for connecting a reference switch, and the standard assumes it is wired where the motion executor can sample it directly.

When the executor is the drive, that place is the drive's input terminals. Configure a switch-based homing method and the drive starts searching, sweeping the axis until one of its own inputs changes state. A switch wired to a PLC input card never appears in that search: the PLC does not forward its I/O image into the drive's homing logic, and the motion configuration offers no place to declare a PLC input as the drive's reference switch. The block runs, the axis moves, the search never completes, and the block reports an error or times out. The fix is not a setting — the wiring and the method have to agree.

The latency you accept with a PLC-wired switch #

The deciding quantity with a PLC-side switch is the delay between the switch changing state and the position value you record. A drive-wired switch is latched in the drive's input and servo scan, independent of anything the PLC is doing. A PLC-wired switch passes through three stages before you act on it: the input filter of the PLC input, the PLC program scan, and the fieldbus period that carries the corrected position or any stop command back to the drive. At the moment of detection, the axis has already moved past the switch by:

error = v × t_delay

with t_delay = t_input_filter + t_PLC_scan + t_bus_period, all summed worst-case.

Worked example (illustrative values — read your own filter, cycle-time monitor and bus period from your project): take a homing approach speed of 50 mm/s, a 5 ms input filter, a 10 ms PLC scan and a 4 ms fieldbus period. The summed delay is 19 ms, so the axis overshoots the switch by 50 mm/s × 0.019 s = 0.95 mm before your program captures position — and the stop command itself arrives that much later. Lower the approach speed to 5 mm/s and the same delays produce 0.095 mm of overshoot. The error scales linearly with speed, which is the whole lever you control.

The same delay applies every run, but the scan and bus periods jitter, so repeatability is set by the variation, not the average. Approach the switch from the same direction at the same speed ten or more times and read the recorded position each time; the spread should fall within v × (scan and bus period variation). If it does not, check the input filter time, whether your program records the PLC's position image or the drive's actual position, and whether the approach speed really is constant between runs.

Wire it to the drive or keep it on the PLC #

Requirement Switch on drive inputs Switch on PLC inputs with SetPosition
Homing repeatability Independent of PLC scan and bus period Set by scan and bus period variation
Switch-based MC_Home methods Usable — the drive finds the switch Not usable — the drive never sees the switch
Over-travel reaction Drive reacts inside its own servo loop Delayed by scan plus bus period plus deceleration
Position capture at the edge Latched in the drive Captured one to three cycles late
Suits low-accuracy axes Yes Yes

The decision follows from that table. If the axis needs a repeatable, deterministic origin — most servo axes do — wire the reference switch and the over-travel switches to the drive's inputs and use the drive's switch-based homing method. If the application tolerates an origin offset in the range your latency calculation gives, the PLC wiring is acceptable and saves the extra drive-input wiring.

Over-travel deserves its own note: it is not a homing nicety but a limit function. A limit wired to the drive (the inputs commonly designated P-OT and N-OT for the positive and negative directions) is evaluated inside the drive and stops the axis without waiting for the PLC. A limit wired to PLC inputs only stops the axis after the scan and bus delay plus the deceleration distance, so the mechanical margin beyond the switch must be at least v × t_delay plus the stopping distance at your deceleration setting. If the actuator's hard stop sits close to the switch, that margin does not exist and the limit switches belong on the drive. This is a machine-safety boundary, not a tuning preference — size it against the machine's risk assessment, not against this article.

Homing from a PLC input with SetPosition #

When the switch stays on the PLC, skip the drive-side search and set the origin yourself:

  1. Wire the reference switch to a PLC input and map it to a tag in your program.
  2. Move the axis toward the switch with an ordinary velocity or relative move block, at a speed low enough that the overshoot from the section above sits inside your tolerance — pick the speed from your own calculation, not from habit.
  3. On the switch's rising edge, stop the axis.
  4. Call the SetPosition block from a one-shot contact on that same edge, writing your reference value — zero, or whatever matches your coordinate system.
  5. Run all production moves relative to that origin.

The one-shot matters: without it, SetPosition executes every scan while the switch is held, and any motion while it is held re-zeros the axis repeatedly. If you need the drive to search its own switch but cannot free up a drive input, the same discipline applies on the drive side; the origin search behavior of a dedicated pulse-output module is laid out in the origin search home position finder guide on our motion knowledge base.

One further catch: SetPosition writes a running value, not a stored absolute reference. After a drive power cycle the axis no longer knows where the origin is, so the switch approach and the write must run again at every power-up. An absolute encoder removes that need, but only if you validate the absolute reference after installation — the reason a saved origin adjustment disappears after a power cycle is covered in our article on absolute encoder adjustment lost after power-up, and hard-stop homing with a torque limit is an alternative when no switch can be added at all.

If your drive's input assignment and homing-method configuration are unclear, take them from the homing and input sections of that drive family's manual rather than from trial and error — manufacturers such as Mitsubishi document drive-side homing parameters and PLCopen block behavior in the servo amplifier manual that ships with the drive.

Questions asked

Why can't a switch-based MC_Home method use a reference switch wired to PLC inputs?

MC_Home sends a homing command to the drive, and the drive runs the whole sequence internally, sampling only its own digital inputs. A switch that terminates at a PLC input is not part of that loop, so the drive searches forever and never reports finding the reference. There is no standard way to map a PLC input into the drive's homing search; the assignment lives in the drive's own input configuration.

How much position error does a PLC-wired reference switch add?

Overshoot equals homing velocity multiplied by the summed delay of the input filter, the PLC scan and the bus period. For example, at 50 mm/s with a 5 ms input filter, a 10 ms scan and a 4 ms bus period, the delay is 19 ms and the axis overshoots about 0.95 mm before you capture position. Drop the approach speed to 5 mm/s and the same delays shrink the error to about 0.095 mm.

What does SetPosition do for homing?

SetPosition writes a chosen value, such as zero, into the axis's running position at the moment the PLC sees the switch edge. That defines the origin without any drive-side search. Call it from a one-shot contact so it executes once per edge, not every scan while the switch is held, and re-run the sequence after every power-up because it changes a running value, not a stored absolute reference.

Why are P-OT and N-OT over-travel inputs better on the drive?

The drive evaluates its own over-travel inputs inside the servo loop, so the reaction does not wait for a PLC scan or a bus period. If there is no room for that margin, the limits belong on the drive.

Keep reading

  • How-to

    Homing a Servo Axis to a Hard Stop With Torque Limit

    Approach the stop in torque control at a torque below the actuator's allowable end-stop load and low speed, accept contact only as sustained torque with near-zero velocity inside the permitted travel window, stop, then execute MC_Home with the Zero position preset method. The preset only writes the coordinate; sequence logic must qualify the stop first.

    Servo and stepper motion

  • Troubleshooting

    Fixing a grid align error after a servo motor rebuild

    The zero-return switch made, but the control finished its alignment move without seeing the encoder's marker pulse. Verify the encoder connector, cable and the Index Invert A and Index Invert B fields first; if those are right, loosen the motor coupling, rotate the motor 180 degrees on the ballscrew and re-home — the documented field fix that clears the alarm when the marker sits outside the alignment move.

    Servo and stepper motion

  • How-to

    Reversing an Axis After a Belt Drive Retrofit in Mach3

    Yes — flip the direction active level for that axis in Config > Ports and Pins > Motor Outputs (the Dir LowActive checkbox) and commanded travel reverses; never mirror programs or swap motor and encoder wiring. The 0.02 in of lost motion is separate: seat the ball screw in its thrust supports mechanically, because no polarity change removes it.

    Servo and stepper motion