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:

X6 Lathe how to make it move in Z first and in X last?


Darin
 Share

Recommended Posts

Hello,

 

How do I make Mastercam always post a Z move first to approach the part and X only to exit? I can't get reference points to do this... It always post a X and Z on the same line which is a crash sometimes.. Is there a way to make it go to a certain home position in Z when approaching and the X when exit? I started with MPLmaster post... We have X6

post-1869-0-44391400-1361222624_thumb.jpg

post-1869-0-56300600-1361222747_thumb.jpg

post-1869-0-07557800-1361222756_thumb.jpg

post-1869-0-56816800-1361222762_thumb.jpg

  • Like 1
Link to comment
Share on other sites

In your post processor there is a 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.", [if y_axis_mch, "V0."], "W0.", strcantext, e$
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$
]

 

The home_type variable controls if G28 U0. W0. or if the values in the machine def define the home position.

Important point the values in the machine def are world co-ordinates so Z on the lathe is X on the home position and X on the lathe is Y in the home position setting (as a radius value)

 

The first setcion is retracting when X and Z values are used (home_type = 1)

The second is for retracting when G28 U0. W0. is used (home_type = any_thing_but_1)

 

Switching where the pfzout come out or the "W0." arround will affect the output

Example:

 

 

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, e$
pcan1, pbld, n$, 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.", [if y_axis_mch, "V0."], e$
pcan1, pbld, n$, "W0.", strcantext, e$
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$
]

 

The approach is a similar edit in the ltlchg postblock.

 

Look for this line:

 

pcan1, pbld, n$, *sgcode, pfxout, pyout, pfzout, pscool, strcantext, e$

 

Allan

Link to comment
Share on other sites

That worked for the home position but it still moves in X and Z at the same time.... Below is the code... I have tried ref points no go...

 

 

G28 U0.

G28 W0.

N1 G0 T0101

G18 G99

M24

G97 S312 M03

G0 X2.45 Z.5 <------------------------------- This needs to be only Z move first then it can be X ... This can crash from the home position sometimes...--------------------------------------------------------->

G50 S3500

G96 S200

Z.055

G1 X-.0625 F.01

G0 Z.155

X2.45

Z.01

G1 X-.0625

G0 Z.11

X2.45

Z0.

G1 X-.0625

G0 Z.1

(ROUGHS O.D.)

G0 X2.0506

Z.21

G1 Z.11

Z-3.6812

X2.192 Z-3.6105

G0 Z.21

X1.8512

G1 Z.11

Z-2.99

X1.8575

G3 X2.02 Z-3.0713 R.0812

G1 Z-3.9813

X2.1614 Z-3.9105

G0 Z.21

X1.6518

G1 Z.11

Z-2.99

X1.8575

G3 X1.8712 Z-2.9903 R.0812

G1 X2.0126 Z-2.9196

G0 Z.21

X1.4524

G1 Z.11

Z-2.99

X1.6718

X1.8133 Z-2.9193

G0 Z.21

X1.2531

G1 Z.11

Z-2.99

X1.4724

X1.6139 Z-2.9193

G0 Z.21

X1.0537

G1 Z.11

Z-2.99

X1.2731

X1.4145 Z-2.9193

G0 Z.21

X.8543

G1 Z.11

Z-.0021

X.9863 Z-.0681

G3 X1.0105 Z-.0973 R.0412

G1 Z-2.7543

G3 X1.0305 Z-2.7813 R.0412

G1 Z-2.99

X1.0737

X1.2151 Z-2.9193

(FINISHES O.D.)

G50 S3600

G0 Z.1

X0.

G1 Z0.

X.7959

G3 X.8401 Z-.0092 R.0313

G1 X.9722 Z-.0752

G3 X.9905 Z-.0973 R.0312

G1 Z-2.7583

G3 X1.0105 Z-2.7813 R.0313

G1 Z-3.

X1.8575

G3 X2. Z-3.0713 R.0713

G1 Z-3.95

X2.1414 Z-3.879

G97 S153

G28 U0.

G28 W0.

M01

(TOOL - 7 OFFSET - 7)

(OD THREAD LEFT INSERT - NTC-3L10E)

(MIYANO)

(HEX_CAPSCREW_1.00-8UNCX3.00)

(TURNS 1-8 THREADS)

G28 U0.

G28 W0.

N7 G0 T0707

G18 G99

G97 S200 M03

G0 X1.19 Z.2281

G76 P010060 Q10 R0.

G76 X.8512 Z-2.75 P694 Q214 R0. F.125

G28 U0.

G28 W0.

M05

M30

%

Link to comment
Share on other sites

If you always Mastercam to do it that way you'll need to change your post, just as Allan described, look for the line he mentioned on the " ltlchg postblock", pcan1, pbld, n$, *sgcode, pfxout, pyout, pfzout, pscool, strcantext, e$

 

and break it just as you did for the ref return block.

 

Or if you only want to do it on certain Tpaths, ie, you're using the tailstock, then I would just add a couple points to my chain so the tool would follow them as approach moves.

 

HTH

Link to comment
Share on other sites

If you always Mastercam to do it that way you'll need to change your post, just as Allan described, look for the line he mentioned on the " ltlchg postblock", pcan1, pbld, n$, *sgcode, pfxout, pyout, pfzout, pscool, strcantext, e$

 

and break it just as you did for the ref return block.

 

Or if you only want to do it on certain Tpaths, ie, you're using the tailstock, then I would just add a couple points to my chain so the tool would follow them as approach moves.

 

HTH

 

 

Great thanks that worked...

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