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:

X3 How to send Lathe home with G28


mroy0404
 Share

Recommended Posts

You need to make the following changes in your post.

 

Find the ltlchg$ post block.

 

ltlchg$          #Toolchange, lathe
     toolchng = one
     gcode$ = zero
     copy_x = vequ(x$)
     pcc_capture   #Capture LCC ends, stop output RLCC
     c_rcc_setup$   #Save original in sav_xa and shift copy_x for LCC comp.
     pcom_moveb    #Get machine position, set inc. from c1_xh
     c_mmlt$        #Position multi-tool sub, sets inc. current if G54...
     ptoolcomment
     comment$
     if home_type < two, #Toolchange G50/home/reference position
       [
       sav_xh = vequ(copy_x)
       sav_absinc = absinc$
       absinc$ = zero
       start_xh = vequ(xh$)        
       pmap_home   #Get home position, xabs
       ps_inc_calc #Set start position, not incremental
       #Toolchange home position
       if home_type = one,
         pbld, n$, *sgcode, pwcs, pfxout, pfyout, pfzout, e$
       else,
         [
         #Toolchange g50 position
         pbld, n$, *sg28ref, "U0.", [if y_axis_mch, "V0."], "W0.", e$
         if home_type = zero, pbld, n$, *sg50, pfxout, pfyout, pfzout, e$
         ]
       pe_inc_calc #Update previous
       absinc$ = sav_absinc
       copy_x = vequ(sav_xh)
       ]

 

You need to break up the line with the '*sg28ref' code. Change that line to the following two lines:

 

pbld, n$, *sg28ref, "U0.", e$      #<-----ADDED ', e$' after U0.
n$, *sg28ref, [if y_axis_mch, "V0."], "W0.", e$    #<----- ADDED NEW LINE FOR G28 V0. W0. output

Link to comment
Share on other sites

You will also need to make the same change to the pl_retract post block

 

pl_retract      #Retract tool based on next tool gcode, lathe (see ptoolend)
     cc_pos$ = zero
     if home_type = one,
       [
       xh$ = vequ(start_xh)
       pmap_home   #Get home position, xabs
       ps_inc_calc #Set inc.
       pbld, n$, psccomp, e$
       if css_actv$ & css_end_rpm & not(lathe_stop | synch_flg | n1_gcode = 1003 | n1_posttype <> posttype$ | n1_spindle_no <> spindle_no$),
         [
         pspindle
         prpm
         ]
       pcan1, pbld, n$, *sgcode, pfxout, pfyout, pfzout, [if drop_offset, *toolno], strcantext, e$
       if lathe_stop | synch_flg | n1_gcode = 1003 | n1_posttype <> posttype$ | n1_spindle_no <> spindle_no$,
         [
         pbld, n$, pnullstop, e$
         ]
       ]
     else,
       [
       #Retract to reference return
       pbld, n$, `sgcode, psccomp, e$
       if home_type = m_one & drop_offset, pbld, n$, *toolno, e$
       if css_actv$ & css_end_rpm & not(lathe_stop | synch_flg | n1_gcode = 1003 | n1_posttype <> posttype$ | n1_spindle_no <> spindle_no$),
         [
         pspindle
         prpm
         ]        
       pcan1, pbld, n$, *sg28ref, "U0.", e$    #<---- START CHANGES HERE
       n$, *sg28ref, [if y_axis_mch, "V0."], "W0.", strcantext, e$   #<----- ADD THE FOLLOWING LINE

       if lathe_stop | synch_flg | n1_gcode = 1003 | n1_posttype <> posttype$ | n1_spindle_no <> spindle_no$,
         [
         pbld, n$, pnullstop, e$
         ]
       if home_type > m_one & drop_offset, pbld, n$, *toolno, e$

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