Error Handler / "If" statement help

I'll be the first to admit I don't have the required programming training to do this, which is why I'm seeking some help (still new to the company with having only the initial ABB programming class completed).

In short - we have a robot that has a gun attached (gas torch) and coats a part that is on an external axis, which rotates (spindle).
We got a torque collision error on the spindle, which faulted out the robot but kept the torch and coating material on, unbeknownst to the operator for an extended amount of time. This obviously ruined the part.

Speaking with ABB tech support - they offered some guidance on using an error handler within the routine and sent me some manuals. While this may prove helpful, I'm not really sure how to word it or go about setting things up, and where exactly to put it (assuming in the PROC Coat_Roll, listed below).

Would greatly appreciate any guidance with that. But can't I also just use an "IF" statement to say that if the spindle stops, shut off all inputs/outputs, similar to an E-stop situation?

Any information would be GREATLY appreciated!

Main routine and sub-routine listed:

PROC main()
SetDO TPstop, high;
Running:=FALSE;
DoneCoating:=FALSE;
    TPErase;
    TPWrite "Walk In Mode Program Start";
    ActUnit Spindle;
    Init_IO;
    Home_Walk_in;
    Get_Data;
    regPassCount:=NUM_PASSES;
    TPWrite "Robot waiting Cycle Start";
    TPWrite "Robot Cycling";
    Coat_Roll;
    TPWrite "Done";
    Init_IO;
    TPErase;
    TPWrite "Walk In Mode Program Stop";
    Home_Walk_in;
    DeactUnit Spindle;
    Stop;
  ENDPROC


PROC Coat_Roll()
    Calculations;
    Start_Roll;
    Powder_on;
    SetDO doTorchCoolCtrl, high;
    MoveL pStart, vTrav_Rapid, fine, tool2;
    IF regTravSpeed=0 THEN
      WaitTime NUM_PASSES;
      GOTO D;
    ENDIF
    WHILE regPassCount>0 DO
      IF regPassCount>0 THEN
LR:=1;
Running := TRUE;
    IF PassTime > 500 THEN
FOR L FROM 1 TO n - 1 DO
L2:=L;
        MoveL pMid{L}, v5\V:=TRAV_MMPS, z1, tool2;
ENDFOR
    ENDIF
L2:=0;
        MoveL pStop, v5\V:=TRAV_MMPS, z1, tool2;
Running := FALSE;
        Pass_count;
      ENDIF
      IF regPassCount>0 THEN
LR:=0;
Running := TRUE;
    IF PassTime > 500 THEN
FOR L FROM n-1 TO 1 STEP -1 DO
L2:=L;
        MoveL pMid{L}, v5\V:=TRAV_MMPS, z1, tool2;
ENDFOR
    ENDIF
L2:=0;
        MoveL pStart, v5\V:=TRAV_MMPS, z1, tool2;
Running := FALSE;
        Pass_count;
      ENDIF
    ENDWHILE

Comments

  • EricH
    EricH Germany
    If the error happens in Coat_Roll() then you handle the error like this:
    PROC Coat_Roll()
    .
    .
    .
    ERROR
    IF(ERRNO= {torque collision error nr})
    ShutDownOutputs;
    ENDIF
    ENDPROC
  • EricH
    EricH Germany
    An IF-statement would not be recognized, because the program stops after an unhandeled error.
  • j_proulxFB
    j_proulxFB Watertown, WI USA
    Use a Stop Event Routine. This will run a routine when the robot program is Stopped. Could use QStop also. This is a Controller System parameter. The code the Event Routine to turn off the torch. See section 3.6 in the System Parameter manual
  • I would probably create a virtual signal that the program controls, and cross connect that with a systeminput that is high when the task is executing and output it to the torch. That would give the result that the torch can only ever be on if the task is executing. Let me know if you need guidance.
    //Markus Näslund
  • Eskatsaros
    Eskatsaros new castle, PA
    EricH said:
    If the error happens in Coat_Roll() then you handle the error like this:
    PROC Coat_Roll()
    .
    .
    .
    ERROR
    IF(ERRNO= {torque collision error nr})
    ShutDownOutputs;
    ENDIF
    ENDPROC
    Thank you all for the input - Does it matter where this goes in the routine, or just as long as its in there?
  • Eskatsaros
    Eskatsaros new castle, PA
    Also, is there a general fault statement that I can use to shut down everything regardless of what the error says?
  • Eskatsaros
    Eskatsaros new castle, PA
    Use a Stop Event Routine. This will run a routine when the robot program is Stopped. Could use QStop also. This is a Controller System parameter. The code the Event Routine to turn off the torch. See section 3.6 in the System Parameter manual
    I will look at this as well - thank you!

  • EricH
    EricH Germany
    Does it matter where this goes in the routine, or just as long as its in there?
    It needs to be at the end of the Routine for syntax reasons, it will only be executed, when the error happens.

    If you want to make a general error handling then I would suggest the other solutions here. Whether you use an event routine or a virtual signal doesn't matter, although an event routine is a lot more comfortable.