I am currently making the robot move to a specific point in the 3D world by creating a vcMotionTarget object with the position matrix of the component I want it to move to, and then running Controller.moveTo(MotionTarget).
I noticed that in some cases, this rotates A6 (the last axis) much more than I would want to. Is there a way to tell the controller to go to a position matrix with the TCP, but ignore the rotation of that matrix around its Z? I’m sure there is a better way to phrase the question, so I attached a video. There you can see the robot going to a position where the flange is pointing up. I would like the robot to go to that position, but with minimum rotation of A6.
I haven’t checked the exact specifics but in the software you can change the robot configuration. The object “vcMotionTarget” also has configuration mode where you can swap this around, perhaps this could solve the issue when you check different configurations?
There’s no direct way to disable one DOF on the target matrix. Maybe the easiest way in this case would be to override motion target’s 6th joint value with current value. That recalculates matrix and should keep 6th axis stationary on that motion. Code snippet below should do the trick
jvs = MotionTarget.JointValues
jvs = Controller.Joints.CurrentValue # assuming robot is at previous position when this code is executed
MotionTarget.JointValues = jvs
There are other ways to manipulate target matrices to reduce degree of freedoms for robot motions. This is done for example on some delta robot models on eCat. Deltas often have 3 or 4 DOFs and target matrix Z is forced to be vertical and X and Y are horizontal. You can do this sort of manipulation with vector cross product. Here’s a snippet from ABB IRB 360-1/1600 python kinematics:
# Force X and Y axes on root XY plane
# tool0_in_root is target matrix
VZ = vcVector.new(0, 0, 1)
N = tool0_in_root.N
N.Z = 0
O = VZ ^ N
tool0_in_root.N = N
tool0_in_root.O = O
tool0_in_root.A = VZ
At the start of snippet target matrix orientation is unrestricted. Its N (X) vector is projected to XY-plane (Z=0). It is normalized and then N and vertical vector VZ are used to build O (Y) vector with a cross product. By the nature of cross product this forces O to be on XY-plane as well. Finally vectors N, O and VZ are assigned to the matrix. uniform() call assures that matrix is orthonormal but it’s just a safety measure and in theory it should be unnecessary.
Here’s a visualization of the previous snippet’s target matrix orientation before and after the snippet: