Homing is harder. The most elegant solution is probably to create a modified Limit3 component with homing as a built-in behaviour.
It can be done with a combination of
sample-hold
and
offset
.
Well, you could use sample-hold if it wasn't limited to S32 data anyway. For floating point data (like axis position) you actually need to use a
mux2
component with the output looped back to the input.
When the limit switch is tripped you store the current position command in the sample-hold and that is used to offset the command and feedback to the limit-switch origin. There are wrinkles here, such as a sudden large following error and a step change in PID inputs, which is why either a modified Limit3 or a dedicated extra-axis-homing component might be a better idea.
In an ideal world LinuxCNC would simply allow many more joints than axes and would home them along with all the others.