Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

G40


Recommended Posts

What is the post you are using? If you need the G41/G42 with a G1 call then might need to write some logic in the post to see the flag for G40 and output it by itself, but still output the G41/G42 with the G1 when it is turned on.

 

Generic Fanuc 3X calls it this way.

 

prapidout #Output to NC of linear movement - rapid [/size]
pcan1, pbld, n$, sgplane, `sgcode, sgabsinc, pccdia,
pxout, pyout, pzout, strcantext, pscool, e$
#Modify following line to customize output for high-speed toolpath
#tool inspection/change points
if rpd_typ$ = 7, pbld, n$, "M00", "(TOOL INSPECTION POINT - POST CUSTOMIZATION REQUIRED)", e$

plinout #Output to NC of linear movement - feed
pcan1, pbld, n$, sgplane, `sgcode, sgabsinc, pccdia,
pxout, pyout, pzout, feed, strcantext, pscool, e$
#Modify following line to customize output for high-speed toolpath
#tool inspection/change points
if rpd_typ$ = 7, pbld, n$, "M00", "(TOOL INSPECTION POINT - POST CUSTOMIZATION REQUIRED)", e$

pcirout #Output to NC of circular interpolation
pcan1, pbld, n$, sgplane, sgcode, sgabsinc, pccdia,
pxout, pyout, pzout, parc, feed, strcantext, pscool, e$


pccdia #Cutter Compensation[/size]
#Force Dxx#
if prv_cc_pos$ <> cc_pos$ & cc_pos$, prv_tloffno$ = c9k
sccomp
if cc_pos$, tloffno$[/size]


# --------------------------------------------------------------------------
# Cutter compensation G code selection
scc0 : "G40" #Cancel cutter compensation
scc1 : "G41" #Cutter compensation left
scc2 : "G42" #Cutter compensation right
sccomp : "" #Target string

fstrsel scc0 cc_pos$ sccomp 3 -1

 

So if you needed G41/G42 to act like it does now you would have to make a condition statement in my thoughts. Maybe something like this.

 

[
prapidout #Output to NC of linear movement - rapid
if sscomp > 0,
 [
 pcan1, pbld, n$, sgplane, `sgcode, sgabsinc, pccdia,
 pxout, pyout, pzout, strcantext, pscool, e$
 #Modify following line to customize output for high-speed toolpath
 #tool inspection/change points
 if rpd_typ$ = 7, pbld, n$, "M00", "(TOOL INSPECTION POINT - POST CUSTOMIZATION REQUIRED)", e$
 ]
else,
 [
 pcan1, pbld, n$, sgplane, pccdia , sgabsinc,
 pxout, pyout, pzout, strcantext, pscool, e$
 #Modify following line to customize output for high-speed toolpath
 #tool inspection/change points
 if rpd_typ$ = 7, pbld, n$, "M00", "(TOOL INSPECTION POINT - POST CUSTOMIZATION REQUIRED)", e$
 ]

 

That is just me throwing stuff out there to think about. You will need to decide how to handle it in each rapid, liner and arc move and that requires knowing what you want to go on at the machine. That may not even work I did not test it was just thinking out loud to provoke some thought and might even get a guru to chime in which would be cool as well.

Link to comment
Share on other sites

I agree with Mick sounds odd to have that causing issues. Make sure that your are leading out with a lead in line of half the tool diameter. If you still need to turn off cutter comp after the G1 line the code above from Crazymillman is pretty good except your test should be on "cc_pos$" not "sscomp".

 

plinout #Output to NC of linear movement - feed
if cc_pos$ > 0,
	 [
	 pcan1, pbld, n$, sgplane, `sgcode, sgabsinc, pccdia,
	 pxout, pyout, pzout, strcantext, pscool, e$
	 #Modify following line to customize output for high-speed toolpath
	 #tool inspection/change points
	 if rpd_typ$ = 7, pbld, n$, "M00", "(TOOL INSPECTION POINT - POST CUSTOMIZATION REQUIRED)", e$
	 ]
else,
	 [
	 pcan1, pbld, n$, sgplane, pccdia , sgabsinc,
	 pxout, pyout, pzout, strcantext, pscool, e$
	 #Modify following line to customize output for high-speed toolpath
	 #tool inspection/change points
	 if rpd_typ$ = 7, pbld, n$, "M00", "(TOOL INSPECTION POINT - POST CUSTOMIZATION REQUIRED)", e$
	 ]

Link to comment
Share on other sites
  • 1 month later...

I run a Allen Bradley 10 series controller and for me if the G40 is not on a separate line when cutting a circle it make a tear drop. Now the G41/G42 have to be on a G1 line in order for it to cut correctly.

 

But, the control in question is an Okuma control, not an Allen Bradley. Different control, different rules :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...