Hello,
I have a small robot setup with an IRB140.
I would like to be able to check if the robot is in the home position, in the rapid code.
If the robot is not in the home pos, the robot should reset, and run to the home pos.
The problem is that sometimes the operator for some reason will go in to the robot, push the release brake button and move the robot manually. We have tried telling them that they shouldn’t do this, but they keep doing it … ![]()
I have attached the code I use right now. it works actually really great.
But if they move the robot after the this program have been run once, the “pndo4_Resat” will be 1, and therefore it wont run the routine again.
BTW i’m pretty new to programming, and if this way of doing it, is totally wrong, please let me know ![]()
Thanks in advanced.
Martin Greve
IF pndo4_Resat=0 THEN
SR7_ResetRoutine;
ENDIF
PROC SR7_ResetRoutine()
pCurrentRobotPos_01:=CJointT();
MotionSup\On\TuneValue:=250;
pRobotResetTarget:=CRobT(\Tool:=Gripper\WObj:=wobj0);
IF pCurrentRobotPos_01.robax.rax_5<-10 THEN
pRobotResetTarget.trans.x:=550;
MoveL pRobotResetTarget,vVerySlow,fine,Gripper\WObj:=wobj0;
MoveJ p00Home,vVerySlow,fine,Gripper\WObj:=Conveyor;
IF nGripperFull=1 THEN
SR6_Reset_Dropoff;
ENDIF
nGripperFull:=0;
SetDO pndo4_Resat,1;
ELSE
pRobotResetTarget.trans.z:=300;
MoveL pRobotResetTarget,vVerySlow,fine,Gripper\WObj:=wobj0;
MoveJ p00Home,vVerySlow,fine,Gripper\WObj:=Conveyor;
IF nGripperFull=1 THEN
SR6_Reset_Dropoff;
ENDIF
nGripperFull:=0;
SetDO pndo4_Resat,1;
ENDIF
MotionSup\On\TuneValue:=150;
Stop;
ENDPROC