Skip to content

pumakins: keep every joint within a half turn of the previous value - #4708

Draft
grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:pumakins-base-unwrap
Draft

grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:pumakins-base-unwrap

Conversation

@grandixximo

Copy link
Copy Markdown
Contributor

Follow-up to #4586 (issue #4585), which unwrapped the wrist, joints 4 and 6. The arm joints have the same problem, and worse.

Joint 1 is atan2(py, px) less another atan2, joint 3 a difference of two, and joint 2 the difference of joint 3 from a third. So each can come back a whole turn away from the joint that made the pose, not only when it crosses +-180. Motion takes that as a whole turn of the joint in one servo cycle.

On the puma sim: jog the waist to 169 in joint mode and switch to world mode. On master, joint 0 becomes -191, past the -170 soft limit, and every world move after that is refused. With this change it stays at 169 and world jogs work. Below about 167 nothing shows with the arm reaching forward, because the D3 offset moves the wrap point; with the arm leaning back, the waist is a turn off anywhere.

The change

Every joint now goes through the same angleDiff() step as the wrist, onto the value within a half turn of the joint passed in. That includes the wrist pitch, joint 5, so there is one rule for all six.

Test

tests/pumakins-unwrap now walks the waist, the shoulder and the elbow through +-180 in each direction as well as the wrist: the pose of each step from the forward, and the inverse handed the joints of the step before. On master 120 of the 200 poses fail, all on joints 1, 2 and 3. The wrist pitch is left out, since at +-180 the wrist is folded back on itself and joints 4 and 6 are not determined.

Draft

This conflicts with #4702, which moves pumakins onto the parameter block. I will rebase it once #4702 merges and mark it ready then.

f5311b8 unwrapped the wrist, joints 4 and 6, which came straight from atan2() and jumped a whole turn when they crossed +-180. The arm joints were left as they were. Joint 1 is atan2(py, px) less another atan2, joint 3 a difference of two, and joint 2 the difference of joint 3 from a third, so each can come back a turn away from the joint that made the pose, not only at the boundary: the waist at 150 degrees returned -210. Motion takes that as a whole turn of the joint in one servo cycle. On the puma sim, with the waist jogged to 169 in joint mode, switching to world mode set joint 0 to -191, past the -170 soft limit, and every world move after it was refused.

Every joint now goes through the same angleDiff() step as the wrist, onto the value within a half turn of the joint passed in. The wrist pitch, joint 5, as well, for one rule; at +-180 the wrist is folded back on itself and the test leaves it out.

tests/pumakins-unwrap walks the waist, the shoulder and the elbow through +-180 each way as well as the wrist, the pose of each step from the forward and the inverse handed the joints of the step before. Without the change 120 of the 200 poses fail, on joints 1, 2 and 3.
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