Repository navigation
homing: joint.N.homing reports only that joint - #4955
grandixximo wants to merge 3 commits into
Conversation
Since 1543217 a joint's homing pin and status stay TRUE until the whole homing run ends. In a Home All with several HOME_SEQUENCE groups, joint 0 still reads homing while the next group homes. A machine with one switch input for home and limits masks the limits of the joints that are not homing, so it leaves joint 0's limit live and trips when the next joint presses the shared switch (forum thread 59433). The race that hold worked around comes from motion keeping homing_active set for two more servo cycles after the last joint finished, while the sequence machine walked to idle. A home command sent in that window was refused. Now the sequence moves on in the cycle its last joint finishes, so homing_active drops together with that joint's homing flag, and the hold is gone. linuxcncrsh JOINT_WAIT_HOMED also waits for homing_active, so a wait on all joints cannot end between two groups. tests/home-dist now runs a Home All of joint 0 then the synchronized pair and checks that joint 0 no longer reads homing while the pair homes; it fails with the hold.
|
Interesting CI fail on pkg arch amd64 bookworm: |
|
Sorry, that fail was on ARM64, not x86 |
If you are homing from one command, then any output pin to indicate that the homing process is active should be active for the entire procedure and not glitch between joints. Glitching causes races and false operational progressions. The output pin itself, indicating that the (or a) homing process is currently in progress is probably useful. But, for example, complex homing group operations need to assure that this pin is active while the entire homing procedure is running.
Testing for the race is a race. A race is indeterministic by its definition. You cannot determine indeterminism... |
The rerun passed. I tracked it down: on an estop reset task syncs the parameter file to disk, which took 3.45 s on that runner, and linuxcncrsh gave up waiting for the heartbeat, so the machine never came on. #4957 makes linuxcncrsh wait for task to receive the command first.
Right, that is how
Not quite in this case: with the pin, a xor2 + flipflop in HAL compares |
|
Rereading your comment: if no output pin should glitch during a homing run, that includes an or2 over the |
Yes, I think that would be fine.
But if you can catch is consistently in the thread cycle, then it isn't a race but a glitch :-) But, when it is fixed, shouldn't we be able to trust it then? And, just doing it for one scenario may not cover the real problem when complex setups are being homed? You'd need a whole swath of different configurations to be somewhat sure and then, still, you know how users can be inventive to create that scenario you didn't test for. You know, the N scenarios you have but you should have tested N+1 scenarios ;-) |
In a "Home All" scenario, the |
motion.is-homing is TRUE from the start of a homing command until its last joint has finished, without a break between HOME_SEQUENCE groups. It is the signal HAL needs for "the machine is homing": the joint.N.homing pins report each joint only, and an or2 over them drops for a servo cycle between groups. It shows the homing_active flag motion already keeps for task.
|
Added |
JOINT_WAIT_HOMED ends by waiting one heartbeat for motion to switch to teleop. Wait two, so a whole servo cycle runs after the homed status was seen.
Since #3800 a joint's
homingpin and status stay TRUE until the whole homing run ends. In a Home All with several HOME_SEQUENCE groups, joint 0 still reads homing while the next group homes. That broke a config on the forum (https://forum.linuxcnc.org/24-hal-components/59433-joint-x-homing-signal-possible-bug) where one switch input feeds the home and limit pins of joints 0 and 2: the HAL masks the limits of the joints that are not homing, sees joint 0 as still homing, leaves its limit live, and the machine trips when joint 2 presses the shared switch.The race #3800 fixed is real: after the last joint finished, motion kept
homing_activeset for two more servo cycles while the sequence machine walked to idle, and a home command sent in that window was refused. This PR removes the hold and fixes the window at its source instead: the sequence moves on in the cycle its last joint finishes, sohoming_activedrops together with that joint'shomingflag. linuxcncrsh JOINT_WAIT_HOMED also waits forhoming_active, so a wait on all joints cannot end between two groups.tests/home-dist now runs a Home All of joint 0 then the synchronized pair and checks that joint 0 no longer reads homing while the pair homes; it fails on master.
Two questions:
motion.is-homingpin wanted? It would give HAL a signal for the whole homing run; the OR of thejoint.N.homingpins drops for one servo cycle between HOME_SEQUENCE groups, as it did before homing: Fix race between joint's homing status and state machine done #3800.