Being a Fanuc newb, I need a bit of help here.
I'm using a 6-axis Fanuc in a depalletizing fashion, to pick boxes from a pallet. I have a 3D vision system to get the coordinates of what I'm picking, which provides me a PR containg X,Y,Z, and Rz of the center of the top surface of the box (Rx and Ry are always 0). That all works fine.
The one fly in the ointment is that, because I'm picking up rectangularly-symmetrical boxes, there's no disambiguation for Rz -- if the box is rotated 45deg, the Rz value I receive could be 45, or -135 -- it's literally 50/50. Now, to protect the cables and hoses, I want to limit the Rz angles the robot uses to (for example) -90 to +90. Since my end effector is also rectangular and symmetrical, all I need to do is line up the long axis of my end effector with the long axis of the box -- I don't care if I pick it up 180deg "wrong".
From my previous experience with other robot brands, this seemed simple enough: use some IF statements to add 180 to Rz if Rz was less than -90, or subtract 180deg if RZ was greater than +90. Well, the math works, but the effect on the robot's motion is not what I expected. Despite limiting the Rz value of the PR this way, sometimes the robot simply decides to go "the long way around", even though the shortest route (in joint space) from its starting position would be the other alternative.
What I expected was that, given my unambiguous JPos starting point, the path planner would choose the shortest joint-space path to the Vision location in the PR, but that's not happening.
I'm guessing that I'm running into some sort of conflict between the Cartesian coordinates and the Configuration settings. But I don't know enough about how Fanuc path planning works to say for certain.
So, my questions:
is there some other cause for this behavior that I need to look into?
If I'm right about the Cartesian/Configuration conflict, what's the best way to handle it? Can I "remove" the Configuration values from a motion command, such that the path planner simply chooses the "least motion" path?
Can I do any of this in TP, or would it require KAREL?