programming with loops

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

  • programming with loops

    Gents, few questions about loops.
    1)Lets imagine you have kind of cylindrical part, a you must inspect 76 axial sections around it, in every section several features. First thought - use loop, rotate alignment to every section, index probe. Works, but.. after four hours at 65th section you have collision (off position hole 3mm inspected with 2mm ball) and have to corect target coordinates...
    How to do so ?
    When you breake a loop you must strat from the begining...
    In other softwares its a piece of cake, but with PC_DMIS ?
    2)To avoid situation above tried to paste with pattern.
    But - MOVEs are not calculated correctly, alignment rotation is not recalculated, even if in alignment used USE_ACTIVE_ALIGNMENT, it refers to the first alignment, and features are not recalculated to local alignment.

    Any tips how to avoid spending weeks on donkey work ?

  • #2
    Not sure why move points didn't work with paste with pattern as I use it quite often and move points have never failed to work.
    Xcel & MicroVal Pfx & Global 37mr4 thru 2012mr1sp3
    Contura Calypso 5.4

    Lord, keep Your arm around my shoulder and Your hand over my mouth. Amen.

    Comment


    • louisd
      louisd commented
      Editing a comment
      I use move/increments fundamentally to avoid whatever drama occurs when you paste a movepoint with pattern and it goes wonky.

    • Kp61dude!
      Kp61dude! commented
      Editing a comment
      I stopped using move increments due to them not working on Offline mode, they crash. I almost exclusively program offline.

    • louisd
      louisd commented
      Editing a comment
      Kp61dude!, if you hit ALT+P and look at move/increments offline, I agree that move increments APPEAR to crash and move to crazy locations, but online they run exactly as you program them to... unless you get some wild false-trigger or physical anomaly with a point related to your alignment features.

  • #3
    Originally posted by dwade View Post
    Not sure why move points didn't work with paste with pattern as I use it quite often and move points have never failed to work.
    Maybe "new fuction" in 2018 R2 - even trainer was supprised.

    Additionaly, when you change alignment and answer YES for elements coordiantes recalculation - it does not apply to MOVEs.. they remain unchganged.
    Last edited by opton; 03-29-2019, 10:48 AM.

    Comment


    • Kp61dude!
      Kp61dude! commented
      Editing a comment
      Correct. Sometimes they're super easy to fix for example it failed to change positive moves to negative in a single axis. Still not working is not working.

  • #4
    Could be too that we don't have any issues because we're still running V4.3 and 2011.
    Xcel & MicroVal Pfx & Global 37mr4 thru 2012mr1sp3
    Contura Calypso 5.4

    Lord, keep Your arm around my shoulder and Your hand over my mouth. Amen.

    Comment


    • #5
      Gents, but when your alignment changed and you want PC-DMIS to recalculate all features does it recalculate moves ? In my version 2018R2 it does not, what means than with dozens sections I have to manually change them...
      And what about paste with pattern - we know that moves does not work correctly, but how to paste with pattern alignment (rotation to every section) ?
      I am still refering to cylindrical parts - inspection of several hundreds features, inspection time 17hours. Manualy correcting every of 76 sections is 2weeks stupid work.
      What was piece of cake in other softwares (Modus, Calypso, even Mcosmos), with PC-DMIS looks like something unachievable ..
      Any suggestion will help..

      Comment


      • opton
        opton commented
        Editing a comment
        This is what I am fighting for - avoid restaring as we are talking about several hours of loop execution.

      • louisd
        louisd commented
        Editing a comment
        a distraction from your post, but: I can't imagine a part that would take 17 hours to measure. are you effectively using the machine's speeds and acceleration parameters? I mean I worked on some really large gyroscope components & covers (38" wheels) but yeah never took more than a few hours..

      • R2ah1ze1l
        R2ah1ze1l commented
        Editing a comment
        Make the coordinates of your move points (if applicable) assignments and specify the assignments when your program begins:
        assign/v1=0
        assign/v2=4
        assign/v3=10
        Move\Point(v1,v2,v3)

        Now regardless of alignment changes your values remain, AND if there is a requirement to change, you only have to go to your assignments to make the change. Might save some time? HTH

    • #6
      The following code should "roughly" rotate the alignment by the angle that you need every time.
      It'll move to a safe point, rotate the alignment, move safely, measure part, move safely. Rinse and repeat until the loop is done.


      Code:
      A1 = ALIGNMENT/START, RECALL: STARTUP, LIST=YES
          ***INSERT PART ALIGNMENT***
      ASSIGN/COUNT = 0
      MOVE/POINT,<0,0,HEIGHT + 1> ***HEIGHT IS HEIGHT OF PART***
      WHILE/COUNT < 76
      ADJUSTEDALIGN = ALIGNMENT/START, RECALL:A1, LIST=YES
          ALIGNMENT/ROTATE_OFFSET, 360/76*COUNT, ABOUT, ZPLUS
      MOVE/POINT, NORMAL, <0,-(1 + R), HEIGHT + 1>
      ***
      INSERT YOUR MEASUREMENTS HERE
      ***
      MOVE/POINT, NORMAL, <0,-(1 + R), HEIGHT + 1>
      ASSIGN/COUNT=COUNT + 1
      END_WHILE/
      Last edited by JacobCheverie; 04-03-2019, 07:07 AM.

      Comment


      • #7
        Some tips:
        1)Save the data after every loop. If the software crash or a collision ocure you still have some data.
        You can start then the loop in for example 65 when you fill in 65 in the start number of the loop.
        2)Can you use clearance planes and avoidance move instaed of moves?

        Comment


        • #8
          Originally posted by JacobCheverie View Post
          The following code should "roughly" rotate the alignment by the angle that you need every time.
          It'll move to a safe point, rotate the alignment, move safely, measure part, move safely. Rinse and repeat until the loop is done.


          Code:
          A1 = ALIGNMENT/START, RECALL: STARTUP, LIST=YES
          ***INSERT PART ALIGNMENT***
          ASSIGN/COUNT = 0
          MOVE/POINT,<0,0,HEIGHT + 1> ***HEIGHT IS HEIGHT OF PART***
          WHILE/COUNT < 76
          ADJUSTEDALIGN = ALIGNMENT/START, RECALL:A1, LIST=YES
          ALIGNMENT/ROTATE_OFFSET, 360/76*COUNT, ABOUT, ZPLUS
          MOVE/POINT, NORMAL, <0,-(1 + R), HEIGHT + 1>
          ***
          INSERT YOUR MEASUREMENTS HERE
          ***
          MOVE/POINT, NORMAL, <0,-(1 + R), HEIGHT + 1>
          ASSIGN/COUNT=COUNT + 1
          END_WHILE/
          Thanks for that.
          I played a bit with that.
          What I noticed is that functionality of WHILE is similar to LOOP - if execution stopped there is no chance to continue from the point it stopped

          Comment


          • #9
            Originally posted by Martijn View Post
            Some tips:
            1)Save the data after every loop. If the software crash or a collision ocure you still have some data.
            You can start then the loop in for example 65 when you fill in 65 in the start number of the loop.
            2)Can you use clearance planes and avoidance move instaed of moves?

            ad.1) it does not work - even if you want continue execution from some particular count, it starts from first, wherease MOVEs are recalculated to the loop count you started..
            Similarlly, you cannot skip first loop execution.
            I faced strange situation - after some hours of program execution, I stopped and saved the program. After some time program collapsed when I did some modyfication, so the back up was loaded. BUT it turned out that for for elements in loops buffer was cleared - there was circle cosntrustion from points in loop and could not be calculated.
            I checked with short dummy program, just taking few points in loop, saved and reloaded, but this time I could use all the points. Looks like in the first case buffer was "overloaded" ?
            Fortunatelly, results were stored in report buffer, so could see tolerances for all elements in loop.
            ad. 2)Sometimes it is possible, sometimes not, as the move is not straight but must ommit some bosses.

            Comment


            • louisd
              louisd commented
              Editing a comment
              Here you go: make an input comment "C1" at beginning of routine. ask "what loop iteration do you want to start at?"
              you will want to add a validation loop to make sure it's a whole number between 0 and 76,
              Code:
               IF/QTY.INPUT-INT(QTY.INPUT)<>0 OR !(QTY.INPUT>=0 AND QTY.INPUT<=76)    goto/(label placed just above comment)

              THEN: replace line of code that JacobCheverie posted
              Code:
               ASSIGN/COUNT = 0
              with
              Code:
               ASSIGN/COUNT = C1.input
              this way you can collect all your partial data until it crashes, then restart your run wherever you left off.
              make routine output your dims within the loop, so you collect all the info per loop iteration. If your pattern of 76 loops constructs pattern that need simultaneous evaluation, this is not a solution. Fix your loop to be robust.

          • #10
            Why is your loop failing? Is there a collision (part not symmetric?) Is it a software crash due to large amounts of data?

            If it is a collision, why not program around the feature that it is crashing on? In other words, if it crashes on one iteration due to a unique section, loop all sections but that one. Measure it separately after.

            If it is a software crash, maybe consider measuring 1/4 of the part in one shot, run program four times.

            If the location tolerance is wide on the feature and your probe size is similar to the hole size, maybe try a smaller probe or a find hole method?

            Comment


            • #11
              Some things I've learned with programming in loops:
              1. Program the whole loop cycle with your count at a static value of 1.
              2. Start and end loop with same alignment coordinates
              3. Test/verify it functions properly.
              4. Update loop cycle count to whatever value you need.
              5. Don't change ANYTHING, within loop command, unless you revert loop count back to static value of 1& re-execute first.

              Specific to you, if your 64th iteration of your loop is off enough to crash, you need to more robustly locate an initial-locate feature within the loop, (IE a hole with a very exaggerated prehit/retract distance) so your loop iterations can still run if part has issues. I'd increase prehit to something that will definitely find the part every time. then take a initial point against major cylinder (polar radius), then construct a line to centroid of cyl. align/ rotate and origin to that point coordinate and ray line. then, I'd measure a hole or feature within the loop region to more accurately set a rotation datum (polar angle) and re-do the alignment again the same way.

              Comment


              • #12
                Originally posted by JacobCheverie View Post
                Why is your loop failing? Is there a collision (part not symmetric?) Is it a software crash due to large amounts of data?

                If it is a collision, why not program around the feature that it is crashing on? In other words, if it crashes on one iteration due to a unique section, loop all sections but that one. Measure it separately after.

                If it is a software crash, maybe consider measuring 1/4 of the part in one shot, run program four times.

                If the location tolerance is wide on the feature and your probe size is similar to the hole size, maybe try a smaller probe or a find hole method?
                It was just example in my first post, I am looking for the best way how to deal with parts like descibed - I work mainly with cylindrical, conical parts.
                Off course, I always make an effort to avoid such situations, but sometimes you cannot predict strange situations.

                I know the two methods (loops and paste with pattern) and I am considering prons and cones of the methods and with your help guys want to find a way to live with the poor funcionality.
                Like wrote before - in oter softwares loops are nice, robust and frendly, with PC-DMIS it is disaster..

                Comment


                • JacobCheverie
                  JacobCheverie commented
                  Editing a comment
                  It sounds to me like you are trying to program parametrically? Or is there that much part-to-part variation in your field?
                  If the parts are made to the print it should be straightforward to account for unique features (e.g. a large boss on 1 of the 76 sections).
                  If there is a lot of process variation then large clearance/safety moves should help, along with find hole.
                  From personal experience, I program primarily in Calypso. I have found the looping in PCDMIS to be much easier to read/write. Some other softwares hide a lot of the syntax behind a UI, whereas PCDMIS makes it more clear right up front.

              • #13
                Originally posted by louisd View Post
                Some things I've learned with programming in loops:
                1. Program the whole loop cycle with your count at a static value of 1.
                2. Start and end loop with same alignment coordinates
                3. Test/verify it functions properly.
                4. Update loop cycle count to whatever value you need.
                5. Don't change ANYTHING, within loop command, unless you revert loop count back to static value of 1& re-execute first.

                Specific to you, if your 64th iteration of your loop is off enough to crash, you need to more robustly locate an initial-locate feature within the loop, (IE a hole with a very exaggerated prehit/retract distance) so your loop iterations can still run if part has issues. I'd increase prehit to something that will definitely find the part every time. then take a initial point against major cylinder (polar radius), then construct a line to centroid of cyl. align/ rotate and origin to that point coordinate and ray line. then, I'd measure a hole or feature within the loop region to more accurately set a rotation datum (polar angle) and re-do the alignment again the same way.
                ad.2) What I noticed, the best way is to rotate alignment at the end of a loop, not at the begining. Thanks for this all theo,actl,targ are in line.

                Comment


                • #14
                  [QUOTE=opton;n447321]


                  ad.1) it does not work - even if you want continue execution from some particular count, it starts from first, wherease MOVEs are recalculated to the loop count you started..
                  Similarlly, you cannot skip first loop execution.


                  I first make an alignment outside the loop. In the loop I start with the alignment of that loop were I recall the alignment outside the loop. I use variable to change the alignment in every loop.
                  This is how I can start in loop 65 without measuring loop 1 first. I don't need an alignment from the first loop.

                  Comment

                  Related Topics

                  Collapse

                  Working...
                  X