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:

LATHE HOME in MPLFAN


M_CODE1
 Share

Recommended Posts

Using the MPLFAN post that came with MasteCam.

 

Is there a way for this post to output the home position as my User Defined Home Position instead of the "G28 U0. V0. W0. M05" that I am getting now?

 

I want G0 X15 Z7 M05.

 

 

Running X2 MR2 SP1.

 

Thanks

 

Mike

Link to comment
Share on other sites

Realizing that it will always (and I do mean always!) be that way if you hard code, then yes.

 

code:

pl_retract      #Retract tool based on next tool gcode, lathe (see ptoolend)

cc_pos$ = zero

if home_type = one,

[

pmap_home #Get home position, xabs

ps_inc_calc #Set inc.

pbld, n$, psccomp, e$

pcan1, pbld, n$, *sgcode, pfxout, pfyout, pfzout, *toolno, e$

pbld, n$, pnullstop, strcantext, e$

]

else,

[

#Retract to reference return

pbld, n$, `sgcode, psccomp, e$

if home_type = m_one, pbld, n$, *toolno, e$

pcan1, pbld, n$, *sg28ref, "U0.", [if y_axis_mch, "V0."], "W0.",

pnullstop, strcantext, e$

if home_type > m_one, pbld, n$, *toolno, e$

]

Notice the *sg28ref, "U0." ect ect... remove the

*sg28ref, "U0.", [if y_axis_mch, "V0."], "W0." and change it to *sg00, "X15. Z7."

 

That should do it. Make sure you backup the post before you do this =]

 

HTH

Link to comment
Share on other sites

I dont want it hard coded, that could be bad> I want it to come from my Home position I set in each operation.

 

I guess another question is, one the Fanuc controller, is there a way to set where it goes home at with the "G28 U0. V0. W0. M05". Familar with the Fanuc control on a mill but not on a lathe.

Link to comment
Share on other sites

# mi1 - Work coordinate system: (home_type)

# -1 = Reference return / Tool offset positioning.

# 0 = G50 with the X and Z home positions.

# 1 = X and Z home positions.

# 2 = WCS of G54, G55.... based on Mastercam settings.

 

 

home_type : 1 #Flag for type of home location, read from misc. int.

 

Put the 1 in for home type and still got the same output? G28 U0. V0. W0. M05

Link to comment
Share on other sites

the place you changed it was only a flag to initialize the variable. Either you put the 1 in the misc value from the operation in Mastercam or do the following:

find this post block: pmiscint$ and in it just put the # before the line:

home_type = mi1$

 

should look like this:

 

pmiscint$

if sub_level$ <= zero, absinc$ = mi2$

ref_ret = mi3$

#home_type = mi1$

Link to comment
Share on other sites

Ref. Return [0=G28,1=G30]

 

G30 U0. V0. W0. M05

 

When I changed that it just output a G30 instead of the G28?

 

Also tried changing the post and still the same output

 

pmiscint$ #Capture the top level absinc for subprograms

if sub_level$ <= zero, absinc$ = mi2$

ref_ret = mi3$

#home_type = mi1$

Link to comment
Share on other sites

G30 will send the machine to a position a certain distance from machine zero. That distance is set in parameter 1241 (fanuc 16/18). At the top of every lathe program I had:

 

G10L50

N1241P1R0

N1241P2R-200000

G11

G30U0W0

M01

 

The P1R0 sets the x-axis to 0.000 from machine home.

The P2R-200000 stes the z-axis to -200.000mm from machine home. (can not use decimal point thus R-200000)

 

These parmeter values must be in metric even if the machine is in inch. In our shop it was the setup guys responsability to change the P2R-value in the program to a safe value for turret indexing depending on how long his tools were. It worked great for us and I didn't have to calcualate any positions for indexing when creating the programs.

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...