![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| Fanuc Discuss Fanuc controllers here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
| I thought that I had a copy of the chip breaker turn/dwell program from my old machine but I seem to have misplaced it. So anyone want to help me write one? or if you have one post it? I want to turn/dwell/turn/dwell/turn...ect I thought it looked something like this: %9010 #1 =z end #2 =turn distance/chip break #3 =dwell #4 =feed IF [#2 LT0] goto2 IF [#3 LT0] goto3 IF [#4 LT0] goto4 while [#5041 LT #1] DO1 G1 W#2 f#4 G4 U#3 END1 N1 #3000=1 (No Z) N2 #3000=2 (No Q) N3 #3000=3 (No D) N4 #3000=4 (No F) % My questions are -How do I define my current Z position. If I remember the old program correctly I thought it was #1=#5401 but I could be wrong. I just looked in the Fanuc manual and think I need to use a #5041-5048 macro but can someone confirm this. Also how do I determine what axis number my X and Z are? -I want to write the code in the program as G65 Z(end) Q(chip break) D(dwell) F(feed). How do I link Z,Q,D, and F to my sub program? Can I say #2=Q? Or do I use some parameter #'s like Q=#5403? -In my WHILE statement should I use a Z or W for my feed move? Does it matter? Do I have it written correctly that the loop will end when it hits my end point or could it possibly over-turn by going to the end of the last chip break assuming the chip break distance is not divisible by the overall distance. -How do I signify the end of the loop? m99? I know thats kinda a lot so thanks a bunch in advance!
__________________ I program, setup and run Swiss lathes with Fanuc controls |
|
#2
| ||||
| ||||
| a simple example is if you want to use D in your G65 and you need to check it is greater than 0 you put this into your macro.... IF [#7 GT 0] GOTO 100 etc A #1 B #2 C #3 D #7 E #8 F #9 H #11 I #4 J #5 K #6 M #13 Q #17 R #18 S #19 T #20 U #21 V #22 W #23 X #24 Y #25 Z #26 So that's one of your questions answered |
|
#3
| ||||
| ||||
| I'm no macro expert but if you think about this it's not far off a G74 peck cycle on a lathe but instead of back-off at the peck depth it dwells instead. There is a drill peck cycle macro in the Fanuc 16/18/21 series operator's manual (and probably other series manuals too) but using a totally different method. Anyway, based on your method something like this should work.... Z end point = -10.00" (#26) Peck Q = 0.200" (#17). must be positive value Dwell D = 1 second (#7) Feed F = 0.014" (#9) Back-off in X at end of pass as incremental U value. sign important! U is positive for OD turning and minus for ID boring (#21) #5042 = Z axis current pos (#5041 = X axis current pos) G65 P9010 Z-10.0 Q0.200 D1.0 U0.04 F0.014 % O9010 #1 = #5042 (remember start Z position) WHILE [#5042 LT #26] DO (or maybe GT because #26 is a negative Z and current pos is also negative, but less negative if face = Z0) IF [[#5042 - #26] LT #17] THEN #17 = #5042 - #26 (prevent over-run) G1 W-#17 F#9 (peck W-0.200 at feed 0.014") G4 U#7 (dwell 1 second) END N1 G1 U#21 (at end of pass move away incrementally) G0 Z#1 (rapid back to initial start point) % The 'prevent over-run' line basically checks current position (which will be a minus Z value) and subtracts the end position (also a negative Z value). If that amount is less than the peck amount then the peck amount becomes the remainder between current position and end position. For example if current pos = Z-9.9 then peck W = -9.9 minus -10.0 = 0.100" At least in theory anyway ![]() To use this as a custom G-code set parameter 6050 to the number of your custom G-code. 6050 corresponds to program 9010. 6051 to 9011. 6052 to 9012 etc. You may need to fine tune this on the machine in case some of the logic is wrong, especially the 'prevent over-run' part Last edited by fordav11; 10-29-2011 at 08:13 AM. |
|
#4
| |||
| |||
Something like the following in Blue would fix this. This example is based on end of workpiece being Z Zero. % O9010 #1 = #5042 (remember start Z position) WHILE [#5042 GT #26] DO1 #2=ABS[#26-#5042] IF[#2LT#17]TH#17=#2 G1 W-#17 F#9 (peck W-0.200 or W-#2 value at feed 0.014") G4 U#7 (dwell 0.1 second) END1 G1 U#21 (at end of pass move away incrementally) G0 Z#1 (rapid back to initial start point) % Regards, Bill |
|
#5
| |||
| |||
O9010 (DRILL MACRO) #100=#7(SET VARIABLE #100 EQUAL TO D – PECK AMOUNT) #101=ABS [#26] (SET VARIABLE #101 EQUAL TO Z - HOLE DEPTH) #102=#6 (SET VARIABLE #102 EQUAL TO K – DRILL RETURN OFFSET) #103=#18 (SET VARIABLE #103 EQUAL TO R – RETRACT LOCATION) #104=#100 (TEMPORARILY SET VARIABLE #104 EQUAL TO PECK AMOUNT) #105=#9 (SET VARIABLE #105 EQUAL TO F, FEED RATE) WHILE [#104LT#101] DO1 (LOOP WHILE TEMP Z-VALUE IS LESS THAN FINISH DEPTH) G1 Z-#104 F#105 (FEED TO PECK DEPTH = VALUE OF #104) G0 Z#103 (CLEAR CHIP - RAPID TO RETRACT LOCATION) Z- [#104-#102] (RAPID RETURN TO LAST LOCATION LESS K VALUE) #104=#104+#100 (SET TEMP Z EQUAL TO TEMP Z PLUS PECK VALUE) END1 (END LOOP) G1 Z-#101 (DRILL TO FINISH DEPTH) G0 Z#103 (RAPID OUT TO RETRACT LOCATION) M99 (RETURN TO MAIN PROGRAM) This closely resembles the subprogram call illustrated earlier, except that now the subroutine is called up with a G65 instead of an M98. Calling subprograms with a G65 allows you to "pass" variables to the subprogram. Variables make it easy to alter a program as cutting conditions require by simply changing the value of D, R, K, etc. It also makes it easy to use these macros for other jobs, as you can simply change a few values in the G65 macro call instead of rewriting the entire drilling routine. A cleaner way to use this program would be to assign it a G code, like this: O0001 (MAIN PROGRAM) N4 G97 M3 S1000 T404 G0 X4. Z1. G183 Z-1.5 D.35 R.07 F.012 K.02 G28 U0 W0 M30 This makes the macro program appear to be just like any other canned cycle in your machine. If you want to assign a G code to your macro programs, you will need to open the parameter manual for your control and find the specific parameter that maps the program number (usually a 9000-series program) to the G code. In fact, as you may have already realized, there are few differences between a macro program and a canned cycle. But while canned cycles are fixed, macro programs give you the freedom to accomplish any programming task you desire. And that usually is a big plus when conducting drilling operations on a CNC lathe. |
| Sponsored Links |
|
#6
| ||||
| ||||
| Anyway, I find it very interesting that you waited 2 days to answer this after I took the time to read up in the manual and provided a possible solution. Hmmmm interesting |
|
#7
| |||
| |||
| I hadn't noticed that you'd edited your post whilst I was typing. Regards, Bill Last edited by angelw; 10-29-2011 at 06:55 PM. |
|
#8
| ||||
| ||||
![]() I never knew (never looked) for a gcode call to a 9000 program |
|
#9
| |||
| |||
|
fordav11 had made that suggestion in Post #3, and creating a custom G code was covered for the OP MCImes in his other Thread "How do I set a Custom G code?" |
|
#10
| ||||
| ||||
|
my point is I noticed you reading the OP 2 days ago (the bottom of the page shows who is reading the page) but of course at that time there was no solution posted and you didn't post one either. I waited a couple of days in case someone who knows more about macro answered it but no one did so I posted my reply after doing some research. then 2 days later you nit-pick my reply after I supplied a possible solution without fully reading/refreshing. You could have re-read it after and it would have been courteous to correct your reply acknowledging my solution and/or removing your unnecessary post entirely. The main problem was the OP cross-posted causing duplicate info/posts. On most forums cross-posting will get you banned although here it's kind of ok I think because 90% of the forums here are dead and a newcomer wouldn't know that. Anyway I don't require a reply here so please don't as this is getting off-topic and the original post was answered in full. The only thing remaining now is to wait for MCImes to come back here and say whether it worked on his machine and solved his problem.... Last edited by fordav11; 10-31-2011 at 05:08 AM. |
| Sponsored Links |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| custom macro | hillafbmike | Fanuc | 2 | 04-13-2011 09:30 PM |
| Chip Breaker for Aluminum | tpsimer | General Metalwork Discussion | 24 | 11-12-2010 10:59 AM |
| "difference between Custom Macro A and Custom Macro B" | arulthambi | Parametric Programing | 4 | 10-05-2009 03:34 PM |
| Writing a custom M code? | greeder88 | Dynapath | 1 | 06-24-2009 08:52 AM |
| Custom Macro B On A 18t. | JIMMYZ | Fanuc | 3 | 10-18-2006 10:08 PM |