Skip to content

motion: axis_sync_teleop_tp_to_carte_pos resets velocity/acceleration#3949

Open
is-primary-dev wants to merge 1 commit intoLinuxCNC:masterfrom
is-primary-dev:motion-teleop-sync-velocity-reset
Open

motion: axis_sync_teleop_tp_to_carte_pos resets velocity/acceleration#3949
is-primary-dev wants to merge 1 commit intoLinuxCNC:masterfrom
is-primary-dev:motion-teleop-sync-velocity-reset

Conversation

@is-primary-dev
Copy link
Copy Markdown

axis_sync_teleop_tp_to_carte_pos in src/emc/motion/axis.c updates teleop_tp.curr_pos and pos_cmd to the current cartesian command but leaves curr_vel and curr_acc untouched. Both callers semantically represent "joint at rest at the current cartesian position" — enabling motion from DISABLED, and entering TELEOP after homing. Leaving residual velocity in the trajectory planner lets simple_tp_update_normal integrate one cycle of motion on the first pass after the sync, drifting curr_pos away from the synced value. The patch zeros curr_vel and curr_acc alongside the existing position sync.

Reproduction on an XYZZ setup where Z homes at MAX_LIMIT: home all, jog Z in the minus direction, release the jog key (axis_jog_abort(immediate=0) runs with residual velocity), re-home. Pre-fix: Z lands 1–3 mm below HOME depending on jog-settle timing. Post-fix: Z lands at HOME within machine resolution.

No upstream test harness exercises the FREE -> TELEOP transition after re-homing, so verification is by manual reproduction.

Without this, residual teleop_tp.curr_vel from an aborted jog can
survive the FREE -> TELEOP transition. axis_sync_teleop_tp_to_carte_pos
is called in two places: enabling motion from DISABLED, and entering
teleop mode (e.g. after homing finishes). Both semantically represent
the joint being at rest at the current cartesian position — leaving
the trajectory planner's velocity and acceleration at stale non-zero
values causes the first simple_tp_update_normal call after the sync
to integrate one cycle of motion, drifting curr_pos away from the
synced position.

Two-line fix matching the function's documented intent.
@BsAtHome BsAtHome added bug v2.9 candidate Things that would be nice to have for 2.9 2.10-candidate would be nice to have fixed in 2.10 labels Apr 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.10-candidate would be nice to have fixed in 2.10 bug v2.9 candidate Things that would be nice to have for 2.9

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants