hexagon logo

PC-DMIS 3D Line Straightness

PC-DMIS appears to have issues calculating the proper straightness of a 3D line. The definition of straightness from the PC-DMIS online help is: This is the diameter of a cylinder that contains all the input points. A best-fitting routine determines the axis of the cylinder. If this is actually what PC-DMIS is using then the results are wrong using any method available in PC-DMIS.

; test points and resulting line
PNT1 =FEAT/POINT,CARTESIAN,NO
THEO/<432.03501,-1213.3127,50.2008>,<0,0,1>
ACTL/<432.03501,-1213.3127,50.2008>,<0,0,1>
CONSTR/POINT,CAST,PT_46_1
PNT2 =FEAT/POINT,CARTESIAN,NO
THEO/<455.70566,-1213.79075,42.17132>,<0,0,1>
ACTL/<455.70566,-1213.79075,42.17132>,<0,0,1>
CONSTR/POINT,CAST,PT_46_2
PNT3 =FEAT/POINT,CARTESIAN,NO
THEO/<479.38146,-1214.19232,34.15272>,<0,0,1>
ACTL/<479.38146,-1214.19232,34.15272>,<0,0,1>
CONSTR/POINT,CAST,PT_46_3
PNT4 =FEAT/POINT,CARTESIAN,NO
THEO/<503.0449,-1214.60886,26.09845>,<0,0,1>
ACTL/<503.0449,-1214.60886,26.09845>,<0,0,1>
CONSTR/POINT,CAST,PT_46_4
PNT5 =FEAT/POINT,CARTESIAN,NO
THEO/<526.72087,-1215.06874,18.08364>,<0,0,1>
ACTL/<526.72087,-1215.06874,18.08364>,<0,0,1>
CONSTR/POINT,CAST,PT_46_5
LIN1 =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
THEO/<432.0354,-1213.32863,50.20282>,<0.9468433,-0.0173208,-0.3212286>
ACTL/<432.0354,-1213.32863,50.20282>,<0.9468433,-0.0173208,-0.3212286>
CONSTR/LINE,BF,3D,PNT1,PNT2,PNT3,PNT4,PNT5,,
OUTLIER_REMOVAL/OFF,3
FILTER/OFF,WAVELENGTH=0

​; straightness results
DIM STRA3= STRAIGHTNESS OF LINE LIN1 UNITS=MM ,$
GRAPH=OFF TEXT=OFF MULT=10.00 ARROWDENSITY=100 OUTPUT=BOTH
AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
M 0.00000 0.01000 0.00000 0.04133 0.04133 0.03133 -------->

​FCFSTRA2 =GEOMETRIC_TOLERANCE/STANDARD=ASME Y14.5,SHOWEXPANDED=YES,
UNITS=MM,OUTPUT=BOTH,ARROWDENSITY=100,
SEGMENT_1,STRAIGHTNESS,DIAMETER,0.01,TOL_ZONE_MATH =DEFAULT,
TEXT=OFF,CADGRAPH=OFF,REPORTGRAPH=OFF,MULT=10,
MEASURED:
LIN1:0.04623,
ADD
FEATURES/LIN1,,

​FCFSTRA3 =GEOMETRIC_TOLERANCE/STANDARD=ASME Y14.5,SHOWEXPANDED=YES,
UNITS=MM,OUTPUT=BOTH,ARROWDENSITY=100,
SEGMENT_1,STRAIGHTNESS,DIAMETER,0.01,TOL_ZONE_MATH =LSQ,
TEXT=OFF,CADGRAPH=OFF,REPORTGRAPH=OFF,MULT=10,
MEASURED:
LIN1:0.05824,
ADD
FEATURES/LIN1,,​


First off, why three different (and wrong) answers for the same thing?

The correct result is 0.04936 mm using the above data. I was able to verify this in PC-DMIS by creating an alignment from the best fit line and finding the smallest diameter circle containing all the input points:

A1 =ALIGNMENT/START,RECALL:MC_CSY,LIST=YES
ALIGNMENT/LEVEL,ZPLUS,LIN1
ALIGNMENT/TRANS,XAXIS,LIN1
ALIGNMENT/TRANS,YAXIS,LIN1
ALIGNMENT/END

CIR1 =FEAT/CIRCLE,CARTESIAN,IN,MIN_CIRCSC],NO
THEO/<-0.00715,0.00477,463.95901>,<0,0,1>,0.04936
ACTL/<-0.00715,0.00477,463.95901>,<0,0,1>,0.04936
CONSTR/CIRCLE,BF,2D,PNT1,PNT2,PNT3,PNT4,PNT5,,
OUTLIER_REMOVAL/OFF,3
FILTER/OFF,UPR=0


