Official Luthiers Forum!
http://mowrystrings.luthiersforum.com/forum/

Help with GCode
http://mowrystrings.luthiersforum.com/forum/viewtopic.php?f=10106&t=45967
Page 1 of 1

Author:  cbrviking [ Tue Jun 30, 2015 11:13 pm ]
Post subject:  Help with GCode

I'm having trouble figuring this out. I want to generate code for cutting arched fret slots and this is what I have for code:

( Test 6/30/2015 7:17:26 PM )
( T3 : 0.125 )
G20 G90 G64 G40
G0 Z0.75
( T3 : 0.75 )
T3 M6
( Fret Arch Test )
G17
M3 S1000
G0 X0.0 Y3
G1 F10.0 Z-0.0941191
G19
G03 X0.0 Y-3 R12 F5
G0 Z0.75
M5
M30

And here is the preview in Mach3:
Attachment:
Fret.JPG


The Mach3 display looks like it goes from 3.0 to -3.0 in the Z axis like I want, but the sketch looks totally different.

Author:  Durero [ Wed Jul 01, 2015 12:37 am ]
Post subject:  Re: Help with GCode

Looks good to me.

Can you clarify your concern with the code?

Have you tried running the program "in the air" with no cutter in the spindle to see if the movement looks right?

Author:  cbrviking [ Wed Jul 01, 2015 9:48 am ]
Post subject:  Re: Help with GCode

That's a great idea - I'll do that tonight.

Author:  Jim Watts [ Wed Jul 01, 2015 10:07 am ]
Post subject:  Re: Help with GCode

It looks like it should work. The G0's are rapid positioning moves, M6 is a tool change, m3 is your spindle speed, g1 is motor synchronized move with a feed rate (plunging down to a z height in this case), g19 setting up a new work plane perpendicular to the x axis and top top plane, g03 is a circular interpolation in the new work plane ( your fret slot).
I'm not sure why you don't need a g17 ofter the g03 block to put you back in the xy plane though, unless the g19 is only operating on the next block.
I usually just stay in the default g17 (xy) plane. All of this is the work of you postprocessor BTW and can be tweeked around to output different formats.
I don't know if this helps you or not.

Author:  Ken McKay [ Wed Jul 01, 2015 1:51 pm ]
Post subject:  Re: Help with GCode

Jim you sound like a pro!
I use a cam program and with the curved surface, I mill along the curve for each fret.


Sent from my iPhone using Tapatalk
Ken

Author:  Jim Watts [ Wed Jul 01, 2015 4:10 pm ]
Post subject:  Re: Help with GCode

I spent a big chunk of my early career programming 5 axis mills for the aircraft industry. It's been a while though.

Author:  cbrviking [ Thu Jul 02, 2015 8:16 am ]
Post subject:  Re: Help with GCode

I use CamBam for my cam program and it won't import a curved line in the X-Z plane correctly. I'm a C++ programmer so I thought I would just write a program to generate the G-Code. From the Mach3 preview this doesn't look right - it's not centered arond the 'peak' of the fret. I haven't had a chance to run it so I don't know exactly what it will do.

Author:  Jim Watts [ Thu Jul 02, 2015 2:17 pm ]
Post subject:  Re: Help with GCode

Why bother with the YZ plane, you should be able to drive the curve anyway with the output being a series of points. Your output would be a G01 with a bunch of points. It makes a bigger file, but who cares. But on the other hand I don't know anything about Cambam, maybe it can't do a curve out of the xy plane.

Author:  Bob Garrish [ Wed Jul 08, 2015 12:02 pm ]
Post subject:  Re: Help with GCode

I, like Jim, don't like to use arcs outside the XY plane just because I like knowing what's going on as soon as I look at the G-code. Cutting up the code into line segments is also nice for this, since it's always clear where the machine is and where it's going, and program size essentially doesn't matter on a modern controller.

It appears that Mach3 doesn't notice, but something I noticed immediately when I looked at your code is that the trailing decimals are missing (F5, for example, instead of F5.0 or F5.). On many CNC controls it will interpret F5 as F0.0005 instead of F5.0, and it'll seem like your code has frozen.

Author:  rlrhett [ Wed Jul 08, 2015 12:59 pm ]
Post subject:  Re: Help with GCode

Bob Garrish wrote:
I, like Jim, don't like to use arcs outside the XY plane just because I like knowing what's going on as soon as I look at the G-code. Cutting up the code into line segments is also nice for this, since it's always clear where the machine is and where it's going, and program size essentially doesn't matter on a modern controller.

It appears that Mach3 doesn't notice, but something I noticed immediately when I looked at your code is that the trailing decimals are missing (F5, for example, instead of F5.0 or F5.). On many CNC controls it will interpret F5 as F0.0005 instead of F5.0, and it'll seem like your code has frozen.

OMG do I hate that. The Haas machine I use sometimes looks for a trailing dot. For inexplicable reasons MadCam doesn't always add them in. The whole program comes to a screeching halt and I never know why! There seems to be a lot of complaints around Mach3, but compared to the Haas controller it is an absolute wonder.


Sent from my iPhone using Tapatalk

Author:  Bob Garrish [ Mon Jul 13, 2015 11:09 am ]
Post subject:  Re: Help with GCode

rlrhett wrote:
Bob Garrish wrote:
I, like Jim, don't like to use arcs outside the XY plane just because I like knowing what's going on as soon as I look at the G-code. Cutting up the code into line segments is also nice for this, since it's always clear where the machine is and where it's going, and program size essentially doesn't matter on a modern controller.

It appears that Mach3 doesn't notice, but something I noticed immediately when I looked at your code is that the trailing decimals are missing (F5, for example, instead of F5.0 or F5.). On many CNC controls it will interpret F5 as F0.0005 instead of F5.0, and it'll seem like your code has frozen.

OMG do I hate that. The Haas machine I use sometimes looks for a trailing dot. For inexplicable reasons MadCam doesn't always add them in. The whole program comes to a screeching halt and I never know why! There seems to be a lot of complaints around Mach3, but compared to the Haas controller it is an absolute wonder.


Sent from my iPhone using Tapatalk


They err on the side of caution. Running at 0.050 IPM by accident is better than running at 500 IPM by accident :)

Author:  ZekeM [ Mon Jul 13, 2015 6:45 pm ]
Post subject:  Re: Help with GCode

what bob said about decimals is spot on. you dont have decimals in your Y axis moves either which can throw things for a loop. also using G64 is strange......... other than that it should work

Author:  cbrviking [ Fri Aug 21, 2015 9:22 am ]
Post subject:  Re: Help with GCode

Update - the code worked perfectly!

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/