Skip to content

motion: keep the last pose as the forward's guess after a failed forward - #4757

Open
grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:kins-forward-seed
Open

grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:kins-forward-seed

Conversation

@grandixximo

Copy link
Copy Markdown
Contributor

With KINEMATICS_BOTH, motion starts the forward kinematics of the feedback (and, in joint mode, of the command) from the pose of the cycle before. After one failed forward it starts from world_home instead, every cycle until the forward solves again. For an iterative forward far from home, that start can fail again, or converge to another platform pose with the same joint positions. Because that pose is a real solution, the following cycles stay on it: the position reads wrong until the machine comes back near home. The joints do not jump, since the other pose has the same joints, but the DRO is wrong and so is the start of the next path in world coordinates.

With this change, home is the starting guess only until the forward has solved once since all joints were homed. A failed forward puts back the pose it was given, and that is the next guess.

How often it matters, in the hexapod-sim geometry (genhexkins defaults, home 0 0 20 0 0 0): over 23141 platform poses whose straight path from home the forward follows cycle by cycle (X and Y to 15, Z 8 to 38, tilts to 45 degrees, turns to 90), the forward started at home fails at 675 and lands on another pose at 319, all of them near the edges. In the middle of the workspace (X and Y to 10, Z 14 to 26, tilts to 30, turns to 45) it finds all 10765. A forward started from the previous cycle never failed, so the trigger is something else going wrong for a cycle: a bad joint reading, a strut at or below zero length, a near-singular pose.

tests/kins-forward-seed moves the platform to X-15 Y-15 Z32 A30 B15 C90, makes the forward fail for a few cycles with genhexkins.limit-iterations set to 0, and requires the feedback, and the command in joint mode, to come back to the platform. On master both stay on X-14.69 Y-14.81 Z31.67 A28.6 B18.2 C97.1.

With KINEMATICS_BOTH, motion seeds the forward of the feedback, and in joint mode of the command, with the pose of the cycle before; after one failed forward it seeded from world_home instead, every cycle until the forward solved again. For an iterative forward far from home that seed can fail again or converge to another pose with the same joints, and since that pose is a solution, the following cycles stay on it: the position reads wrong until the machine comes back near home. Home is now the guess only until the forward has solved once since all joints were homed; a failed forward puts back the pose it was given, which is the next guess.

In the hexapod-sim geometry, over 23141 platform poses whose straight path from home the forward follows cycle by cycle, the forward started at home fails at 675 and lands on another pose at 319, all near the edges (X and Y at 15, tilts to 45 degrees, turns to 90); in the middle of the workspace it finds them all. tests/kins-forward-seed moves the platform to one of those, makes the forward fail for a few cycles with genhexkins.limit-iterations 0, and requires the feedback and the joint mode command to come back to the platform; without the change both stay on X-14.69 Y-14.81 Z31.67 A28.6 B18.2 C97.1.
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