Skip to content

homing: bound the homing moves, return from a failed latch move - #4578

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

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

Conversation

@grandixximo

Copy link
Copy Markdown
Contributor

Every homing move is planned to twice the joint's travel. With a dead home switch the search runs until a limit switch stops it, or into the end of the travel when the limit switch doubles as the home switch and is ignored. A switch stuck on sends the initial back-off the same way at search speed, which on a Z axis with its switch at the top means down into the table. A switch that fails after its first trip sends the latch move the same way at latch speed. Operators who retry the homing drive the joint further with every attempt.

This adds two [JOINT_n] keys, both defaulting to 0, which keeps today's behaviour:

  • HOME_SEARCH_DIST: the farthest the search move may travel without finding the switch.
  • HOME_LATCH_DIST: the farthest each of the moves made next to the switch may travel: the back-off waiting for the switch to clear, the latch move, and the index pulse search. A few times the trip overshoot (search speed squared over twice the acceleration) plus the width of the switch's active zone covers them; with an index it must also cover one encoder revolution.

A search that runs out stops where it is and the homing is aborted with an error; the next attempt searches on from there, since a search may legitimately need the whole travel and a joint that has not found its switch yet is no worse off further along. The real use is a continuous rotary joint: its soft limits sit far apart, so today a dead switch spins it until someone hits estop; HOME_SEARCH_DIST a little over one revolution turns that into an abort after one turn.

When one of the moves bounded by HOME_LATCH_DIST runs its full length the joint reports which move, moves back to where that move began at the speed of that move, and the homing is aborted. The machine stays on. The other joints of the sequence stop at once, and the joints synchronized with it (negative HOME_SEQUENCE) move back to the start of their own current move too, so a coupled pair ends where it started. A joint homed repeatedly against a stuck or intermittent switch therefore stays put instead of creeping. A limit switch hit during the return aborts as before.

tests/home-dist covers a dead switch, a switch stuck on, a switch that dies after its first trip, and a synchronized pair with both switches stuck on: the search stops at its bound, the other moves come back to where they began, the expected message is reported and the machine stays on.

The homing module interface gains the two distances in set_joint_homing_params(); homecomp.comp is updated.

Every homing move is planned to twice the joint's travel, so a joint with
a dead switch searches until it hits a limit switch or the end of its
travel, a joint whose switch is stuck on backs off the same way, and a
switch that fails after its first trip sends the latch move the same way
at latch speed. Operators who retry the homing move the joint further
each time.

Add [JOINT_n]HOME_SEARCH_DIST for the search move and HOME_LATCH_DIST for
the back-off, latch and index moves, both defaulting to 0, the old
unbounded behaviour. A search that runs out stops where it is and the
homing is aborted; the next attempt searches on from there. When one of
the other moves runs its full length the joint reports which move,
moves back to where that move began at the same speed, and the homing is
aborted. The other joints of the sequence stop at once; those
synchronized with the joint return to the start of their own current
move as well.

tests/home-dist covers a dead switch, a switch stuck on, a switch that
dies after its first trip, and a synchronized pair with both switches
stuck on.
@grandixximo

Copy link
Copy Markdown
Contributor Author

@Sigma1912 is the other one #4577 😁

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.

1 participant