Why Does the PLC Home Command Miss a Following Error?

James Nishida6 min read
Motion ControlOther ManufacturerTroubleshooting
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

The failure is in the sequence structure, not in the three warning-bit tests. A continuously executing PLC must release control after each scan so the controller can process motion commands and update status. The blocking while(m7500 < 3) loop prevents that normal scan pattern, while the initialization at the top can restart all three jogs and clear every latch when the program repeats. Replace the loop with a persistent, scan-based state sequence, prove each command was accepted, and verify actual home completion separately from command issuance.

Motion and status prerequisites

Before anything else, confirm the controller can home each motor independently. A warning following-error bit says that commanded and measured positions have separated beyond the warning threshold; it does not identify why. Mechanical obstruction, torque limitation, loss of feedback, incorrect feedback polarity, excessive acceleration, or a motor that cannot produce the requested motion can all raise it.

  1. Test #1hm, #2hm, and #3hm individually through the controller command interface.
  2. For each motor, verify the configured home direction, home capture source, and motion profile. Confirm that homing moves away from the condition producing following error rather than farther into it.
  3. With the motors stationary and free to move, verify that m141, m241, and m341 are clear. A bit already high at startup would cause an immediate home request.
  4. Jog one motor with the applicable #1j-, #2j-, or #3j- command and observe commanded position, actual position, following error, and the controller command-error indication.

Do not move on until each standalone home command is accepted, moves in the intended direction, and reaches the controller's native home-complete condition without a fatal following-error trip.

Single-run initialization

The original program places the jog command and all four resets ahead of the while loop:

cmd"#1j-#2j-#3j-"
m7500 = 0
m7501 = 0
m7502 = 0
m7503 = 0

On a controller where a PLC program repeats after reaching its end, completing all three branches makes m7500 reach 3, exits the loop, and returns execution to the beginning. The next pass commands all motors to jog negative again and erases the one-shot latches. This can turn a completed sequence into an unintended restart.

Use m7500 as a persistent sequence value. One workable allocation is 0 for initialization, 1 for active monitoring, and 4 after three home requests. Write 0 only when a new cycle is deliberately requested; do not assign 0 unconditionally inside every program pass.

if (m7500 = 0)
  m7501 = 0
  m7502 = 0
  m7503 = 0
  cmd"#1j-#2j-#3j-"
  m7500 = 1
endif

After the initialization scan, confirm m7500 remains 1, all request latches remain 0, and the three motors received the negative-jog request. If the controller reports a command parsing or execution error, stop here and separate the combined jog string into commands accepted by that controller.

Scan-based warning response

Remove the while loop. Let the PLC evaluate each warning once per normal pass, issue at most one home request for that motor, and return control to the controller scheduler. Servo processing may run at a higher priority than background PLC execution, but command interpretation and status publication still need normal scheduler opportunities.

if (m7500 < 4)
  if (m141 = 1)
    if (m7501 = 0)
      cmd"#1hm"
      m7501 = 1
      m7500 = m7500 + 1
    endif
  endif

  if (m241 = 1)
    if (m7502 = 0)
      cmd"#2hm"
      m7502 = 1
      m7500 = m7500 + 1
    endif
  endif

  if (m341 = 1)
    if (m7503 = 0)
      cmd"#3hm"
      m7503 = 1
      m7500 = m7500 + 1
    endif
  endif
endif

This structure also permits two or three warnings to be handled during the same PLC pass. The following table defines what the existing storage values now mean.

Value Meaning Required observation
m7500 = 0 New-cycle initialization requested Warning bits are clear before jogging
m7500 = 1 Jog issued; no home request recorded All commanded motors are moving as intended
m7500 = 2 or 3 One or two home requests recorded Corresponding one-shot latches are set
m7500 = 4 Three home requests recorded No automatic reset or new jog occurs

Do not move on until a forced or naturally produced warning transition sets only its matching latch and increments m7500 exactly once.

Command acceptance and motion response

Setting m7501, m7502, or m7503 proves only that PLC logic reached a cmd statement. It does not prove that the command parser accepted the string, that the motor entered its homing state, or that homing completed. Read the controller's command-error status and native motor-status indicators after every request during commissioning.

  1. Capture the warning bit transition, the matching latch, commanded position, actual position, following error, motor enable state, and motion mode in one trace.
  2. When the warning rises, confirm the latch changes on the next observed PLC evaluation.
  3. Confirm the command interface reports no syntax, queue, or motion-state rejection.
  4. Confirm the motor leaves the original negative jog and enters the configured homing sequence.
  5. Confirm following error stops increasing before the fatal limit is reached.
  6. Use the controller's home-complete status—not the request latch—to declare the motor homed.

If the latch changes but motion mode does not, investigate command acceptance or whether a home command is legal from the current motion state. If the motion mode changes but following error continues rising, inspect home direction, mechanical loading, feedback, torque availability, and the configured home profile.

Following-error response margin

The fatal following-error limit is reported as 40 times the warning threshold. That ratio is an amplitude relationship, not a guaranteed reaction time. The time available depends on how fast following error is growing, PLC execution latency, command-processing latency, and how the motor responds to the home request.

Estimate the observed margin from a controller trace rather than converting the 40:1 ratio into time. Record the warning crossing and project the measured following-error slope toward the fatal threshold. If the home transition does not arrest the growth with adequate margin, lower the commanded approach severity, trigger from a dedicated home or limit input, or revise the mechanical method. Read the permitted settings and motion behavior from the controller documentation instead of guessing thresholds.

Using following error as the normal homing trigger means the axis must fail to track before homing begins. That protection signal is a poor repeatable position reference and can subject the motor and mechanism to a physical stop or sustained torque. Do not move on until repeated traces show the warning-to-response interval and the decline in following error before the fatal threshold.

End-to-end commissioning test

  1. Set the sequence request to m7500 = 0 with all three warning bits clear.
  2. Start the PLC and verify one—and only one—#1j-#2j-#3j- sequence is issued.
  3. Produce the motor 1 trigger condition under controlled commissioning conditions. Verify m141, m7501, the #1hm request, command acceptance, homing state, and home completion in that order.
  4. Repeat for motor 2 through m241, m7502, and #2hm, then for motor 3 through m341, m7503, and #3hm.
  5. Verify m7500 progresses from 1 to 4 without double-counting a warning that remains high.
  6. After m7500 reaches 4, continue observing the PLC for several program passes. The final proof is that no latch resets, no negative jog restarts, all three native home-complete indications remain valid, and no fatal following-error trip occurs.

FAQ

Can I keep the while loop if each motor eventually raises its warning bit?

No. A blocking while(m7500 < 3) loop can monopolize background PLC execution and delay command handling or status work. Evaluate the three warning conditions once per PLC pass and retain the state in m7500 through m7503.

Does a fatal limit 40 times the warning limit guarantee enough time to issue home?

No. The ratio describes following-error magnitude, not time; measure the error slope and command-response interval in a trace. The motor must enter homing and reverse or arrest the error growth before the fatal threshold.

Can I use the following-error warning as the normal home reference?

It can trigger logic, but it indicates loss of position tracking rather than a precise reference. Prefer the controller's configured home or limit input, then complete the final test by verifying command acceptance, native home completion, and falling following error for all three motors.

Back to blog