Hello Guest it is April 17, 2021, 02:50:46 AM

### Author Topic: G82 Drilling Cycle  (Read 666 times)

0 Members and 1 Guest are viewing this topic.

#### JG

• 50
##### G82 Drilling Cycle
« on: July 13, 2020, 08:23:38 PM »
I do hope that this is the right place to beg a G-Code question - if not please advise, and maybe move to a more appropriate section.

I'm making a sacrificial table for my Denford into which I will be putting a grid of M4 threaded inserts.

This entails drilling a series of holes - all the same diameter and depth - so I've been reading the CNC Cookbook tutorial which tells me that the parameters needed for a G82 Drilling Cycle are :
•   -  X-Y :  Co-ordinates
•   -  Z :  Bottom of hole
•   -  R : Retract position
•   -  P : Dwell time
•   -  F : Cutting Feed Rate
•   -  L : Number of repeats
Now, I understand all of those but can't see where the distance between the holes is specified. I can see that the holes must be in a line - either on the X or Y axis and that a second/third (and so on) cycle would be needed to create a [grid] -  in my case this will be 50 x 40 (X - Y)

The holes will be less than two diameters deep so there is no reason to use G83
I've read the tutorial a number of times but cannot see any reference to the spacing --  what am I missing?

#### TPS

• 2,110
##### Re: G82 Drilling Cycle
« Reply #1 on: July 14, 2020, 03:23:31 AM »
here a small example to drill 4 holes

Code: [Select]
`G90 G0 G54 X-55 Y-55 S2000 M3G82 G98 Z-6 R1 P1 F150Y55X55Y-55G80G0 Z5M5`
X/Y Zero is in Center of the holes

1st hole at X-55 Y-55
2nd hole at X-55 Y55
3rd hole at X55 Y55
4th hola at X55 Y-55

hope that helps
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

#### JG

• 50
##### Re: G82 Drilling Cycle
« Reply #2 on: July 14, 2020, 04:04:38 AM »
Thanks TPS - The only code I don't understand there is G54 --  I have a list which was described as 'definitive' but it doesn't have anything between G42 and G73 so I now suspect (I suppose I always did) that it is incomplete.

I can also see that setting up the modal codes S R P & F and then specifying the X or Y co-ordinates would do exactly what I'm looking for - very straightforward - it was the fact that the CNC Cookbook also specified an [L] parameter (number of repeats) and I couldn't (can't) see how that would work without specifying a hole 'pitch'.

This therefore begs the question of why use G82 when G81 would do the same thing ---- or would it?

#### TPS

• 2,110
##### Re: G82 Drilling Cycle
« Reply #3 on: July 14, 2020, 04:18:20 AM »
G54 is the fixture Offset (if specified)
you can use the G-Code button on Mach3 Standard Screen set for help, and examples for the G-Code as well.

here an other example by using the L Parameter
Code: [Select]
`G90 G0 G54 X0 Y0 S2000 M3G91 G82 G98 X4 Y5 Z-6 R1 P1 F150 L3G0 Z5M5`
machine will move to X0/Y0
then to X4/Y5 drill the first hole
then to X8/Y10 drill the 2nd hole
then to X12/Y15 and drill the 3rd hole
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

#### JG

• 50
##### Re: G82 Drilling Cycle
« Reply #4 on: July 14, 2020, 05:01:00 AM »
GOT IT !

The X & Y co-ordinates are [ RELATIVE ] (or incremental) not Absolute

That now makes sense, Thanks.
That is not what the CNC Cookbook tutorial suggests though.

I had seen the [ G-Codes ] button in Mach3 (and used it) - I just hadn't noticed that the list was larger than the one I had downloaded

Looking again at the example you site TPS, it seems to me that it would not drill a hole at the initial position but would drill holes in a diagonal line rather than a grid.
By omitting the Y parameter I would expect 3 holes along the X axis at 4 units pitch and of course omitting the X parameter - 3 along the Y axis at 5 units pitch.
Hmmm...  I think I need to do a simulation and watch the 'Table Display' very closely.

#### TPS

• 2,110
##### Re: G82 Drilling Cycle
« Reply #5 on: July 14, 2020, 05:17:52 AM »
yes just Play a bit around and drill some hole in the air.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

#### JG

• 50
##### Re: G82 Drilling Cycle
« Reply #6 on: July 14, 2020, 05:28:21 AM »
The great benefit of 'simulation' - no material or tooling costs

I've already proved my theory so there's not a deal of cost in time either!

You've also shown me that I can omit the leading zeros from codes such as M03 so thanks for that as well.

#### JG

• 50
##### Re: G82 Drilling Cycle
« Reply #7 on: July 14, 2020, 02:39:44 PM »
I've done quite a few simulations this afternoon and have nearly got drilling a grid of holes sorted, but one thing still alludes me.
This is the program I have now settled on :
Code: [Select]
`%O0000  (Drill Hole Grid.NC)N10 G21 G90  N20 G0 X200 Y100 Z0 S6000 M3N30 G1 F100 Z-20N40 G0 Z0N100 G91 G82 G98 X-50  Z-20 R-10 P1 F100 L3N110 Y-40N120 G1 G82 X50 L3N130 Y-40N140 G1 G82 X-50 L3N200 G0 Z0N210 M5%`
The simulation works and shows that it does drill a total of 12 holes, however, the tool always returns to Z0 after drilling rather than Z-10 as I expected due to 'R-10' in line N100.

Can anyone explain why?  or, better still, tell me what 'R' ought to be to minimize the Z travel between holes.

#### TPS

• 2,110
##### Re: G82 Drilling Cycle
« Reply #8 on: July 15, 2020, 02:52:53 AM »
here is a screenshot of Mach G-Code help, witch explains the retract Position of z-axis.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

#### JG

• 50
##### Re: G82 Drilling Cycle
« Reply #9 on: July 15, 2020, 04:48:15 AM »
Obviously I must have some differences in my set-up.
I have two systems -  one in my 'office' where I do the design/coding work with a Mach3 installation that isn't attached to a CNC machine at all - it allows me to do simulations without causing any damage!

The second is the 'Live' system in my workshop connected to a Denford MicroRouter Compact.

It seems that the screen '.set' is different on each (though both are named 1024.set) and the [ G-Code ] button has different results on each.

The 'Live' system shows a 'pop out' window and clicking on an entry does give me G-Code hints but the office system shows a non-interactive G-Code List 'Image'.

I've just copied the 1024.set file from 'Live' to 'Office' (after renaming the office version) and now the office [ G-Code ] button is inactive?    This seems to indicate that there are other files that also need to be transferred but I have no idea which.