hexagon logo

Best-fit Alignments: Least squares vs. Vector

Which is the better Best-Fit alignment to use when comparing point deviation to CAD models? (Least Squares or Vector) Example, I am measuring these 36 points and using a 3D best-fit alignment. I am getting pretty substantial differences in the profile depending on the best-fit type. I have Rotate and Translate 3D alignment, but in the Least-SQR alignment it appears a -X- translation would help. What am I doing wrong?

RECALL/ALIGNMENT,INTERNAL,A5
A8 =ALIGNMENT/START,RECALL:A5,LIST=YES
ALIGNMENT/BF3D,LEAST_SQR,CREATE WEIGHTS=NO,ROTANDTRANS,USE SCALING=NO,-0.0053,0,-0.0032,-0.0004,-0.001,-0.0102
ITERATEANDREPIERCECAD=NO
Deviation Threshold=0.0003937
SHOWALLINPUTS=NO,SHOWALLPARAMS=NO
ALIGNMENT/END
FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;NOM,MAXMIN, , , , ,
SCN1 =FEAT/SET,CARTESIAN
THEO/<0,-1,0>,<0,1,0>
ACTL/<0,-1,0>,<0,1,0>
CONSTR/SET,BASIC,PNT145,PNT146,PNT147,PNT148,PNT149,PNT150,PNT151,PNT152,PNT153,PNT154,PNT155,PNT156,PNT157 ,PNT158,PNT159,PNT160,PNT161,PNT162,PNT163,PNT164, PNT165,PNT166,PNT167,PNT168,PNT169,PNT170,PNT171,PNT172,PNT173,PNT174,PNT175,$
PNT176,PNT177,PNT178,PNT179,PNT180,,
DIM PROF5= PROFILE OF SURFACE OF SET SCN1 FORMANDLOCATION UNITS=MM ,$
GRAPH=ON TEXT=OFF MULT=100.00 ARROWDENSITY=100 OUTPUT=BOTH
AX NOMINAL MAX MIN
M 0.0000 0.1668 -0.1632 <---|--->



RECALL/ALIGNMENT,INTERNAL,A5
A8 =ALIGNMENT/START,RECALL:A5,LIST=YES
ALIGNMENT/BF3D,VECTOR_LST_SQR,CREATE WEIGHTS=NO,ROTANDTRANS,-0.0107,0,-0.0063,0.0059,-0.0011,-0.01
ITERATEANDREPIERCECAD=NO
Deviation Threshold=0.0003937
SHOWALLINPUTS=NO,SHOWALLPARAMS=NO
ALIGNMENT/END
FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;NOM,MAXMIN, , , , ,
SCN1 =FEAT/SET,CARTESIAN
THEO/<0,-1,0>,<0,1,0>
ACTL/<0.0053,-1,0.0031>,<0.0001093,1,0.0000014>
CONSTR/SET,BASIC,PNT145,PNT146,PNT147,PNT148,PNT149,PNT150,PNT151,PNT152,PNT153,PNT154,PNT155,PNT156,PNT157 ,PNT158,PNT159,PNT160,PNT161,PNT162,PNT163,PNT164, PNT165,PNT166,PNT167,PNT168,PNT169,PNT170,PNT171,PNT172,PNT173,PNT174,PNT175,$
PNT176,PNT177,PNT178,PNT179,PNT180,,
DIM PROF5= PROFILE OF SURFACE OF SET SCN1 FORMANDLOCATION UNITS=MM ,$
GRAPH=ON TEXT=OFF MULT=100.00 ARROWDENSITY=100 OUTPUT=BOTH
AX NOMINAL MAX MIN
M 0.0000 0.0304 -0.0151 ----|#---
Parents
  • From 2015.1 core manual :

    Comparing Best Fit Alignments

    Least Squares Fit
    (Shown as LEAST_SQR in Command mode)
    The Least Squares fit minimizes the sum of the squared errors, which is the same as minimizing the average squared error.
    A weighted Least Squares fit minimizes a weighted average of the squared errors. It is supported for 2D, 3D, and user-defined best fit alignments.

    Vector Fit
    (Shown as VECTOR_LST_SQR in Command mode)
    The Vector fit is a kind of Least Squares fit, except that the error vectors are projected onto given direction vectors (usually the normals), and these projected distances are used in the Least Squares fit.
    If the normal vectors are used, then motion perpendicular to the normal is allowed without affecting the "goodness" of the fit.
    This can be used to mimic a hard gage. It is supported for 2D and 3D best fit alignments.

    Min Max Fit
    (Shown as MIN/MAX in Command mode)
    A Min/Max fit minimizes the maximum error.
    For this reason it can be used in an accept/reject procedure;
    if the maximal error is small then all errors are small, whereas a small least squares error, being an average, doesn't guarantee that all errors are small. It is supported only for 2D best fit alignments.
    If weights based on tolerances are used then a Min/Max fit reduces the percentage of available tolerance used by each feature.
    The Least Squares fit reduces the "average" amount of tolerance used by all features. Since the weights generated are reciprocals of the tolerances, a feature with a relatively small weight (or lower priority) corresponds to a large tolerance zone, which gives it more freedom to move without affecting the other features. A feature with a relatively large weight (or small tolerance zone) gets a high priority in the alignment process.


    I would use vector fit, because it's like using T_values in the algo, so it should be the closest way (in my opinion only !) on versions without min max vector...
Reply
  • From 2015.1 core manual :

    Comparing Best Fit Alignments

    Least Squares Fit
    (Shown as LEAST_SQR in Command mode)
    The Least Squares fit minimizes the sum of the squared errors, which is the same as minimizing the average squared error.
    A weighted Least Squares fit minimizes a weighted average of the squared errors. It is supported for 2D, 3D, and user-defined best fit alignments.

    Vector Fit
    (Shown as VECTOR_LST_SQR in Command mode)
    The Vector fit is a kind of Least Squares fit, except that the error vectors are projected onto given direction vectors (usually the normals), and these projected distances are used in the Least Squares fit.
    If the normal vectors are used, then motion perpendicular to the normal is allowed without affecting the "goodness" of the fit.
    This can be used to mimic a hard gage. It is supported for 2D and 3D best fit alignments.

    Min Max Fit
    (Shown as MIN/MAX in Command mode)
    A Min/Max fit minimizes the maximum error.
    For this reason it can be used in an accept/reject procedure;
    if the maximal error is small then all errors are small, whereas a small least squares error, being an average, doesn't guarantee that all errors are small. It is supported only for 2D best fit alignments.
    If weights based on tolerances are used then a Min/Max fit reduces the percentage of available tolerance used by each feature.
    The Least Squares fit reduces the "average" amount of tolerance used by all features. Since the weights generated are reciprocals of the tolerances, a feature with a relatively small weight (or lower priority) corresponds to a large tolerance zone, which gives it more freedom to move without affecting the other features. A feature with a relatively large weight (or small tolerance zone) gets a high priority in the alignment process.


    I would use vector fit, because it's like using T_values in the algo, so it should be the closest way (in my opinion only !) on versions without min max vector...
Children