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:

cncchipmaker

Verified Members
  • Posts

    190
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by cncchipmaker

  1. I made an improvement to the FACE MILL MACRO, please see previous post.
  2. Usually when you have a probe it will come with macros already built into it to square up A axis. For instance here at work we use a O9917 which is custom for our use. If you want to write your own macro you could use this general guide and this would be for a horizontal: 1st probe hit Z: X+ direction and then store position into variable #600 2nd probe hit Z: X- direction and then store position into variable #601 Run Macro: #602=[#601-#600]/2. #603=ATAN[#602]/[width of X total distance divided by 2.] IF[#603GT180.]THEN#603=#603-360. (Update G54 A) #5224=#5224+#603 Note: If A goes the wrong direction subtract #603 from #5224 #5224 is the system variable for G54 A on a Fanuc and Haas controls.
  3. I updated the rough square pocket program with cutter comp and fixed the error in the face mill macro. See previous posts for these changes.
  4. This was requested through a personal message. I am going to have to go through all of my unproven programs for you guys. O1111(FACE MILL MACRO) (STARTS AT UPPER LEFT CORNER) (BASED ON X0Y0 MIDDLE OF STOCK) (IF YOU WANT TO COMPLETELY EXIT) (OFF STOCK FOR FINISH MAKE YOUR) (E VARIABLE BIGGER THAN TOOL DIAMETER) (PROVEN ON NC PLOT ONLY) (FORMAT G65/G66 QTXYSEZWRF) (Q = #17 - STEPOVER IN Z/ DOC) (T = #20 - TOOL DIAMETER) (X = #24 - MATERIAL SIZE -X-) (Y = #25 - MATERIAL SIZE -Y-) (S = #19 - STEPOVER PERCENTAGE) (E = #8 - EDGE HANGOVER AMOUNT) (Z = #26 - Z ZERO/TOP OF STOCK) (W = #23 - END Z) (R = #18 - CLEARANCE PLANE) (F = #9 - FEEDRATE) (*********************************) (CALCULATE Y STEPOVER AMOUNT) #100=[#19*.01]*#20 (STORE X AND Y ABSOLUTES) #101=#5001 #102=#5002 (CALCULATE # OF PASSES) #103=#25+[#20-#100] #104=FUP[#103/#100] #114=#104 (CALCULATE PATTERN) (CLEARANCE POSITION X LEFT) #105=#101-[[#24/2.]+1.] #105=#105-[#20/2.] (CLEARANCE POSITION X RIGHT) #106=#101+[[#24/2.]+1.] #106=#106+[#20/2.] (HANGOVER POSTION X LEFT) #115=#101-[[#24/2.]+#8] #115=#115+[#20/2.] (HANGOVER POSTION X RIGHT) #116=#101+[[#24/2.]+#8] #116=#116-[#20/2.] (Y INITIAL START) #107=#102+[[#25/2.]+[#20-#100]] #107=#107-[#20/2.] (CALCULATE Z STEPOVER) #120=ABS[#26]-ABS[#23] #120=ABS[#120] IF[[#26*#23]GE0]GOTO1 #120=ABS[#26]+ABS[#23] N1#121=ROUND[#120/#17] #122=#120/#121 IF[#122GT[#120/2.]]THEN#122=#120 (RAPID TO MIDDLE OF STOCK) G0G90X#101Y#102 (GOTO INITIAL CLEARANCE PLANE) (UPPER LEFT CORNER) X#105Y#107 Z[#26+.1] G1Z#26F#9 #123=#5003-#122 (CUT FACE) WHILE[#121GE1.]DO1 IF[#121EQ0]GOTO1001 G1Z#123F#9 #121=#121-1. WHILE[#104GE1.]DO2 IF[#104LT1.]GOTO10 #104=#104-1. G90G1X#116 IF[#104LT1.]GOTO10 G91Y-#100 #104=#104-1. G90G1X#115 IF[#104LT1.]GOTO10 G91Y-#100 END2 N10 #104=#114 (EXIT OFF STOCK) IF[#5001GT#101]GOTO100 G90G1X#105 GOTO1000 N100 G90G1X#106 N1000 G0Z[#123+.1] X#105Y#107 #123=#123-#122 END1 N1001G0Z#18 X#101Y#102 M99
  5. OK, I think I got it. Please give me any feedback that you can. O3334(ROUGH POCKET) (ABSOLUTE MACRO) (MUST HAVE START HOLE IN CENTER) (PROVEN ON NC PLOT ONLY) (FORMAT G65/G66 XYQSTRZEF) (X = #24 - X DIMENSION) (Y = #25 - Y DIMENSION) (Q = #17 - STEPOVER IN Z/ DOC) (S = #19 - STEPOVER IN XY/ PERCENTAGE) (T = #20 - TOOL DIAMETER) (R = #18 - CLEARANCE PLANE) (Z = #26 - Z START/ TOP OF STOCK) (E = #8 - END OF POCKET IN Z) (F = #9 - FEEDRATE) (*********************************) IF[[#24*#25*#17*#19*#20*#8*#9]EQ0]GOTO1000 (CALCULATE DOC IN Z) #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 (CALCULATE DOC IN X) #103=[#19*.01]*#20 #104=[#24/2.]-[#20/2.] #105=ROUND[#104/#103] #106=#104/#105 IF[#106GT[#104/2.]]THEN#106=#104 (CALCULATE DOC IN Y) #107=[#19*.01]*#20 #108=[#25/2.]-[#20/2.] #109=ROUND[#108/#107] #110=#108/#109 IF[#110GT[#108/2.]]THEN#110=#108 (STORE POSTIONS AND GO TO Z START) #111=#5001 #112=#5002 #114=#112 #115=#111 #116=#112 #117=#111 G0G90X#111Y#112 Z[#26+.1] G1Z#26F#9 #113=#5003-#102 #120=#105 IF[#120LT#109]THEN#120=#109 #125=#105 #129=#109 #130=#120 WHILE[#101GE1.]DO1 IF[#101EQ0]GOTO10 #101=#101-1. G90G1Z#113F#9 WHILE[#120GE1.]DO2 IF[#120EQ0]GOTO100 (CALCULATE TOOL PATH) IF[#109LE0]GOTO20 #114=#114+#110 N20 IF[#105LE0]GOTO30 #115=#115-#106 N30 IF[#109LE0]GOTO40 #116=#116-#110 N40 IF[#105LE0]GOTO50 #117=#117+#106 N50 (CUT POCKET) G1G90G41Y#114F#9 X#115 Y#116 X#117 Y#114 X#111 (DOWN COUNT) #105=#105-1. #109=#109-1. #120=#120-1. END2 N100 #105=#125 #109=#129 #114=#112 #115=#111 #116=#112 #117=#111 #120=#130 X#111Y#112G40 #113=#113-#102 END1 N10 X#111Y#112 Z#18 M99 N1000 #3000=1(DATA LACKING!)
  6. OK, it was driving me crazy not being able to figure this out on my own so I downloaded the trial version of NC PLOT and I have to say it's awesome. I have been writing these macros the hard way for many years. With this tool It only took me about 15 min to find out where most of my errors were. I still have I think only one bug to work out. I just wanted to apologize if my programs have caused any unwanted frustration to those of you who are trying to use them. It is only my intent to make certain machining applications easier through the use of macros for you guys. Thanks, James.
  7. Just downloaded NC PLOT trial version on my vacay, I will give it a try.
  8. We have had great luck with Titex drills. You will get the best results with through coolant.
  9. I promise the next thing I post will be a proven program, I just need more time. James.
  10. Sorry, I did not mean to get so defensive. I appreciate any criticism or new ideas and I appologize for being "snippy". I would just like to see people fix the problem if they know that there is one or come up with a new solution. I mean we are all here to help each other out, or at least that is my opinion.
  11. Look, I'm giving this my best shot at what I have available. If anyone can make it better please do and repost. I am just trying to help a guy out and I know I am not perfect. I did not cut anything at Z0 because you would be just cutting air or very small amount of material so the first Z cut is below Z0 by the Q amount. I did not use #3000 because I am not sure if it would work for his particular control and wanted a message that could be seen by any control.
  12. Sorry, It's obvious I rushed through this. It's a work in progress. I will try to get a copy of NCPlot. I have never used it and am used to just proving out macros I write at the machines. O3334(ROUGH POCKET) (ABSOLUTE MACRO) (MUST HAVE START HOLE IN CENTER) (UNPROVEN) (FORMAT G65/G66 XYQSTRZEF) (X = #24 - X DIMENSION) (Y = #25 - Y DIMENSION) (Q = #17 - STEPOVER IN Z/ DOC) (S = #19 - STEPOVER IN XY/ PERCENTAGE) (T = #20 - TOOL DIAMETER) (R = #18 - R PLANE) (Z = #26 - Z START/ TOP OF STOCK) (E = #8 - END OF POCKET IN Z) (F = #9 - FEEDRATE) (*********************************) IF[[#24*#25*#17*#19*#20*#18*#26*#8*#9]EQ0]GOTO1000 (CALCULATE DOC IN Z) #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 (CALCULATE DOC IN X) #103=[#19*.01]*#20 #104=[#24/2.]-[#20/2.] #105=ROUND[#104/#103] #106=#104/#105 IF[#106GT[#104/2.]]THEN#106=#104 (CALCULATE DOC IN Y) #107=[#19*.01]*#20 #108=[#25/2.]-[#20/2.] #109=ROUND[#108/#107] #110=#108/#109 IF[#110GT[#108/2.]]THEN#110=#108 (STORE POSTIONS AND GO TO Z START) #111=#5001 #112=#5002 #114=#112 #115=#111 #116=#112 #117=#111 G0G90X#111Y#112 Z[#26+.1] G1Z#26F#9 #113=#5003-#102 #120=#106 IF[#120LT#110]THEN#120=#110 WHILE[#101GE1.]DO1 IF[#101EQ0]GOTO10 #101=#101-1. G90G1Z#113F#9 WHILE[#120GT0]DO2 IF[#120LT0]GOTO100 #120=#120-1. (CALCULATE TOOL PATH) IF[#109EQ0]GOTO20 #114=#114+#110 N20 IF[#105EQ0]GOTO30 #115=#115-#106 N30 IF[#109EQ0]GOTO40 #116=#116-#110 N40 IF[#105EQ0]GOTO50 #117=#117+#106 N50 (CUT POCKET) G1G90Y#114F#9 X#115 Y#116 X#117 X#111 (DOWN COUNT) #105=#105-1. #109=#109-1. END2 N100 X#111Y#112 #113=#113-#102 END1 N10 X#111Y#112 Z#18 M99 N1000 M00(DATA LACKING)
  13. I am sorry that it did not work the 1st time, sometimes the macros take a while to debug. I will continue to look at it for you. Without being in front of a machine it might take me a little more while to figure it out. Yes we need to remove the # sign just before the IF, good catch. I will update it.
  14. Here is an example of how you can pull the digits: O8116( SIX DIGIT S/N MACRO) ( USE OFFSET 98 FOR SERIAL # ) ( 00.0001 WILL ENGRAVE 1 ) ( 1ST NUMBER ) #138=[#2098*.1] #140=FIX[#138] #141=#140+8100. ( 2ND NUMBER ) #138=[#140*10] #139=FIX[#2098] #140=#139-#138 #142=#140+8100. ( 3RD NUMBER ) #138=[#139*10] #139=FIX[#2098*10] #140=#139-#138 #143=#140+8100. ( 4TH NUMBER ) #138=[#139*10] #139=FIX[#2098*100] #140=#139-#138 #144=#140+8100. ( 5TH NUMBER ) #138=[#139*10] #139=FIX[#2098*1000] #140=#139-#138 #145=#140+8100. ( 6TH NUMBER ) #138=[#139*10] #139=FIX[#2098*10000] #140=#139-#138 #146=#140+8100. ( ARGUMENT ) IF[#141GT8100.]GOTO1 IF[#142GT8100.]GOTO2 IF[#143GT8100.]GOTO3 IF[#144GT8100.]GOTO4 IF[#145GT8100.]GOTO5 IF[#146GT8100.]GOTO6 GOTO100 N1M198P#141 N2M198P#142 N3M198P#143 N4M198P#144 N5M198P#145 N6M198P#146 N100M99
  15. Yes, please remove it. I hope that is the only thing wrong. Can someone please let me know if it works out, I do not get a chance to prove out everything I write.
  16. Yes, I already have the Z step down figured out, but not sure how to calcutlate the pocket yet. I will need some time to figure that out. This will be used as a G65 macro call. Ex: G65P0001T.5Q.2X5.Y6. where T is tool diameter, Q is stepover, X&Y are the dimensions of the pocket, and so on.
  17. Do you want this routine to also step down in Z or do u want to adjust it every time?
  18. Does anyone have any questions yet about the macros I posted?
  19. Roll tapping would be much more efficient than thread milling. We have had great luck in 304, must use oil though and make sure the minor diameter is free of coolant before tapping

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