What's new
What's new

program loop

Tatanka

Plastic
Joined
Apr 18, 2006
Location
NE Oklahoma
I need to know how to rerun the same program over with a new part offset in z each time. I've set the machine up with several inches sticking out of the chuck, and am running a single part off the end of the stock. What I want to do is run the exact program over several times with a z offset 1 part deeper into the stock until I run out of stock> How do I do this? I have a Haas sl-40 machine,
 
Hi,

Press two times the offset key and yo will see every offset position that you can use:

G54 X... Z...
G55 X... Z...

If you wat run the same program moving the z offset, change the value in "Z". Thats all

Sorry for my english.

Alain
 
%
(startup Codes)
G54
M98 P1000
G55
M98 P1000
G56
M98 P1000
G28
M30
N1000 ( Local Sub)
The
Entire
Body
Of
Your
Program
Here
M99
%
 
Part counter

Tatanka
If you have Macros active I can show you how to shift using G10 L2 P1 W-(part width+ partoff width)
I use #521 to store the value in #5222 (the original G54 Z position) and then G10 L2 P1 Z#521 at the end of the program to reset G54 Z to the original value.
This method has no limits for the number of parts per blank. We have parted off as many as 40 washers.
Be careful!! If you set the count wrong it will shift into the chuck. Ask me how I know!!

%
O1844 (HAAS MULTIPLE PART)
#501= .1 (OVER ALL LENGTH)
#502= 22 (MULTIPLE PART COUNT)
#503= .156 (PART OFF WIDTH + FACE OFF AMOUNT FOR NEXT PART )
#504= #501 + #503 (MULTIPLE PART SHIFT AMOUNT)
#521= #5222 (SAVE G54 'Z' START POSITION)

N100 ( START OF MACHINING PART)
G54 G90
(STUFF)
(MORE STUFF)


(PART OFF RESTART POINT)

G53 G00 X0.
G53 G00 Z0
T5 (PART OFF TOOL)

(PARTOFF STUFF)

#502= [ #502 - 1 ] (PART COUNTER)
IF [ #502 LT 1 ] GOTO200
G10 L2 P1 W - #504 (SHIFT G54 Z )
GOTO100 (JUMP BACK TO TOP FOR NEXT PART)
N200 G10 L2 P1 Z#521 (RESET Z TO ORIGINAL START POSITION)
G53 G00 X0.
G53 G00 Z0.
M30
%
 
Last edited:
I prefer the method that SeymourDumore has shown and use it the most.

Another method is to modify the Z Axis Offset after each part with a G10. I really don't like using this approach as if you do not reset the Z offset to the original Z numbers correctly, it can cause a big BOO BOO. I use this mostly if making real thin parts like washers where you can make 30-40 pcs and a new Offset for each would be too tedious.
 
Gar
If I use SeymourDumore's method along with G52 then would my code look like this to make 40 washers from one blank?

%
(startup Codes)
G54
M97 P1000 L40
G52 Z0
G28
M30
N1000 ( Local Sub)
The
Entire
Body
Of
Your
Program
Here
G52 Z-(SHIFT AMOUNT)
M99
%
 
Last edited:
I thought it was G10 W-.125 to modify the offset incrementally in Z.

Just remember to check that the machine resets G54 back to the original Zero when starting over.


Time to play.
 
jwk42:

Yes.

Except on HAAS lathes I do not believe any have a HAAS mode like the mills, and in Fanuc mode all G52 components are rezeroed under many conditions, including program start. You do need to be using Fanuc mode to use G52 in this fashion.

However, I think including the G52 Z0 is still a good idea although probably un-necessary.

.
 








 
Back
Top