Skip to content

task: gate probe completion on full motion drain (#3650)#3970

Closed
grandixximo wants to merge 1 commit intoLinuxCNC:masterfrom
grandixximo:fix/3650-queue-not-empty-probe
Closed

task: gate probe completion on full motion drain (#3650)#3970
grandixximo wants to merge 1 commit intoLinuxCNC:masterfrom
grandixximo:fix/3650-queue-not-empty-probe

Conversation

@grandixximo
Copy link
Copy Markdown
Contributor

@grandixximo grandixximo commented Apr 26, 2026

working on it

Probe is a queue-buster: the interpreter must wait for the probing
motion to fully stop before reading probe parameters (#5061..#5069),
otherwise the result is sampled mid-motion and the position reported
is stale.

Previously EMC_TRAJ_PROBE_TYPE returned EMC_TASK_EXEC::DONE as its
postcondition, so the interp_list could advance to the next command
(typically EMC_TASK_PLAN_SYNCH) and then to the next read() before the
trajectory queue had fully drained. With a bouncy probe (re-trip during
deceleration) or under cyclic G38.x sequences, the next read_inputs()
ran while motion.traj.queue > 0 and the CHKS guard fired:

    "Queue is not empty after probing"

Add a dedicated EMC_TASK_EXEC::WAITING_FOR_PROBE postcondition state
that holds the interp_list until:

  - motion.status == DONE
  - io.status     == DONE
  - motion.traj.queue == 0
  - motion.traj.probing is clear

This makes the safety guarantee explicit at the probe boundary instead
of relying on the next command's precondition to drain the queue, and
covers the timing windows where bouncy probe edges or rapid successive
G38.x commands let the interpreter race ahead of the planner.

Closes LinuxCNC#3650
Closes LinuxCNC#662
Closes LinuxCNC#263
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