Tool rotation [PickMaster 3]

Have the problem with the tool rotation. I use the gripper to pick the square part, angle variation set from -180 to 180, if angle between the parts greater than 180 degrease, pipe will rotate around the head.

I find some code on this forum and have few questions:

Z,PickTarget.RobTgt.rot - it?_Ts this the same value what is in Vision Analyzer?

Can someone explain about all this values please? Thanks

nRotZ1:=0;

nRotZ2:=0;

nRotZ3:=0;

nAngleZ:=EulerZYX(,PickTarget.RobTgt.rot);

IF nAngleZ>-135 and nAngleZ<-45 THEN

!nothing todo

ELSE

nRotZ1:=-130;

nRotZ2:=-70;

nRotZ3:=-180;

ENDIF

TriggLConc,RelTool(PickTarget.RobTgt,0,0,-ItmSrcData{Index}.OffsZRz:=nRotZ1),MaxSpeed,ItmSrcData{Index}.VacuumAct1,z5,tGripWObj:=WObjPick;

MoveLConc,PickTarget.RobTgt,LowSpeed,z1Inpos:=ItmSrcData{Index}.TrackPoint,tGripWObj:=WObjPick;

GripLoad ItemLoad;

MoveL RelTool(PickTarget.RobTgt,0,0,-60Rz:=nRotZ2),LowSpeed,z1,tGripWObj:=WobjPick;

TriggL RelTool(PickTarget.RobTgt,0,0,-ItmSrcData{Index}.OffsZRz:=nRotZ3),LowSpeed,ItmSrcData{Index}.AckT2:=PickDone,z5,tGripWObj:=WObjPick;

ENDPROC

Hi
The angle given by nAngleZ:=EulerZYX(,PickTarget.RobTgt.rot); is generally the same as the VisionAnalyzer, but it is not the same as the joint angle, due to TCP orientation and conveyor orientation.

This code looks like it is forcing the gripper to three given angles for approach and depart, if the pick point angle is lower than -135 and higher than -45. But it doesn’t affect the pick point itself.

/Mats

Hi Mats. Thanks for answer, so what is best way to rotate the tool in same direction all time, its any code examples for it? Thanks.

Look at the utility module in this post:
http://forums.robotstudio.com/forum_posts.asp?TID=3889&KW=UtilityMW%2E5%2E13%2Ezip&PID=12923#12923
It has a procedure called “SetToolRot” which limits the orientation.

/Mats