path recovery after e-stop was triggered
Hello all,
Using robot ware 5.16, path recovery option available.
Trying to program the robot to go to Service_pos after E-stop was pressed and reset, and automatically go back and continue work where he left off.
Tried:
Configuration - I/O:
doEStopTriggered, digital output.
MODULE MainModule
..........
VAR errnum ERR_MY_ERR:=-1;
VAR robtarget p1;
Using robot ware 5.16, path recovery option available.
Trying to program the robot to go to Service_pos after E-stop was pressed and reset, and automatically go back and continue work where he left off.
Tried:
Configuration - I/O:
doEStopTriggered, digital output.
MODULE MainModule
..........
VAR errnum ERR_MY_ERR:=-1;
VAR robtarget p1;
PROC Path_10()
Bookerrno Err_MY_err;
IF DOutput(doEStopTriggered)=1 RAISE ERR_MY_ERR;
ArcLStart Target_10,v1000,seam1,weld1,fine,Weldgun\WObj:=Workobject_1;
ArcL Target_20,v1000,seam1,weld1,z10,Weldgun\WObj:=Workobject_1;
ArcL Target_30,v1000,seam1,weld1,z10,Weldgun\WObj:=Workobject_1;
ArcL Target_40,v1000,seam1,weld1,z10,Weldgun\WObj:=Workobject_1;
ArcL Target_50,v1000,seam1,weld1,z10,Weldgun\WObj:=Workobject_1;
ArcLEnd Target_50,v1000,seam1,weld1,fine,Weldgun\WObj:=Workobject_1;
ERROR
IF ERRNO=ERR_MY_ERR THEN
StopMove;
StorePath;
SetDO doEStopTriggered,0;
p1:=CRobT(\Tool:=weldgun\WObj:=Workobject_1);
MoveL Service_Pos,V1000,z20,Weldgun\Wobj:=Workobject_1;
MoveL p1,v1000,fine,Weldgun\Wobj:=Workobject_1;
RestoPath;
StartMoveRetry;
ENDIF
ENDPROC
System Modules (for the digital output)
When i reset the E-stop, and press play the robot does the error correction but loops over and over inside off the error handler.
If instead of StartMoveRetry i use Return the robot starts welding from the beginning, and not where he left off.
Can you please help me, i am doing something wrong.
System Modules (for the digital output)
MODULE Events(SYSMODULE)
PROC QStopTriggered()
SetDO doEStopTriggered,1;
Exitcycle;
ENDPROC
ENDMODULE
When i reset the E-stop, and press play the robot does the error correction but loops over and over inside off the error handler.
If instead of StartMoveRetry i use Return the robot starts welding from the beginning, and not where he left off.
Can you please help me, i am doing something wrong.
0
Best Answers
-
Try a "long jump":Main()
...
BookErrNo err_move_stop;
IDelete intETriggered;
CONNECT intETriggered WITH stop_weld;
ISignalDO doEStopTriggered,0,intETriggered;
TRAP stop_weld
StopMove\Quick;
RAISE err_move_stop;
ERROR
RAISE ;
ENDTRAP
PROC Path_10()
...
ArcLStart *,V100,smh,wld_h30n0\Weave:=wv_h30n0,fine,tool_w50022 \Wobj:=BT1\Track:=track_h\SeamName:="seam1";
...
ArcLEnd *,V200,smh,wld_h30n0\Weave:=wv_h30n0,fine,tool_w50022 \Wobj:=BT1\Track:=track_h;
...
ERROR (err_move_stop)
IF ERRNO=err_move_stop THEN
err_coll_routine;
RETRY;
ENDIF
ENDPROCYour E-Stop will stop the robot(if it is a emergency stop as I understood). If you reset (doEStopTriggered=0) an interrupt will be activated whichcalls a trap-routine that generates an error. The error is handed over to the error handler of the current procedure. There your handler routine (here replaced by err_coll_routine) will be executed andthe controller will continue with the current instruction (retry).
0 -
OK, but after start he should write trap and enter the error-section?
0 -
Ha, I forgot: Instead of just ERROR for the error-section it must be ERROR(Err_MY_err) !!!
0 -
it writes Trap when i start path_10
where should i put the Error(Err_My_err)?0 -
In path_10, instead ERROR you put Error(Err_My_err). This is necessary to catch a raised error.
0 -
the same, continues where he left off, with out entering the gun cleaning routine0
-
He writes "trap"?0
-
I neglected to mention that the trap can execute after e-stop if it is set to safe.Lee Justice0
-
Good tip. Because we stopp, the interrupt might be ignored.So change the command to ISignalDO \SingleSafe,doEStopTriggered,1,intETriggered;
0 -
YesLee Justice0
-
i start the program, it starts welding, i press the E-stop and reset it, press play, does the error recovery goes to service position, the robot goes back where he left off, the pointer moves back to path_10 where he left off, and gives an error : 50359: Path Recorder on StorePath level not allowed, and stops the program execution0
-
if i use PathRecStop; in the error handler, then the program execution stops with: 10020: Execution error stateDescriptionThe program execution in task T_ROB1 has been stopped due to a spontaneous error.0
-
ERROR (ERR_MY_ERR)IF ERRNO=ERR_MY_ERR THENStopMove;PathRecStop;StorePath;SetDO doEStopTriggered,0;p1:=CRobT(\Tool:=weldgun\WObj:=Workobject_1);MoveL Service_Pos,V1000,z20,Weldgun\Wobj:=Workobject_1;ArcLStart p1,v1000,seam1,weld1,fine,Weldgun\WObj:=Workobject_1;RestoPath;StartMoveRetry;ENDIF
so i wrote it like this , and it works like a charm, but only once! if i pres the E-stop again, it just starts where it left off, does not enter the error handler0 -
MODULE Event(SYSMODULE)PROC QStopTriggered()SetDO doEStopTriggered,1;ENDPROCENDMODULEPROC main()IDelete intETriggered;CONNECT intETriggered WITH stop_now;ISignalDO\SingleSafe,doEStopTriggered,1,intETriggered;Path_10;ENDPROC
PROC Path_10()ArcLStart Target_10,v1000,seam1,weld1,fine,Weldgun\WObj:=Workobject_1;ArcL Target_20,v1000,seam1,weld1,z10,Weldgun\WObj:=Workobject_1;ArcL Target_30,v1000,seam1,weld1,z10,Weldgun\WObj:=Workobject_1;ArcL Target_40,v1000,seam1,weld1,z10,Weldgun\WObj:=Workobject_1;ArcL Target_50,v1000,seam1,weld1,z10,Weldgun\WObj:=Workobject_1;ArcLEnd Target_50,v1000,seam1,weld1,fine,Weldgun\WObj:=Workobject_1;
ENDPROCTRAP stop_nowVAR robtarget stop_pos;StopMove;PathRecStop;StorePath;GetSysData Weldgun;GetSysData Workobject_1;stop_pos:=CRobT(\Tool:=Weldgun\WObj:=Workobject_1);MoveL Offs(stop_pos,0,0,20),v50,fine,Weldgun\WObj:=Workobject_1;MoveL Service_Pos,V1000,z20,Weldgun\Wobj:=Workobject_1;MoveL stop_pos,v1000,fine,Weldgun,\WObj:=Workobject_1;SetDO doEStopTriggered,0;RestoPath;StartMove;ENDTRAPENDMODULE
i also wrote it like this and it works perfect, but only once, if i press e-stop again than it wont enter the trap routine, it just start welding from where it left of like after a normal e-stop0 -
so we are on the right path, but not quit there yet ), why cant i find this information in any rapid manual? am i not looking in the right manuals? all the examples that i find in the manuals are for normal error handling nothing related to E-stop. How do other users handle an E-stop trigger by accident (like walking into light curtains, or opening the safety door by force, or just pressing the E-stop by accident)
Thank you so much for your help guys!!!!0 -
It works only once because of the line that enables the interrupt for the digital output:
ISignalDO\SingleSafe,doEStopTriggered,1,intETriggered;
The "\SingleSafe" argument makes it possible to activate the interrupt after resuming the program (exactly what you were looking for). However the Single part means the interrupt will only be triggered once. From the technical reference manual (3HAC050917-001) about the Single argument:
Specifies whether the interrupt is to occur once or cyclically. If the argument Single is set, the interrupt occurs once at the most. If the Single and SingleSafe arguments is omitted, an interrupt will occur each time its condition is satisfied.To work around this, you can delete and reconnect the interrupt at the top of your TRAP routine (stop_now), like this:
IDelete intETriggered;
CONNECT intETriggered WITH stop_now;
ISignalDO\SingleSafe,doEStopTriggered,1,intETriggered;
About the question for good RAPID documentation, check the RAPID Overview manual (3HAC050947-001)
0 -
Thank you Nicola!
Just read about the singlesafe, found it in the rapid manual
If i set it like you sad then after the trap routine start path 10 all over again , does not start where it left off
Had an exitcycle at the end of the trap routine (was experimenting with it) that is why it started path 10 from begining.
Deleted the exitcycle, and now it works 100% every time i pres E-Stop does the trap routine then returns from where it left off.
Thank you guys for your help !!!!!!!!!!!!!!!!!
0 -
Hallo, thats right. You have to use \singlesafe switch to have the interrupt working after a quick stop.But it will work only once, so you have to reconnect in the trap-routine.Your case is special, because you intend to go to a cleaning position after the e-stop.Usually you just continue bei pressing start. Especially when welding, the robot will perform a restart a little bit backwards automatically (if configured in the error handler).A description of the method you will find in Technical reference Manual-Rapid Kernel 3HAC16585-1, , Revision G
Controller software IRC5 RobotWare 5.12.
0 -
And if you modify the TRAP routine like this?.TRAP stop_nowVAR robtarget stop_pos;StopMove;PathRecStop;StorePath;IDelete intETriggered;SetDO doEStopTriggered, 0;GetSysData Weldgun;GetSysData Workobject_1;stop_pos := CRobT(\Tool:=Weldgun\WObj:=Workobject_1);MoveL Offs(stop_pos,0,0,20), v50, fine, Weldgun \WObj:=Workobject_1;MoveL Service_Pos, v1000, z20, Weldgun \Wobj:=Workobject_1;MoveL stop_pos, v1000, fine, Weldgun, \WObj:=Workobject_1;RestoPath;CONNECT intETriggered WITH stop_now;ISignalDO \SingleSafe, doEStopTriggered, 1, intETriggered;StartMove;ENDTRAPEDIT: Nevermind, I see that it's working now, super!0
Answers
-
Thank you for your reply, i tried it , and it does not do anything0
-
Your e-stop is a emergency stop of the robot where you set doEStopTriggered to 1 automatically?
0 -
This is how i get the digital output: doEStopTriggered to become 1, when the Emergency stop button is pressed
MODULE Events(SYSMODULE)PROC QStopTriggered()SetDO doEStopTriggered,1;Exitcycle;ENDPROC- Controller configuration, type Event routine.
- Right click to create a new event routine.
- Routine: QStopTriggered
- Event: QStop
- Sequence number: 0
- Task: T_ROB1
- All tasks: No
- All motion tasks: NO
0 -
I understand. Let's skip trap and try something simple.VAR errnum err_move_stop:=-1;
...
! your event routine
PROC QStopTriggered()
RAISE err_move_stop;
ERROR
RAISE;
ENDPROC
Main()
...
BookErrNo err_move_stop;
...
! your welding routine
PROC Path_10()
...
ArcLStart *,V100,smh,wld_h30n0\Weave:=wv_h30n0,fine,tool_w50022 \Wobj:=BT1\Track:=track_h\SeamName:="seam1";
...
ArcLEnd *,V200,smh,wld_h30n0\Weave:=wv_h30n0,fine,tool_w50022 \Wobj:=BT1\Track:=track_h;
...
ERROR (err_move_stop)
IF ERRNO=err_move_stop THEN
err_coll_routine;! your error routine
RETRY;
ENDIF
ENDPROCEvent routine contains no exitcycle.0 -
i get an error in the event routine: unhandled error0
-
The ERROR(err_move_stop)- section must be in all routines where a QStop can happen.
0 -
i put the error(err_move_stop) section in all the routines,
and now i have an error when i press the e_stop: Task: T_ROB1The program is executing in an EVENT routine. It is not allowed to execute the instruction MoveL in an EVENT routine.
0 -
mmh, I checked the code as above on my controller and it runs. Your event-routine contains only the code from my example ? - there should be anything else in.So when you make your MoveL you have already left Proc QStopTriggered.0
-
This is what i have found in the Technical reference manualRAPID Instructions, Functions and Data types:RestoPath cannot be executed in a RAPID routine connected to any of following specialsystem events: PowerOn, Stop, QStop, Restart or Step.
Can i use anything else to store and restore the interrupted path ?0 -
Yes the restriction is like that. But in your event-routine there is no movement or restopath, it just generates an error and leaves. What is your RW version?0
-
5.160
-
yes but i have in the gun cleaning procedure store and resto path0
-
Ok, you have to do so when interrupting a path. I do not quite understand why the controller is announcing that he is still in the event-routine when it is already finished (after its error-statement).Try to go back to the first proposal with interrupt and trap.But do the trigger not on low but on high : ISignalDO doEStopTriggered,1,intETriggered;
0 -
its the same, loops inside the gun_cleaning process0
-
But you have removed : IF DOutput(doEStopTriggered)=1 RAISE ERR_MY_ERR; from your welding routine?
0 -
if i remove that, then it continues the welding from the beginning , and does not do the gun cleaning process0
-
Its because of ExitCycle I suppose, where it uses the error-section inside main. A "Retry" there will call Path_10 again. Loop inside the gun-cleaning means there is another error which end up always there.Your code should look like that now:MODULE Events(SYSMODULE)
PROC QStopTriggered()
SetDO doEStopTriggered,1;
ENDPROC
ENDMODULE
Main()
...
IDelete intETriggered;
CONNECT intETriggered WITH stop_weld;
ISignalDO doEStopTriggered,1,intETriggered;....TRAP stop_weld
StopMove\Quick;
RAISE ERR_MY_ERR;
ERROR
RAISE ;
ENDTRAP
...
path_10;
....
ENDPROC
PROC Path_10()
Bookerrno Err_MY_err;
ArcLStart Target_10,v1000,seam1,weld1,fine,Weldgun\WObj:=Workobject_1;
ArcL Target_20,v1000,seam1,weld1,z10,Weldgun\WObj:=Workobject_1;
ArcL Target_30,v1000,seam1,weld1,z10,Weldgun\WObj:=Workobject_1;
ArcL Target_40,v1000,seam1,weld1,z10,Weldgun\WObj:=Workobject_1;
ArcL Target_50,v1000,seam1,weld1,z10,Weldgun\WObj:=Workobject_1;
ArcLEnd Target_50,v1000,seam1,weld1,fine,Weldgun\WObj:=Workobject_1;
ERROR
IF ERRNO=ERR_MY_ERR THEN
StopMove;
StorePath;
SetDO doEStopTriggered,0;
p1:=CRobT(\Tool:=weldgun\WObj:=Workobject_1);
MoveL Service_Pos,V1000,z20,Weldgun\Wobj:=Workobject_1;
MoveL p1,v1000,fine,Weldgun\Wobj:=Workobject_1;
RestoPath;
StartMoveRetry;
ENDIFThe error-section muste be in all path_ii.0 -
i cant put the Trap routine in the PROC MAIN () it says syntax error0
-
so i put it after PROC MAIN ()0
-
and it does nothing, i press the emergency stop, the robot stops, when i release it it continues the welding from where it left off, and the doEstopTriggered stays 10
-
i wrote everything as you said0
-
its like is not executing the Trap routine0
-
OK, so it is not entering the error section. Add "SetDO doEStopTriggered,0;"
after the bookerrno and a TPWrite "Trap"; in the trap routine that we can check if it is executed.
0 -
writes on the teach pendant Trap when i start the program and sets doEstopTriggered to 0 at the beginning of path_10, it does not enter the gun cleaning routine .0
-
When the E-stop is pressed, program execution stops. A trap will not execute unless it is in a background task.Lee Justice0
-
When you activate e-stop in the middle of welding, what happens?
0 -
the robot stops0
-
the pointer remains in Path_100
-
if i add exitcycle or return to the event routine the pointer jumps to main0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 798 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings