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).
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
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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
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
Comment