Oh I see.
The original problem of my professor was that he wants to know the "continuous workspace" of the robot. He defines this as the space in which the TCP can connect all points without exactly those "unanticipated side effects", like the robot moving around Axis 4 to unwind it due to its limitations.
But doesn't that space change, cause it depends on the previous points (and the resulting axis position) if the next point is still "continuous" or not?
His solution to that was to only do it within one fixed SnT, so I wouldn't have that problem...
Display MoreHonestly, the least amount of work would be to use FRAME variables and ignore S&T entirely. When PTP motion is commanded to a position variable that lacks S&T, the robot will pick whatever S&T combination works for the Cartesian-space destination with the minimum amount of axis travel. So S&T get picked based on the joint pose the robot is starting from.
This can have unanticipated side effects, mostly the robot choosing non-intuitive paths from Point A to Point B if the A4 and A6 have gotten wound up, and the "intuitive" move would drive one of those axes beyond its soft limit. Or spinning the wrist can cause issues with your cabling, depending on how it's attached. But to a first approximation, you can probably do most of what you need just commanding PTP moves with no S&T values at all (not 0, undefined).
So, PTP {X 1000,Y 500,Z 1000, A 90, B 45,V -90} will execute a PTP move to those coordinates, with the robot motion planner picking the S&T of "least resistance", like water flowing downhill.
It is a good idea to have your path begin and end with an AXIS position, however, which has no ambiguity and can be used to "unwind" the wrist axes (and also "fix" any axes that have gotten into strange positions). It's standard practice to use the HOME position for this, as HOME (technically XHOME) is defined in axis angles, not Cartesian coordinates:
PTP XHOME
or
PTP {A1 0,A2 -90,A3 90,A4 0,A5 0,A6 0}
XHOME can be redefined to your own needs.