Official Luthiers Forum!

Owned and operated by Lance Kragenbrink
It is currently Tue Apr 16, 2024 3:04 am


All times are UTC - 5 hours





Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Help with GCode
PostPosted: Tue Jun 30, 2015 11:13 pm 
Offline
Cocobolo
Cocobolo
User avatar

Joined: Tue Sep 27, 2011 9:47 am
Posts: 175
First name: Jamie
Last Name: Unden
City: Lakeside
State: CA
Zip/Postal Code: 92040
Country: USA
Focus: Build
Status: Amateur
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.


You do not have the required permissions to view the files attached to this post.


Top
 Profile  
 
 Post subject: Re: Help with GCode
PostPosted: Wed Jul 01, 2015 12:37 am 
Offline
Cocobolo
Cocobolo

Joined: Wed Jan 08, 2014 7:58 pm
Posts: 273
First name: Leo
Last Name: Pedersen
City: Bowen Island
State: British Columbia
Zip/Postal Code: V0N 1G2
Country: Canada
Focus: Build
Status: Amateur
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?


Top
 Profile  
 
 Post subject: Re: Help with GCode
PostPosted: Wed Jul 01, 2015 9:48 am 
Offline
Cocobolo
Cocobolo
User avatar

Joined: Tue Sep 27, 2011 9:47 am
Posts: 175
First name: Jamie
Last Name: Unden
City: Lakeside
State: CA
Zip/Postal Code: 92040
Country: USA
Focus: Build
Status: Amateur
That's a great idea - I'll do that tonight.


Top
 Profile  
 
 Post subject: Re: Help with GCode
PostPosted: Wed Jul 01, 2015 10:07 am 
Offline
Contributing Member
Contributing Member
User avatar

Joined: Thu May 12, 2005 5:46 am
Posts: 2933
Location: United States
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.

_________________
Jim Watts
http://jameswattsguitars.com


Top
 Profile  
 
 Post subject: Re: Help with GCode
PostPosted: Wed Jul 01, 2015 1:51 pm 
Offline
Koa
Koa

Joined: Fri Jan 25, 2008 9:55 am
Posts: 982
Location: Traverse City Michigan
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

_________________
Ken


Top
 Profile  
 
 Post subject: Re: Help with GCode
PostPosted: Wed Jul 01, 2015 4:10 pm 
Offline
Contributing Member
Contributing Member
User avatar

Joined: Thu May 12, 2005 5:46 am
Posts: 2933
Location: United States
I spent a big chunk of my early career programming 5 axis mills for the aircraft industry. It's been a while though.

_________________
Jim Watts
http://jameswattsguitars.com


Top
 Profile  
 
 Post subject: Re: Help with GCode
PostPosted: Thu Jul 02, 2015 8:16 am 
Offline
Cocobolo
Cocobolo
User avatar

Joined: Tue Sep 27, 2011 9:47 am
Posts: 175
First name: Jamie
Last Name: Unden
City: Lakeside
State: CA
Zip/Postal Code: 92040
Country: USA
Focus: Build
Status: Amateur
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.


Top
 Profile  
 
 Post subject: Re: Help with GCode
PostPosted: Thu Jul 02, 2015 2:17 pm 
Offline
Contributing Member
Contributing Member
User avatar

Joined: Thu May 12, 2005 5:46 am
Posts: 2933
Location: United States
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.

_________________
Jim Watts
http://jameswattsguitars.com


Top
 Profile  
 
 Post subject: Re: Help with GCode
PostPosted: Wed Jul 08, 2015 12:02 pm 
Offline
Brazilian Rosewood
Brazilian Rosewood
User avatar

Joined: Tue May 02, 2006 9:02 am
Posts: 2351
Location: Canada
First name: Bob
Last Name: Garrish
City: Toronto
State: Ontario
Country: Canada
Status: Professional
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.

_________________
Bob Garrish
Former Canonized Purveyor of Fine CNC Luthier Services


Top
 Profile  
 
 Post subject: Re: Help with GCode
PostPosted: Wed Jul 08, 2015 12:59 pm 
Offline
Koa
Koa
User avatar

Joined: Mon Nov 24, 2008 12:17 pm
Posts: 1162
City: Escondido
State: CA
Zip/Postal Code: 92029
Country: USA
Focus: Build
Status: Semi-pro
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


Top
 Profile  
 
 Post subject: Re: Help with GCode
PostPosted: Mon Jul 13, 2015 11:09 am 
Offline
Brazilian Rosewood
Brazilian Rosewood
User avatar

Joined: Tue May 02, 2006 9:02 am
Posts: 2351
Location: Canada
First name: Bob
Last Name: Garrish
City: Toronto
State: Ontario
Country: Canada
Status: Professional
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 :)

_________________
Bob Garrish
Former Canonized Purveyor of Fine CNC Luthier Services


Top
 Profile  
 
 Post subject: Re: Help with GCode
PostPosted: Mon Jul 13, 2015 6:45 pm 
Offline
Contributing Member
Contributing Member
User avatar

Joined: Fri Dec 21, 2012 11:52 am
Posts: 1388
First name: Zeke
Last Name: McKee
City: Goodlettsville
State: TN
Zip/Postal Code: 37070
Country: United States
Focus: Build
Status: Amateur
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


Top
 Profile  
 
 Post subject: Re: Help with GCode
PostPosted: Fri Aug 21, 2015 9:22 am 
Offline
Cocobolo
Cocobolo
User avatar

Joined: Tue Sep 27, 2011 9:47 am
Posts: 175
First name: Jamie
Last Name: Unden
City: Lakeside
State: CA
Zip/Postal Code: 92040
Country: USA
Focus: Build
Status: Amateur
Update - the code worked perfectly!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group
phpBB customization services by 2by2host.com