Posts by MoEL

    In your pictures, your robot is in Remote control, so you will need to have 4 UIs to have to robot without errors.

    MENU2

    • SYSTEM 1
      • Config
        • 7 Enable UI signals: TRUE
        • 42 Remote/local setup: Remote

    snaUaWSuBNJV6nDyuCRGK8NtWl2fHJU8G4vSi-iuF5GzJrYyTlHUisCD4eo5Ok18TWXMPF8l8qpspqnEbU-aXdl4wd0mmqDpQBvo3dMyi5xTQAeXOoF55YvVkKreohbM4n4VtHmwius


    So you have 2 option,

    Disable:

    Enable UI signals: TRUE put it in False

    Remote/local setup: Remote put it in Local

    or

    Make sure that you plc or external device send the 4 signals like in the picture.

    I've got a KAREL program I wrote a while ago to use a touch probe to find the center of the top surface of a small locating block on a large work piece. The block is machined tool steel with a poke-yoke dowel pin pattern on the bottom. Three of them get placed on the work piece to teach a user frame. The reason they're removable is because they'd be in the way otherwise, and there's no room to machine any other type of locating feature. There are a few dozen different work pieces that get put into this system which range in size from 400mm x 400mm up to 2100mm x 1525mm and are only located in the center, which means the yaw/pitch/roll values are different each time. To run the routine all you do is give the robot the approximate position of the block, and it runs through a 9 point routine to determine the precise location of it. Once you've found three blocks, you've got your frame. We tried vision and lasers to do the locating, but at the end of the day the most repeatable process was the touch probe. I'd like to develop a standard probe and routine for all of the jobs requiring user frames but I just haven't had time to design it.

    Hello,


    How did you interface the probe to Robot or PLC input?


    Thank you

    That's great!

    Is it possible to share your 3D cad?

    I would like to give it a try when possible

    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

    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.

    Sometimes I get this error if I keep RG opened for a few days; a restart usually fixes it for me..


    As a temporary (and probably better solution), could you use the 'Logic Simulation Assistant'? I/O simulation is more flexible and saves per program. Under 'Test-Run' tab.

    Hello,


    Is it possible for you to explain how does the "Logic Simulation Assistant" work? thank you very much


    Thanks again

    Hello again,


    I found a solution by myself, but I don't know if it is optimized,


    You write your 3 vector on Registers 1, 2 and 3

    You call the program form TPE program giving the 3 parameters

    Code
       1:  CALL UNITVECTOR(1,2,3)

    Here is my Karel code

    it overwrites the same registers

    Hello everyone,


    Could you please help to convert a vector to unit vector with Karel Please?

    I know how to do it methematically but I don't know the karel synthax.


    Let's say I have this vector:


    Vector1 (a, b, c)


    To find the unit vector of Vector1, the formula is:

    UnitVector1(a',b',c') where:

    a' = a / (sqrt(a^2 + b^2 + c^2))

    b'= b / (sqrt(a^2 + b^2 + c^2))

    c' = c / (sqrt(a^2 + b^2 + c^2))


    I am looking for somthing that I feed with a,b,c and returns a',b' and c'


    Thank you


    Thank you very much


    Finally I used Cramer's rule, and it works fine,


    Thanks again

    We don't want to use the Fanuc built in functions such as Touch Sensing ... because we have other robot brands (Kuka, Abb...) and we hope to find a way that can be adapted for the different brands

    Nice case, never thought about that :)

    What's your intention for it?

    I want to calculate automatically the Uframe,

    So I touch 3 points on each plan,

    3 points define a plan equation,

    So I have 3 equations,


    Then I solve the 3 equation system to find the origin point of the UFrame.


    After that I calculate the unit vectors for X , Y and Z directions,


    With the origin point and the 3 vectors, I have the Transformation Matrix of my Uframe,

    I then convert it to Euler Angles to find the xrzwrp.