Represent a PR in a different User Frame

  • Hello,


    I have a set of PRs that are defined in User Frame #2. I'd like to transform them so that I have the PR's, but represented in User Frame #1.


    I'm not trying to change the physical locations. I'd want to have the same locations, represented in User Frame #1.


    Preferably, I'd like to be able to execute this transformation from within a TP program.


    I can't figure out how to do this. Any help or suggestions would be appreciated.


    I'm sorry if this post is in the wrong location (I'm new to this forum). I'm using a FANUC R-2000iB with an R-Ji3B controller.

  • AD
  • Please see here:


    External Content youtu.be
    Content embedded from external sources will not be displayed without your consent.
    Through the activation of external content, you agree that personal data may be transferred to third party platforms. We have provided more information on this in our privacy policy.

  • I'm not trying to change the physical locations. I'd want to have the same locations, represented in User Frame #1.

    Can you explain more of what you mean by keeping the same physical locations? Do you mean the tool will be in same position in real-world? Or do you mean the same position relative to the user frame?

  • You can use a brute force method instead of an automatic method. Move to the PR in Frame #1, set Frame #2 to the active frame, touch up the PR without moving the robot. Set the active frame back to Frame #1 and repeat for the other PR's. You can create a TP with the PR's and the UFRAME instructions to make it a little easier but will still be manual.

  • Can you explain more of what you mean by keeping the same physical locations? Do you mean the tool will be in same position in real-world? Or do you mean the same position relative to the user frame?

    I mean I want to tool to be in the same physical locations in the real world. Here is a sloppy MS paint drawing that might help explain:



    This is for a palletizing application. UF1 is the frame I'm using to describe the robot frame. UF2 is the pallet frame, which may be rotated and translated relative to the robot frame.


    The PRs are the product placement locations on the pallet, so they are defined relative to UF2 based on the palletizing pattern. However, I want to know what these PRs would be if they were defined relative to UF1 since the pickup location is defined in UF1 and I'm doing some midpoint calculation to avoid obstacles. In order to do my calculation, I must have both the pickup location and placement locations represented in the same frame (UF1).


    Since UF2 is known relative to UF1 and the PRs are known relative to UF2, I would think this would be pretty simple. Outside of Fanuc TP programming, this would require a simple coordinate transformation, but I can't figure out how to do it within TP.


    Do you have Karel as an option?

    No, unfortunately.

  • You can use a brute force method instead of an automatic method. Move to the PR in Frame #1, set Frame #2 to the active frame, touch up the PR without moving the robot. Set the active frame back to Frame #1 and repeat for the other PR's. You can create a TP with the PR's and the UFRAME instructions to make it a little easier but will still be manual.

    I've done that before and it works. However in this application, I would need to know the PR in UF1 before actually moving the robot there.

    Please see here:


    External Content youtu.be
    Content embedded from external sources will not be displayed without your consent.
    Through the activation of external content, you agree that personal data may be transferred to third party platforms. We have provided more information on this in our privacy policy.

    This video is informative but it doesn't address my problem.

    Edited once, last by KPS93 ().

  • I think to find the PR[1] coordinates on UF1, it should be:

    PR[1]OnUF1=InverseMatrixUF2*PR[1]OnUF2


    But I don't know if you can calculate the InverseMatrix with only TPE language


    Edit:

    Verified right now with excel, the formula is right,

    and you can do it with TPE language, but it will be pretty challenging


    Here you can see the step-by-step to calculate de Inverse Matrix

    https://matrix.reshish.com/inverse.php


    Convert your UF2 to Matrix format, and put it in the web I gave and follow the step by step calculus doing it on excel, one you understand all the steps you do it in Fanuc TPE.

    Edited once, last by MoEL ().

  • Convert your UF2 to Matrix format, and put it in the web I gave and follow the step by step calculus doing it on excel, one you understand all the steps you do it in Fanuc TPE.

    That still leaves the question of converting from XYZWPR to the matrix, and then back again.


    I know the formulae for doing that for KUKA, but KUKAs rotate Z-Y'-Z", where Fanucs rotate X-Y'-Z", so the Euler portions of the matrix have to be calculated differently.


    Also, doing the math for the conversion requires having trigonometry functions, and those are a paid option on Fanuc controllers. So the OP would need to check if their Fanuc has those available.

  • That still leaves the question of converting from XYZWPR to the matrix, and then back again.


    I know the formulae for doing that for KUKA, but KUKAs rotate Z-Y'-Z", where Fanucs rotate X-Y'-Z", so the Euler portions of the matrix have to be calculated differently.


    Also, doing the math for the conversion requires having trigonometry functions, and those are a paid option on Fanuc controllers. So the OP would need to check if their Fanuc has those available.


    Converting UFrame from XYZWPR is easy,

    Code
       1:  $PR_CARTREP=0 ;
       2:  PR[100]=UFRAME[9:UFrame9] ;

    This makes PR[100] take the matrix transformation of UF9.

    And to calculate the Inverse Matrix I gave a web site with the step by step, where you don't need any trigonometry or complex math function.


    I had to calculate any Uframe given 9 points (3 points per plane) and I did all the calculus on TPE language, exepte to convert vector to unit vector, I had to do it on karel. but in this case he does not need to calculate any unit vector.


    For this case, I did the calculus on excel, and the steps are as follows:


    - Convert Uframe to Matrix format. (Matrix with 16 parameters)

    - Find the Inverse Matrix. (Matrix with 16 parameters)

    - Multiply this inverse Matrix with the the matrix of your known PR (Matrix of 4 parameters)

    Parameter = X coordinate, Parameter = Y coordinate, Parameter = Z coordinate, Parameter = 1)


    This will give you your XYZ of you PR on the UF1


    You don't need any payed option such as maths or karel fonction to do this

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now