Position Converter - Convert from XYZWPR Rep to Joint Rep and Back

  • Now Open Source:



    I've created a freeware tool I would like to share with the community. I've named it Position Converter. Position Converter’s purpose is to convert Fanuc TP program points from XYZWPR representation to Joint representation and vice versa. The program does this by opening a full MD: backup and parsing all .ls files contained along with a number of various files for the robot’s arm type, user tools, and user frames in order to do the conversion properly.

    What Position Converter looks like when a backup is opened:



    Download and extract the attached .zip file into a folder somewhere.
    Make sure your computer has .Net 4.6.1 Framework installed.

    Program Tips:

    • Hovering over a point will display its contents in a tooltip.
    • Hovering over a program will display its comment in a tooltip.
    • Points are color coded by their point representation. Green for XYZWPR, and blue for Joint.
    • If a conversion fails, the point will be colored red, and the tooltip will be updated on why the conversion failed.
    • You can view the parsed in robot type, user frames and robot model under the view tab.

    Known Issues:

    • The math will have slight differences from a conversion done on the Fanuc controller vs a conversion done by this program. Typically the differences are in the order of hundredths to thousandths of a millimeter (far below the repeatability of a typical arm).
    • Only NUT or FUT point configurations are supported. I plan on adding support for NDT, FDT, NDB, and FDB at a later date.
    • Only the following arms are supported, more to be added in the future:

      • R-1000iA/80F with and without insulation plate.
      • R-1000iA/100F with and without insulation plate.
      • R-2000iA/165F,/200F with and without insulation plate.
      • R-2000iB/125L,/165F,/210F with and without insulation plate.
      • R-2000iC/125L,/165F,/210F with and without insulation plate.
      • Arc Mate 120iC or M20iA
      • M710iC/12L
      • M710iC/20L - Untested
      • M710iC/20M - Untested
      • M710iC/45M - Untested
      • M710iC/50 - Untested
      • M710iC/70 - Untested
    • Multiple groups are now kinda supported, but only the first group will get converted.
    • Remote TCP is not supported.
    • Extended Axes are not supported.

    Help Me Out:

    This release is pretty much alpha level. As such there will be bugs and crashes. Please let me know if this program works out for you, or if you would like to have a particular arm added. If the program craps out for any reason, please dwagner@synapticrobotics.com the backup so I can fix the issue. I plan on supporting this for a while.

    Revision History:

    V1.1.1.0 - Initial Release

    V1.1.1.1 - Added R2000iA/165 and 200F variants

    V1.1.1.2 - Added R2000iB/125L and R2000iC/125L variants

    V1.1.1.3 - Added .csv output for programs when 'saving as'. Outputs a .csv of the program points.

  • Place your Ad here!

  • You can do this in Karel as well and deploy in roboguide or on an actual controller. It is nice for some applications. Good job!

    True, but all those cost money.

    Several years ago, I wrote a routine in Karel that does the same thing as this (attached), but the IK solving is a black box. I mainly used this program to as an exercise in order to learn how to solve inverse kinematics via matrix math, and to get a better understanding of matrix math in general. Turns out solving a robot with a spherical wrist is not too hard once you have your head around the math behind it.

  • Definitely some time involved in figuring this out I am sure. I have only learned a bit about matrix math; I don't have enough patience to learn more, and when I tried watching the web session it made me sleeeeeeepy. haha :mad:

  • Hello,

    Have you implemented the complete robot kinematic in your program? It's an impressive job!

    I don't have much experience in robotic programming yet, so I don't know in which case such a tool could be useful, do you have some example?

  • Yes, the robot's kinematics are modeled in the program. All forward and inverse kinematics are done in it.

    I mainly wrote it for a customer of mine that needs to do this task frequently. They have a path in car body space coordinates, robot gets installed in the plant, the service tech touches up the path to match reality, then the laser tracker guy comes in to shoot in the robots into body space, but the tech doesn't want to lose his touch ups, so he converts his whole path to joint. Once the real body space transform is known, they convert the path back to XYZWPR.

    If they are lucky, they get the laser tracker guy in before they do the touch up, but the laser tracker guy is usually slammed.

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

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

  • Ok thanks for your explanation!

    Actually I am really interested by converting cartesian coordinates XYZWPR to joint values for the LR-Mate 200iD/4S. I am trying to get its DH parameters but with no success yet (cf. this thread)...

    I see that your tool looks into .ls files, are there some info about DH parameters in these files?

  • I have the DH parameters hard coded into the tool for now. To figure out which DH parameters to use, the tool just parses the version.dg file and then looks up the arm in a look up table. I should break the arm data out into their own file structure. DH parameters are derived from the data sheet on Fanuc's website. If I wanted to get fancy, I could pull the DH parameters out of the system variables, which are stored in $PARAM_GROUP[1].$DH_A and $PARAM_GROUP[1].$DH_D last time I checked.

    For that arm it looks like the DH parameters are:

    DH parametersAlpha (α)a (mm)d (mm)Theta (θ) (deg)
    Joint 1 DH parameters90
    Joint 2 DH parameters0260090-θ2
    Joint 3 DH parameters90200θ32+90
    Joint 4 DH parameters-900290θ4*(-1)
    Joint 5 DH parameters9000θ5
    Joint 6 DH parameters000θ6*(-1)
    FacePlate DH parameters00700

    Note that since Fanucs place their origin at the intersection of J1 and J2, you can ignore the 330mm from the base to J2.

    You could combine the J6 and Faceplate DH parameters, but I broke them out because it made it easier for me.

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

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

  • I found the DH parameters thanks to you.

    In roboguide I have the following values.. they are quite different, do you know why?


    Then, I have a problem with the matrix, I found several doc and each show different matrix... which one should I use?

    Matrix1 - page 3

    Matrix2 - page 3

    Matrix3 - page 3

    I have tried all three with both DH parameters sets and none gave me the correct result...

    (sorry for using your thread to ask these questions).

  • Regarding the DH parameters you found, they are pretty much the same, it is just that they do a -90 in alpha on J3 whereas I do a +90. They then "undo" this at J6 with the 180 alpha. By defining the J3 at a -90, they have to define all the folowing d's negative, and take opposite rotations on alpha to J6. I see why they did this though. By doing it that way, they don't have to negate their J4 and J6 theta's like I do.

    I use (and apparently so does Fanuc) the equations defined in the Wikipedia article about DH parameters. This is what your first two papers use.

    The third paper is using the modifed DH parameters, which are sometimes refered to as just DH parameters. Which tends to lead to a bit of confusion.

    I've been testing both sets of DH parameters and am getting good results. Hopefully we can find out where your error is coming in.

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

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

  • Thank you very much for your help.

    Here is the result with the previous parameters when calculating the face plate point P= M*[0 0 0 1] = [280 0 -360 1].

    In fact the values are correct but I would rather prefer to get P =[360 0 280 1] to be aligned with the working coordinates system of the robot (where Z is vertical etc.).

    I don't understand why the kinematic coordinate system is not aligned with the working coordinates system, not sure I am clear..

  • I'm not familiar with that nomenclature. I would expect a 4x4 matrix, or XYZWPR representation.

    It won't be aligned. The numbers you are getting are the same as a user tool on the face plate. Z will be lined up with world X, and X with world Z.

    You should be getting the following:

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

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

  • Since most Fanuc arms are spherical wrists, the inverse kinematics become a bit simpler. Look up kinematic decoupling if you would like to read more.

    The thousand foot view of how it works is that you use the wrist center point to solve for the major axes, and then you use the WPR of the point to fine the minor axes.

    How my conversion utility works:

    1. Convert point to matrix representation. Fanucs are world Rz*Ry*Rx, so you can use that to get back to matrix rep.
    2. Take the point and matrix multiply it by the inverse of the TCP to get back to the Faceplate.
    3. Then times that by the inverse of the wrist center point to the faceplate to get back to the wrist center.
    4. Once the wrist center point is found, check for reachability, and if reachable, solve J1, J2, and J3.
    5. Now solve for J4, J5, and J6.

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

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

  • Yes they are. However, we are both right! Rx - Ry' - Rz'' is equivalent to Rz - Ry - Rx.

    How does that work? I'm not sure we're using the same terminology here -- I know that when I'm programming a Fanuc vs a KUKA, and using my hand to work out what angles I need to use, I have to rotate in completely different sequences.

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

Advertising from our partners