hexagon logo

Iterative alignment transformation matrix

Is there an easy way to report out the transformation matrix that is applied by an iterative alignment? I want to recall an alignment from a previous fixture alignment and then run an iterative alignment on the part on that fixture and report out the exact rotations and translations used to transform from one alignment to the next.

Thanks for any help.
  • You can do it with a vector and a matrix (not only a matrix) with assignments (one more time !!!!!) :
    In the init ref, you can write the transformation to construct end ref or vice versa :
    The vector of the translation is : ASSIGN\V1=FORMAT("%3.3f,%3.3f,%3.3f",END_REF.ORGIN)
    The matrix is write in 3 lines :
    1st line : ASSIGN\V2=FORMAT("%3.8f,%3.8f,%3.8f",END_REF.XAXIS)
    2nd line : ASSIGN\V2=FORMAT("%3.8f,%3.8f,%3.8f",END_REF.YAXIS)
    3rdline : ASSIGN\V2=FORMAT("%3.8f,%3.8f,%3.8f",END_REF.ZAXIS)
    You can write it in a text file to recall values in a generic feature. Be carefull to use format function and "%3.8f" for vector values, if not , values are limited to decimal place of your programm.
  • I have used this method:
    In alignment1, construct point at origin. Also create Generic Line along X axis.

    Run through alignment2.
    Now construct another point at origin and another generic line along X axis.

    Now you can report XYZ movement between the points and anglular shift between lines.
  • Thanks to both of you for the help! I am able to get my head around Josh's solution a bit easier so I will probably start with that.

    JEFMAN, can you elaborate a bit on exactly how you would apply your solution? I'm not sure exactly what "Format" and "End_Ref" are accessing so I'm not 100% clear on where these lines need to be placed in relationship to the two alignment commands. For the matrix you are placing 3 different values into a single variable. How does this workout? I would think that the 2nd line would just over write that value from 1st line. I am sure this is just my lack of understanding so any help that you can give to pull me along a bit further would be very much appreciated. Even if I end up using Josh's solution I would still like to understand how this works.

    Thanks again.
  • I try to explain, even if it's a little hard for me in english !!!
    For the "format" function, it's usefull for 2 things : first, it removes the "<" and ">" of a vector or a point value - second, it allows you to write more values than decimal place does.
    For the matrix rotation, if you turn around Z of an angle A, the matrix is wrote like this :
    Cos A Sin A 0
    -Sin A Cos A 0
    0 0 1
    If you do another rotation around another axis, you write another matrix like this one, but cos, sin , 0 and 1 change of place.
    The total rotation matrix result is the product of the first by the second (etc if there are more rotations).
    If you construct a first alignment, for example INIT_REF, then you measure a second alignment (END_REF), you recall init_ref and you assign what I wrote in the first reply.
    ASSIGN\V1=FORMAT("%3.3f,%3.3f,%3.3f",END_REF.ORGIN )
    ASSIGN\V2=FORMAT("%3.8f,%3.8f,%3.8f",END_REF.XAXIS )
    ASSIGN\V3=FORMAT("%3.8f,%3.8f,%3.8f",END_REF.YAXIS )
    ASSIGN\V4=FORMAT("%3.8f,%3.8f,%3.8f",END_REF.ZAXIS )

    You can create a generic feature point with x = V1.X,Y=V1.Y and Z = V1.Z.
    It's the origin of END_REF.
    You can create a plane with X=V1.X,Y=V1.Y and Z = V1.Z and I=V4.X,J=V4.Y and K=V4.Z, and create Z axis of END_REF. The same for X and Y planes.
    If you write matrix in a text file, you can recall values with read function.
    I use it when the init ref is not easily accessible all the long of measurement (after a reversal, for example)

    I hope it's clear, I'm not sure !!!!!!
  • I try to explain, even if it's a little hard for me in english !!!
    For the "format" function, it's usefull for 2 things : first, it removes the "<" and ">" of a vector or a point value - second, it allows you to write more values than decimal place does.
    For the matrix rotation, if you turn around Z of an angle A, the matrix is wrote like this :
    Cos A Sin A 0
    -Sin A Cos A 0
    0 0 1
    If you do another rotation around another axis, you write another matrix like this one, but cos, sin , 0 and 1 change of place.
    The total rotation matrix result is the product of the first by the second (etc if there are more rotations).
    If you construct a first alignment, for example INIT_REF, then you measure a second alignment (END_REF), you recall init_ref and you assign what I wrote in the first reply.
    ASSIGN\V1=FORMAT("%3.3f,%3.3f,%3.3f",END_REF.ORGIN )
    ASSIGN\V2=FORMAT("%3.8f,%3.8f,%3.8f",END_REF.XAXIS )
    ASSIGN\V3=FORMAT("%3.8f,%3.8f,%3.8f",END_REF.YAXIS )
    ASSIGN\V4=FORMAT("%3.8f,%3.8f,%3.8f",END_REF.ZAXIS )

    You can create a generic feature point with x = V1.X,Y=V1.Y and Z = V1.Z.
    It's the origin of END_REF.
    You can create a plane with X=V1.X,Y=V1.Y and Z = V1.Z and I=V4.X,J=V4.Y and K=V4.Z, and create Z axis of END_REF. The same for X and Y planes.
    If you write matrix in a text file, you can recall values with read function.
    I use it when the init ref is not easily accessible all the long of measurement (after a reversal, for example)

    I hope it's clear, I'm not sure !!!!!!


    I forgot the major step !
    If you want to re-construct the second alignment in another part programm, you can do it by measuring only the first one (or vice versa) and apply the generic features.
  • Thank you very much JEFMAN. I understand how this works now. I'll give it a try.
  • There's another way to know rotations, with Euler angles method. Three rotations (nutation, precession, own rotation) are calculated step by step.
    The translation between the 2 alignments is a vector, like the 1st solution.
    1st step : Calculation of nutation
    ASSIGN\V1=CROSS(ALIGN_1.ZAXIS,ALIGN2.ZAXIS)
    Construc a generic plane PL1, in ALIGN_1 at 0,0,0 and I=V1.I,J=V1.J,K=V1.K.
    Create an alignment with PL1 for level.
    In this alignment, create a line LN1 (1,0,0)
    ASSIGN\OWN_ROTATION=ANGLEBETWEEN(LN1.IJK,ALIGN_2.XAXIS)
    The sign of angle is calculated with an id statement (for example if ALIGN_2.XAXIS.J>=0, OWN_ROTATION=-ANGLEBETWEEN(LN1.IJK,ALIGN_.XAXIS)
    ASSIGN\NUTATION=ANGLEBETWEEN(ALIGN_1.ZAXIS,ALIGN_2.ZAXIS)
    ASSIGN\PRECESSION=ANGLEBETWEEN(LN1.IJK,ALIGN_1.XAXIS)

    If you want to re-construct the second alignment from the first, you have to construct some generic feature, and turn angles around good axis... Good luck !
  • Very cool. Thank you very much for posting that addition. I'm going to work all of these methods out to make sure I understand them fully. In this field it is probably not possible to know too much about how to make these type of calculations.
  • Wow, Jefman.

    This is really good stuff, thank you for sharing.