Moving origin with generic features & variables

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

  • Moving origin with generic features & variables

    **SOLVED**

    Below code cleared everything up.
    Thanks to all who responded.

    Code:
    F1         =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                NOM/XYZ,<0+0,0+0,V4+0>,$
                MEAS/XYZ,<0+0,0+0,V4+0>,$
                NOM/IJK,<0+0,0+0,1+0>,$
                MEAS/IJK,<0+0,0+0,1+0>
    A5         =ALIGNMENT/START,RECALL:A4,LIST=YES
                  ALIGNMENT/TRANS,ZAXIS,F1
                ALIGNMENT/END

    Original post-->

    I have read on this forum that the proper way to move an origin using variables is by using Generic Features, feeding your variable into the feature, and then aligning to said feature.

    So I'm writing a program....
    After my original part origin, I am trying to make generic features and then origin to those generic features to move my origin around.
    Everything looks normal until I create an origin at the generic point and then all of a sudden...BOOM..everything gets weird.

    When I create F1, the point appears on top of my model just like I want. When I origin to F1 and then click in my window below F1, the point moves down to the bottom of the model and all of the measured stuff was on my model moves down off of the model. All I want is for the program to origin to the top, why is it moving everything instead?

    Code:
    STARTUP    =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
                ALIGNMENT/END
    VIEW151    =VIEWSET/
                FORMAT/TEXT,OPTIONS,ID,HEADINGS,SYMBOLS, ;NOM,TOL,MEAS,DEV,OUTTOL, ,
                MOVESPEED/ 500
                TOUCHSPEED/ 3
                DISPLAYPRECISION/6
                PREHIT/0.0001
                RETRACT/0.0001
                LOADPROBE/PNT5_10_10
                TIP/T1A90B180, SHANKIJK=0, -1, 0, ANGLE=180
    $$ NO,
                Model Import Details:
    
                VIEW151--> RY90,TZ2.285
    C3         =COMMENT/INPUT,NO,FULL SCREEN=NO,
                What part number would you like to measure?
    
                Type:
    
                147, 148, 149, 150, 151, 152, or 153
                IF/C3.INPUT<147 OR C3.INPUT>153 OR LEN(C3.INPUT)<>3
                GOTO/C3
                END_IF/
                ASSIGN/V1="Part Number: "+"1294-15-"+C3.INPUT
                SELECT/C3.INPUT
                  CASE/147
                  END_CASE/
                  CASE/148
                  END_CASE/
                  CASE/149
                  END_CASE/
                  CASE/150
                  END_CASE/
                  CASE/151
                    ASSIGN/V2=2.0290
                    ASSIGN/V3=0.8940
                    ASSIGN/V4=2.2850
                  END_CASE/
                  CASE/152
                  END_CASE/
                END_SELECT/
    C1         =COMMENT/INPUT,YES,FULL SCREEN=NO,
                Work Order#
                COMMENT/REPT,
                V1
    C2         =COMMENT/INPUT,YES,FULL SCREEN=NO,
                Equipment ID #
                COMMENT/REPT,
                CMM Program Validation Date:
    PNT1       =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                THEO/<0,0,0>,<0,0,-1>
                ACTL/<0,0,0>,<0,0,-1>
                TARG/<0,0,0>,<0,0,-1>
                SHOW FEATURE PARAMETERS=NO
                SHOW CONTACT PARAMETERS=NO
    A1         =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                  ALIGNMENT/TRANS,XAXIS,PNT1
                  ALIGNMENT/TRANS,YAXIS,PNT1
                  ALIGNMENT/TRANS,ZAXIS,PNT1
                ALIGNMENT/END
                MODE/DCC
                CLEARP/YMINUS,-0.125,ZPLUS,0,ON
                TOUCHSPEED/ 25
                MOVE/CLEARPLANE
    CIR1       =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,OUT,LEAST_SQR
                THEO/<0,0,0.1>,<0,0,1>,0.1635,0
                ACTL/<0,0,0.1>,<0,0,1>,0.1635,0
                TARG/<0,0,0.1>,<0,0,1>
                START ANG=0,END ANG=180
                ANGLE VEC=<1,0,0>
                DIRECTION=CW
                SHOW FEATURE PARAMETERS=NO
                SHOW CONTACT PARAMETERS=NO
                TOUCHSPEED/ 3
    A2         =ALIGNMENT/START,RECALL:A1,LIST=YES
                  ALIGNMENT/TRANS,XAXIS,CIR1
                  ALIGNMENT/TRANS,YAXIS,CIR1
                ALIGNMENT/END
                CLEARP/YMINUS,-0.1,ZPLUS,0,ON
                TOUCHSPEED/ 3
                MOVE/CLEARPLANE
    PNT_BOTTOM =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                THEO/<0,0,0>,<0,0,-1>
                ACTL/<0,0,0>,<0,0,-1>
                TARG/<0,0,0>,<0,0,-1>
                SNAP=NO
                SHOW FEATURE PARAMETERS=NO
                SHOW CONTACT PARAMETERS=NO
                MOVE/CLEARPLANE
    CYL1       =FEAT/CONTACT/CYLINDER/DEFAULT,CARTESIAN,OUT,LEAST_SQR
                THEO/<0,0,0.3>,<0,0,1>,0.1635,-0.2
                ACTL/<0,0,0.3>,<0,0,1>,0.1635,-0.2
                TARG/<0,0,0.3>,<0,0,1>
                START ANG=0,END ANG=180
                ANGLE VEC=<-1,0,0>
                DIRECTION=CCW
                SHOW FEATURE PARAMETERS=NO
                SHOW CONTACT PARAMETERS=NO
    A3         =ALIGNMENT/START,RECALL:A2,LIST=YES
                  ALIGNMENT/TRANS,ZAXIS,PNT_BOTTOM
                  ALIGNMENT/LEVEL,ZPLUS,CYL1
                ALIGNMENT/END
                WORKPLANE/YPLUS
    LIN1       =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
                THEO/<0,-0.5,0>,<0,1,0>
                ACTL/<0,-0.5,0>,<0,1,0>
                CONSTR/LINE,ALIGN,1,WORKPLANE
                WORKPLANE/ZPLUS
    A4         =ALIGNMENT/START,RECALL:A3,LIST=YES
                  ALIGNMENT/TRANS,ZAXIS,PNT_BOTTOM
                  ALIGNMENT/ROTATE,YPLUS,TO,LIN1,ABOUT,ZPLUS
                  ALIGNMENT/TRANS,XAXIS,CYL1
                  ALIGNMENT/TRANS,YAXIS,CYL1
                  ALIGNMENT/LEVEL,ZPLUS,CYL1
                ALIGNMENT/END
    F1         =GENERIC/POINT,INDEPENDENT,CARTESIAN,$
                NOM/XYZ,<0,0,0>,$
                MEAS/XYZ,<0+0,0+0,V4+0>,$
                NOM/IJK,<0,0,1>,$
                MEAS/IJK,<0+0,0+0,1+0>
    A5         =ALIGNMENT/START,RECALL:A4,LIST=YES
                  ALIGNMENT/TRANS,ZAXIS,F1
                ALIGNMENT/END
    1 pic for group.png2 pic for group.png
    Last edited by DAN_M; 11-07-2017, 07:57 AM.

  • #2
    did you click YES to the question, after inserting the NEW alignment?? I bet NOT
    B&S One
    PC-DMIS CAD v2014

    Romer Infinity

    Comment


    • #3
      I wasn't prompted to click yes or no.

      the alignment is at the end of my program and is simply recalling A4 so logically thinking I shouldn't have an issue (except for the fact that I do =/)

      Comment


      • #4
        I see. what is v4?
        B&S One
        PC-DMIS CAD v2014

        Romer Infinity

        Comment


        • DAN_M
          DAN_M commented
          Editing a comment
          I posted the code above......

          V4 is the variable that controls the overall height of the part.

        • WolfMan
          WolfMan commented
          Editing a comment
          well, I don't see v4 tide up to anything. ahh I see it. my bad.

          Did you try running the code, with variables sometimes they need be executed

        • DAN_M
          DAN_M commented
          Editing a comment
          Its tied into an input statement towards the top of my program.

          Code:
          C3         =COMMENT/INPUT,NO,FULL SCREEN=NO,
                      What part number would you like to measure?
          
                      Type:
          
                      147, 148, 149, 150, 151, 152, or 153
                      IF/C3.INPUT<147 OR C3.INPUT>153 OR LEN(C3.INPUT)<>3
                      GOTO/C3
                      END_IF/
                      ASSIGN/V1="Part Number: "+"1294-15-"+C3.INPUT
                      SELECT/C3.INPUT
                        CASE/147
                        END_CASE/
                        CASE/148
                        END_CASE/
                        CASE/149
                        END_CASE/
                        CASE/150
                        END_CASE/
                        CASE/151
                          ASSIGN/V2=2.0290
                          ASSIGN/V3=0.8940
                          ASSIGN/V4=2.2850
                        END_CASE/
                        CASE/152
                        END_CASE/
                      END_SELECT/

      • #5
        Mmmm, nope.
        Last edited by VinniUSMC; 11-06-2017, 02:55 PM.
        "This is my word... and as such is beyond contestation."

        Comment


        • DAN_M
          DAN_M commented
          Editing a comment
          My origin is at the base. I then create F1 at the height of V4 and that generic point goes right to the top of the model just like I want it to. (you can see in pic#1, its right where its supposed to be). When I make a new origin to that point that is sitting nicely up top, everything shifts down for some reason. Thats what I'm seeing =/

          Alignments can't handle variable offsets. I have tried, sometimes it works, other times it just p!$$es me off. I read on "the other forum" to use generic features, and its not working.

          I just tried everything using an offset point, everything looks proper now, hopefully it doesnt blow up when I get real parts!!

        • VinniUSMC
          VinniUSMC commented
          Editing a comment
          Yeah, I was thinking backwards. But, I tested it in 2017 and it worked right.

          Try deleting the generic and alignment and recreate it. It looks like it's either what WolfMan suggested earlier, or somehow your CAD is getting stuck. Or whatever version you're on doesn't like it. I dunno.

      • #6
        what about making you NOM matching the MEAS values inside the F1 ?

        I think maybe it's going to the NOM instead of measured.
        B&S One
        PC-DMIS CAD v2014

        Romer Infinity

        Comment


        • #7
          Your CAD= part is checked in this program is what it looks like to me

          Comment


          • DAN_M
            DAN_M commented
            Editing a comment
            Thanks for taking a stab at my issue...but I have never used CAD=Part. I solved my problem, solution is above

        • #8

          Code:
          F1 =GENERIC/POINT,INDEPENDENT,CARTESIAN,
          $ NOM/XYZ,<0,0,0>,
          $ MEAS/XYZ,<0+0,0+0,V4+0>,
          $NOM/IJK,<0,0,1>,
          $ MEAS/IJK,<0+0,0+0,1+0>
          Dependent, Dan, dependent.... And I'm not from Catalonia !

          Comment


          • #9
            Why don't you offset PNT_BOTTOM of V4 directly in A4.
            You select PNT_BOTTOM on Z origin, you type "10" in offset value, then in the edit window, you change 10 by V4...

            Comment


            • DAN_M
              DAN_M commented
              Editing a comment
              Very good logic. This is the first thing I did what I started working with variables.

              But then, I went on the other CMM forum, and read a huge long conversation about how it is not good for your program to do that and it can make your program crash down the road. I am just trying to go off of what other people are saying because thats how i've learned pretty much everything

          • #10
            Your nominal for F1 is set to '0', your actual is 0+v4, the value of V4 should be the Z nominal of F1. Then your triheadren will be appropriate.. Good luck

            Comment


            • #11
              Hey Dan,

              If I understand correctly, the family of parts are same in diameter at the base but different in length?
              Wouldn't be easier to keep the A4 alignment for all the part No's and use the variable to control the length?

              In regards to the alignment sequence, you should Level first, then rotate and then origin.

              Just an observation.
              Last edited by Roberto; 11-07-2017, 07:10 AM.
              sigpicIt's corona time!
              737 Xcel Cad++ v2009MR1....SE HABLA ESPAÑOL

              Comment


              • DAN_M
                DAN_M commented
                Editing a comment
                Hey @Roberto


                Alignments do not play nice with variables. So They have to be controlled by generic features or offset points, I just had a couple settings messed up within my generic feature. Solution is above in the original post.

            • #12
              Hello! Lovely conversation.
              I use variables to construct generic features for alignment regularly;
              for example I have a part where there is a hole on one side or the other depending on how it's loaded into the rotary table.
              I couldn't use find hole, because it is a very small hole and I use vision on it.
              So I had to actually create this hole as a generic feature. Essentially...

              I created an alignment for the hole to be measured
              I created a label (so I could reference this without realigning)
              I changed the OnError to Edge_Not_Detected (If it doesn't detect an edge, e.g. there is no hole) assign a variable (IS_180 = 1)
              I used the Auto Circle Feature to construct my circle. Which was like a millimeter in diameter
              I set the OnError back to Off
              And if the variable IS_180 = 1 it would rotate 180°, realign itself and try again. And if it failed it would just error out, otherwise continue.

              I had a lot of trouble doing this (running an Optiv Performance 443, and it crashed a lot with error checking, labels, circles...

              Once the hole was measured I created a generic feature which would be the aligning hole.

              It is good practice to set a variable to be used for an alignment (or anything important really, this applies to most if not all code) to a static value.
              E.G your variable is equal to a separate variable, and THAT variable is the one that changes from how you measure.

              I'm not going to try to explain why, it just happens to work that way for me.

              Glad you found a solution, DAN_M!
              .02

              Comment


              • #13
                TL;DR

                The generic feature needed to have the nominal value filled out as well.

                "This is my word... and as such is beyond contestation."

                Comment


                • DAN_M
                  DAN_M commented
                  Editing a comment
                  should I be using dependent or independent for the point type?

                • VinniUSMC
                  VinniUSMC commented
                  Editing a comment
                  I think JEFMAN is right, but, I'll be honest, I don't actually know what the difference is. Mine are always dependent, but I've never questioned why, or thought about changing it.
              Working...
              X