Overcoming pierce point error: lines do not converge

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Overcoming pierce point error: lines do not converge

    Hi guys, looking to make a robust method to prevent the "lines do not converge error" on some constructed pierce points (line into circle).

    I've got pics here https://photos.app.goo.gl/1cbhG8y8X4DRHVzg6 (kirbs, work your magic to post please, as I have 1kb left of my 1mb allowance. lol.
    two arcs, four lines to construct four pierce points. The parts are small (0.09" diameter hole)
    I think some parts have flash on the edges of the line-arc intersect point, so the probe is shanking out and producing completely incorrect circles.

    I want to know if there's a way for me to anticipate lines do not converge error, then add a loop to grow the diameter, or shift Y value of circle, until lines do converge.

    Here's the code I tossed together, forces generic diameter and YZ locations based upon robust inner circle that's not segmented (ID1), if any of the measured values become outliers (>0.003" or so).

    CIR1 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
    THEO/<0.148,0,0>,<1,0,0>,0.0985
    ACTL/<0.148,0,0>,<1,0,0>,0.0985
    TARG/<0.148,0,0>,<1,0,0>
    START ANG=342,END ANG=378
    ANGLE VEC=<0,1,0>
    DIRECTION=CCW
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO
    CIR2 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
    THEO/<0.148,0,0>,<1,0,0>,0.0985
    ACTL/<0.148,0,0>,<1,0,0>,0.0985
    TARG/<0.148,0,0>,<1,0,0>
    START ANG=18,END ANG=-18
    ANGLE VEC=<0,-1,0>
    DIRECTION=CW
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO
    $$ NO,
    Below code does the following (with goal to prevent erroneous intersect points).
    V5 & V6= Finds smallest Y location deviation from zero, between cir1 and cir2, and outputs that value (used to locate ID2 Y value if MID_IDCIRS is > 0.004" off).
    V7= Finds the average diameter of cir1 and cir2. if either cir is different from ID1 cir by 0.003" or more, it forces ID1's measured value to create the average.
    V8= Finds the average Z location of Cir1 and Cir2. If either circles are off by more than 0.003" it forces the Z value to 0 for that circle z.
    ASSIGN/V5=MIN(ARRAY(ABS(CIR1.Y),ABS(CIR2.Y)))
    ASSIGN/V6=IF(V5==ABS(CIR1.Y),CIR1.Y,CIR2.Y)
    ASSIGN/SMALLDIA1=SORTUP(ARRAY(CIR1.DIA,ID1.DIA))
    ASSIGN/SMALLDIA2=SORTUP(ARRAY(CIR2.DIA,ID1.DIA))
    ASSIGN/C1_DIAM=IF(ABS(SMALLDIA1[2]-SMALLDIA1[1])>=0.003,ID1.DIA,CIR1.DIA)
    ASSIGN/C2_DIAM=IF(ABS(SMALLDIA2[2]-SMALLDIA2[1])>=0.003,ID1.DIA,CIR2.DIA)
    ASSIGN/V7=(C1_DIAM+C2_DIAM)/2
    ASSIGN/V8=(IF(ABS(CIR1.Z)>=0.003,0,CIR1.Z)+IF(ABS(CIR2.Z) >=0.003,0,CIR2.Z))/2
    MID_IDCIRS =FEAT/POINT,CARTESIAN,NO
    THEO/<0.148,0,0>,<1,0,0>
    ACTL/<0.148,0,0>,<1,0,0>
    CONSTR/POINT,MID,CIR2,CIR1
    ASSIGN/MIDLOC=IF(ABS(MID_IDCIRS.Y)>=0.004,V6,MID_IDCIRS.Y )
    ID2 =GENERIC/CIRCLE,DEPENDENT,CARTESIAN,OUT,$
    NOM/XYZ,<0.148+0,CIR1.TY,CIR1.TZ>,$
    MEAS/XYZ,<0.148+0,CIR1.Y,CIR1.Z>,$
    NOM/IJK,<1,0,0>,$
    MEAS/IJK,<1,0,0>,$
    RADIUS/0.0985+0,C1_DIAM
    ID3 =GENERIC/CIRCLE,DEPENDENT,CARTESIAN,OUT,$
    NOM/XYZ,<0.148+0,CIR2.TY,CIR2.TZ>,$
    MEAS/XYZ,<0.148+0,CIR2.Y,CIR2.Z>,$
    NOM/IJK,<1,0,0>,$
    MEAS/IJK,<1,0,0>,$
    RADIUS/0.0985+0,C2_DIAM
    MID_ID =GENERIC/CIRCLE,DEPENDENT,CARTESIAN,OUT,$
    NOM/XYZ,<0.148+0,MID_IDCIRS.TY,MID_IDCIRS.TZ>,$
    MEAS/XYZ,<0.148+0,MIDLOC,V8>,$
    NOM/IJK,<1,0,0>,$
    MEAS/IJK,<1,0,0>,$
    RADIUS/0.0985+0,V7
    AXISLINE =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
    THEO/<0.03,0,0>,<1,0,0>
    ACTL/<0.03,0,0>,<1,0,0>
    CONSTR/LINE,BF,3D,ID1,MID_ID,,
    OUTLIER_REMOVAL/OFF,3
    FILTER/OFF,WAVELENGTH=0
    MOVE/INCREMENT,<-0.4,0,0>
    MOVE/INCREMENT,<0,0,0.2>
    PART_ALIGN_6DOF=ALIGNMENT/START,RECALL:STARTUP,LIST=YES
    ALIGNMENT/LEVEL,XPLUS,AXISLINE
    ALIGNMENT/ROTATE,YPLUS,TO,INIT_ROTLINE2,ABOUT,XMINUS
    ALIGNMENT/TRANS,YAXIS,ID1
    ALIGNMENT/TRANS,ZAXIS,ID1
    ALIGNMENT/TRANS,XAXIS,FRONT_PLANE
    ALIGNMENT/END

    ID_LINE1 =FEAT/CONTACT/LINE/DEFAULT,CARTESIAN,UNBOUNDED
    THEO/<0.148,0.0466,0.053>,<0,-0.0436,-0.999>,<0,-0.9990482,0.0436194>,<-1,0,0>,0.025
    ACTL/<0.148,0.0466,0.053>,<0,-0.0436,-0.999>,<0,-0.9990482,0.0436194>,<-1,0,0>,0.025
    TARG/<0.148,0.0466,0.053>,<0,-0.0436,-0.999>,<0,-0.9990482,0.0436194>,<-1,0,0>
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO
    ID_PNT1 =FEAT/POINT,CARTESIAN,NO
    THEO/<0.148,0.0481,0.086>,<0,-0.0436194,-0.9990482>
    ACTL/<0.148,0.0481,0.086>,<0,-0.0436194,-0.9990482>
    CONSTR/POINT,PIERCE,ID_LINE1,ID2
    ID_LINE2 =FEAT/CONTACT/LINE/DEFAULT,CARTESIAN,UNBOUNDED
    THEO/<0.148,0.0466,-0.053>,<0,-0.0436,0.999>,<0,-0.9990482,-0.0436194>,<-1,0,0>,0.025
    ACTL/<0.148,0.0466,-0.053>,<0,-0.0436,0.999>,<0,-0.9990482,-0.0436194>,<-1,0,0>,0.025
    TARG/<0.148,0.0466,-0.053>,<0,-0.0436,0.999>,<0,-0.9990482,-0.0436194>,<-1,0,0>
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO
    ID_PNT2 =FEAT/POINT,CARTESIAN,NO
    THEO/<0.148,0.0481,-0.086>,<0,-0.0436194,0.9990482>
    ACTL/<0.148,0.0481,-0.086>,<0,-0.0436194,0.9990482>
    CONSTR/POINT,PIERCE,ID_LINE2,ID2
    ID_LINE3 =FEAT/CONTACT/LINE/DEFAULT,CARTESIAN,UNBOUNDED
    THEO/<0.148,-0.0466,-0.053>,<0,0.0436,0.999>,<0,0.9990482,-0.0436194>,<-1,0,0>,0.025
    ACTL/<0.148,-0.0466,-0.053>,<0,0.0436,0.999>,<0,0.9990482,-0.0436194>,<-1,0,0>,0.025
    TARG/<0.148,-0.0466,-0.053>,<0,0.0436,0.999>,<0,0.9990482,-0.0436194>,<-1,0,0>
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO
    ID_PNT3 =FEAT/POINT,CARTESIAN,NO
    THEO/<0.148,-0.0481,-0.086>,<0,0.0436194,0.9990482>
    ACTL/<0.148,-0.0481,-0.086>,<0,0.0436194,0.9990482>
    CONSTR/POINT,PIERCE,ID_LINE3,ID3
    ID_LINE4 =FEAT/CONTACT/LINE/DEFAULT,CARTESIAN,UNBOUNDED
    THEO/<0.148,-0.0466,0.053>,<0,0.0436,-0.999>,<0,0.9990482,0.0436194>,<-1,0,0>,0.025
    ACTL/<0.148,-0.0466,0.053>,<0,0.0436,-0.999>,<0,0.9990482,0.0436194>,<-1,0,0>,0.025
    TARG/<0.148,-0.0466,0.053>,<0,0.0436,-0.999>,<0,0.9990482,0.0436194>,<-1,0,0>
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO
    ID_PNT4 =FEAT/POINT,CARTESIAN,NO
    THEO/<0.148,-0.0481,0.086>,<0,0.0436194,-0.9990482>
    ACTL/<0.148,-0.0481,0.086>,<0,0.0436194,-0.9990482>
    CONSTR/POINT,PIERCE,ID_LINE4,ID3

  • #2
    You might try creating reverse lines.

    Comment


    • louisd
      louisd commented
      Editing a comment
      all the line vectors point towards the center of the part, so that shouldn't have any impact.

  • #3
    You could check the shortest distance between cir2 and each line (in that order). If dist < cir2 radius the line will pierce cir2, if dist == cr the line will be a tangent, if dist > cr the line will not touch cir2 at all.
    (If I have understood the problem correctly)
    AndersI
    SW support - Hexagon Metrology Nordic AB

    Comment


    • louisd
      louisd commented
      Editing a comment
      Upon further investigating I found the star probe was bent a bit, causing shank-hits. I replaced the probe, and it seems to have entirely mitigated the issue. I like your concept though.

  • #4
    You can create an alignment at the center of the circle and do alignment lines. I do this all the time.
    Scott Staral
    Layout Tech.
    Wisconsin Aluminum Foundry

    Comment


    • #5
      Ok re-hashing my post... Circle math is good, but the line vectors are periodically flipping on me enough to make the math failed errors continue.

      I think I figured out a solution. If the J vector of the line is less than we will say, 25% of theoretical (0.03 J) it should produce the math error.
      So I'm adding an if statement. If J is > (-0.03), and shift the line and remeasure it 0.008" closer to the known parting line, which will increase the vector, to be back in line with theoretical/expectation.

      Big question now is, if I added this code, creating duplicate auto-line feature ID's like this, it will overwrite all values of the first execution, upon the IF statement being true, and skipping entirely, upon the IF statement being false, correct?! If i'm wrong, what's the workaround?

      Code:
      ID_LINE1 =FEAT/CONTACT/LINE/DEFAULT,CARTESIAN,UNBOUNDED
      THEO/<0.148,0.0466,0.053>,<0,-0.0436,-0.999>,<0,-0.9990482,0.0436194>,<-1,0,0>,0.025
      ACTL/<0.148,0.0466,0.053>,<0,-0.0436,-0.999>,<0,-0.9990482,0.0436194>,<-1,0,0>,0.025
      TARG/<0.148,0.0466,0.053>,<0,-0.0436,-0.999>,<0,-0.9990482,0.0436194>,<-1,0,0>
      SHOW FEATURE PARAMETERS=NO
      SHOW CONTACT PARAMETERS=NO
      IF/ID_LINE1.J > (-0.03)
         ID_LINE1 =FEAT/CONTACT/LINE/DEFAULT,CARTESIAN,UNBOUNDED
           THEO/<0.148,0.0466,0.045>,<0,-0.0436,-0.999>,<0,-0.9990482,0.0436194>,<-1,0,0>,0.025
           ACTL/<0.148,0.0466,0.045>,<0,-0.0436,-0.999>,<0,-0.9990482,0.0436194>,<-1,0,0>,0.025
           TARG/<0.148,0.0466,0.045>,<0,-0.0436,-0.999>,<0,-0.9990482,0.0436194>,<-1,0,0>
           SHOW FEATURE PARAMETERS=NO
           SHOW CONTACT PARAMETERS=NO
      END_IF/
      Last edited by louisd; 08-12-2019, 06:46 PM.

      Comment


      • TK_Fire
        TK_Fire commented
        Editing a comment
        Loop until you get a line that works maybe?

        Label
        evaluate/adjust line
        Line
        If bad GOTO Label

        may need to add variable in there for the first run
        Last edited by TK_Fire; 08-13-2019, 08:01 AM.

      • louisd
        louisd commented
        Editing a comment
        I like it!
        assign variable to be initial line Z nominal,
        do loop,
        Measure line with variable assigned to Z.
        re-assign variable value to shift Z closer to flash/parting line
        until J vector of line is > 0.03

        that makes one feature ID to measure, until it lines up. brilliant!
        I'll have to add some default case to protect it from falling too low, but its a great plan. thanks for the suggestion TK_Fire

    Related Topics

    Collapse

    Working...
    X