frame transformation with interpolation change

  • Hi all,


    I am trying to change coordinate systems of a programmed point and need to change interpolation types from base to fixed tcp.


    My end goal is to use 3 points to record a workpiece origin as well as A,B,C values for the fixed tool tcp.


    I already am able to get the A,B C values to record and write to a base frame but I believe I need to use fixed tcp interpolation to get the proper position values to write to a carried tcp (workpiece).


    Is there a quick function to do this that I am overlooking?


    Thanks in advance.

  • check pinned topic READ FIRST and get key manuals. one of them is system variables manual.


    $IPO_MODE = #BASE ; normal case, robot guided tool

    $IPO_MODE = #TCP ; using fixed tool

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • Panic,


    Thanks for the quick response. I am familiar with those variables.


    Let me explain in further detail what I am trying to accomplish.


    I am using 3 points P1, P2, P3 taught in IPO_MODE #BASE say TOOL[2] BASE[0]. These are used to calculate user base frame arrays A,B,C, say BASE[1] while X,Y,Z will be direct data overwrite from a known fixture position. I would then like to take the position in space of P1 transform it to P4 in IPO_MODE #TOOL, BASE[1], TOOL[2]. I would then like to use the X, Y, Z values of this point to populate TOOL[3].


    This way I can have a proper rotational orientation setup in BASE[1] with direct relation to TOOL[3] tcp


    I do not know how to easily convert a point taught in IPO_MODE #BASE to IPO_MODE #TOOL. Everything I have tried so far has changed the physical position in space rather than keep the same physical position with changed representation.

  • Panic,

    I will gather some code and put something together.


    as far as INV_POS, I am dabbling with them, still unsure or its been unclear to me how they fully work and to what extent. I have read what there is about them in the 8.5 software manual but I found there is not very great descriptions there.


    If you are able to clarify some of the functions and or abilities/constraints that would be much appreciated.

  • as far as INV_POS, I am dabbling with them, still unsure or its been unclear to me how they fully work and to what extent.

    INV_POS performs a matrix inversion on a FRAME or POS type variable. This basically "reverses" the variable.


    For example, in KRL, any POS variable is defined relative to a frame of reference, usually $BASE. The POS can be considered as a sequence of instructions:

    1. Start at the position and orientation of $BASE

    2. Move along $BASE X by POS.X

    3. Move along $BASE Y by POS.Y

    4. Move along $BASE Z by POS.Z

    5. Rotate in place around your Z axis by POS.A

    6. Rotate in place around your new Y axis by POS.B

    7 Rotate in place around your new X axis by POS.C


    The order of 2-4 is not really important, but the order of 5-7 is critical.


    Performing an INV_POS of the POS variable would give a FRAME-type variable that is, basically, the same directions but in reverse -- starting from POS, how to get to $BASE. Given the way Euler angles (the ABC values) work, it's not possible to invert a 6DOF variable by simple arithmetic -- matrix algebra is required. INV_POS performs the conversion from FRAME to matrix, performs the matrix inversion, then converts the resultant matrix back to FRAME.


    INV_POS can be used, in addition with the Geometric Operator, to calculate the 6DOF relationship between any point in space and any other point in space. If one were only concerned about 3DOF (XYZ), then simple arithmetic would suffice, but to accurately handle the rotation angles and their effects on the XYZ values, these system functions are necessary.

  • Ok, to revisit my initial question.


    Here is what I would like to do



    I want the 2 positions P1 & p32 to be exact same point in space.


    Currently all of my other programming works correctly if I manually record p32 after driving to P1.


    I figure there should be a way for the controller to do that for me but my understanding is INV_POS cant be used in conjunction with an EXTTCP point.


    Thanks,

  • you were asked but never provided info you promised. all you shared was cropped screenshot of couple of inline forms. this tells us nothing. where are the actual values? where is your attempt to calculate it?

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • for some arbitrary choice of coordinate systems (lets call the cases X and Y) we can write TCP equations:

    robot_position_x:tool_x=base_x:point_x

    robot_position_y:tool_y=base_y:point_y


    the ":" is called geometric operator. despite appearance, this is not a division operator, it is essentially a matrix multiplication operator (there is no division when working with matrices).


    everyone learned about algebra, vectors, matrices. .. and 3D math is matrix based math

    in algebra if you have dealt with simpler constructs and this worked:

    5*w=w*5=5w


    and

    a*b=c*d

    you can express c as

    c=a*b/d


    and since matrix multiplication is not commutative

    A:B is not the same as B:A

    because with matrices it MATTERS from WHICH side multiplication is performed, operands cannot arbitrarily switch sides (they can but this is no longer an equation, so bummer...).


    learning and retaining are two different worlds which is why all the smarts come from few clever kids that ate all their vegetables.


    since there is no division with matrices, we just use multiplication by inverse of the matrix (fortunately, frames and rotation matrices are type of matrices that are always invertible).


    and sometimes we need to look at the robot and notice that robot did not move but the tool was changed. in that case the above TCP equations are not very useful, we need to transform them into more suitable form and look at thing from perspective of the robot flange (the part that did not move).


    so from

    robot_position_x:tool_x=base_x:point_x

    robot_position_y:tool_y=base_y:point_y


    we get

    robot_position_x=base_x:point_x:INV_POS(tool_x)

    robot_position_y=base_y:point_y:INV_POS(tool_y)


    notice that in TCP equations, robot position was multiplied by tool position from the RIGHT.

    so during transform, tool position moves to the other side of equation but it still MUST be one the RIGHT side of the expression - but inverted.


    and if robot arm did not move, then robot_position_x=robot_position_y

    in that case we can write

    base_x:point_x:INV_POS(tool_x)=base_y:point_y:INV_POS(tool_y)


    and you can calculate any term knowing the others.

    to determine value for point_y by using suitable matrix operations we need to remove everything around it.


    point_y is multiplied by base_y from the LEFT.

    to get rid of it, move it to the other side equation and multiply in inverse value also from the LEFT.


    so you get

    INV_POS(base_y):base_x:point_x:INV_POS(tool_x)=point_y:INV_POS(tool_y)


    but point_y is still not alone, it is multiplied by another factor from the RIGHT. we just repeat the process:

    INV_POS(base_y):base_x:point_x:INV_POS(tool_x):INV_POS(INV_POS(tool_y))=point_y

    note that double INV_POS matrix multiplication simply returns same thing (just like double multiplication by negative one in algebra)

    so we get

    INV_POS(base_y):base_x:point_x:INV_POS(tool_x):tool_y=point_y

    or if we switch sides:

    point_y = INV_POS(base_y):base_x:point_x:INV_POS(tool_x):tool_y


    that works for any set of frames.


    now about that "fixed tool"...


    note that in case of fixed tool, things are the same, only terminology changes.

    tool and base are swapped in name. so if in case Y you have external tool then

    base_Y is your fixed tool frame and tool_Y is the workpiece frame.

    and since reference coordinate system is "on the other end", you may need to INV_POS obtained result. this is comparable to multiplying scalar or vector by -1 to flip it over.

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • Panic,


    Thanks for the detailed explanation of the formulas involved to calculate frames.


    I did not post my attempts to convert the positional points mentioned because I was attempting to use INV:POS and its my understanding that this function cannot be used with fixed tool interpolation.


    Here is the code I currently have gotten to be successful to achieve my end goal, I was just trying to eliminate a manual teaching step from this process.


    ;teach base frame


    ;FOLD PTP P1 Vel=100 % PDAT1 Tool[2]:Workpiece2 Base[0] ;%{PE}

    ;ENDFOLD


    ;FOLD PTP P2 Vel=100 % PDAT2 Tool[2]:Workpiece2 Base[0] ;%{PE}

    ;ENDFOLD


    ;FOLD PTP P3 Vel=100 % PDAT3 Tool[2]:Workpiece2 Base[0] ;%{PE}

    ;ENDFOLD


    GOTO POS32


    SET_AREA1_ORIGIN:


    frame_error = ComputeFrameFrom3Pts(xp1,xp2,xp3,base_data[3])

    if frame_error == 1 then

    msgnotify("Area definition points too close together.")

        halt

    endif


    if frame_error == 2 then

    msgnotify("Area definition points are collinear.")

        halt

    endif



    base_data[3].x = base_data[1].x

    base_data[3].y = base_data[1].y

    base_data[3].z = base_data[1].z



    GOTO SKIPP


    POS32:


    ;FOLD PTP p1 Vel=100 % PDAT28 Tool[2]:Workpiece2 Base[0] ;%{PE}

    ;ENDFOLD



    ;FOLD WAIT Time= 1.0 sec ;%{PE}

    WAIT SEC 1.0

    ;ENDFOLD


    ;FOLD PTP p32 Vel=100 % PDAT29 Tool[2]:Workpiece2 Base[3] extTCP ;%{PE}

    ;ENDFOLD


    SKIPP
    :

    XP001.A = XP_ORIGIN.A

    XP001.B = XP_ORIGIN.B

    XP001.C = XP_ORIGIN.C

    xp002 = xp32



    I would like to eliminate the need to touch up p32 to match p1 once the base frame is calculated with the frames macro.

    I have identified this step in the purple colored code above.

    I hope this helps explain what I am trying to accomplish as well as where I am at with the coding so far.

    Sorry for the delayed responses, I have some conflicting schedules that are currently limiting my ability to fetch code and post it.


    Thanks

  • no idea what you are really doing there. things do not make sense, for example 'workpiece' is meant to be used with external tool but but then you are using "workpiece2" with all points, inclding P1-P3. also you did not post actual code, just the "user impression" of what appears on smartPad. that is not code, that is just façade. and finally you did not include any values to check what you are getting (DAT file is important part of the program).

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • I replied to post #12 and panic mode to post #11.


    Here is the code I currently have gotten to be successful to achieve my end goal

    The goal of this forum is to help!


    And to my opion post #11 did not help at all.


    mmilo31 just picked the rosins and did not have left any for all the others

  • ...why the sudden replies to a post from February?

    good question...

    :thinking_face:

    not sure how it showed up on my radar. most of me responses are reactions to various notifications but there does not seem to be any in this case. i do use multiple devices and some of them may have something open for quite a while.

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

Advertising from our partners