9 / 16 · Machine programming

Homing and coordinate validity

Design a bounded reference search and distinguish calibration from changing a number.

Zero needs a physical reason

A 600 mm slide powers up at an unknown location. Writing zero into its position tag makes the screen tidy, but the controller still does not know where the fixture is. Homing establishes a measured relationship between the mechanics and the coordinate system.

A reference search might approach a switch, retract from it, approach again at reduced speed and capture an encoder index. The exact sequence depends on the mechanics, drive and selected homing method. PLCopen Part 5 describes homing concepts; vendor MC_Home options define the installed behavior.

Specify the search before programming it

Record the initial direction, initial speed, expected switch polarity, search travel, timeout, index use, reference coordinate and final stopping behavior. Decide what happens if the switch is already active when the sequence starts. A search that assumes every start occurs off the switch can move in the wrong direction from an unusual power-up position.

The assigned home coordinate and the final physical standstill point can differ because capture occurs before braking finishes. Beckhoff documents this distinction for its MC_Home operation. Do not assume that Position 0 guarantees the final carriage position is exactly zero.

ObservationRequired decision
Switch active at startDefined retract or permitted alternate search
No switch transitionBounded travel/time failure
Index never capturedDefined calibration failure
Wrong physical directionStop commissioning and correct configuration
Power lost during searchRe-establish coordinate validity before automatic travel

These bounds are ordinary control measures. The safety arrangement must independently address hazardous travel and access.

Absolute feedback still needs validity

An absolute encoder can retain shaft position, but the shaft-to-load relationship may be lost after a coupling replacement, belt slip or gearbox work. Battery state, encoder initialization and configuration changes also belong to the vendor's validity checks. Retained software data does not prove the mechanics stayed aligned.

Define a reference-valid flag whose meaning is precise. It might require successful calibration, confirmed absolute data and no invalidating maintenance event. Decide which events clear it. A general Ready bit that stays TRUE through every restart hides this requirement.

SetPosition and direct calibration

MC_SetPosition changes the coordinate representation. Direct homing modes can mark calibration under a defined vendor arrangement. Neither operation searches for a physical datum by itself. They can be correct when another valid measurement establishes position, but their justification must be written down.

TryPLC's MC_Home moves its model to its zero reference and assigns the requested coordinate. It has no home switch, encoder index, timeout or search-direction mechanics. Use the scaling bench to explore coordinate offsets; do not use its behavior as a template for a real homing sequence.

A bounded procedure

For the 600 mm teaching slide, choose permitted search bounds from the actual machine design instead of copying arbitrary values from an example. First verify direction and switch behavior under the approved procedure. Start the reference operation, monitor its outcome and maximum search time, then verify final feedback and repeated reference accuracy. If calibration fails, preserve the failure reason and inhibit coordinate-based automatic moves.

After successful homing, a separate move can take the carriage to a known loading station. Keep Homed and AtLoad separate: calibration establishes the coordinate; the loading move establishes the working position.

Exercises

Design state paths for switch already active, missing switch and missing index. Explain which event makes reference validity TRUE and what clears it. Then compare two power cycles: one with an absolute encoder and untouched mechanics, one after a coupling was removed. State why their restart checks differ.

Use the scaling bench to set an offset at a known datum. Explain the evidence required before that numerical change is acceptable. The worked answer must include a physical measurement or justified absolute reference, not merely the desire to display zero.

References

PLCopen motion-control parts include Part 5 homing. Beckhoff MC_Home documents calibration options and final-position behavior.

Check your reasoning

A direct coordinate assignment is:

  • Proof that the coupling is intact
  • A coordinate change, not a reference search
  • A guaranteed switch and index search
Worked answer

A coordinate change, not a reference search. Reference validity needs a justified physical measurement or absolute-position arrangement.

The home switch never arrives. A homing sequence should:

  • Stop through its defined bounded failure path
  • Search forever
  • Report Done after a fixed timer
Worked answer

Stop through its defined bounded failure path. Define maximum travel/time and fault recovery before permitting the search.