Author Topic: G98 G99 CNC Question  (Read 3535 times)

Offline Dave Otto

  • Full Member
  • *****
  • Posts: 3584
  • Boise, Idaho USA
    • Photo Bucket
G98 G99 CNC Question
« on: August 24, 2016, 12:00:08 AM »
I have been playing around with G98 & G99 commands on my Mach3 controller. It works kind of but not completely the way it should. Iím wondering if Iím doing something wrong of if Mach just canít handle changing between G98 & G99 in the G82 canned cycle. I have tried numerous different combinations and I can never get to do what I want. My desire in this exercise was to drill the first hole and retract to the initial plane which it does with the G98 in line N05. Then after drilling the second hole only return to the R plane which it does using G99 in line N06.

After drilling the 3rd hole I wanted the drill to return to the initial plane using G98 in line N07, this is where it goes to hell, the control ignores the G98 and stays at the R plane and moves to ands drill the last hole? I can give it a new R value in the same line and it will retract to that; but it also feeds from that location on the last hole.

From the examples I have seen on the internet; I should be able to jump back and forth between G98 & G99 without affecting the rest of the caned cycle.

Any Ideas?
Dave

%
O100 (PROGRAM NUMBER)

(BEGIN PREDATOR NC HEADER)
(MCH_FILE=4AXVMILL.MCH)
(COORD_SYS 1=X0 Y0 Z0)
(MTOOL T1 S7 D0.25 C0. A90. H2.5)
(MTOOL T2 S4 D0.159 C0. A118. H2.25)
(SBOX X0. Y-2.471 Z-1.493 L3.472 W2.471 H1.493)
(END PREDATOR NC HEADER)


(FIRST MACHINE SETUP - Machine Setup - 1)

(PROGRAM NAME - FUEL REGULATOR.NC)
(POST -  BC_3X_MILL 3-AXIS GENERIC FANUC)
(DATE - SUN. 08/21/2016)
(TIME - 12:17PM)

N01 G00 G17 G40 G49 G80 G20 G90

(FIRST CUT - FIRST TOOL)
(Machine Setup - 1  Chamfer Drill)
(STANDARD FEATURE MILL HOLE - 0.1590)

(TOOL #1 0.25  .250D - 90DEG - SHARP CHAMFER TOOL)

N03 G90 G54 X0.156 Y-0.1875 S2500 M03
N04 G43 H1 D1 Z2. M07
N05 G82 G98 X0.156 Y-0.1875 Z-0.095 R0.1 P0.05 F3.5
N06 X0.782 Y-2.2835 G99
N07 X2.69 G98
N08 X3.316 Y-0.1875
N09 G80
N10 G00 Z2.
N11 M09
N12 M05
N13 G91 G28 Z0.
N14 G90
N27 G90 G59 X0. Y0.

(END OF FILE)
N28 M30

(END OF PROGRAM)
%

Offline kvom

  • Full Member
  • ****
  • Posts: 1989
Re: G98 G99 CNC Question
« Reply #1 on: August 24, 2016, 12:55:32 AM »
I think it depends on whether each drill operation is considered a separate cycle vs. a continuation of a single cycle.  The mach3 documentation refers to subsequent operations as "repeats".  So if each hole is its own cycle that uses modal words, then what you are seeing is correct.  The second hole starts at Z0.1 and that's its retract plane given that there is no R word.  The start plane of hole 1 is "forgotten".



Offline Dave Otto

  • Full Member
  • *****
  • Posts: 3584
  • Boise, Idaho USA
    • Photo Bucket
Re: G98 G99 CNC Question
« Reply #2 on: August 24, 2016, 01:13:38 AM »
Hi Kirk

Each hole in the caned cycle is controlled by the G82 Caned cycle until it is canceled by G80; so the feed rate, hole depth, etc. are the same for all the holes in that cycle. Except for the fact that you are supposed to be able to switch back and forth between the initial plane and R plane inside the caned cycle; The control doesn't forget, it knows that G99 is the R plane and G98 is the initial plane; at least it is supposed to.. I have seen many examples of this on the internet and this is why it make me wonder if it is a Mach issue? Do you run Mach 3 on your mill, would you mind giving it a try when you have a minute?

I'm going to try it on my machine at work and see how it behaves.

Thanks for your ideas,
Dave

Offline kvom

  • Full Member
  • ****
  • Posts: 1989
Re: G98 G99 CNC Question
« Reply #3 on: August 24, 2016, 01:20:54 AM »
I can try it for sure.  It's either as I interpreted above or it's a bug.  I know different controls often interpret g-code "standards" differently.

As I also have mach4 on the mill I can see if it operated differently than mach3.

Offline Dave Otto

  • Full Member
  • *****
  • Posts: 3584
  • Boise, Idaho USA
    • Photo Bucket
Re: G98 G99 CNC Question
« Reply #4 on: August 24, 2016, 01:29:28 AM »
OK thanks.

Dave

Offline kvom

  • Full Member
  • ****
  • Posts: 1989
Re: G98 G99 CNC Question
« Reply #5 on: August 24, 2016, 02:48:13 PM »
On both M3 and M4, none of the subsequent ops result in retracts to Z2.

In referencing the Haas g-code documentation it appears that for Haas the G98/G99 within a single G8x sequence does what you want.

For safety, adding an R word to get over an "obstacle" makes sense regardless of the machine.

Online Tennessee Whiskey

  • Full Member
  • *****
  • Posts: 3774
  • Springfield, Tennessee. USA
Re: G98 G99 CNC Question
« Reply #6 on: August 24, 2016, 08:24:36 PM »
Boy,  I'd buy both of y'all a rib platter and bottomless beer,  if I had a clue what you were saying :lolb: :lolb:. Great diagnostic dialog though  :cheers:

Whiskey

Offline kvom

  • Full Member
  • ****
  • Posts: 1989
Re: G98 G99 CNC Question
« Reply #7 on: August 24, 2016, 10:47:51 PM »
For TW and any others interested, He is drilling (actually countersinking) 4 separate holes.  The G82 command tells it where the hole is (X Y), how deep (Z), how fast to descend the drill (F), how long to pause at the bottom (P), and how far to retract the drill when finished with the hole.

For subsequent holes, it's possible to skip all the rest of the parameters other than specifying the X and/or Y value.  That's because all the parameters are modal, meaning they're remembered until the G80 at the end says to forget everything.

The G98/G99 discussion is involved with whether to retract to the R value or to the Z position at the time the first hole was started.  Sometimes you want to go higher than the R value in case moving the drill would hit a clamp or some other part of the work when moving to the next hole position.  Since Mach seems to forget the initial position once a G99 is issued, this program doesn't do what Dave wants/expects.

I'll take those ribs now.

Offline Dave Otto

  • Full Member
  • *****
  • Posts: 3584
  • Boise, Idaho USA
    • Photo Bucket
Re: G98 G99 CNC Question
« Reply #8 on: August 25, 2016, 01:09:11 AM »
For TW and any others interested, He is drilling (actually countersinking) 4 separate holes.  The G82 command tells it where the hole is (X Y), how deep (Z), how fast to descend the drill (F), how long to pause at the bottom (P), and how far to retract the drill when finished with the hole.

For subsequent holes, it's possible to skip all the rest of the parameters other than specifying the X and/or Y value.  That's because all the parameters are modal, meaning they're remembered until the G80 at the end says to forget everything.

The G98/G99 discussion is involved with whether to retract to the R value or to the Z position at the time the first hole was started.  Sometimes you want to go higher than the R value in case moving the drill would hit a clamp or some other part of the work when moving to the next hole position.  Since Mach seems to forget the initial position once a G99 is issued, this program doesn't do what Dave wants/expects.

I'll take those ribs now.

Exactly Kirk,

Mach3 works fine if you have the G98 or G99 in the G8X line. It does just as it should; returns to either the initial Z point (the last Z value before the G8X) or the R value in the caned cycle line. From what I understand from doing a little poking around on the Mach forum is the ability to change back and forth during the caned drill cycle G98/G99 (which most controls allow) does not work in Mach3. I wonder if they fixed it in Mach4.

For 99% of what I do it is not a problem now that I know how to get my drill back to the initial Z value (my post processor was set to default to G99). This weekend I was working on an expensive fuel regulator for a dragster, and it had a large appendage in the middle that I was trying to get around; which got me playing with the commands in the drill cycle.

As I originally indicated I was able to start out using G98 and then shift to G99 in the middle of the cycle; but when I wanted to go back to G98 before the last hole in the cycle, the control would ignore it and stay a the R value. Oh well know I know.

It would be nice if if it did work as it should; say you are drilling 100 holes in a plate and you need to jump over some clamps in 4 places. It would be much easier to just switch to G89 at that location and then drop back down to the R value and continue on.

Now that we seem to be on the same page I'm curious how Mach4 works? Do you want to check it out sometime?

Thanks for your insight,
Dave

PS. let me know how the BBQ is?  :lolb:
« Last Edit: August 25, 2016, 01:21:38 AM by Dave Otto »

Offline kvom

  • Full Member
  • ****
  • Posts: 1989
Re: G98 G99 CNC Question
« Reply #9 on: August 25, 2016, 12:18:14 PM »
I did check it at the same time as M3, and it works the same.

Offline Flyboy Jim

  • Full Member
  • ****
  • Posts: 1532
  • Independence, Oregon
Re: G98 G99 CNC Question
« Reply #10 on: August 26, 2016, 03:16:28 AM »
For TW and any others interested, He is drilling (actually countersinking) 4 separate holes.  The G82 command tells it where the hole is (X Y), how deep (Z), how fast to descend the drill (F), how long to pause at the bottom (P), and how far to retract the drill when finished with the hole.

For subsequent holes, it's possible to skip all the rest of the parameters other than specifying the X and/or Y value.  That's because all the parameters are modal, meaning they're remembered until the G80 at the end says to forget everything.

The G98/G99 discussion is involved with whether to retract to the R value or to the Z position at the time the first hole was started.  Sometimes you want to go higher than the R value in case moving the drill would hit a clamp or some other part of the work when moving to the next hole position.  Since Mach seems to forget the initial position once a G99 is issued, this program doesn't do what Dave wants/expects.

I'll take those ribs now.

Great mini-tutorial Kirk! Maybe you should write a "CNC For Dummies" book!  ;)

Enjoy those cyber ribs and beverage!  :LickLips:  :DrinkPint:

Jim

Sherline 4400 Lathe
Sherline 5400 Mill
"You can do small things on big machines, but you can do small things on small machines".