RobotStudio event

Home movement of robots

Options
Hello, we're working on a big project where we want our robots to be able to get to their home position in a safe way.

The robots have about three movement procedures each, and a few of them are very long.
In another project I used TrigX to assign numbers to my positions, which worked fine but resulted in a very long reference procedure.
I've also looked into PathRecMoveBwd, but the usage of this may result in collisions where we fetch material from feeders.

How do the rest of you programmers solve problems like this? :)
Tagged:

Comments

  • soup
    soup ✭✭✭
    Options
    When possible, I use world zones (and tool I/O when relevant) to choose a different way home based on the current position of the robot.

    In complicated or unpredictable situations, I've had to make a human jog into a safe-to-home position before enabling the home button.
  • VictorAx
    Options
    soup said:
    When possible, I use world zones (and tool I/O when relevant) to choose a different way home based on the current position of the robot.

    In complicated or unpredictable situations, I've had to make a human jog into a safe-to-home position before enabling the home button.
    Isn't world zones an option?
  • DenisFR
    DenisFR ✭✭✭
    Options
    Hello,
    If your positions are not so close, you can check if current is near each of them.
  • VictorAx
    Options
    DenisFR said:
    Hello,
    If your positions are not so close, you can check if current is near each of them.
    Something like this?
    IF CRobT() = p10 THEN
                DoThis;
            ELSE
                DoThat;
            ENDIF

  • Micky
    Micky ✭✭✭
    edited June 2018
    Options
    Hello,

    the RobotWare Option "Machine Tending" provides a solution for the Homerun by using special move instructions and the use of a homerun strategy, so that the robot drop a part, before it moves to its home position.

    See page 112 in the manual:

    BR
    Micky

  • lemster68
    lemster68 ✭✭✭
    Options
    I will share some code I wrote a little while back, you can maybe use it in your recovery strategy.

    MODULE Utility
      VAR string stRobt:=stEmpty;
      VAR string stClosestPoint;
      CONST num nMaxRecoverDist:=2000;
      PERS tooldata tCheck;
      PERS string stToolName;
      TASK PERS wobjdata wobjCheck:=[FALSE,TRUE,"",[[0,0,0],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];
      PERS string stWobjName:="wobj0";
      
      PROC FindNearestPoint()
        VAR robtarget pCurrentPosition;
        VAR num n12Distance:=10000;
        VAR robtarget checkrobt;
        VAR datapos block;
        
        GetSysData tCheck\ObjectName:=stToolName;
        GetSysData wobjCheck\ObjectName:=stWobjName;
        pCurrentPosition:=CRobT(\Tool:=tCheck\WObj:=wobjCheck);
        SetDataSearch "robtarget"\InMod:="R1_Data";
        WHILE GetNextSym(stRobt,block\Recursive) DO
          GetDataVal stRobt\TaskName:="T_ROB1", checkrobt;
          ! Compare current robot position with stored robtarget
          ! If it is less than maximum recovery distance store the name
          ! and distance from current position.
          IF (Distance(checkrobt.trans,pCurrentPosition.trans) < nMaxRecoverDist) THEN
            ! Check to see if point is within Maximum recovery
            ! but maybe farther than last compared point.
            ! Should update n12Distance if closer point is found.
            IF Distance(checkrobt.trans,pCurrentPosition.trans) < n12Distance THEN
              n12Distance:=Distance(checkrobt.trans,pCurrentPosition.trans);
              stClosestPoint:=stRobt;
            ELSE
              ! Do nothing, point is farther from last found point
              ! within max recover distance nMaxRecoverDist.
            ENDIF
          ENDIF
        ENDWHILE
        IF n12Distance >= nMaxRecoverDist THEN
          TPWrite "Nearest taught point is Not Found!!!  Caution!!!";
          TPWrite "Not close enough to a known taught point!!!";
          TPWrite "Active tool used to check was " + stToolName;
          TPWrite "Active work object used to check was " + stWobjName;
        ELSE
          TPWrite "Nearest taught point is: " + stClosestPoint;
          TPWrite "Distance from current position is: "\Num:=n12Distance;
          TPWrite "Active tool used to check was " + stToolName;
          TPWrite "Active work object used to check was " + stWobjName;
        ENDIF
      ENDPROC

    ENDMODULE
    Lee Justice
  • DenisFR
    DenisFR ✭✭✭
    Options
    You can mix @lemster68 solution with that:

    &nbsp; FUNC bool IsRobotNear(robtarget pToCheck\PERS tooldata tTool\PERS wobjdata wObj\num nTrans\num nRot)<br>&nbsp;&nbsp;&nbsp; VAR robtarget p_Current;<br>&nbsp;&nbsp;&nbsp; VAR pos pos_Gap;<br>&nbsp;&nbsp;&nbsp; VAR num n_Trans:=10;<br>&nbsp;&nbsp;&nbsp; VAR num n_Rot:=0.1;<br>&nbsp;&nbsp;&nbsp; VAR bool b_Near:=False;<br>&nbsp;&nbsp;&nbsp; VAR orient or_Res;<br>&nbsp;&nbsp;&nbsp; VAR pose pose_Inv:=[[0,0,0],[1,0,0,0]];<br><br>&nbsp;&nbsp;&nbsp; IF Present(nTrans) n_Trans:=nTrans;<br>&nbsp;&nbsp;&nbsp; IF Present(nRot) n_Rot:=nRot;<br>&nbsp;&nbsp;&nbsp; !<br>&nbsp;&nbsp;&nbsp; p_Current:=CRobT(\Tool?tTool\WObj?wObj);<br>&nbsp;&nbsp;&nbsp; b_Near:=(Distance(p_Current.trans,pToCheck.trans) < n_Trans);<br>&nbsp;&nbsp;&nbsp; !<br>&nbsp;&nbsp;&nbsp; pose_Inv.rot:=pToCheck.rot;<br>&nbsp;&nbsp;&nbsp; pose_Inv:=PoseInv(pose_Inv);<br>&nbsp;&nbsp;&nbsp; or_Res:=pose_Inv.rot * p_Current.rot;<br>&nbsp;&nbsp;&nbsp; !<br>&nbsp;&nbsp;&nbsp; b_Near:=b_Near AND Abs(EulerZYX(\X,or_Res))<n_Rot<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AND Abs(EulerZYX(\Y,or_Res))<n_Rot<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AND Abs(EulerZYX(\Z,or_Res))<n_Rot;<br>&nbsp;&nbsp;&nbsp; RETURN b_Near;<br>&nbsp; ENDFUNC

  • soup
    soup ✭✭✭
    Options
    @VictorAx -- yes, world zones is an option.
  • VictorAx
    Options
    lemster68 said:
    I will share some code I wrote a little while back, you can maybe use it in your recovery strategy.
    This!
    MODULE Utility
      VAR string stRobt:=stEmpty;
      VAR string stClosestPoint;
      CONST num nMaxRecoverDist:=50;
      PERS tooldata tCheck;
      PERS string stToolName;
      PERS wobjdata wobjCheck:=[FALSE,TRUE,"",[[0,0,0],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];
      VAR string stWobjName;
     
      FUNC robtarget FindNearestPoint(string actMod)
        VAR robtarget pCurrentPosition;
        VAR num n12Distance:=10000;
        VAR robtarget checkrobt;
        VAR datapos block;
        VAR robtarget RetPos;
       
        GetSysData tCheck\ObjectName:=stToolName;
        GetSysData wobjCheck\ObjectName:=stWobjName;
        pCurrentPosition:=CRobT(\Tool:=tCheck\WObj:=wobjCheck);
        SetDataSearch "robtarget"\InMod:=actMod;
        WHILE GetNextSym(stRobt,block\Recursive) DO
          GetDataVal stRobt\TaskName:="T_ROB1", checkrobt;
          ! Compare current robot position with stored robtarget
          ! If it is less than maximum recovery distance store the name
          ! and distance from current position.
          IF (Distance(checkrobt.trans,pCurrentPosition.trans) < nMaxRecoverDist) THEN
            ! Check to see if point is within Maximum recovery
            ! but maybe farther than last compared point.
            ! Should update n12Distance if closer point is found.
            IF Distance(checkrobt.trans,pCurrentPosition.trans) < n12Distance THEN
              n12Distance:=Distance(checkrobt.trans,pCurrentPosition.trans);
              stClosestPoint:=stRobt;
              RetPos:=checkrobt;
            ELSE
              ! Do nothing, point is farther from last found point
              ! within max recover distance nMaxRecoverDist.
            ENDIF
          ENDIF
        ENDWHILE   
       
        RETURN RetPos;
      ENDFUNC

    ENDMODULE

    Combined with this
    MoveJ FindNearestPoint(lastmod),vmax,fine,tCheck\WObj:=wobjCheck;

    Where lastmod is a string I assign the name of in the corresponding module.

    Thanks!!

  • PTB
    Options
    In one of my current projects I am using world zones. The robot will be operating in four different areas. I have given each area a “Home” position and its own world zone. I have set the world zone up so it is just a small distance from fixtures. If the robot needs to home from outside the world zone and possibly too close to a fixture, I am directing the user to jog the robot into the world zone.  When the robot is in the world zone I will then get it to MOVEL in one axis away from the fixture and until the world zone digital output turns off. From here I should then be in a position that I can move to the areas home position. I have chosen area home positions that the robot can easily move between. I have not fully tested this method as of yet just putting it up here as a suggested homing method and open for improvements..
  • lemster68
    lemster68 ✭✭✭
    Options
    Cool, glad to help.  But vmax in a recovery is quite confident, to say the least.
    Lee Justice