Catching Kinematic Error
Dear colleagues,
I am quite new to RAPID programming, so I apologize if my question is too trivial.
I need a mechanism to catch kinematic errors if they happen and continue execution of the program. Example:
MODULE MyModule
VAR bool error_flag := FALSE;
PROC MyProc()
! The following line generates error 50065 "Kinematic error"
MoveAbsJ somewhere_out_of_reach, speed, zone, tool;
! I want the execution to continue here after the error
TPWrite "The show must go on!", \Bool=error_flag;
ERROR
TPWrite "Hello from error handler!";
error_flag := TRUE;
TRYNEXT;
ENDPROC
ENDMODULE
However, the ERROR handler is never executed -- the program simply stops and an error message is logged.
What am I missing?
I am quite new to RAPID programming, so I apologize if my question is too trivial.
I need a mechanism to catch kinematic errors if they happen and continue execution of the program. Example:
MODULE MyModule
VAR bool error_flag := FALSE;
PROC MyProc()
! The following line generates error 50065 "Kinematic error"
MoveAbsJ somewhere_out_of_reach, speed, zone, tool;
! I want the execution to continue here after the error
TPWrite "The show must go on!", \Bool=error_flag;
ERROR
TPWrite "Hello from error handler!";
error_flag := TRUE;
TRYNEXT;
ENDPROC
ENDMODULE
However, the ERROR handler is never executed -- the program simply stops and an error message is logged.
What am I missing?
0
Comments
-
I've done something similar;MODULE MyModule
VAR bool error_flag := FALSE;
PROC MyProc()! Create a temp jointtargetVAR jointtarget jntReach;! The jointtarget is crated from the position, somewhere_out_of_reached should be a robtargetjntReach := CalcJointT(somewhere_out_of_reach, tool\wobj);! If this point isn't reachable, error ERR_OUTSIDE_REACH or ERR_ROBLIMIT is raisedMoveAbsJ somewhere_out_of_reach, speed, zone, tool;
! I want the execution to continue here after the error
TPWrite "The show must go on!", \Bool=error_flag;
ERRORSkipWarn; !Don't raise an errorTPWrite "Hello from error handler!";
error_flag := TRUE;
TRYNEXT;
ENDPROC
ENDMODULE
0 -
If configuration is not a concern you can turn use ConfJ\Off for singularity issues, for out of reach positions I would verify that the robot can reach the points in RobotStudio prior to execution.0
-
xerim said:If configuration is not a concern you can turn use ConfJ\Off for singularity issues, for out of reach positions I would verify that the robot can reach the points in RobotStudio prior to execution.0
-
Actually, the CalcJointT function should error if the calculated Jointtarget is out of reach. If you still do not see it passing into your error handler you might try the RAISE instruction.
Lee Justice0 -
Do you have multitasking? You can restart the system in the background with multitasking0
-
0
-
You could try to configure a virtual analog output that is connected to the execution error you are experiencing, then create a procedure which restarts the system in the background when that signal is set to high.0
-
virtual analog output that is connected to the execution error0
-
Change your Error handler handler to what follows, more or less.
TEST ERRNO
CASE 50065:
TPWrite "blah blah";
TRYNEXT;
DEFAULT
Stop;
! Look in program data for ERRNO value, match it with predefined Error numbers
! This helps in finding unanticipated errors
ENDTESTLee Justice0 -
@lemster68 The problem is that the error handler NEVER FIRES in case of kinematic error!0
-
mkatliar said:@lemster68 The problem is that the error handler NEVER FIRES in case of kinematic error!0
-
I did mention in an earlier post that you may need to use the RAISE instruction for the error. Also, the best way to troubleshoot such things is to single step forward one line at a time instead of pressing the start button. Then you can see how the logic evaluates both TRUE or FALSE.Lee Justice0
-
Hello @lemster68,
have a look at step-by-step execution of the program: https://youtu.be/-XQimhLkxCQ
As I did mention before, in the case of kinematic error the program DOES NOT ENTER THE ERROR HANDLER. Therefore it does not matter what you put there.0 -
What is the error code 194?Lee Justice0
-
@lemster68 it is division by 0, obviously.0
-
I did not look at the values for those variables. There is no CalcJointT function there, which should throw an error if it is out of range. I would normally use the step forward button on the virtual TP.Lee Justice0
-
The internal error handler of the robot takes over when there is no error handler created by the user, which would indicate that your error handler is incorrectly defined. Take a look at page 74 of the Technical Reference Manual - Rapid Overview0
-
Try this:
MODULE MainModule FUNC bool CanRobReach(robtarget ToPoint, PERS tooldata Tool, \PERS Wobjdata wobj) VAR jointtarget jdump; jdump:=CalcJointT(ToPoint,tool\wobj?wobj); RETURN TRUE; ERROR SkipWarn; RETURN FALSE; ENDFUNC PROC main() CONST robtarget far_away:=[[10000,10000,10000],[0.0208901,-0.980874,-0.19283,-0.016298],[0,0,1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]; CONST jointtarget far_away2:=[[1000,1000,1000,1000,1000,1000], [9E9,9E9,9E9,9E9,9E9,9E9]]; IF CanRobReach(far_away, tool0) THEN MoveabsJ far_away2, v100,fine, tool0; ELSE TpWrite "error caught"; ENDIF ENDPROC ENDMODULE
0 -
OK, I made a bit of an oversight. I took what you said that the error number was, just as it reads and will be written into the error log as such. BUT, and this is a big but here, Rapid system error numbers are mostly 4 digits some are 3. The 50065 Kinematic error will go into the motion. So what will work is code like this:
PROC Routine1() MyJointTarget:=CalcJointT(myRobtarget,Tool0); Stop; ERROR TEST ERRNO CASE ERR_ROBLIMIT: TRYNEXT; CASE ERR_OUTSIDE_REACH: TRYNEXT; DEFAULT: Stop; ENDTEST ENDPROC
This is a very simple example, tested in RS, goes into error handler. Of course the robtarget is declared way out of reach.Lee Justice0 -
@xerim @lemster68
Below is the reply that I got from an ABB engineer:
Unfortunately it is not working like you try to do, MoveAbsJ instruction does not throw any errors when trying to travel to out of reach point.
MoveAbsJ can only handle
Usually robots work in their working envelope and never cross the range border. Only collision errors are handled.
You can go around and use function CalcJointT(). CalcJoinT() can throw errors like mentioned below or write Your own error handler.Please check if GetTrapData instruction is sufficient for you. This instruction should be located in second task to avoid stopping program execution in case of any error in Motion task.
Then you can use SocketCreate or SocketConnect to establish TCP/IP connection between robot controller and PC to exchange data.
So the bottomline is: there is no way to catch a kinematic error and continue the execution of the motion task.
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