Skip to content

task: unhome VOLATILE_HOME joints on any motion-disable edge#4008

Open
grandixximo wants to merge 1 commit intoLinuxCNC:masterfrom
grandixximo:fix/3954-volatile-home-on-disable
Open

task: unhome VOLATILE_HOME joints on any motion-disable edge#4008
grandixximo wants to merge 1 commit intoLinuxCNC:masterfrom
grandixximo:fix/3954-volatile-home-on-disable

Conversation

@grandixximo
Copy link
Copy Markdown
Contributor

Summary

  • Fixes With VOLATILE_HOME = 1, triggering an end-stop disables the machine but keeps the axis homed #3954. With VOLATILE_HOME=1, tripping a limit switch (or amp-fault, ferror, misc-error, spindle-fault) disables the drives but leaves all joints flagged as homed. Only ESTOP and F2/machine-off paths cleared the homed flag.
  • Adds a 1->0 edge detector on emcStatus->motion.traj.enabled in the task main loop. On the edge it calls emcJointUnhome(-2), which unhomes only joints marked VOLATILE_HOME. Estop and machine-off continue to do their own unhome and remain idempotent.

Why this scope

Test plan

  • Sim config, VOLATILE_HOME=1: home X, jog Y into a hard limit switch. X loses homed status.
  • Sim config, VOLATILE_HOME=1: home X, ESTOP. X loses homed status (existing path, regression check).
  • Sim config, VOLATILE_HOME=1: home X, F2 off. X loses homed status (regression check).
  • Sim config, VOLATILE_HOME=1: home X, hit a soft limit. X stays homed (drive not cut).
  • Sim config, VOLATILE_HOME=0: home X, trigger a fault. X stays homed (no regression).
  • Hardware (stepper + limit switch): reproduce the exact With VOLATILE_HOME = 1, triggering an end-stop disables the machine but keeps the axis homed #3954 scenario.

@BsAtHome
Copy link
Copy Markdown
Contributor

BsAtHome commented May 5, 2026

There may be some tab/space indent mismatch.

So, if a joint fault does not trigger machine off or estop, then this is not triggered? How is the specific joint unhomed in that case?

@grandixximo
Copy link
Copy Markdown
Contributor Author

There may be some tab/space indent mismatch.

So, if a joint fault does not trigger machine off or estop, then this is not triggered? How is the specific joint unhomed in that case?

The only only fault that does not machine off (that I could find) is soft limit, and if machine did not go off, joint should still be in good position, homing should still be valid.
amp-limit already turns off the machine, so no need to loose homing independently.

@BsAtHome
Copy link
Copy Markdown
Contributor

BsAtHome commented May 5, 2026

But that means you must have any joint's fault signal(s) wired up so that the machine goes either off or in estop. Otherwise, your joint may lose tracking and linuxCNC is not aware of that.

Issue LinuxCNC#3954: with VOLATILE_HOME=1, tripping a limit switch (or hitting
amp-fault, following error, etc.) disables the drives but leaves all
joints flagged as homed. Only ESTOP and machine-off paths cleared the
homed flag; every other drive-disable cause silently kept it set.

Detect the traj.enabled 1->0 edge in the task main loop and call
emcJointUnhome(-2) so volatile_home joints are unhomed regardless of
which fault path disabled motion.
@grandixximo grandixximo force-pushed the fix/3954-volatile-home-on-disable branch from ef5bd87 to 6f37ca3 Compare May 5, 2026 14:23
@grandixximo
Copy link
Copy Markdown
Contributor Author

But that means you must have any joint's fault signal(s) wired up so that the machine goes either off or in estop. Otherwise, your joint may lose tracking and linuxCNC is not aware of that.

Which joint fault does not turn off the machine? limit switches machine off, amp-fault machine off.

@BsAtHome
Copy link
Copy Markdown
Contributor

BsAtHome commented May 5, 2026

That which comes from external (like a signal from the drive controller hardware).

@grandixximo
Copy link
Copy Markdown
Contributor Author

grandixximo commented May 5, 2026

That which comes from external (like a signal from the drive controller hardware).

I cannot find a fault path that disables a single joint while leaving the machine on. joint.N.amp-fault-in, hard limit, ferror, misc error, spindle fault, all route through emcmotInternal->enabling = 0, which disables whole motion (traj.enabled 1=>0). edge detector catches that uniformly, so every fault visible to the core unhomes volatile joints.

I cannot find a "one joint faulty, machine stays running" mode, if it exist I can hook signals to unhome only the effected joint that's faulty and volatile.

@BsAtHome
Copy link
Copy Markdown
Contributor

BsAtHome commented May 5, 2026

If there is no path for a single joint failure while the machine stays on, then that is just the way it is and this solution will be adequate to fix the current problem.

If anybody wants to use such a single-joint-failure-mode feature (probably only for very special robotics), then they can send a patch ;-)

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.

With VOLATILE_HOME = 1, triggering an end-stop disables the machine but keeps the axis homed

2 participants