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:

CNC LATHE BROACHING


Wildcat
 Share

Recommended Posts

I am trying to come up with a macro to broach on a CNC Lathe. I have the following but it doesnt seem to want to work. Can someone look at this and see if they see anything that stands out? I have the main and sub together to look at.

%
O0008
(BROACH MACRO PROGRAM)
(CONTAINS SUB PROGRAM #0070)

(ENTER YOUR KEYWAY DATA ON THE NEXT 5 LINES)
#501=2.4000(ENTER KEYWAY LENGTH HERE)
#502=.9682(ENTER STARTING DIAMETER HERE)
#503=1.25(ENTER ENDING DIAMETER HERE)
#504=.002(ENTER DEPTH OF CUT PER PASS HERE)
#505=150(ENTER IPM FEED RATE HERE)

(DO NOT EDIT THESE 3 LINES)
#506=[[#503-#502]/2](AUTO CALCULATES FULL DEPTH)
#507=[#506/#504](AUTO CALCULATES NUMBER OF PASSES)
#508=1(RESETS PASS COUNTER)

G20(INCH INPUT)
M68 (LOCK SPINDLE)
G98(FEED PER MINUTE)
G50S500(SET MAX RPM)
G00G30U0W0(RAPID TO HOME POSITION)
T0808(CALL TOOL)
M23(C-AXIS MODE ON)
G0C0(ROTATE C AXIS)
G0X[#502]Z.10T0101(CALL OFFSET AND RAPID 1 INCH IN FRONT OF PART)
M8(COOLANT ON)
M98P0070L[#507](CALL SUBPROGRAM O0070 AND REPEAT #507 TIMES)
M24(C-AXIS MODE OFF)
G0G99Z1.M9(COOLANT OFF)
G30U0W0T0800(GO HOME AND CANCEL OFFSET)
M67 (UNLOCK SPINDLE)
M30(RESET PROGRAM)
%

%
O0070
(SUB PROGRAM)
G98G1Z[[[#501]*[-1]]-.10]F[#505](FEED PER MINUTE)
X[#502](RETRACT ON X)
G0Z1.0(RETRACT ON Z)
#508=#508+1(PASS COUNTER)
G0X[#502+[#508*#504]](RAPID TO NEXT X POSITION)
M99(RETURN TO MAIN PROGRAM)
%

Thanks

 

Link to comment
Share on other sites

Charlie that is almost like what we done. We have it working now.

This Macro writing is a new thing for me. The one I have is one I found and started to modify it. Now that I have my beak wet I must learn it. Im trying to learn C++ as well.

Thanks for the help and suggestion guys, I very much appreciate it.

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