Skip to content

homing: stop the correct joints when aborting a homing sequence - #4574

Open
grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:gantry-home-4572
Open

grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:gantry-home-4572

Conversation

@grandixximo

Copy link
Copy Markdown
Contributor

While investigating #4572 I found that HOME_ABORT stops the wrong joints: the loop indexes through the local joint pointer, which already points at joints[joint_num]. An abort raised from joint N stops joints N..N+all_joints-1 instead of 0..all_joints-1, so lower-numbered homing joints keep moving with their homing state already cleared, and with more than 8 joints the write runs off the end of the joints[] array.

On a gantry this triggers when the higher-numbered joint of the pair aborts the sequence (stuck home switch, switch bounce, limit hit during backoff): the partner joint's planner is never stopped, which matches the #4572 error output naming joint 0.

The bug came in with e0c3b39 (#3481).

@Sigma1912 could you test whether this fixes the alternating gantry homing failure from #4572? I could not reproduce the following error itself in a sim config (feedback follows the command there, so gantry racking never happens), but this bug sits right in that failure path.

HOME_ABORT loops over all joints to stop their free planners, but it
indexed through the local 'joint' pointer, which already points at
joints[joint_num]. An abort raised from joint N stopped joints N..N+
all_joints-1 instead of 0..all_joints-1: lower-numbered homing joints
kept running with their homing state already cleared, and with more
than EMCMOT_MAX_JOINTS/2 joints the write runs off the end of the
joints array entirely.

On a gantry this shows up when the higher-numbered joint of the pair
aborts (stuck home switch, switch bounce, limit hit): the partner
joint's planner is never stopped, and it faults with a following error
naming the partner, not the joint that caused the abort.

Refs LinuxCNC#4572
@Sigma1912

Sigma1912 commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Thank you for the quick response.
It actually looks like the issue reported in #4572 is config related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants