Page 1 of 1

G8x mill code question

Posted: Wed Aug 24, 2016 5:03 pm
by kvom
This question came up when a friend sent me a g-code program where G8x and G98/99 weren't working together as he expected. If I issue a G81 and then on the next line just specify an X and or Y, am I specifying a single canned cycle or two separate cycles with the second inheriting modal values from the first?

The issue he has is with the retract values. With G98 in force the tool retracts to the higher of the start position or the R value, while with G99 the R value is obeyed. In both Mach3 and Mach4, if G99, then the original Z height of the cycle is forgotten and can't be recovered by a subsequent G98.

If each execution of the canned cycle is considered standalone, then this makes sense. if it's all one single cycle doing multiple holes then it's a bug.

Or it's just a matter of interpretation of g-code "standards", whatever they might be.

Re: G8x mill code question

Posted: Wed Aug 24, 2016 5:33 pm
by GlennW
I don't know the first thing about Mach3 or Mach4, so I have no idea what G98/99 represent, but this is what a simple drilling cycle looks like on my machine.

M3S1200
G81Z-0.042R.1F20
X4.043Y-0.861
X20.513Y-1.763
X22.000Y-7.125
6G80

First line starts the spindle at 1200 rpm
Second line defines the drilling events: Drill to .042" at 20 ipm then retract to .1.
X,X coordinates define the hole locations.
G80 cancels the drilling cycle.

Dunno if that helps or not!

Re: G8x mill code question

Posted: Wed Aug 24, 2016 8:31 pm
by kvom
G81Z-0.042R.1F20
X4.043Y-0.861

In simple language, is this sequence supposed to be 1 canned cycle or two?

And to clarify. If G98 is in effect before the G81, the retract will be the higher of the initial Z or .1. If G99, then .1.

The "problem" being posed is this example

G0 Z1
G98
G81Z-0.042R.1F20
G99
X4.043Y-0.861
G98
X5

The first retract is to Z1, not Z.1
The second is to Z.1
What should the 3rd be?

Re: G8x mill code question

Posted: Wed Aug 24, 2016 8:51 pm
by GlennW
My example will drill in three locations to a depth of .042" with a .1" retraction above the part surface prior to moving to the next location.

Re: G8x mill code question

Posted: Thu Aug 25, 2016 2:35 am
by Magicniner
I don't know if this will help -

G0 Z1 ( G00:Rapid positioning )
G98 ( G98:Set Initial Plane default )
G81Z-0.042R.1F20 ( G81:Drilling to final depth canned cycle R:Arc radius:.1 F:Feedrate:20 )
G99 ( G99:Return to main program )
X4.043Y-0.861
G98 ( G98:Set Initial Plane default )
X5

My CAM is good enough that I'm just picking up bits & pieces of G-Code recognition as I go along but I find this site helps -

http://www.buildlog.net/cnc_laser/cnc/g ... mment.html

Regards,
Nick

Re: G8x mill code question

Posted: Sat Aug 27, 2016 4:11 pm
by Bill Shields
use of G98 / G99 is dependent on control configuration (if it is used at all)

as a general rule, I would not do what you are showing with changing G98 / G99 in the middle of the cycle.

many controls only 'read' G98/G98 at the time the initial cycle is defined...and will stay in effect until a something is called that cancels the G81 (be it G0 / G1 / G80 or with some controls must be G80 G0 combined)...

others MIGHT SWAP in the middle of the cycle, but in general I would have to look at the PLC logic of the individual control (from the machine builder not the control builder) to tell you exactly what the control will do.