UFRAMEs and UTOOLs

Filed under:

One of the great things about FANUC’s TP programming language is that just about anyone, with very little training, can pick up a teach pendant, write a few lines of code and get their robot moving. The language is very high-level and fairly readable so even someone without a programming background can generally understand what each line of code does.

But what if something goes wrong? The problem with making a tool that’s so beginner-friendly (but still very powerful) is that beginners often struggle on fairly basic problems because they don’t understand the lower-level mechanics and software. Their code may also accomplish a task but do so in a way that makes maintenance difficult further down the road.

I think that one of the most powerful and basic concepts that every programmer should understand is how positions and frames relate to eachother. I taught this point; how does the robot get there?

WORLD (UFRAME[0]) and UTOOL[0]

Your robot comes fresh with UTOOL[0] and UFRAME[0] active. What does this mean?

To define any point in any system, that point has to be relative to some Origin, right? Think back to simple 2D charts. The point (2,2) is relative to the (0,0) Origin where the X- and Y- axes cross. Well, all positions for your robot are relative to its Origin, also known as the WORLD frame, UFRAME[0]. This Origin for articulated robots is conveniently located exactly in the center of the J1 axis at the height of J2. (By choosing this Origin, the robot’s kinematic equations become a little simpler, but that’s for another discussion.) The orientation of the Origin has +X moving directly straight away from the back of the base and +Z is up, away from the base, when the robot is mounted to the floor. According to the right-hand rule, that makes +Y to the robot’s left.

Take this position:

   X:  1500.000mm    Y:    50.000mm    Z:   360.000mm
   W:   180.000deg   P:     0.000deg   R:     0.000deg

With what you now know about where the WORLD Origin is, you know that this position is exactly 1500mm in front of the robot, 50mm to the robot’s left and 360mm above J2.

What about the UTOOL?

Now that we know where that point is in space, what part of the robot should move there? Intuitively, you might guess the robot faceplate. If so, you’d be correct if you’re still using UTOOL[0].

UTOOL[0] is defined as:

   X:     0.000mm    Y:     0.000mm    Z:     0.000mm
   W:     0.000deg   P:     0.000deg   R:     0.000deg

This position is directly in the center of the robot faceplate. Whenever the robot moves to a position, it attempts to move the Tool Center Point (TCP), the point in space relative to the faceplate defined by the current UTOOL, to the destination position relative to the current UFRAME.

Let’s do a couple of examples. Take our first position:

   X:  1500.000mm    Y:    50.000mm    Z:   360.000mm
   W:   180.000deg   P:     0.000deg   R:     0.000deg

With an entirely zeroed out UTOOL, the robot will move the faceplate to that point relative to UFRAME[0]. What if we create a UTOOL[1] like this and move to the same position?

   X:     0.000mm    Y:     0.000mm    Z:   100.000mm
   W:     0.000deg   P:     0.000deg   R:     0.000deg

The TCP has now moved 100mm directly down from the faceplate. When we move to the same position, the robot faceplate is now 100mm higher than it was previously.

Now what if we define a new UFRAME[1] with same components as our position? How would we get the robot to move to the same place with this new UFRAME active? Since all positions are relative to a reference frame, and you want to move the robot to this reference frame’s Origin, you’d simply move the robot to this position:

   X:     0.000mm    Y:     0.000mm    Z:     0.000mm
   W:     0.000deg   P:     0.000deg   R:     0.000deg

Why?

Of course you can program a perfectly working application only using UFRAME[0] and UTOOL[0], but all of those positions will be relative to that point directly above J1 in line with J2, and the robot will be moving its faceplate to all of those positions. Is this the most logical way? Probably not.

Let’s say you have a simple vacuum cup directly in the center of the faceplate but 100mm below it. We can use our UTOOL[1] to define it:

   X:     0.000mm    Y:     0.000mm    Z:   100.000mm
   W:     0.000deg   P:     0.000deg   R:     0.000deg

Using this UTOOL, we know that the robot will be moving the bottom of that vacuum cup to all positions, not the robot faceplate. This is probably a better way of thinking about things.

Let’s combine that with a more logical UFRAME. Let’s say we’re picking from a stationary fixture. The corner of this fixture is exactly where our previous position was:

   X:  1500.000mm    Y:    50.000mm    Z:   360.000mm
   W:   180.000deg   P:     0.000deg   R:     0.000deg

If the fixture is 200mm long, 200mm wide, and has a 50mm tall part right in the center of it, where do you think a good pick position might be? Something like this is probably pretty close:

   X:   100.000mm    Y:   100.000mm    Z:    50.000mm
   W:     0.000deg   P:     0.000deg   R:     0.000deg

Relative to the corner of your fixture, the robot is going to move the bottom of the vacuum cup 100mm forward, 100mm left and 50mm above it. It’s very easy to visualize this position in space by using a logical UFRAME and UTOOL.

What if we were using UFRAME[0] and UTOOL[0]? Our pick position would now be:

   X:  1600.000mm    Y:   150.000mm    Z:   510.000mm
   W:   180.000deg   P:     0.000deg   R:     0.000deg

Can you tell just by glancing at that position that it’s going to move the vacuum cup to the very top of that box? Probably not… it’s not relative to anything useful for the given operation.

Another Reason for UFRAMEs

What if the fixture moved? If you only have one position relative to that fixture, it’s not a big deal to re-teach the point, but what if you have 5, 10, 100? Moving that fixture one inch just cost you a lot of time if you didn’t have a UFRAME for it. If you did go through the trouble of using a UFRAME, you simply touch up your UFRAME and all 100 positions are now useful again.

Another Reason for UTOOLs

Similarly, what if you decide to use a different vacuum cup that’s two inches taller? Again, if you only have a single position to touch up, it’s not a big deal, but what if you’re operating on things in 100 different places? You now have to touch up each and every point or damage your gripper. If you were using an accurate UTOOL, you simply add ~50mm to your Z component, and you’re good to go.

Hopefully you now see how UFRAMEs and UTOOLs work, why they help positions make more sense, and how they can save you lots of time when things change.


Want posts like this delivered right to your inbox?

If you liked this post, please sign up for my mailing list!