hexagon logo

Rotating B inside a loop command

Question
I have a cylinder with 6 holes on the side, I program 1 hole and create a loop to do the other 5. My cmm head (Renishaw PH10M) starts at A90B-90. My cylinder is in the Z axis direction, I am working on some code to set the B rotation with a variable but no success can use some help if anyone knows of a way to solve this. Your help is greatly appreciated.
Thank you,
Bob
  • Providing you have done what Chally has said, the code I posted earlier should work with the exception of this line:

    ASSIGN/TIPSTR="T1A60B"+VANG

    It may need to be modified to this:

    ASSIGN/TIPSTR=STR("T1A60B")+VANG
  • This software continues to astound me with it's complex capabilities.
  • Thanks I will try it, and I appreciate your help

    Yes you can get very complex I am just a grasshopper in a huge field Blush)
  • You can use variables in every editable field, if you use the correct format. Blush Thanks for the correction, slesholdofthreep.

    As another neat example of variable usage, you can use variables in an alignment. You first create the alignment using a stand-in feature, since you cannot select variables in the alignment screen. Then, change your feature name to the name of a variable.

    I have a program that recognizes if a part is at a rough or finished state, and modifys the alignment to use a different datum stand-in feature depending on if the datum is present or not.

    Also, Rob, take heed of Matt's reply in your other post. If you do the paste with pattern right, it will add in your angles as long as they are created in the probe file.
  • Yes you can get very complex I am just a grasshopper in a huge field Blush)


    ...then when you update to a newer version of PC-DMIS, it's like someone is torching your field...
  • Version 4.2 the fields are starting to burn....
    I played with the code some and the B moves to 35deg then back to zero, I couldn't make it go from 35 to 70 to 105 etc. Here is my code
    ASSIGN/VANG = 35
    ASSIGN/TIPSTR = STR("T1A-90B")+VANG
    V1 =LOOP/START, ID = YES, NUMBER = 4, START = 1, SKIP = ,
    OFFSET: XAXIS = 0, YAXIS = 0, ZAXIS = 0, ANGLE = 36
    CIR A =FEAT/CONTACT/CIRCLE,CARTESIAN,IN,LEAST_SQR
    THEO/<0,-1.4987,-1.115>,<0,-1,0>,0.125,0,360
    ACTL/<0,-1.4987,-1.115>,<0,-1,0>,0.125,0,360
    TARG/<0,-1.4987,-1.115>,<0,-1,0>
    ANGLE VEC=<1,0,0>
    DIRECTION=CCW
    SHOW ADVANCED MEASUREMENT OPTIONS=NO
    SHOW_CONTACT_PARAMETERS=YES
    NUMHITS=3,DEPTH=0.04,PITCH=0
    SAMPLE HITS=0,SPACER=0
    AVOIDANCE MOVE=BOTH,DISTANCE=0.65
    FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
    SHOWHITS=NO
    TIP/TIPSTR, SHANKIJK=-0.9563, -0.2924, 0, ANGLE=-90
    LOOP/END
    Thank you for your help
    Rob
  • What sles said, in your code - 'VANG' is a constant of 35.

    Untested:
    ASSIGN/VANG = 35
    V1 =LOOP/START, ID = YES, NUMBER = 4, START = 1, SKIP = ,
    OFFSET: XAXIS = 0, YAXIS = 0, ZAXIS = 0, ANGLE = 36
    [COLOR="Red"]ASSIGN/TIPSTR = STR("T1A-90B")+VANG[/COLOR]
    CIR A =FEAT/CONTACT/CIRCLE,CARTESIAN,IN,LEAST_SQR
    THEO/<0,-1.4987,-1.115>,<0,-1,0>,0.125,0,360
    ACTL/<0,-1.4987,-1.115>,<0,-1,0>,0.125,0,360
    TARG/<0,-1.4987,-1.115>,<0,-1,0>
    ANGLE VEC=<1,0,0>
    DIRECTION=CCW
    SHOW ADVANCED MEASUREMENT OPTIONS=NO
    SHOW_CONTACT_PARAMETERS=YES
    NUMHITS=3,DEPTH=0.04,PITCH=0
    SAMPLE HITS=0,SPACER=0
    AVOIDANCE MOVE=BOTH,DISTANCE=0.65
    FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
    SHOWHITS=NO
    TIP/TIPSTR, SHANKIJK=-0.9563, -0.2924, 0, ANGLE=-90
    [COLOR="red"]ASSIGN/VANG=VANG+30[/COLOR]
    LOOP/END
  • Thank you Slesholdofthreep, you confirm my suspicions of incremental move. Thank you VPT the code works on rotating B perfect, but it still going back to B0 when it takes the hits in the holes. Just want to thank you guys for all the brain power and the help I really appreciate it, it so close to being functional I can't stop now so thanks for your patience in my not so savvy code programming.
  • What kind of head do you have that can have an A angle of -90???

    And to answer an earlier question of what if the probe angle goes beyond 180, you can have:

    IF\VANG>180
    ASSIGN\VANG= 360-VANG
    END_IF
    IF\VANG<-180
    ASSIGN\VANG= 360+VANG
    END_IF
    


    Insert this code right after you are incrementing VANG, before the end of the loop, and this way, it will correctly index the probe when going beyond +180 or -180.