I need to run program with 2 different parts on 1 fixture . The program have 6 tools and is to long to fit in my machine . I know that i can program only one part and use g55 to make the other part, but that means all 6 tools need to be finished and that go in the program and replace g54 with g55. Is there any way to make the program after tool no.1 is finished on g54 position to continue to g55 ? But not to double the size of the program ?
Yes put each tool move into a subroutine. This will only add approximately 12 lines of code to the main program and a couple lines of code to your tool movements in each subroutine. Mainly the program number on one line and M99 at the end of each.
Start each tool in the main program, bring it to first position and clearance height, then switch to your subroutine with M98. Be sure to include the clearance height as your last line in the sub and your initial position as the first. If you like you can also bring your tool to the first cutting depth while still in the main program, (as in tool 2 example) just be sure to have it included in what would be the 2nd line of your sub after initial position. You'll want all that info there after jumping over to G55.
If you have a bunch of holes to spot, drill and tap just put all your positions in the sub and start all the drill cycles in the main program. See below.Add K0 at the end of each cycle call so it doesn't double drill the first hole each time.
T1M6 (1/2 END MILL)
G17G20G40G49G54G80G90G98
G0X-0.35Y-3.
G43Z0.1H1S4500M3T2
M8
M98P1001 (ALL YOUR MILL MOVES/FEEDS IN HERE)
G55
M98P1001
M9
T2M6 (CHAMFER)
G17G20G40G49G54G80G90G98
G0X-0.09.Y-3.
G43Z0.1H2S6500M3T3
M8
G1Z-0.1F65.
M98P1002 (ALL YOUR CHAMFER MOVES/FEEDS IN HERE)
G55
M98P1002
M9
T3M6 (SPOT DRILL)
G17G20G40G49G54G80G90G98
G0X3.5Y-4.5
G43Z0.1H3S3500M3T4
M8
G99G81Z-0.075R0.1P75F21.K0
M98P1003 (ALL YOUR HOLE POSITIONS IN HERE)
G55
M98P1003
G80
M9
T4M6 (13/64 DRILL)
G17G20G40G49G54G80G90G98
G0X3.5Y-4.5
G43Z0.1H4S3500M3T5
M8
G98G81Z-0.625R0.F21.K0
M98P1003 (SAME SUB AS PREVIOUS)
G55
M98P1003
G80
M9
T5M6 (1/4-20 TAPPER)
G17G20G40G49G54G80G90G98
G0X3.5Y-4.5
G43Z0.15H5T1
M8
M29S1000
G99G84Z-0.7R0.15F50.K0
M98P1003 (SAME SUB AS PREVIOUS)
G55
M98P1003
G80
M9
G53Z0.Y0.M5
M30
01001 (END MILL SUB)
G0X-0.35Y-3.
G1Z-0.323F33.
-
-
G0Z0.1
M99
01002 (CHAMFER SUB)
G0X-0.09.Y-3.
G1Z-0.1
-
-
G0Z0.1
M99
O1003 (HOLE POSITION SUB)
X3.5Y-4.5
X4.5
X6.
Y-6.
X4.5
X3.5
G80 (CANCEL DRILL EITHER HERE OR IN MAIN PROGRAM DEPENDING ON OTHER NEEDS OF THESE POSITIONS)
M99
Just an example. A few minutes of finger punching. Arbitrary F & S and locations.
Im sure you are giving good explanation how to make the program, but because of my poor knowledge in programming is kinda hard to understand. Do you mind if i send you copy of the program to you, and you to make the changes on the program ? That way i will have the old and new version of the program and i will understand better about every detail, and know for future programs
Thanks
The machine is Stama Fanuc MC010 (old vesrion of robodrill), year :1987, control : Fanuc OM Mate
Check bellow sample of the program. I did cut bunch of lines to make it shorter.
PLEASE Include g55 and g56 to see the exact changes in case i need to run more than one offset
This program is an example for 3 tools on 3 fixtures that should run on a FANUC 0M
All Z-values are for a save distance, when your program runs OK you can always adjust them.
Be careful with your line N32, a rapid to Z2. level can be a little tricky, spindles are very expensive .... LOL
On our older controls I use for multiple parts a simple Macro with G52, not G55, G56 etc. but also sub-programs like this example.
All your nc-data for each tool must be saved in the sub-programs.
Maybe you can remove the lines G00 G90 X0. Y0. and G43 Z100. H01 above each G55 and G56 but it's only for safety.
You can try this program first and look if it runs, good luck.
Like Heavy Metal, I find line numbers mostly useless. You're wanting to save memory space. Line numbers eat up tons of it.
Below is your code cleaned up a little and built into a subroutine work regime. This will make 3 parts located in three different positions and controlled by the G54,G55 and G56 Work Offsets. If you want to make only one part, all you have to do is turn on block skip.
You had your spindle turning backwards on all of them. You want M3 not M4. Unless there is something different about your machine.
In 20 years I have never written a G28. It's not needed. Only if your M6 tool change macro is junk should it ever be needed. G53 is a safer and easier call to send things home. The one added at the end of your program will send the head home and table forward for reloading stock.
Hope this helps and I hope you can follow it. Basically all you do is program for one part. Then create empty subroutine files. Then I copy and paste everything from the first line of each tool right up to the last move to clearance height. Once it's in the subroutine I delete the complete G43 line and the M8 following it. Everything else is there. Then convert your main program to a subroutine layout like shown.
Depending on how your control acts, you may be able to copy all of this over as one file. The control will separate them into individual files.
Thank you very much for your help and your time. I will try these days to make the program and run it.
Heavy_Metal : the line that you mentioned N32 does not rapid in the material, its comes down next to it and starts roughing. Thank you anyway
the_gentlegiant : i did use this program on my other machine and there i need to use M4 to run clockwice instead M3. The inverter was at service and now M3 and M4 are switched
About the extra line in the program are generated from mastercam and im not very familiar with them, but now that you mention i will fix that also. Thank you very much