Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: eoinie on July 11, 2016, 01:03:13 PM

Title: Hole cutting code
Post by: eoinie on July 11, 2016, 01:03:13 PM
Hi
I'm very much an amateur with gCode and have a question. I am trying to cut an 8mm hole with a 2mm bit. Following some study of various YouTube clips I have come up with the following code - trouble is it doesn't work. I am getting an error just before the G3 mode that the arc is different to the size in Line? I can't read it fully on the status window. Anyway, can someone there look at this and tell me what's wrong? Its probably something very basic.
Thanks in advance


G17 G21 G40 G49 G64 G90 G94
S1000
M6
M30

(Hole No1)

G0 Z30
G0 X59 Y0 A180
G0 Z20
G1 Z11 F50
G1 X63
G3 X-63 Y0 I-3 J0 F100
G3 X63 Y0 I3 J0
G1 Z9
G3 X-63 Y0 I-3 J0 F100
G3 X63 Y0 I3 J0
G1 Z7
G3 X-63 Y0 I-3 J0 F100
G3 X63 Y0 I3 J0
G1 Z5
G3 X-63 Y0 I-3 J0 F100
G3 X63 Y0 I3 J0
G1 Z3
G3 X-63 Y0 I-3 J0 F100
G3 X63 Y0 I3 J0
G1 Z1
G3 X-63 Y0 I-3 J0 F100
G3 X63 Y0 I3 J0
G1 Z0
G3 X-63 Y0 I-3 J0 F100
G3 X63 Y0 I3 J0

G0 X59 Y0
G0 Z30
G0 X30

M05
M30
%
Title: Re: Hole cutting code
Post by: Hood on July 11, 2016, 01:27:37 PM
First thing to say is you have a M30 at the beginning, I am presuming this was just a typo when posting to the forum as you would get absolutely nothing at all showing and would certainly not get as far as the G3 line.

So your problem, you must have Mach in Incremental IJ mode and the code is Absolute IJ Mode. You can change the default setting on General Config page. However it is much better to do it in the code, reason being if you have it in  the G Code then when  you load code it will set the correct mode.
 So if you put a G90.1 on the second line of your code it should work fine.
Hood
Title: Re: Hole cutting code
Post by: Davek0974 on July 11, 2016, 02:05:06 PM
Is the Z reference correct?

My code would run from 0 to -9mm

Just wondering ;)
Title: Re: Hole cutting code
Post by: eoinie on July 11, 2016, 05:14:22 PM
Thanks Hood. I'll give that a try- and apologies for the confusing M30 typo.
Dave0974 - The Z reference is positive because I am cutting holes in a cylinder and Z0 runs along the centre axis of the cylinder.
Title: Re: Hole cutting code
Post by: eoinie on July 12, 2016, 05:48:57 AM
OK so I'm still in trouble here (I did say I wasn't great at this)
I'm trying to cut an 8mm hole in a cylindrical part and have the G21 in there. Trouble is the radius is huge and I suspect that I might be cutting an 8inch hole instead. Can't figure out why though.
Title: Re: Hole cutting code
Post by: Hood on July 12, 2016, 06:01:45 AM
Why not just use the Cut Circle wizard in Mach to get the code?
Hood
Title: Re: Hole cutting code
Post by: eoinie on July 12, 2016, 06:06:06 AM
I tried it but its cutting the hole about 1.5mm too small for some reason.
Title: Re: Hole cutting code
Post by: Hood on July 12, 2016, 07:27:27 AM
Strange, does your machine cut to size for other operations?
Hood
Title: Re: Hole cutting code
Post by: eoinie on July 12, 2016, 08:47:49 AM
Yes. The machine is pretty accurate overall.
Title: Re: Hole cutting code
Post by: Hood on July 12, 2016, 09:33:47 AM
The circle wizard code looks fine to me.

Also remember you need to account for the dia of the cutter on the circles diameter.

Hood
Title: Re: Hole cutting code
Post by: eoinie on July 12, 2016, 09:59:10 AM
it might just be backlash - i'll need to check it out. Thanks for your help.