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:

Custom Macro B Programming


Recommended Posts

Here you go. I basically modified a couple of macros that I already had. My old rough out program forced itself to 3 passes but this one should allow you to do a min. of 2 rough passes and a max of 3 spring passes. Who needs more than 3 spring passes right? So you basically forced me to create something new, Thanks! I would recomend dry running this program before you go all out. Remember your variables have to have decimals and please put a value in every spot. Please let me know if it works for you. I do not have that much time to prove out everything I write.

 

 

O6005(ROUGH SQUARE/ RECTANGLE)

(ALLOWS FOR 2 PASSES NOW)

(INSTEAD OF 3 MIN.)

(AND ADDED SPRING PASSES FOR mkd!)

(UNPROVEN)

M00

(FORMAT G65/G66 QTXYHVKRZEFS)

(Q = #17 - STEPOVER IN Z/ DOC)

(T = #20 - TOOL DIAMETER)

(X = #24 - FINAL SIZE -X- DIM.)

(Y = #25 - FINAL SIZE -Y- DIM.)

(H = #11 - STOCK WIDTH/ HORIZONTAL)

(V = #22 - STOCK HEIGHT/ VERTICAL)

(K = #6 - PART CORNER RAD./ SIDES)

(R = #18 - R PLANE)

(Z = #26 - Z START ZERO)

(E = #8 - END OF PROFILE IN Z)

(F = #9 - FEEDRATE)

(S = #19 - # SPRING PASSES)

(***********************************)

IF[#19GT3.]THEN#19=3.

#100=ABS[#26]-ABS[#8]

#100=ABS[#100]

IF[[#26*#8]GE0]GOTO1

#100=ABS[#26]+ABS[#8]

N1#101=ROUND[#100/#17]

#102=#100/#101

IF[#102GT[#100/2]]THEN#102=#100

IF[#102GT[#100/2]]THEN#101=1.

#103=#5001

#104=[#103-.1]-[[#20/2]+[#11/2]]

#105=#5002

#106=[#105+.1]+[[#20/2]+[#22/2]]

#121=#103+[[#24/2]-#6]

#131=#105+[[#25/2]-#6]

#122=#103-[[#24/2]-#6]

#132=#105+[[#25/2]-#6]

#123=#103-[[#24/2]-#6]

#133=#105-[[#25/2]-#6]

#124=#103+[[#24/2]-#6]

#134=#105-[[#25/2]-#6]

#107=[#20/2]+#6

G0G90X#104Y#106

Z[#26+.1]

G1Z#26F#9

#108=#5003

(STEP DOWN PROFILE)

WHILE[#101GE0]DO1

IF[#101LT0]GOTO10

#101=#101-1.

G1Z#108F#9

G41Y[#132+#107]

X#121

G02X[#121+#107]Y#131J-#107

G1Y#134

G02X#124Y[#134-#107]I-#107

G1X#123

G02X[#123-#107]Y#133J#107

G1Y#132

G02X#122Y[#132+#107]I#107

G03X[#122+.1]Y[[#132+#107]+.1]J.1

G0Z[#108+.1]

G40X#104

#108=#108-#102

END1

( SPRING PASSES )

#149=#19

WHILE[#149GE0]DO1

IF[#149LT0]GOTO100

#149=#149-1.

G0G90X#104Y#106

G1Z#108F#9

G41Y[#132+#107]

X#121

G02X[#121+#107]Y#131J-#107

G1Y#134

G02X#124Y[#134-#107]I-#107

G1X#123

G02X[#123-#107]Y#133J#107

G1Y#132

G02X#122Y[#132+#107]I#107

G03X[#122+.1]Y[[#132+#107]+.1]J.1

G40X#104

END1

N100G0G90Z#18

X#103Y#105

M99

  • Like 1
Link to comment
Share on other sites

Now to harness the power of MC plus Custom MACRO B, you could turn this into a Custom Drill Cycle. There's enough variables in the cycle itself plus the additional custom stuff on the last page.

Link to comment
Share on other sites
Guest MTB Technical Services

Interesting Fanuc Macro-B tidbit

 

On the newer 31i series control architecture, macro expressions assigned to an address are evaluated as the NC blocks are buffered through the look-ahead.

You will only see actual values for those addresses as the program scrolls during execution.

You won't see the Macro expression.

 

The blocks that have been buffered display as blue versus the standard program display color.

Link to comment
Share on other sites

Now to harness the power of MC plus Custom MACRO B, you could turn this into a Custom Drill Cycle. There's enough variables in the cycle itself plus the additional custom stuff on the last page.

 

I already have a few custom drill cycles written. Is there something in particular you would like to see?

Link to comment
Share on other sites

 

 

I already have a few custom drill cycles written. Is there something in particular you would like to see?

 

No thank you, I've got a number of them myself. Mostly probing cycles, but i do have the occasional shape in a cycle. A lot of douple don't know it's even possible.

Link to comment
Share on other sites

I've just done 2D shapes... Anything more and... well... that's why I have and use a CAM System to be honest.

 

MACRO B has it's place, but it is changing and relegated more or less to probing, checking machine states, etc...

 

I can count on two hands with fingers to spare the number of places I've been to in the last 10 years that programmed complete parts on a machining center using strictly MACRO B. In the early to late 90's it was more prevalent. Now, not so much.

Link to comment
Share on other sites
I've just done 2D shapes... Anything more and... well... that's why I have and use a CAM System to be honest.

 

MACRO B has it's place, but it is changing and relegated more or less to probing, checking machine states, etc...

 

+1

Even for most parametric parts it's hard to beat a WELL set up CAM system WITH a dialed in post. Even for simple pockets I use 2D dynamic paths with ramp contour entries pretty much every time. Not something easily or economically done with macros no matter what. That being said I use Macro B a ton for the situations you stated.

 

Mike

Link to comment
Share on other sites

I've just done 2D shapes... Anything more and... well... that's why I have and use a CAM System to be honest.

 

MACRO B has it's place, but it is changing and relegated more or less to probing, checking machine states, etc...

 

I can count on two hands with fingers to spare the number of places I've been to in the last 10 years that programmed complete parts on a machining center using strictly MACRO B. In the early to late 90's it was more prevalent. Now, not so much.

 

I have some really cool 3D custom macros for basic shapes like spheres, cones, pyramids, etc. I even have one for a variable radius. Boredom is the inventor of these things!

Link to comment
Share on other sites

I have some really cool 3D custom macros for basic shapes like spheres, cones, pyramids, etc. I even have one for a variable radius. Boredom is the inventor of these things!

Boredom.... :rofl: Man... if I had a dollar for every time I created something just because I could out of boredom, I'd be a wealthy man. :rofl:

 

I guess that's what seperates us from the 80%'ers eh boys? (i.e. those just along for the ride)

Link to comment
Share on other sites
  • 3 weeks later...
  • 4 months later...

How about a macro or parametric program to machine an eggcrate (SinX SinY) pattern around a sphere on a lathe using X,Z,C? I have written similar programs but am struggling with this one. Thanks :)

Link to comment
Share on other sites

Here is my latest macro for standard mills. I have only dry ran it and not been able to cut any chips with it yet. I am not familiar with mill turns so in order for me create the macro you are looking for I would need to know your exact variable inputs, the variables that you have at your disposal and what you need the macro to do exactly in order for me to help you. Thanks.

 

O5656(DIAMOND PIN MACRO)

(PIN AT 0 DEGREES IS VERTICAL)

(ABSOLUTE MACRO)

 

(FORMAT G65/G66 ABDTMWREFS)

(A = #1 - INCLUDED ANGLE OF PIN)

(60 DEGREES IS COMMON)

(B = #2 - G68 ROTATION FROM 0 DEGREES)

(D = #7 - DIAMETER OF PIN)

(T = #20 - TOOL DIAMETER)

(M = #13 - MATERIAL SIZE)

(SQUARE OR ROUND)

(W = #23 - WIDTH OF PIN CONTACT)

(R = #18 - R PLANE)

(E = #8 - END OF EM IN Z)

(F = #9 - FEEDRATE)

(S = #19 - # OF SPRING PASSES)

(*********************************)

(LIMIT SPRING PASSES TO 3.)

IF[#19GT3.]THEN#19=3.

(STORE CURRENT XY POSTION)

#100=#5001

#101=#5002

(CALCULATE TANGENT POSITIONS)

(BASED ON ARGUMENT -A-)

(-X-/-I-)

#102=[#23/2.]+[COS[#1/2.]*[#20/2.]]

(-Y-/-J-)

#123=ASIN[#23/2.]/[#7/2.]

#103=[COS[#123]*[#7/2.]]+[sIN[#1/2.]*[#20/2.]]

(CALCULATE FIRST POSITION -X-)

#105=#102+[TAN[#1/2.]*[#103]]

(CALCULATE MATERIAL CLEARANCE)

#106=[#13/2.]+[#20/2.]+.1

(STORE EACH LOCATION)

#110=#100-#106

#111=#101

#112=#100-#105

#113=#100-#102

#114=#101+#103

#115=#100+#102

#116=#101+#103

#117=#100+#105

#118=#101

#119=#100+#102

#120=#101-#103

#121=#100-#102

#122=#101-#103

(SET SPRING PASS COUNTER)

#149=#19

(SET ROTATION)

#530=#2

IF[#2GT180.]THEN#530=#2-360.

G68R#530

(GOTO 1ST POSTION)

G0G90X#110Y#111

Z[#8+.1]

G1Z#8F#9

G41X#112

WHILE[#149GE0]DO1

IF[#149LT0]GOTO10

#149=#149-1.

G1X#113Y#114

G02X#115Y#116I#102J-[#103]

G1X#117Y#118

X#119Y#120

G02X#121Y#122I-[#102]J#103

G1X#112Y#111

END1

N10G1G40G90X#110

G0Z#18

G69

X#100Y#101

M99

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