Defining User Frames

  • Hello


    working with a R30iA controller with handlingTool


    I am wondering if there is a way to manually teach a user frame by entering the origin, the Y and the Z instead of the origin, the Y and the X, I want to teach the frame with the 3 point method.


    any help is appreciated, thanks in advance.

  • Yes, you can do transforms with TP, although it is a bit involved.


    Here I wrote something to rotate a frame by its own Z.

    Re: Rotating a User Frame by its own Z axis


    I was lazy, and only did the rotation aspect of the multiplication. Shouldn't be too hard to expand it to cover translation as well.


    In that thread, in the post below mine, Hawkme goes over how to do the same thing with the vision support tools option, which would cover translation.

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

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

  • only reason I have for correcting it is, I like have Z+ go up if possible, easier to remember, and I will be doing a bunch of Z+ offsets within this particular frame.


    I do have the matrix function but am not quite sure yet how to use it properly.

  • yeah I know that (have done it wrong a bunch in the past), but in my situation I can only reach the origin, z+ and Y+ accurately, so I need to teach it with origin, x+, y+ and then spin the frame 90 degrees around the y axis, and that should make z+ up y+ should be to the left and x+ should be straight away

  • Code


    1 : PR[3:A MATRIX]=UFRAME[1] ; <-could use Argument here

    2 :;

    3 : PR[4]=PR[4]-PR[4];

    4 : PR[4,3]=90; <-could use argument here

    5 :;

    6 : !PR5 = PR3*PR4, R6=ERR CODE ;

    7 : CALL MATRIX(3,4,5,6) ;

    8 : UFRAME[1]=PR[5:C MATRIX] ;


    so I've been experimenting with this code and cannot seem to get the desired output, all it seems to do for me is change the Z value of the user frame.

    Maybe it has something to do with the strange way it is copying the uframe into the PR, it is not the usual XYZWPR, instead its NX, NY, NZ, OX, OY, OZ, AX, AY, AZ, LX, LY, LZ, this is however the only of the 3 pr's that uses this format, is that an issue? I am not sure what the 6 does on line 7, I assume it has something to do with an error scenario, which I assume is not needed?


    anyone have any idea on this?


    thanks again

  • PR[4,3]=90 should be PR[4,5]=90 if you want to rotate around Y. This assumes that PR[4] is in LPOS format.


    R6 will store an error code if Matrix fails. aka, you pass it an uninitialized PR or something like that.

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

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

  • Maybe it has something to do with the strange way it is copying the uframe into the PR, it is not the usual XYZWPR, instead its NX, NY, NZ, OX, OY, OZ, AX, AY, AZ, LX, LY, LZ, this is however the only of the 3 pr's that uses this format, is that an issue?

    This is just the 4x4 matrix representation of the frame. Anytime you set a PR equal to a User or Tool frame it will be stored as a matrix rather than a cartesian position unless you change the system variable to $PR_CARTREP to true before initializing the pr. In this case, you actually want the matrix value (hence the PRs "A MATRIX" comment) so what are seeing is correct.

Advertising from our partners