1. Home
    1. Dashboard
    2. Search
  2. Forum
    1. Unresolved Threads
    2. Members
      1. Recent Activities
      2. Users Online
      3. Team Members
      4. Search Members
      5. Trophys
  3. Articles
  4. Blog
  5. Videos
  6. Jobs
  7. Shop
    1. Orders
  • Login or register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • Blog Articles
  • Products
  • More Options
  1. Robotforum - Support and discussion community for industrial robots and cobots
  2. Forum
  3. Industrial Robot Support and Discussion Center
  4. Fanuc Robot Forum
Your browser does not support videos RoboDK Software for simulation and programming
Visit our Mainsponsor
IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Sponsored Ads

Offest of a UF along itself axis

  • MoEL
  • November 16, 2023 at 3:53 PM
  • Thread is Unresolved
  • Online
    MoEL
    Reactions Received
    1
    Trophies
    2
    Posts
    109
    • November 16, 2023 at 3:53 PM
    • #1

    Hi,

    I have a UF, lets say at X: 1000, Y: 1000, Z: 1000, w: 15deg, p: -27 deg, r: 128

    I want to offest 100mm this UF along itself axis, so I need to find the new coordinates XYZ that will be the result of this Offset, wpr will stay the same.

    Any idea of how to do that easily?

    Thank you very much.

  • Go to Best Answer
  • MoEL November 16, 2023 at 3:55 PM

    Changed the title of the thread from “Offest of a UF in itself axis” to “Offest of a UF along itself axis”.
  • HalbesYoyo
    Persona non grata
    Reactions Received
    47
    Trophies
    3
    Posts
    151
    • November 16, 2023 at 4:34 PM
    • #2

    Easy peasy :winking_face:

    you can load, alter and write a UFRAME via Position registers. Like:

    Code
    1: PR[97] = UFRAME[3]
    2: PR[99] = PR[97] + PR[98]
    3: UFRAME[4] = PR[99]

    You only have to keep in mind that adding two PR will keep the CONF of the first summand and therefore 2: PR[99] = PR[98] + PR[97] will be different from 2: PR[99] = PR[97] + PR[98] if they do not have the same CONF.

    2: PR[99] = PR[97] + PR[98]


    2: PR[99] = PR[98] + PR[97]


  • Sergei Troizky
    Reactions Received
    70
    Trophies
    6
    Posts
    658
    • November 16, 2023 at 4:36 PM
    • #3

    Not clear whether you want to do it manually or programatically.

    If programatically, will you allow robot movement for that, and is the frame origin physically reachable?

    Do it well right away. It will become bad by itself.

  • Online
    MoEL
    Reactions Received
    1
    Trophies
    2
    Posts
    109
    • November 16, 2023 at 4:59 PM
    • #4
    Quote from Sergei Troizky

    Not clear whether you want to do it manually or programatically.

    If programatically, will you allow robot movement for that, and is the frame origin physically reachable?

    Hi,
    I need to do it programmatically.

    And I understand your point, by moving the robot at needed point in the UF, and then get its world position with LPOS, this should work but is it passible without moving the robot, with some calculations?
    and yes, the UF origin is physically reachable.

  • Online
    MoEL
    Reactions Received
    1
    Trophies
    2
    Posts
    109
    • November 16, 2023 at 5:02 PM
    • #5
    Quote from HalbesYoyo

    Easy peasy :winking_face:

    you can load, alter and write a UFRAME via Position registers. Like:

    Code
    1: PR[97] = UFRAME[3]
    2: PR[99] = PR[97] + PR[98]
    3: UFRAME[4] = PR[99]

    You only have to keep in mind that adding two PR will keep the CONF of the first summand and therefore 2: PR[99] = PR[98] + PR[97] will be different from 2: PR[99] = PR[97] + PR[98] if they do not have the same CONF.

    2: PR[99] = PR[97] + PR[98]


    2: PR[99] = PR[98] + PR[97]


    Display More

    Thank you, but I think my question was not clear enough, I need to move the UF 100mm along itself axis, so the new origin in world coordinates will not be current coordinate + 100mm because of the rotations wpr.

  • HawkME
    Reactions Received
    568
    Trophies
    11
    Posts
    3,268
    • November 16, 2023 at 9:04 PM
    • #6

    You need to use Matrix multiplication to manipulate a frame relative to itself.

    This has been discussed several times before if you search the forum.

    Another option is to just add an offset onto each position, then it will do the math for you.

  • HalbesYoyo
    Persona non grata
    Reactions Received
    47
    Trophies
    3
    Posts
    151
    • November 17, 2023 at 8:48 AM
    • #7
    Quote from MoEL

    Thank you, but I think my question was not clear enough, I need to move the UF 100mm along itself axis, so the new origin in world coordinates will not be current coordinate + 100mm because of the rotations wpr.

    Ah, sry. I didn't get that the crucial part is the fact the frame is not parallel to WORLD.

    Unfortunately for matrices I'm out of the game. I really need to look into this. :confused_face:

  • hoitzing
    Reactions Received
    24
    Trophies
    1
    Posts
    128
    • November 17, 2023 at 9:45 AM
    • #8

    With KAREL it's very easy to do so: take the offset (for instance x=100, yzwpr=0, call it PR_offset for instance) as a position (so it represents your translated user frame expressed in your original user frame PR_uf_original), and convert it to world coordinates. To do the conversion in TP, you would need some matrix math option (I'm not sure exactly what's out there). In KAREL it's simply using the : operator (found under relative position operator in the KAREL manual):

    Code
    PR_uf_new = PR_uf_original : PR_offset

    Edited once, last by hoitzing (November 22, 2023 at 7:55 AM).

  • pdl
    Reactions Received
    269
    Trophies
    9
    Posts
    1,531
    • November 17, 2023 at 3:07 PM
    • #9

    Just get the math option, it's cheaper in the long run.

  • Nation
    Typical Robot Error
    Reactions Received
    541
    Trophies
    9
    Posts
    1,923
    • November 17, 2023 at 8:56 PM
    • #10

    I implemented the Karel program MATRIX in TP. Downside is you have to sacrifice a user frame for it to work. I picked 9.

    In the karel program you would call it like so:

    Code
    :  CALL MATRIX(89,90,91) ;

    Where PR[91]=PR[89]*PR[90].

    The TP Program functions the same way, except for the name.

    Code
    :  CALL MMULT(89,90,91) ;

    Here is the program:

    Code
    /PROG MMULT Macro
    /ATTR
    OWNER = MNEDITOR;
    COMMENT = "Matrix Mul in TP";
    PROG_SIZE = 2451;
    CREATE = DATE 23-11-17 TIME 14:39:10;
    MODIFIED = DATE 23-11-17 TIME 14:39:10;
    FILE_NAME = FRAME_RO;
    VERSION = 0;
    LINE_COUNT = 63;
    MEMORY_SIZE = 2863;
    PROTECT = READ_WRITE;
    TCD: STACK_SIZE = 0,
    TASK_PRIORITY = 50,
    TIME_SLICE = 0,
    BUSY_LAMP_OFF = 0,
    ABORT_REQUEST = 0,
    PAUSE_REQUEST = 0;
    DEFAULT_GROUP = 1,*,*,*,*;
    CONTROL_CODE = 00000000 00000000;
    /APPL
    
    
    AUTO_SINGULARITY_HEADER;
    ENABLE_SINGULARITY_AVOIDANCE : TRUE;
    /MN
    1: JMP LBL[1] ;
    2: !******************************** ;
    3: ! ;
    4: !Program Name: MMULT ;
    5: ! ;
    6: !Program Description: Preforms ;
    7: ! matrix multiplication of two ;
    8: ! PRs, and stores the result in ;
    9: ! an additional PR. ;
    10: !Caveats: ;
    11: ! This requires a free user ;
    12: ! frame to do the matrix ;
    13: ! conversion. The default in ;
    14: ! this program is 9. ;
    15: ! ;
    16: !Program Arguments: ;
    17: ! AR[1]=The 'A' PR index. ;
    18: ! AR[2]=The 'B' PR index. ;
    19: ! AR[3]=The 'C' PR index. Where ;
    20: ! C = A : B ;
    21: ! ;
    22: !******************************** ;
    23: LBL[1:Start] ;
    24: ;
    25: --eg: Tell the robot to store frames as transform (matrix) rep. ;
    26: $PR_CARTREP=(0) ;
    27: ;
    28: --eg: Convert the passed in PRs to transform rep. ;
    29: UFRAME[9:UFrame9]=PR[AR[1]] ;
    30: PR[AR[1]]=UFRAME[9:UFrame9] ;
    31: UFRAME[9:UFrame9]=PR[AR[2]] ;
    32: PR[AR[2]]=UFRAME[9:UFrame9] ;
    33: PR[AR[3]]=LPOS-LPOS ;
    34: UFRAME[9:UFrame9]=PR[AR[3]] ;
    35: PR[AR[3]]=UFRAME[9:UFrame9] ;
    36: ;
    37: --eg: Preform matrix multiplication ;
    38: --eg: Ref:
    : http://www.c-jump.com/bcc/common/Talk3/Math/Matrices/W01_0150_matrix_by_matrix_mult.htm ;
    39: PR[AR[3],1]=((PR[AR[1],1]*PR[AR[2],1])+(PR[AR[1],4]*PR[AR[2],2])+(PR[AR[1],7]*PR[AR[2],3])) ;
    40: PR[AR[3],2]=((PR[AR[1],2]*PR[AR[2],1])+(PR[AR[1],5]*PR[AR[2],2])+(PR[AR[1],8]*PR[AR[2],3])) ;
    41: PR[AR[3],3]=((PR[AR[1],3]*PR[AR[2],1])+(PR[AR[1],6]*PR[AR[2],2])+(PR[AR[1],9]*PR[AR[2],3])) ;
    42: PR[AR[3],4]=((PR[AR[1],1]*PR[AR[2],4])+(PR[AR[1],4]*PR[AR[2],5])+(PR[AR[1],7]*PR[AR[2],6])) ;
    43: PR[AR[3],5]=((PR[AR[1],2]*PR[AR[2],4])+(PR[AR[1],5]*PR[AR[2],5])+(PR[AR[1],8]*PR[AR[2],6])) ;
    44: PR[AR[3],6]=((PR[AR[1],3]*PR[AR[2],4])+(PR[AR[1],6]*PR[AR[2],5])+(PR[AR[1],9]*PR[AR[2],6])) ;
    45: PR[AR[3],7]=((PR[AR[1],1]*PR[AR[2],7])+(PR[AR[1],4]*PR[AR[2],8])+(PR[AR[1],7]*PR[AR[2],9])) ;
    46: PR[AR[3],8]=((PR[AR[1],2]*PR[AR[2],7])+(PR[AR[1],5]*PR[AR[2],8])+(PR[AR[1],8]*PR[AR[2],9])) ;
    47: PR[AR[3],9]=((PR[AR[1],3]*PR[AR[2],7])+(PR[AR[1],6]*PR[AR[2],8])+(PR[AR[1],9]*PR[AR[2],9])) ;
    48: PR[AR[3],10]=((PR[AR[1],1]*PR[AR[2],10])+(PR[AR[1],4]*PR[AR[2],11])+(PR[AR[1],7]*PR[AR[2],12])+PR[AR[1],10]) ;
    49: PR[AR[3],11]=((PR[AR[1],2]*PR[AR[2],10])+(PR[AR[1],5]*PR[AR[2],11])+(PR[AR[1],8]*PR[AR[2],12])+PR[AR[1],11]) ;
    50: PR[AR[3],12]=((PR[AR[1],3]*PR[AR[2],10])+(PR[AR[1],6]*PR[AR[2],11])+(PR[AR[1],9]*PR[AR[2],12])+PR[AR[1],12]) ;
    51: ;
    52: --eg:Tell the robot to store frames as cart rep. ;
    53: $PR_CARTREP=(1) ;
    54: ;
    55: --eg:Set the original PRs and the result back to cartesian rep. ;
    56: UFRAME[9:UFrame9]=PR[AR[1]] ;
    57: PR[AR[1]]=UFRAME[9:UFrame9] ;
    58: UFRAME[9:UFrame9]=PR[AR[2]] ;
    59: PR[AR[2]]=UFRAME[9:UFrame9] ;
    60: UFRAME[9:UFrame9]=PR[AR[3]] ;
    61: PR[AR[3]]=UFRAME[9:UFrame9] ;
    62: ;
    63: LBL[32766:End of Program] ;
    /POS
    /END
    Display More

    Check out the Fanuc position converter I wrote here! Now open source!

    Check out my example Fanuc Ethernet/IP Explicit Messaging program here!

  • HawkME
    Reactions Received
    568
    Trophies
    11
    Posts
    3,268
    • November 17, 2023 at 9:44 PM
    • #11

    Nice work! That will come in handy if working on a robot without that is option.

  • Nation
    Typical Robot Error
    Reactions Received
    541
    Trophies
    9
    Posts
    1,923
    • November 18, 2023 at 2:53 PM
    • Best Answer
    • #12

    Can't have matrix multiplication without inverse. I created the inverse TP program as well. Same deal as MULTIPLY. You have to sacrifice a frame. 9 again in this case.

    Same deal as the multiply. Karel version is called like this:

    Code
    : CALL INVERSE(89,90) ;

    Where PR[90]=PR[89]'.

    The TP Program functions the same way, except for the name.

    Code
    : CALL MINV(89,90) ;

    Here is the program:

    Code
    /PROG MINV Macro
    /ATTR
    OWNER = MNEDITOR;
    COMMENT = "Matrix Inv in TP";
    PROG_SIZE = 1905;
    CREATE = DATE 23-11-18 TIME 08:46:34;
    MODIFIED = DATE 23-11-18 TIME 08:46:34;
    FILE_NAME = FRAME_RO;
    VERSION = 0;
    LINE_COUNT = 58;
    MEMORY_SIZE = 2337;
    PROTECT = READ_WRITE;
    TCD: STACK_SIZE = 0,
    TASK_PRIORITY = 50,
    TIME_SLICE = 0,
    BUSY_LAMP_OFF = 0,
    ABORT_REQUEST = 0,
    PAUSE_REQUEST = 0;
    DEFAULT_GROUP = 1,*,*,*,*;
    CONTROL_CODE = 00000000 00000000;
    /APPL
    
    
    AUTO_SINGULARITY_HEADER;
    ENABLE_SINGULARITY_AVOIDANCE : TRUE;
    /MN
    1: JMP LBL[1] ;
    2: !******************************** ;
    3: ! ;
    4: !Program Name: MINV ;
    5: ! ;
    6: !Program Description: Preforms ;
    7: ! matrix inversion of the ;
    8: ! passed in PR, and stores the ;
    9: ! result in an additional PR. ;
    10: !Caveats: ;
    11: ! This requires a free user ;
    12: ! frame to do the matrix ;
    13: ! conversion. The default in ;
    14: ! this program is 9. ;
    15: ! ;
    16: !Program Arguments: ;
    17: ! AR[1]=The 'A' PR index. ;
    18: ! AR[2]=The 'B' PR index. Where ;
    19: ! B = A' ;
    20: ! ;
    21: !******************************** ;
    22: LBL[1:Start] ;
    23: ;
    24: --eg: Tell the robot to store frames as transform (matrix) rep. ;
    25: $PR_CARTREP=(0) ;
    26: ;
    27: --eg: Convert the passed in PRs to transform rep. ;
    28: UFRAME[9:UFrame9]=PR[AR[1]] ;
    29: PR[AR[1]]=UFRAME[9:UFrame9] ;
    30: PR[AR[2]]=LPOS-LPOS ;
    31: UFRAME[9:UFrame9]=PR[AR[2]] ;
    32: PR[AR[2]]=UFRAME[9:UFrame9] ;
    33: ;
    34: --eg: Preform matrix inversion ;
    35: --eg: Ref:
    : http://www-graphics.stanford.edu/courses/cs248-98-fall/Final/q4.html ;
    36: PR[AR[2],1]=(PR[AR[1],1]) ;
    37: PR[AR[2],2]=(PR[AR[1],4]) ;
    38: PR[AR[2],3]=(PR[AR[1],7]) ;
    39: PR[AR[2],4]=(PR[AR[1],2]) ;
    40: PR[AR[2],5]=(PR[AR[1],5]) ;
    41: PR[AR[2],6]=(PR[AR[1],8]) ;
    42: PR[AR[2],7]=(PR[AR[1],3]) ;
    43: PR[AR[2],8]=(PR[AR[1],6]) ;
    44: PR[AR[2],9]=(PR[AR[1],9]) ;
    45: PR[AR[2],10]=(((-1)*PR[AR[1],1]*PR[AR[1],10])-(PR[AR[1],2]*PR[AR[1],11])-(PR[AR[1],3]*PR[AR[1],12])) ;
    46: PR[AR[2],11]=(((-1)*PR[AR[1],4]*PR[AR[1],10])-(PR[AR[1],5]*PR[AR[1],11])-(PR[AR[1],6]*PR[AR[1],12])) ;
    47: PR[AR[2],12]=(((-1)*PR[AR[1],7]*PR[AR[1],10])-(PR[AR[1],8]*PR[AR[1],11])-(PR[AR[1],9]*PR[AR[1],12])) ;
    48: ;
    49: --eg:Tell the robot to store frames as cart rep. ;
    50: $PR_CARTREP=(1) ;
    51: ;
    52: --eg:Set the original PRs and the result back to cartesian rep. ;
    53: UFRAME[9:UFrame9]=PR[AR[1]] ;
    54: PR[AR[1]]=UFRAME[9:UFrame9] ;
    55: UFRAME[9:UFrame9]=PR[AR[2]] ;
    56: PR[AR[2]]=UFRAME[9:UFrame9] ;
    57: ;
    58: LBL[32766:End of Program] ;
    /POS
    /END
    Display More

    Check out the Fanuc position converter I wrote here! Now open source!

    Check out my example Fanuc Ethernet/IP Explicit Messaging program here!

  • HawkME
    Reactions Received
    568
    Trophies
    11
    Posts
    3,268
    • November 18, 2023 at 4:42 PM
    • #13

    Sweet! You should add those to the tools section of the forum.

  • Nation
    Typical Robot Error
    Reactions Received
    541
    Trophies
    9
    Posts
    1,923
    • November 18, 2023 at 7:22 PM
    • #14
    Quote from HawkME

    Sweet! You should add those to the tools section of the forum.

    Will do.

    Check out the Fanuc position converter I wrote here! Now open source!

    Check out my example Fanuc Ethernet/IP Explicit Messaging program here!

  • wag_FFU
    Reactions Received
    4
    Trophies
    2
    Posts
    86
    • November 25, 2023 at 1:46 PM
    • #15

    Hi guys, I´m working with a project where the customer want to use the same program with the parts located in different positions. The offset is calculated with a scanner.

    The customer idea is to create a program for every parts , like usual robot projects, but instead of attach part always in the same position, it simply scan the original part and the send the difference from the teached part directly to the robot.

    I receive the shift values, X,Y,Z,W,P,R and the current part rotation center values (X,Y,Z). I have to rotate the Frame to adapt the program to the scanned part.

    Right now I´ve created a program to rotate and shift a frame related to a point .

    I´ve done everything with Matrix

    1) Shift the frame used to create the program with the Shift X,Y,Z values

    (F is the frame used to teach the program converted in matrix)


    2) Rotate the original part center of rotation

    (R is the Shift W,P,R with X=Y=Z=0 converted in Matrix)

    3) The new Frame is (of course is a matrix)

    |New Frame| = | Frame Shift| x | Rotation Matrix|

    Am I doing it right or I ´ve overcomplicated the entire project?

    Is it a different way to rotate and shift this frame, also with a built in instruction I haven´t found yet?

    That boter me so much, I can´t believe I ended with a so complicated solution , should I use the 2D camera options? Thanks to all

  • Nation
    Typical Robot Error
    Reactions Received
    541
    Trophies
    9
    Posts
    1,923
    • November 27, 2023 at 5:38 PM
    • #16

    Is this for a 3D offset?

    Either way, I think you are over complicating it. If you are shifting in a frame that is already defined, just take the offset from the camera, subtract it from your reference position, and run with that.

    Check out the Fanuc position converter I wrote here! Now open source!

    Check out my example Fanuc Ethernet/IP Explicit Messaging program here!

  • wag_FFU
    Reactions Received
    4
    Trophies
    2
    Posts
    86
    • November 28, 2023 at 12:11 PM
    • #17
    Quote from Nation

    Is this for a 3D offset?

    Either way, I think you are over complicating it. If you are shifting in a frame that is already defined, just take the offset from the camera, subtract it from your reference position, and run with that.

    I don´t understand it, should I create a shift using my part center and the shifted part value?

Advertising from our partners

IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Advertise in Robotics
Advertise in Robotics

Job Postings

  • Anyware Robotics is hiring!

    yzhou377 February 23, 2025 at 4:54 AM
  • How to see your Job Posting (search or recruit) here in Robot-Forum.com

    Werner Hampel November 18, 2021 at 3:44 PM
Your browser does not support videos RoboDK Software for simulation and programming

Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Thread Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000
  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™
As a registered Member:
* You will see no Google advertising
* You can translate posts into your local language
* You can ask questions or help the community with your knowledge
* You can thank the authors for their help
* You can receive notifications of replies or new topics on request
* We do not sell your data - we promise

JOIN OUR GREAT ROBOTICS COMMUNITY.
Don’t have an account yet? Register yourself now and be a part of our community!
Register Yourself Lost Password
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on Google Play
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on the App Store
Download