Abb robotstudio programming movement

  • Hello everyone

    Currently i'm programming a robotized cells with an Irb6700 and a conveyor. This cells need to manage different types of products and every one has a different grab position.


    I was thinking on how i could organize the rapid code in the best way.

    The first thing it came up in my mind is to create a function that return a robtarget "generalGrabPose" based on the product code and then use a single instruction MoveL to this robtarget.


    But on the other side, if i need to adjust an offset for the position with the flexpendant i can't modify the single moveL instruction...

    I could need a long test-case with different MoveL instruction, so i could change the single offs for every robtarget but i don't like pretty much this option.

    Is there a better way to organize it? Or some inbuild function to help me?


    Thanks.

  • You could create an array of robtargets. In this way, there is only one "named" robtarget but it contains a different position for each part type. When you modify the position, it will ask you which element you would like to update.


    Code
    CONST robtarget pAtGrabPosition{3}:=[
    [[172.52,155.40,5.87],[0.000331694,-0.999943,0.0106272,-8.62312E-05],[1,-2,1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],
    
    [[159.08,156.43,5.89],[0.00400481,-0.00228554,-0.999987,0.00224012],[1,-2,3,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],
    
    [[158.53,154.19,6.94],[0.00295511,-0.00246473,-0.999991,0.00166861],[1,-2,3,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]
    ];

    To go to the different positions you need to provide a number that corresponds to the data inside the array. This could be another num variable that gets updated based on something like a group input

    Code
    VAR num nPartType;
    
    nPartType:=giPartTypeFromPLC; 
    MoveL pAtGrabPosition{nPartType},v200,fine,tool_Gripper\WObj:=wobj_Conveyor;

    In this way, the same movement instruction can be updated to go the correct position for each part type.

  • Offs will only affect whatever the current array element is. If you use something like:

    Code
    MoveL Offs(pAtGrabPosition{2},0,0,100),v200,z20,tool_Gripper\WObj:=wobj_Conveyor;

    Then the robot will move 100mm on the Z axis from the second robtarget in the array. If you were to hard-code the offset values into the Offs function, then the robot would move the same amount away from the taught positions. If you need to make different offset moves based on the part type, you could set something up like this:

    If the part type is 1, the robot will offset 30mm in X and 100mm in Z. If the part type is 2, offset 50 in X, 2 in Y, and 250 in Z. In this way, even if a new part type is added later on, you only need to add another CASE to set the correct offset amounts.

Advertising from our partners