Trap routine not executing
csmith
✭
Hi,
I want to setup a trap routine to execute when the robot runs into a Motion Error.
In my motion task, I'm setting up the interrupt and tying it to a DO;
This is my TRAP:
You can see, I want to move to a safe home position in case we get a Motion Error.
In my main() I ultimately call an EGMRunPose and have the robot controlled by an EGM data-stream.
Once the robot get's into a singularity, Dynamic load too high or joint out of range error, I can see the DO toggle,
but I'm getting a 40210 - Interrupt removed from queue error, which means the TRAP routine won't run.
I want to setup a trap routine to execute when the robot runs into a Motion Error.
In my motion task, I'm setting up the interrupt and tying it to a DO;
<div>PROC SetupInterrupts() IDelete intOverride; CONNECT intOverride WITH tOverride; ISignalDO errorsig, 1, intOverride; TPWrite "Interrupt Setup"; ENDPROC</div>
This is my TRAP:
<div>TRAP tOverride ISleep intOverride; CONST jointtarget homepos:=[[0,10,20,30,40,50],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]; TPWrite "Interrupt fired"; MoveAbsJ homepos,v100,fine,tool0; IWatch intOverride; ENDTRAP</div>
VAR intnum intOverride:=0is defined in my System Module
You can see, I want to move to a safe home position in case we get a Motion Error.
In my main() I ultimately call an EGMRunPose and have the robot controlled by an EGM data-stream.
Once the robot get's into a singularity, Dynamic load too high or joint out of range error, I can see the DO toggle,
but I'm getting a 40210 - Interrupt removed from queue error, which means the TRAP routine won't run.
What am I missing?
Thank you
Tagged:
0
Comments
-
It seems like a TRAP is only executing if the Program is running.
Am I out of luck after a Motion Error which stops the program execution and turns off the motors ?
How can I recover from a situation like that? Just turning Motors back on doesn't seem to work as I immediately trip the same error again.
Right now I have to go to Manual mode, jog out of the Singularity/Joint out of range, go back to automatic and restart.
This works but I was hoping there is a more elegant solution.
Thanks0 -
You are correct the program has to be running to execute an interrupt.
You need to catch the error (if it is a recoverable error) in an error handler at the end of the executing procedure/routine.
I could not find an errnum (error number) for singularity, but for joint out of range it is ERR_ROBLIMIT (yes the errnum is text not a number!) - but instead of trying to trap an individual error you could just respond to any error and return the robot to the home position as per your trap routine code above.
There is help on error handlers in the RAPID overview manual under the basic programing chapter->error recovery.
0 -
Or you check in a background task for the state of that output signal and try to handle it there. Of Course you can not move the robot from a background task, but you can handle signals for example.For example, resetting the error by signal (system input and cross connection) and then call an interrupt by signal.0
Categories
- All Categories
- 5.5K RobotStudio
- 395 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings