![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| Haas Mills Discuss Haas machinery here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
I' making parts from tube stock.Simple set up , tube is sitting vertically in 3 jaw chuck. I machine inside diameter, outside profile , top of the part and then it's being cut off with carbide saw to approx. 0.160 thick. Then manually change offset Z- .225 in G54. Run again and so on. Because set up is quite rigid, I can make 10 parts without pulling this tube up. So I was thinking Simple program like % O100 M98 P110 L10 M30 O110 {MAIN PROGRAM} LINE TO CHANGE G54 -.225 M99 % Does anybody know how to do it . Any help would be greatly appreciated. thanks Tom |
|
#2
| |||
| |||
| G10 L2 G91 P1 Z-.225 And instead of having two programs using M98 make it a subroutine using M97. You start with the Z value in G54 at 0.0. BLAH is all the stuff I am too lazy to type BLAH BLAH BLAH G10 L2 G91 P1 Z.225 <<<<<<<<<<<<<<<<<<WRONG, READ POST FURTHER DOWN G10 L2 G91 P1 Z-.225 M97 P1000 L10 G10 L2 G90 P1 Z.0 BLAH BLAH M30 N1000 All your program stuff M99 The line that says G10 L2 G91 P1 Z.225 is to move the G54 Z up .225 so that at the subroutine call immediately below with an L count it just goes back to 0.0 for the first run through the sub, then increments down 10 times calling the sub each time. The final G10 L2 G90 P1 Z.0 puts the G54 Z value back to zero before the program ends.
__________________ An open mind is a virtue...so long as all the common sense has not leaked out. Last edited by Geof; 05-10-2007 at 08:47 PM. |
|
#3
| |||
| |||
| 070510-1938 WITOMCIO: Use G52 and a loop. Before the loop initialize G52 to 0. #150 = 0. G52 Z #150 (the content of G52 is added (maybe subtracted) from the currently active G5x.) (where x = 4,....,9) Start your loop with an initialized count limit. Your progam #150 = #150 - 0.225 Test for done count End loop Stop . |
|
#5
| |||
| |||
Change the G10 L2 G91 P1 Z.225 to this: G10 L2 G90 P1 Z.225 The reason for this is that if you had a program the same as my first post and you stopped part way through the L count your G54 Z value would have been incremented down so many steps. Then, if you repositioned the workpiece and started again you would not be at Z0.0 so you would try to start working part way down the material amidst much crunching and puzzlement. Putting the absolute value of (+)Z0.225 into the G54 Z coordinate at the start of the loop means no matter what the value is when you start the program the first entry into the subroutine has the correct value of Z0.0. You may never have stopped the program part way through the loop count but it is always better to be safe than sorry.
__________________ An open mind is a virtue...so long as all the common sense has not leaked out. |
| Sponsored Links |
|
#7
| |||
| |||
|
You could, it just means entering more information at setup; G54 Z.0, G55 Z-.225, G56 z-.45, etc, and writing 10 lines with the Gnn M97 P1000 lines in the program. You could also do it with G52 by putting in the actual values insteading incrementing like gar explained. In this case the 10 lines would be G52 Z.0 M97 P1000, G52 Z-.225 M07 P1000, G52 Z-.450 M97 P1000, etc. The disadvantage to doing it this way is not much but if for some reason you want to change the Z shift value you have to remember to change all the lines whereas using the incremental command you only change the one value.
__________________ An open mind is a virtue...so long as all the common sense has not leaked out. |
|
#9
| |||
| |||
| More specific: The working program in the subroutine can be in absolute coordinates. G54 (center and top of part at the start of new stock) G52 X 0. Y 0. Z 0. (initialize G52 to zeroes) #150 = 0. (initialize Z offset accumulator) #151 = 10 (initialize count limit) N100 #151 = #151 + 1 (doing the increment here means that #151 IDs the current part) G52 Z #150 (the content of G52 is added to the currently active G5x.) (G54 is the current active G5x based on the above assertion of G54) (whether there is a sign inversion when G52 is combined with G5x you will have to verify) G65 N2000 (to call your program for one part) #150 = #150 - 0.225 (your incremental move) IF [#151 GT 9] GOTO 120 GOTO 100 M00 O2000 your part program. You can work with internal subroutines if you want. You could use WHILE also. . |
|
#11
| |||
| |||
| This is the way I would probably do it if I didn't have Macros to set up counters. Since we always leave our G54 Z at zero I would set or reset G54 to zero in line N100. Then if I have to reset and start over I have my original G54 Z0 to start at the top of the part. For short blanks you can set G54 in N100 to whatever level you need to start, and change the L word in N120 to the number of parts left to do. We make multiple parts on our lathes using Macros to count and saving the original start Z in #5222. Multiple part blanks are no fun!! Any time you mess with part Zero's you have to be very careful. Edit--- I added line N125 to reset G54 to zero after the last part off each blank % O7654 (TEST G54 Z SHIFT ) N30 (WRITTEN 05-11-2007 13:35:38) N40 (RETURNED 05-11-2007 15:01:26) N50 G17 G54 G90 N60 G40 G49 G80 N70 G53 G00 Z0. N80 G53 G00 X-20. Y0. ( SET OR RESET G54 Z TO ZERO ) N100 G10 L2 P1 Z0. ( CALL LOCAL SUB 10 TIMES ) N120 M97 P170 L10 ( RESET G54 Z TO ZERO AFTER LAST PART ) N125 G10 L2 P1 Z0. N130 G53 G00 Z0. N140 G53 G00 X-20. Y0. N160 M30 (END OF MAIN PROGRAM) N170 (START OF MACHINING SUBROUTINE) (TOOL #01 IS A TOOL ) N190 G53 G00 Z0. N200 G53 G00 X-20. Y0. N210 T1 M06 N230 G54 G00 G90 X0. Y0. N240 G43 Z0.2 H01 D01 M08 ( DO SOMETHING HERE ) N260 G53 G00 Z0. M09 N270 G53 G00 X-20. Y0. N280 M01 (TOOL #02 IS A TOOL ) N300 G53 G00 Z0. N310 G53 G00 X-20. Y0. N320 T2 M06 N330 G54 G00 G90 X0. Y0. N340 G43 Z0.5 H02 D02 M08 ( DO SOMETHING HERE ) N360 G53 G00 Z0. M09 N370 G53 G00 X-20. Y0. N380 M00 (PROGRAM STOP) ( SHIFT G54 Z -.250 ) N400 G10 L2 P1 G91 Z-0.25 N410 M99 % Last edited by JWK42; 05-12-2007 at 07:57 AM. |
|
#12
| |||
| |||
| 070511-1513 EST USA Correct Geof. I am of the opinion that everyone should activate MACROS and learn to take advantage of all the neat capabilities provided. As you know Geof, I am not talking to you but to all the other readers here. Just G65 with parameter passing probably makes MACROS worth while. However, I would like a G65 equivalent for local subroutines. Your own counters, DPRNT, and math operations are so useful. . |
![]() |
| 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 |
| Mach 3 work offset retention. | Geoff86 | Machines running Mach Software | 9 | 01-30-2010 02:03 PM |
| How to set part program offset | wayneman | Bridgeport and Hardinge Mills | 0 | 01-25-2007 12:22 PM |
| Changing tool height ofsets and re-runing program | Fudd | Fadal | 4 | 11-03-2006 08:01 AM |
| work offset in fanuc 6m b- help | rags | Fanuc | 14 | 08-03-2006 09:39 PM |
| change offset in program | jianjianca | G-Code Programing | 11 | 12-22-2005 10:48 AM |