Author Topic: Help calculating an offset  (Read 863 times)

0 Members and 1 Guest are viewing this topic.

Offline DMayAstro

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
Help calculating an offset
« on: August 14, 2017, 05:55:36 AM »

I'm brand new to the forum.  I'm having trouble with calculating an offset for pick and place equipment.

Here's the story.  I have a JIG that we use a pin to get specific X,Y and Z encoder values.  I want to use this same JIG to teach all the different product types we Pick and Place.  The hole in the JIG represents the X and Y center of a device on a tray.  I know the distance from the tray edge to the center of the pocket for both axis.

I have the same information for the other product. 

I erroneously thought the answer would be to add the difference between these two center points to the original point for both X and Y axis.  This obviously doesn't work.

This strikes me as more a geometry problem.


Offline SkyeFire

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 32
  • -Receive: 935
  • Posts: 6347
Re: Help calculating an offset
« Reply #1 on: August 14, 2017, 03:58:44 PM »
It is a geometry problem, but one the robot should be equipped to handle natively.  The details depend on your brand, of course.

The critical point is that any reference frame in a robot (UFrame, Base, etc) is a relative transform from a reference frame, in 6 Degrees Of Freedom -- that is, X,Y,Z, and Rx, Ry, Rz.

In every industrial robot, there is a facility to create these frames by touching 3 or 4 points on the frame you're trying to create -- usually the Origin, a point defining the X+ vector, and a point somewhere in the positive quadrant of the XY plane.  This will generate an XYZRxRyRz set of 6 coordinates that, basically, say:  "Starting from the frame of reference (usually the robot's World/Root/Base-0), move this many mm along X, then Y, then Z, then rotate this many degrees around X, then this many degrees around the new Y, then this many degrees around the new Z."  The rotation angles are Euler or Tait-Bryan values, usually.

Let's assume for the sake of argument that you do this, and your new frame's XY plane is perfectly parallel to the World XY plane, but rotated 45deg relative around Z.

If you go to the values of your new frame, and simply add 10mm to the X value, you will not be moving along your frame's X axis, but along the World X axis.  To move along your frame's X axis, you need to perform some math.  Or, generally, most robots include a function to do this for you.

The underlying math is usually to convert each frame into a matrix, perform a cross-multiplication of the two matrices, then convert the result back into your robot's preferred coordinate nomenclature (this can be tricky, since there are many different valid Euler sequences, and every brand seems to use a different one.  And then there's ABB, which uses quaternions....)