I did figure out the method PC-DMIS used to calculate the straightness with the GeoTol command when the TOL_ZONE_MATH is set to DEFAULT or LSQ (Least Squares is not a valid description by the way). Neither method results in the smallest containing cylinder. The legacy method is a mystery and clearly wrong.


  • @ neil.challinor​​ there is something obviously wrong with the 3D line results (Legacy and GeoTol LSQ). Although the standards define straightness as the smallest containing cylinder (or minimum separation of containing parallel planes for flatness) I don't have a problem with the Least Squares version. You have this an an option so I don't think you see this as a problem either. A CMM is just a big approximation machine to begin with and Least Squares is the preferred fit in most (maybe all) cases as it tends to filter out the filiers. The Least Squares result is usually what I expect to find in any software as the default.


    In terms of the Geometric Tolerance command, "DEFAULT" means that it will use the default calculation as defined in whichever standard you have selected (ISO 1101 or ASME Y14.5). In the case of Datum Math, this would be constrained L2 for ASME or constrained min/max for ISO. For feature math, again, there are differences between ASME and ISO with ISO having a number of rules which dictate different calculations depending on whether modifiers are invoked. For Tolerance Zone math, it will generally be a vector min/max fit for profile or, as you have already learnt, Chebyshev for form tolerances.

    You are able to override any of the math types by selecting Least Squares, but you would no longer be following the selected standard. Least Squares can be useful for providing process information and may yield a more repeatable result on systems that have a large amount of measurement uncertainty. The help file talks at length about math types and suggests users perform their own, "careful study" when deciding which math types to apply.

    https://docs.hexagonmi.com/pcdmis/2023.1/en/helpcenter/mergedProjects/core/geometric_tolerances/Introduction_to_Geometric_Tolerances_and_Feature_Control_Frames.htm?rhhlterm=careful%20study&rhsyns=%20#MiniTOCBookMark5
  • @ neil.challinor​​​ it is very awesome that PC-DMIS is trying to adhere to the standards. I have been critical of this for a very long time (not just PC-DMIS but any inspection software). The reality is that CMM's only sample points so this is all you have to work with and trying to create something that mimics perfect mating parts, as defined in the standards, could be an unachievable goal at the end of the day. At best, a CMM result would be no better than an approximation as it is unlikely you will touch on the exact key points of the part surfaces.

    The vast majority of CMM's out there use touch trigger probes. I do run into machines with SP25M or XS1 probes from time to time but not that many. At least with an analogue probe you can scan more of the features although not all. If you are using a typical CMM with a touch trigger probe you are dealing with very few points so using the max-min fit of the data is going to give you larger variations than the Least Squares version for sure (the form errors will be smaller but the position and orientation will change a lot more than the Least Squares version).

    What kind of Careful Study would a typical CMM user be able to perform? I think I could count on one hand the number of users who understand the significance of the best fit choices and I don't know of any user who would have access to utilities that would help them to fully understand the impact of method selection. If the user did something like run the same part over and over and compare results for repeatability then the Least Squares version will show better where best possible case would be identical variations between the two methods. What else would a typical user do, or be able to do?

    I really believe the default option should be Least Squares. When you consider what a typical CMM is this would be the more logical default in my opinion. For the minority of machines that have more capable equipment using min-max fits or constrained datum's makes more sense but this is a very small set of users.

    I am not trying to fence with you. It is just philosophical thoughts about CMM's, what they are, and what they are capable of.
  • New test with values of #4.
    (I'm back from mountains, my brain seems to be a little more clear Wink)
    Calculating a cylinder from 5 hits needs to calculate 5 vectors between each hit and the centroid (unknown).
    Then calculate 5 cross product between those vectors and the cylinder axis (unknown) which give 5 new vectors.
    The length of a cross product (except in PC-DMIS where it's always 1 !!!!!) is the product of the length of the 2 vectors * sin(angle between vectors).
    Here, this length is the radius at each hit.
    If you minimize the max - min, you should obtain the radius of the cylinder (5 hits design a cylinder, so the max -min should be very few).

    Python gives 0.046471 with a max - min 2.3 10-6 (diameter = straightness)
    Excel gives 0.046472 with a max - min 3.0 10-6 (diameter = straightness)
  • , The cross product function in PC-DMIS is broken so you can't use it for a lot of things as a result. In one regard you could call it a bug since it is a math function that produces an incorrect (unexpected) result but on the other hand it could be a special function unique to PC-DMIS that happens to have the name CROSS() and was never intended to be a real cross product. The worst part of this is when the result of the cross product should have a vector length of zero PC-DMIS reports the default vector of <0,0,1> instead - bleh!.

    Whatever the reason for this it will not be changed so you have to deal with it some other way. If they did change it then programs that use that function might no longer work properly so I suspect it will not be changed (I hope not at least). Whenever I need to use a cross product in PC-DMIS I create my own inline function to do this and ignore the build-in one. I don't have a sample of it handy but it is a simple one line command and I suspect you know how to code this yourself.