Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: JG on July 13, 2020, 08:23:38 PM

Title: G82 Drilling Cycle
Post by: JG 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 :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?
Title: Re: G82 Drilling Cycle
Post by: TPS 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 M3
G82 G98 Z-6 R1 P1 F150
Y55
X55
Y-55
G80

G0 Z5
M5

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
Title: Re: G82 Drilling Cycle
Post by: JG 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?
Title: Re: G82 Drilling Cycle
Post by: TPS 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 M3
G91 G82 G98 X4 Y5 Z-6 R1 P1 F150 L3

G0 Z5
M5

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
Title: Re: G82 Drilling Cycle
Post by: JG 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.
Title: Re: G82 Drilling Cycle
Post by: TPS on July 14, 2020, 05:17:52 AM
yes just Play a bit around and drill some hole in the air.
Title: Re: G82 Drilling Cycle
Post by: JG on July 14, 2020, 05:28:21 AM
The great benefit of 'simulation' - no material or tooling costs  :D

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.
Title: Re: G82 Drilling Cycle
Post by: JG 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 M3
N30 G1 F100 Z-20
N40 G0 Z0

N100 G91 G82 G98 X-50  Z-20 R-10 P1 F100 L3
N110 Y-40
N120 G1 G82 X50 L3
N130 Y-40
N140 G1 G82 X-50 L3

N200 G0 Z0
N210 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.

Title: Re: G82 Drilling Cycle
Post by: TPS 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.
Title: Re: G82 Drilling Cycle
Post by: JG 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.
Title: Re: G82 Drilling Cycle
Post by: TPS on July 15, 2020, 05:30:51 AM
in your main Folder (noramly c:\Mach3) should be a file named:

Mach3MillGcode.htm

this file contains the G-Code help and can also be opened with any browser.
Title: Re: G82 Drilling Cycle
Post by: JG on July 15, 2020, 06:19:52 AM
Thanks TPS -- yes that file exists in both of my systems and I now have a shortcut to it on my office system.

It is still not activated by the [ G-Code ] button - whichever '.set' I invoke.

I'm not concerned about trying to resolve the issue - it's no hardship to simply invoke the shortcut which opens the .htm file in the browser when I do need a 'hint'   -   which I'm sure will be often  ;D

Title: Re: G82 Drilling Cycle
Post by: Tweakie.CNC on July 15, 2020, 06:39:51 AM
If it's any help,   Operator / Edit Button Script allows the G-Codes button code to be changed as shown in this pic.

Tweakie.
Title: Re: G82 Drilling Cycle
Post by: JG on July 15, 2020, 06:59:14 AM
Thanks Tweakie,  That at least points me to yet another 'feature' in the very flexible Mach3 system which I hadn't yet discovered but the VB script in my office system is already exactly as you site - I presume my workshop system is the same.


Seldom taking anything on face value  -   I've just clicked on the [ Run Script ] icon and I'm not surprised to see an error message  "Error on line:1 - Sub or function not defined: GetMainFolder"   but since I am yet to study VB it doesn't really tell me much.
Title: Re: G82 Drilling Cycle
Post by: Tweakie.CNC on July 15, 2020, 07:09:25 AM
Quote
Seldom taking anything on face value  -   I've just clicked on the [ Run Script ] icon and I'm not surprised to see an error message  "Error on line:1 - Sub or function not defined: GetMainFolder"   but since I am yet to study VB it doesn't really tell me much.

I think you have something else wrong in your Mach3 installation (could be anything and short of a re-install I have no idea where to look).

Tweakie.
Title: Re: G82 Drilling Cycle
Post by: JG on July 15, 2020, 07:18:10 AM
That's my opinion as well Tweakie.
Since the 'office' system is only a simulation exercise, a re-installation wouldn't be a problem and may well solve the issue.

Title: Re: G82 Drilling Cycle
Post by: JG on July 21, 2020, 06:52:21 AM
I've been held up in this endeavour due to slow delivery of components but they arrived yesterday so I'm back on it.

When trying a simulation (cutting air) on my workshop system I had a 'Soft limits error' --- which I think I've solved  ---  but when investigating I came up against another 'irritation' in Mach3 regarding the [ Table Display ]  window.  I can 'Zoom' and move the display 'in orbit' OK (even turning the whole thing upside down) but I can't yet see a way to re-position the viewpoint - which effectively means 'panning'. I'm familiar with similar displays in SketchUp etc. where panning is a matter of 'shift' if you are in 'Orbit' but none of the modification keys ( Ctrl etc.) seem to have any effect. Nor does [ Display Mode ] appear to do anything, which might have been an option.


It must surely be my lack of experience with Mach3 controls but I've yet to find anything intuitive that works to modify the display - nor anything in the 'help' to point me to a solution  :(

Can someone enlighten me ?
Title: Re: G82 Drilling Cycle
Post by: Tweakie.CNC on July 21, 2020, 08:23:02 AM
Right click and drag ?

Tweakie.
Title: Re: G82 Drilling Cycle
Post by: JG on July 21, 2020, 08:52:14 AM
No  -  that is what I've been doing and it 'Orbits' quite correctly (as I would expect)  but doesn't change the 'Centre of Rotation' which is what 'Panning' ought to do.

I've also tried zooming out and then clicking to the right or left of the image to zoom in about that point - without success.
Title: Re: G82 Drilling Cycle
Post by: JG on July 25, 2020, 02:44:42 PM
Right click and drag ?
Tweakie.

Thought you might like to know that I've found the answer to this issue.   It's all about settings in [Config][Tool Paths]. Once I'd found that I had much more control and could decide for myself how I wanted the Tool Paths Window to look.

It's not perfect, and I'll do some more experimenting, but much better that the view I was getting by default.