Variables, Alignments, and OnError

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

  • Variables, Alignments, and OnError

    Hello again!
    Running PC-DMIS 2013 MR1 SP5 on a Windows 7 Desktop for an Optiv Performance 443
    ---------------------------------------------------------------------------------------------------------------------------
    (I posted something similar in Vision, but I'm not sure if the problem is directly related to Vision, or the items in the title.)

    Having some trouble again, I'm not really sure to begin.

    The problem I'm having is I can't measure a hole without PC-DMIS crashing and having to restart!

    Essentially I have a part mounted in a rotary table.
    I do an alignment with a TP200, then switch to the Camera, where I perform a measurement and then check for the location of a hole.
    Using OnError, I check if the hole is there (If EDGE_NOT_DETECTED, GOTO/{label})
    The label moves the rotab 180°, adjusts the alignment 180°, and remeasures the hole (it goes to a label above the hole)
    It repeats this process until it detects the hole, or does not detect it twice.

    The construction of the hole has constants for the THEO values, and uses the "plus 0" rule for the TARG values.

    And this is where the problems arise.

    I can't use the data!

    I'm not entirely sure if it's the alignments, the OnError, a bug in Vision, or my hardware, however...
    As soon as I measure the hole, it attempts to either create a variable or an alignment with the circle measurement.
    It freezes at this point, and crashes, and attempts to send the report to Hexagon.

    I will post the necessary code, but I could certainly use some help. Things that would help the most:

    - A better (as in working) method for checking a hole, if not there rotating and remeasuring
    - A summation of the process for how to go about something like that (as in 'do this, then do this, but don't do that)
    - An idea of what I may be doing wrong
    - A simple test program that checks for something (a point would work, I really don't care) and if it doesn't find it, rotates and rechecks, then actually uses the data!

    Things that will NOT help:

    - Worrying about the alignment, or construction of OnError (because it works; the current program rotates and remeasures, but doesn't like when I try to use the points)
    - Different ways to measure the hole. (The hole gets measured, there is a feature that is the hole, and I can recall the hole. Changing to FIXED_RAD or other won't help)
    - Generally useless questions (like what kind of part it is, how the initial alignment happens, how many points I'm using, etc) that don't pertain to crashing at a hole.

    ---------------
    I wish to reiterate.
    The Alignment WORKS, the construction of the circle and corresponding OnError/Label section is OKAY, the probe is able to SUCCESSFULLY find the hole, whether
    it be at 0° or 180°, and take a circle measurement. The circle measurement IS ABLE to draw the little green dots, therefore more-or-less measuring the hole.
    It just crashes when trying to pull any info from the hole.

    As always, any help would be appreciated.

  • #2
    Code:
                MOVE/ROTAB,0,SHORTEST,
                LOADPROBE/NO PROBE ATTACHED
                LOADPROBE/ZOOM
                TIP/TIP1, SHANKIJK=-0, 0, 1, ANGLE=0
                ASSIGN/IS_180=0
                ASSIGN/V2="NO"
                ASSIGN/V_ALIGN=0
                RECALL/ALIGNMENT,INTERNAL,FINE_ALIGN_0
    VIS_ORIGIN =FEAT/POINT,CARTESIAN,NO
                THEO/<0,0,0>,<0,0,1>
                ACTL/<0,0,0>,<0,0,1>
                CONSTR/POINT,ORIGIN
    HOLE_Z     =FEAT/POINT,CARTESIAN,NO
                THEO/<0,0,0.35>,<0,0,1>
                ACTL/<0,0,0.35>,<0,0,1>
                CONSTR/POINT,OFFSET,VIS_ORIGIN,0,0,0.35
                MOVE/ROTAB,0,SHORTEST,HOLE_Z
    VIS_LINFACE=FEAT/VISION/LINE/DEFAULT,CARTESIAN,BOUNDED
                THEO/<-0.05,0,0.33>,<0.05,0,0.33>,<1,0,0>,<0,-1,0>,<0,0,1>,0.1
                ACTL/<-0.0495,0.0007,0.33>,<0.0493,0.0009,0.33>,<0.9999991,0.0013689,0>,<0.0013689,-0.9999991,0>,<0.0000382,-0.0005867,0.9999998>,0.0988
                TARG/<-ABS(0.05),0+0,ABS(0.33)>,<ABS(0.05),0+0,ABS(0.33)>,<1,0,0>,<0+0,-ABS(1),0+0>,<0+0,0+0,ABS(1)>
                SHOW FEATURE PARAMETERS=YES
                  SURFACE=THEO_THICKNESS,0
                  MEASURE MODE=NOMINALS
                  RMEAS=NONE,NONE,NONE
                  CIRCULAR MOVES=NO
                  CLEARPLANE=NO
                  PREPOSITION=NO
                  GRAPHICAL ANALYSIS=NO
                  DIAGNOSTICS=NO
                  FEATURE LOCATOR=NO,NO,""
                SHOW_VISION_PARAMETERS=YES
                  TYPE=AUTOMATIC HIT TARGET
                  COVERAGE=100%
                  COVERAGE ACTIVE TARGETS=4
                  MAGNIFICATION=1.5001
                  HIT TARGET COLOR=RED,NOMINAL COLOR=GREEN
                  HIT TARGET=EA1,0,1,NORMAL,0.0045
                  FILTER=NO,NO
                  EDGE=SPECIFIED EDGE,16,[?]->[?],-->,1,1,1,1,NO,Backlight=<OFF,99.5,ON>,Toplight=<OFF,55,OFF>,Ringlight=<OFF,55.9,OFF>
                  FOCUS=NO
    NEW_ALIGN  =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                ALIGNMENT/LEVEL,YPLUS,FA_CYLOD
                ALIGNMENT/ROTATE_CIRCLE,ZPLUS,TO,FA_CYLOD,AND,FA_PLNROT,ABOUT,YPLUS
                ALIGNMENT/ROTATE,YPLUS,TO,FA_CYLOD,ABOUT,XPLUS
                ALIGNMENT/TRANS,XAXIS,FA_CYLOD
                ALIGNMENT/TRANS,ZAXIS,HOLE_Z
                ALIGNMENT/TRANS,YAXIS,FA_PNTFACE
                ALIGNMENT/END
                CLEARP/ZPLUS,0.5,ZPLUS,0,OFF
                ASSIGN/HOLE_AT_0=0
    LBL_HOLE   =LABEL/
    A1         =ALIGNMENT/START,RECALL:USE_ACTIVE_ALIGNMENT(NEW_ALIGN),LIST=YES
                ALIGNMENT/END
                ONERROR/EDGE_NOT_DETECTED,SET IS_180
    HOLE_TO_MEASURE=FEAT/VISION/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                THEO/<0,1.595,0>,<0,0,1>,0.033,0,0
                ACTL/<0,1.595,0>,<0,0,1>,0.033,0,0
                TARG/<0+0,ABS(1.595),0+0>,<0+0,0+0,ABS(1)>
                ANGLE VEC=<(ABS(1)),0+0,0+0>
                SHOW FEATURE PARAMETERS=YES
                  SURFACE=THEO_THICKNESS,0
                  MEASURE MODE=NOMINALS
                  RMEAS=NONE,NONE,NONE
                  CIRCULAR MOVES=NO
                  CLEARPLANE=NO
                  PREPOSITION=NO
                  GRAPHICAL ANALYSIS=NO
                  DIAGNOSTICS=NO
                  FEATURE LOCATOR=NO,NO,""
                SHOW_VISION_PARAMETERS=YES
                  TYPE=AUTOMATIC HIT TARGET
                  COVERAGE=100%
                  COVERAGE ACTIVE TARGETS=4
                  MAGNIFICATION=1.5001
                  HIT TARGET COLOR=RED,NOMINAL COLOR=GREEN
                  HIT TARGET=EA1,0,1,NORMAL,0.0075
                  FILTER=NO,NO
                  EDGE=MATCHING EDGE,5,[?]->[?],1,1,1,NO,Backlight=<OFF,0,OFF>,Toplight=<OFF,55,ON>,Ringlight=<OFF,55.9,ON>
                  FOCUS=YES,FULL,0.15,YES,2.2,NO
                ONERROR/EDGE_NOT_DETECTED,OFF
                IF/IS_180==1
                MOVE/ROTAB,180,SHORTEST,FA_PLNROT
    A2         =ALIGNMENT/START,RECALL:A1,LIST=YES
                ALIGNMENT/ROTATE_OFFSET,180,ABOUT,YPLUS
                ALIGNMENT/END
                GOTO/LBL_HOLE
                END_IF/
    LBL_GEN    =LABEL/
    F2         =GENERIC/CIRCLE,DEPENDENT,CARTESIAN,IN,$
                NOM/XYZ,<0,1.595,0>,$
                MEAS/XYZ,<HOLE_TO_MEASURE.X.MEAS,HOLE_TO_MEASURE.Y.MEAS,HOLE_TO_MEASURE.Z.MEAS>,$
                NOM/IJK,<0,0,1>,$
                MEAS/IJK,<HOLE_TO_MEASURE.I.MEAS,HOLE_TO_MEASURE.J.MEAS,HOLE_TO_MEASURE.K.MEAS>,$
                DIAMETER/0.0335,HOLE_TO_MEASURE.D.MEAS
    $$ NO,
                NEXT
    
    LBL_CONTINUE=LABEL/
    1595_ALIGN =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                ALIGNMENT/LEVEL,YPLUS,FA_CYLOD
                ALIGNMENT/ROTATE,ZPLUS,TO,F2,ABOUT,YPLUS
                ALIGNMENT/TRANS,XAXIS,F2
                ALIGNMENT/TRANS,ZAXIS,F2
                ALIGNMENT/TRANS,YAXIS,VIS_LINFACE
                ALIGNMENT/END

    Comment


    • InspectorJester
      InspectorJester commented
      Editing a comment
      The program stops at LBL_GEN, or at LBL_CONTINUE if I remove or mark LBL_GEN

  • #3
    I recall similar crashing issues while trying to measure aligned to a rotary waay back in the day, PCDMIS v3.7 days... Probably alignment or rotary-based. I doubt vision.

    Only other piece of advice I have for ya, is to make sure your workplanes are relevant to your Y axis level plane when they need to be. I see zero workplane changes in your code at all.

    Comment


    • #4
      Rookie mistake!
      I have a WORKPLANE/YMINUS trigger at the beginning before the manual alignment. Just realized that's all I have, when all of the holes are in ZPLUS!
      Could be the issue, I'll work on it.

      Also, wouldn't be surprised if it was the rotab. It tends to give random problems just because.

      Appreciate the input! I will get back with more information, or (hopefully) a solution

      Comment


      • #5
        I spent like four days on this specific issue just to find out it was a fricken WORKPLANE?

        ---

        Just goes to show the importance of knowing where you're working from. Thanks louisd!

        Comment

        Related Topics

        Collapse

        Working...
        X