# Tool rotation.  \[PickMaster 3\]

**URL:** <https://tech-community.robotics.abb.com/t/tool-rotation-pickmaster-3/3202>\
**Category:** PickMaster\
**Created:** [November 22, 2009, 11:14pm UTC](https://tech-community.robotics.abb.com/t/tool-rotation-pickmaster-3/3202 "2009-11-22T23:14:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MichalWk](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@MichalWk](https://tech-community.robotics.abb.com/u/MichalWk)\
**Post date:** [November 22, 2009, 11:14pm UTC](https://tech-community.robotics.abb.com/t/tool-rotation-pickmaster-3/3202/1 "2009-11-22T23:14:30Z")

</div>

Hi,

I’m using tool with external wires which not comes via 4 axis. Afer few picks robot is stopping (collision)due to wires which spinning around 4 axis. Gripper is rotating in the same diretion.

I need to lock/avoid rotation of the tool.  
How to do that?  
Br  
Michal

---

<div class="post-metadata">

**Author:** ![createch](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@createch](https://tech-community.robotics.abb.com/u/createch)\
**Post date:** [November 23, 2009, 9:28am UTC](https://tech-community.robotics.abb.com/t/tool-rotation-pickmaster-3/3202/2 "2009-11-23T09:28:32Z")

</div>

Hi Michal,

In this case you should right some Rapid code to avoid the rotating of the gripper in the wrong direction but when doing this you will loose some cycle time.

I have used this simple code:

I check the angle Z of the item and according to the angle I force the axis 4 to rotate in the direction I want.

PROC Pick(num Index)  
VAR num nAngleZ;  
VAR num nRotZ1;  
VAR num nRotZ2;  
VAR num nRotZ3;

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

Do not forget to add some code in the GotoRestartPos routine :

PROC GotoRestartPos()  
VAR num nJointPosRotZ;  
VAR speeddata vSpeed1:=[300,200,1000,1000];  
VAR robtarget TempPos1;

WaitTime 0.2;  
TempPos1:=CRobT(Tool:=tGripWObj:=Wobj0);  
TempPos1.trans.z:=SafePos.trans.z;  
MoveL TempPos1,vSpeed1,fine,tGripWObj:=wobj0;  
WaitTime 0.2;  
JointPos2:= CJointT();  
JointPos2.robax.rax\_4:=0;  
MoveAbsJ JointPos2,vSpeed1,fine,tGripWObj:=wobj0;  
tGrip:=tGrip3;  
FOR i FROM 1 TO MaxNoSources DO  
IF (ItmSrcData{i}.Used) THEN  
TriggL SafePos,VeryLowSpeed,ItmSrcData{i}.Nack,fine,tGripWObj:=wobj0;  
ENDIF  
ENDFOR  
InitIO;  
MoveL MaintPos,LowSpeed,fine,tGripWObj:=wobj0;  
ENDPROC

Succes,  
BR  
Fabrice

---

<div class="post-metadata">

**Author:** ![MichalWk](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@MichalWk](https://tech-community.robotics.abb.com/u/MichalWk)\
**Post date:** [November 23, 2009, 8:41pm UTC](https://tech-community.robotics.abb.com/t/tool-rotation-pickmaster-3/3202/3 "2009-11-23T20:41:49Z")

</div>

Hi,

Thanks for your advise. I will try to force rotation with your sample :).

BR  
Michal
