Register for free
Login
487,779 reg. members
487,779 reg. members
Page 1 of 2 12
Results 1 to 12 of 21
  1. #1
    Registered
    Join Date
    Oct 2017
    Posts
    8

    Trying to cut o-ring grooves using a subprogram.

    Making O-ring groves in different part locations G54-G59 and trying to loop that cut to get to my desired depths. So I thought that I could write a sub program to accomplish that and just give it a new part location every time I ran a new o-ring groove. The program will loop a full circle to the start point then give an invalid I,J or K in G02 or G03. Can someone take a look at this and give me some hints? I have a HAAS TM2P.

    T15 M06
    G90 G154 P17 G00 X-10.32 Y0.
    S3000 M03
    G43 H15 Z1.0 M08
    G01 Z0. F1000.
    M97 P23456 L8
    G00 Z1.0
    G28 G49 Z0.
    G54X0 Y0
    M30

    N23456
    G91 Z-.170 F100.
    G90
    G02 X-10.32 Y0. I0. J0. F125.
    M99

  2. #2
    Registered
    Join Date
    Mar 2008
    Posts
    614

    Re: Trying to cut o-ring grooves using a subprogram.

    You're specifying an Absolute X dim in the G2 line. Are all the O-ring groves in line? If not, change it to incremental is my guess.

  3. #3
    Registered
    Join Date
    Oct 2017
    Posts
    8

    Re: Trying to cut o-ring grooves using a subprogram.

    So I'm using a different part location for each of the 6 parts using say....G54 for one and G52 for the next G53 ....and so on. So if I can get it to run without an error in the first location I should be good for the others just by changing the part location. Right?

  4. #4
    Registered
    Join Date
    Mar 2008
    Posts
    614

    Re: Trying to cut o-ring grooves using a subprogram.

    A few thing weird to me. I'd dump the
    "G28 G49 Z0.
    G54X0 Y0"

    Go with G53 Y0 Z0

    Not sure why you were going back to G54...

    As far as the locations, if they are equally spaced keep it in Incremental. If not, then specify the locations and call up the Sub after each location is my recommendation

  5. #5
    Registered
    Join Date
    Apr 2008
    Posts
    24

    Re: Trying to cut o-ring grooves using a subprogram.

    The easiest way is to run your G02 as relative coordinate as well. Actually, for what you want to do, the ENTIRE sub should be written in G91. See below example.

    N23456
    G91
    Z-.170 F100.
    G02 X0 Y0 I10.32 F125.
    G90
    M99

    G02 in this case will draw a full circle, and come back where it started. However the center of the circle will be 10.32(mm?) to the right of where the tool started moving.



    Wallace

  6. #6
    Gold Member
    Join Date
    Jan 2005
    Posts
    7115

    Re: Trying to cut o-ring grooves using a subprogram.

    Quote Originally Posted by Geo55 View Post
    So I'm using a different part location for each of the 6 parts using say....G54 for one and G52 for the next G53 ....and so on. So if I can get it to run without an error in the first location I should be good for the others just by changing the part location. Right?
    Just use the same program with an X--- Y---- move to each location, why make it complicated for no reason, looks like a crash the way it is programed, a G91 has no place in a program like this, what's the G154 and the P17 for G49 should not be there also

    Give me the dimensions, and the tool size, and the spacing and I will do you a quick program
    Mactec54

  7. #7
    Registered
    Join Date
    Apr 2008
    Posts
    24

    Re: Trying to cut o-ring grooves using a subprogram.

    Quote Originally Posted by extanker59 View Post
    You're specifying an Absolute X dim in the G2 line. Are all the O-ring groves in line? If not, change it to incremental is my guess.
    I second this!!

    Also, we usually ramp into the part instead of plunge, so if I were to write this, the sub will look like this:


    N23456
    G02 X0 Y0 I10.32 Z-0.170 F125
    M99

    and then I would add 2 lines after each time the sub is called to finish and ramp-out the groove:

    G00 X1 Y2 (Move tool to starting point)

    G00 Z0.1 (Move tool to just above part)
    G91 (specify increment mode)
    M97 P23456 L8 (loop program 8 times)
    G02 X0 Y0 I10.32 F125 (run another circle without changing Z, so it bottom of the groove is flat)
    G02 X0 Y0 I10.32 Z1.46 (run yet another circle to ramp out of the groove - optional but it eliminates any chance the cutting tool make a tiny verticle slot in the groove due to tool deflection)
    G90 (go back to absolute mode)

    Copy-past the above (and only change the first X/Y value) for each groove. Also, I am not familiar with HASS, but if it can do nested program, you can put all the above in another sub so the copy-paste will only be two lines:

    ##################################################

    G00 X10 Y20 (Move tool to 1st groove starting point)
    M97 P34567 L1

    G00 X2 Y20 (Move tool to 2nd groove starting point)
    M97 P34567 L1

    G00 X30 Y20 (Move tool to 3rd groove starting point)
    M97 P34567 L1

    G00 X40 Y20 (Move tool to 4th groove starting point)
    M97 P34567 L1

    (Repeat as needed)

    M30



    N34567 (Sub #1 for the clean-up moves on each groove)
    G00 Z0.1 (Move tool to just above part)
    G91 (specify increment mode)
    M97 P23456 L8 (Call the 2nd sub to loop program 8 times)
    G02 X0 Y0 I10.32 F125 (run another circle without changing Z, so it bottom of the groove is flat)
    G02 X0 Y0 I10.32 Z1.46 (run yet another circle to ramp out of the groove - optional but it eliminates any chance the cutting tool make a tiny verticle slot in the groove due to tool deflection)
    G90 (go back to absolute mode)
    G00 Z1 (Move tool to safe Z)
    M99



    N23456
    G02 X0 Y0 I10.32 Z-0.170 F125
    M99

    Obviously keep your initial setup lines, tool change, coolant, etc. in there.




    Wallace

  8. #8
    Registered
    Join Date
    Oct 2017
    Posts
    8

    Re: Trying to cut o-ring grooves using a subprogram.

    Thanks guys, I'm rather new to this (Newbie) and not trying to get to confused. I agree to the ramping of the part instead of the plunge. I am using a 2.38 mm ball nose and the radius of the groove is the 10.32. and I need the total depth to be 1.38. The parts are 30 mm apart in the x axis. I will have to digest the program that you posted Wallace. Little confusing at this stage. However I did use the exact same thing when cutting the 6, 22mm hex shapes it looped several times dropping each time. the moving to the next "G" location and repeating.

  9. #9
    Registered
    Join Date
    Oct 2017
    Posts
    8

    Re: Trying to cut o-ring grooves using a subprogram.

    Sorry, when I say the exact same thing I mean My original Program.

  10. #10
    Registered
    Join Date
    Oct 2017
    Posts
    8

    Re: Trying to cut o-ring grooves using a subprogram.

    The G154 P17 is a part location. It is one of the 100 or so additional part locations that Haas uses. G154 P17, G154 P18, G154 P19, G154 P20, G154 P21, G154 P22 and so on.

  11. #11
    Gold Member
    Join Date
    Jan 2005
    Posts
    7115

    Re: Trying to cut o-ring grooves using a subprogram.

    Quote Originally Posted by Geo55 View Post
    The G154 P17 is a part location. It is one of the 100 or so additional part locations that Haas uses. G154 P17, G154 P18, G154 P19, G154 P20, G154 P21, G154 P22 and so on.
    I new what they where for, I have a few Haas machines, just did not know why you needed them when you only had 6 positions G54 to G59 is all that is needed, or a single G54 with X and Y moves as I said in the first post
    Mactec54

  12. #12
    Registered
    Join Date
    Apr 2008
    Posts
    24

    Re: Trying to cut o-ring grooves using a subprogram.

    Quote Originally Posted by Geo55 View Post
    Thanks guys, I'm rather new to this (Newbie) and not trying to get to confused. I agree to the ramping of the part instead of the plunge. I am using a 2.38 mm ball nose and the radius of the groove is the 10.32. and I need the total depth to be 1.38. The parts are 30 mm apart in the x axis. I will have to digest the program that you posted Wallace. Little confusing at this stage. However I did use the exact same thing when cutting the 6, 22mm hex shapes it looped several times dropping each time. the moving to the next "G" location and repeating.
    I am a total newbie as well, but I have done a lot of computer programming in the past so G-code (and sub-routine) is cake.

    Given the simplicity of the task, I don't think you need to worry about G54 parts-location. In fact, if the o-ring distance is the same, you can even save more time by this:

    ##################################################

    (Setup Steps)
    G90 Absolute coordinate mode
    T15 M06 (Tool change to Tool#15)
    G00 Z10 (Move to safe Z)
    M08 (coolant on)
    S3000 M03 (spindle start 3000 rpm)

    (Setup your position to start the 6 grooves)
    G00 X123 Y456 (Move to first groove. Replace 123/456 with the ACTUAL coordinate of the TOP of your left-most groove)

    (Cut those 6 grooves)
    M97 P20000 L6 (call Sub routine 20000 and repeat 6 times)

    M30 (program ends - should stop spindle and coolant automatically, if not specify M-code prior)

    ==================================================

    N20000 (Main routine)
    G00 Z1 (Move tool close to part)
    G01 Z0.02 F50 (Move tool to just above part - if your measurement/machine is dead accurate, you can G00/rapid to it)
    G91 (specify incremental mode)

    (This part is the actual chip making)
    M97 P21000 L7 (Call the 2nd sub to loop program 7 times. i.e. Circular interpolate from Z0.02, 0.2mm each time, and repeat 7 times - which should give you final Z height being -1.38 (0.02-(0.2*7)=-1.38). Note, This is assuming the surface of your part is Z0.)
    G02 X0 Y0 J-10.32 F125 (run another circle without changing Z, so it bottom of the groove is flat)
    G02 X0 Y0 J-10.32 Z1.38 F125 (run yet another circle to ramp out of the groove - optional but it eliminates any chance the cutting tool make a tiny vertical slot in the groove due to tool deflection)

    G00 Z10 (Move tool to safe Z)
    G00 X30 (Move 30mm to the next groove)
    G90 (Go back to absolute mode)
    M99

    ==================================================

    N21000 (2nd routine)
    G02 X0 Y0 J-10.32 Z-0.2 F125 (circular interpolation, where end-point is the SAME as start point (hence both X/Y = 0 as you are in G91). Center of circle, J, is -10.32 from the starting point. Also Z will ramp down 0.2mm each time.)
    M99

    ##################################################

    The only catch with this, is that your tool will move 30mm again after the last groove is cut. If it will ramp into other stuff, or reach your travel limit (I doubt it), then you can't use it this way. Also I am assuming the surface of the part is Z=0, if not obviously make adjustments. Hope this helps!



    Wallace

Page 1 of 2 12

Similar Threads

  1. Specifying V-Grooves
    By elfrench in forum Uncategorised CAD Discussion
    Replies: 3
    Last Post: 08-10-2013, 10:45 AM
  2. V Grooves!
    By granth3 in forum CNC Tooling
    Replies: 1
    Last Post: 10-18-2011, 11:19 PM
  3. What are Z grooves?
    By rezcar in forum Benchtop Machines
    Replies: 8
    Last Post: 12-12-2009, 08:13 AM
  4. Grooves MCX
    By jorgehrr in forum Mastercam
    Replies: 2
    Last Post: 04-18-2007, 10:58 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •