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:

MPFAN ADD TOOL CHANGE POSITION


dforsythe
 Share

Recommended Posts

x4

x4 mpfan

haas vf-9

 

Im looking for a safe way to add a line of code

before each tool change. It avoids hitting any clamps or vac lines by going here first.

 

g0 g90 g54 x-54.1 y0

 

we have a dedicated haas with a large 4th axis that runs the same parts everyday. the old post we were using worked great until we updated it to x4. i tried using the new mpfan and i just need a few minor changes, this being one of them.

 

thanks

Link to comment
Share on other sites

Search for this section of your post and add the line noted below:

 

code:

 pretract        #End of tool path, toolchange

sav_absinc = absinc$

absinc$ = one

sav_coolant = coolant$

coolant$ = zero

 

# if nextop$ = 1003, #Uncomment this line to leave coolant on until eof unless

[ # explicitely turned off through a canned text edit

if all_cool_off,

[

#all coolant off with a single off code here

if coolant_on, pbld, n$, *sall_cool_off, e$

coolant_on = zero

]

else,

[

local_int = zero

coolantx = zero

while local_int < 20,

[

coolantx = and(2^local_int, coolant_on)

local_int = local_int + one

if coolantx > zero,

[

coolantx = local_int

pbld, n$, scoolantx, e$

]

coolantx = zero

]

coolant_on = zero

]

]

#cc_pos is reset in the toolchange here

cc_pos$ = zero

gcode$ = zero

pbld, n$, sccomp, *sm05, psub_end_mny, e$

pbld, n$, scoolant, e$

pbld, n$, sgabsinc, sgcode, *sg28ref, "Z0.", e$

pbld, n$, "G0", "G90", "G53", "X-55.", "Y0", e$ #<-----------Add this line

 

absinc$ = sav_absinc

coolant$ = sav_coolant

By using the G53 Machine Coordinate system you can move to a safe tool change position with out the position depending on a G54 offset location. You can adjust the X/Y position to what ever works for you.

 

HTH

Josh

Link to comment
Share on other sites

maybe i have an older post. i tried it in a few places with no luck. Thanks for the help, i will keep trying.

 

code:

  

 

pretract #End of tool path, toolchange

phsm_off

sav_absinc = absinc$

absinc$ = one

sav_coolant = coolant$

coolant$ = zero

 

# if nextop$ = 1003, #Uncomment this line to leave coolant on until eof unless

# [ # explicitely turned off through a canned text edit

if all_cool_off,

[

#all coolant off with a single off code here

if coolant_on, pbld, n$, *sall_cool_off, e$

coolant_on = zero

]

else,

[

local_int = zero

coolantx = zero

while local_int < 20,

[

coolantx = and(2^local_int, coolant_on)

local_int = local_int + one

if coolantx > zero,

[

coolantx = local_int

pbld, n$, scoolantx, e$

]

coolantx = zero

]

coolant_on = zero

]

# ]

 

#cc_pos is reset in the toolchange here

cc_pos$ = zero

if convert_rpd$ = one,

[

gcode$ = one

feed = maxfeedpm

ipr_type = zero

]

else, gcode$ = zero

pbld, n$, sccomp, *sm05, psub_end_mny, e$

pbld, n$, sgabsinc, sgcode, [if gcode$ = 1, sgfeed], *sg28, "Z0.", [if gcode$ = 1, feed], scoolant, e$

#if lock_codes = one & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$

#pbld, n$, *sg28, "X0.", "Y0.", protretinc, e$

#if lock_codes = one & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$

if abs(fmtrnd(cabs)) > 360 & nextop$ <> 1003 & not(index),

[

if lock_codes = one, pbld, n$, *sunlock, sunlockcomm, e$

rotretflg = 1

pbld, n$, `sg28, protretinc, e$

rotretflg = 0

if lock_codes = one & cuttype = 0, pbld, n$, *slock, slockcomm, e$

]

absinc$ = sav_absinc

coolant$ = sav_coolant

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