# Offest of a UF along itself axis

• 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.

• ## MoELNov 16th 2023

Changed the title of the thread from “Offest of a UF in itself axis” to “Offest of a UF along itself axis”.
• Easy peasy

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]

Never EVER again fanuc!

• 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?

• 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.

• 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.

• 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.

• 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.

Never EVER again fanuc!

• 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 ().

• 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:

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

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

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:

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

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

• 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!

• 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

• 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!

• 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?