This article will go through a simple way to get a robot out of a location after a crash or emergency stop situation. This requires the programmer to think about how the robot will escape the locations it may be in during its normal operations and some considerations for what the robot should do if someone has driven it to far. In this engineers opinion if you are dumb enough to drive and contort the robot into a state where the home program is struggling to get the robot home then you have enough skill set to get the robot out of the sticky mess you have made…. Nevertheless here is the template that I have gotten from Spencer Rolfson that I have found works well for me.
Here is the code:
UFRAME_NUM=1UTOOL_NUM=1PR[99]= LPOS! CHECK ZONE 1IF (PR[99,1]<2000 AND PR[99,1]>1500 AND PR[99,2]<(-791) AND PR[99,2]>(-2329) AND PR[99,3]>(-187) AND PR[99,3]<2097,JMP LBL[10]!IF NOT IN ANY ZONESPR[90]=PR[100]PR[90,3]=2500J PR[99]100% FINE OFFSET, PR[90]J PR[1] 100% FINEJMP LBL [1]!ESCAPE ZONE 1LBL[10]PR[90]=PR[100]PR[90,1]=1750J PR[99]100% FINE OFFSET, PR[90]PR[90,2]=(-1400)J PR[99]100% FINE OFFSET, PR[90]J PR[1] 100% FINELBL[1]CALL HOME
Alright that was a lot of code for the program to get us into a safe location lets go over what is happening in that code now!
So the first two lines we are setting our user frame and tool frame basically telling the robot what tool we have and what coordinate system we will be using.
PR[99]= LPOS
This line is really cool it sets the current position of the robot and places it in our PR[99] register.
IF (PR[99,1]<2000 AND PR[99,1]>1500
AND PR[99,2]<(-791) AND PR[99,2]>(-2329)
AND PR[99,3]>(-187) AND PR[99,3]<2097,
JMP LBL[10]
Then we use a very large if statement that takes the current value of the robot position and then decides if it is in said zone and then we can jump to a label that takes us to the motion path to get out of the current zone.
This if statement is true we jump to the correct exit movement if its not we just go to the next movement, the benefit to this process is we can have lots of different zones with different motions that are required and we can have the robot safely get out of whatever sticky location that it is in.
Leave a comment