RobotStudio event

Can Anyone help me through this recovery?

We found that on the second press of a homing button the program completely skips over the IF checklocations and goes straight to the else. Since the else sends the robot to Homepos, this is causing unwanted collisions. Full routine is attached. 


Program for robot 1 goes as follows:


PROC R1_Recover()


SyncSpeedOverride;

WaitDO doR2_HomePos,1;

TPErase;

TPWrite "R1 Recovery";


!***************

! HOME RECOVERY

!***************


IF CheckLocation(900,pHome,tGripper)=TRUE THEN

TPWrite "Recovery to Home Position";

HomePos;


!*****************************

! PICK PALLET POUNCE RECOVERY

!*****************************


ELSEIF CheckLocation(400,pPick_Pounce,tGripper\Loc2:=pPick_Pounce10)=TRUE THEN

TPWrite "Recovery From Pick Pounce";

MoveJ pPick_Pounce,v_approach,z_approach,tGripper;

HomePos;


------

------


ELSEIF CheckLocation(1000,pR1_SyncApp,tGripper) THEN

TPWrite "Recovery From Sync Approach";

HomePos;


ELSE

TPWrite "Program is Outside of Predefined Recovery Parameters:";

TPWrite "Manually Jog Robot to a Known Position or to Home.";

!Stop;

HomePos;

ENDIF

ENDPROC

Files

Answers

  • Hi  Jespinoza,

    By second press, do you mean if the user presses the button while the homing routine is executing?

    Without knowing the code in the CheckLocation function, it is likely something to do with the robot moving after the first press and then the CheckLocation having an issue because the robot is moving and only returning FALSE, which is causing it to skip to the last line. 

    One fix for this is to use StopMove, ClearPath & StartMove in the code and waiting for half a second for the robot to stop before checking location and issuing the new move command.

    Hope this helps, 

    Harry