What's new
What's new

Fanuc Turning - Shifting G54 Z after parting

nkburdick

Plastic
Joined
Jun 4, 2020
Hello All,

I'm new to CAM and could use a little help to do this op the right way. Here's what I'm trying to do.

We're making 6 parts out of a single bar on our Fanuc i-series turning center. We set our initial G54 per normal. Then I'd like the program to run to completion and right at the end shift the G54 Z-0.962 incrementally from where it does that parting operation.

Then we can cycle start again after we clear the part and it will run the second part with that new G54 face location. We're not making a ton of these, so I'm happy to have the operator just re-run the program manually. I don't want to run a sub-program with multiple parts for this one.

I tried to add the following at the end of my program, but I got a bad G-code error: G91 G10 L2 P1 X0 Z-0.962

Any tips would be greatly appreciated!

Thanks,
Nick
 
There are 3 ways that I know how to that.

1. Use G54, G55, G56, G57, G58 and G59 work offsets.
2. Use one work offset G54 and program each part subtracting 0.962 in Z for each new part from previous one.
3. Use G10 for first part like G10 P0 Z2.5 (The 2.5 number is just a guess) and then shift G10 P0 at the start of each new part .962" each time.
 
There are 3 ways that I know how to that.

1. Use G54, G55, G56, G57, G58 and G59 work offsets.
2. Use one work offset G54 and program each part subtracting 0.962 in Z for each new part from previous one.
3. Use G10 for first part like G10 P0 Z2.5 (The 2.5 number is just a guess) and then shift G10 P0 at the start of each new part .962" each time.

@fancuku. #2 is the one that I'm looking for. Any thoughts on a G-code line that would programmatically accomplish that shift?
 
I tried to add the following at the end of my program, but I got a bad G-code error: G91 G10 L2 P1 X0 Z-0.962

Any tips would be greatly appreciated!

Thanks,
Nick

Hello Nick,
Unless your control is set to use G Code System B or C, I suspect that the G Code error is being raised by G91. G Code System A is the Fanuc default, where U and W are used as the Incremental counterparts of X and Z respectively. If your control does use G90 and g91 for Absolute and Incremental respectively, then your control may not be equipped with G10. It is an Option feature, but most MTBs supply it and therefore, most think its a Standard Feature.

With Fancuku's number 3 option, you would have to apply the 0.962 value Incrementally to your start value, Z2.5 in Fancuku's example, which would be specified as an Absolute value.

If you're using any of the Work Coordinate System G Codes, G54 to G56, setting the Workshift with G10 P0 can still be used by specifying an initial value of Z0.0 (Absolute), then shifting it Incrementally by the use of G91 Z-0.962 or W-0.962, depending on the G Code System your control is set to use.

Regards,

Bill
 
Any thoughts on a G-code line that would programmatically accomplish that shift?

Like a one line of code? No, I do not know.

Personally I would use G54 to G59 work offsets because I have been burned by G10 once and I will never use it again. I also would not trust an operator running a job like this with different work offsets or shifts. Lets say an insert needs to be flipped on the third part. You have to stop the program, change the insert and restart where you left off. An operator would not know how to restart where you left off. It's a disaster waiting to happen.
A job like that I would run it myself.
 
On two of my controls,(the dreaded)Anilam 1200T and Fagor 8055T, the first line of the program is G92 Z5.0. The last Z move in the program is G0 Z 4.156.

I haven't tried it on the Fanuc machines because none of them are large enough for this part. My Fanucs are system B. Maybe the same programming would work????
 
G92 in Fanuc type B is maximum spindle speed.
Hello Fancuku,
Only partially true.

G92 in Fanuc G Code System B and C has the same purpose as G50 in System A, that is, when used in conjunction with axes addresses, sets the Work Coordinate System and when used with an S address, clamps the Maximum Spindle revs. Accordingly, alphonso's suggestion would work on his Fanuc Controlled machines. However, any use of G50 or G92 is fraught with danger, particularly when a machine operator doesn't fully understand its use. Wherever the axes slides are parked when a G50/G92 is executed, that is where the control thinks it's at according to the coordinates specified with the G50/G92. The objection to using G50/G92 to set the Workpiece Coordinate System is for the same objection you had in your Post #5 for using G10 to manipulate the Workshift.

Regards,

Bill
 
Hello Fancuku,
Only partially true.

However, any use of G50 or G92 is fraught with danger, particularly when a machine operator doesn't fully understand its use


Can't say i fully understand what I'm doing, but I have been making these particular parts for at least 10 years using these programs on these two machines. Just keep moving over until you run out of stock(24"OD x1" wall tube).
 
Like a one line of code? No, I do not know.

Personally I would use G54 to G59 work offsets because I have been burned by G10 once and I will never use it again. I also would not trust an operator running a job like this with different work offsets or shifts. Lets say an insert needs to be flipped on the third part. You have to stop the program, change the insert and restart where you left off. An operator would not know how to restart where you left off. It's a disaster waiting to happen.
A job like that I would run it myself.

I second that. Incremental G10 is asking to rip the chuck jaws off. :eek:

I would set it up like this:

O11111
G90
G10 L2 P1 Z-10.
G10 L2 P2 Z-11.
G10 L2 P3 Z-12.
G10 L2 P4 Z-13.
G10 L2 P5 Z-14.

And then your canned cycles inside subs called up one after another, e.g.:

G54
M97 P1
M97 P2
M97 P3

G55
M97 P1
M97 P2
M97 P3

And so on.

:cheers:
 
Can't say i fully understand what I'm doing, but I have been making these particular parts for at least 10 years using these programs on these two machines. Just keep moving over until you run out of stock(24"OD x1" wall tube).
Hello alphonso,
When everything is going well (as designed) and the program is written in such a way that the G50/G92 is executed with the axes slides in the same, program design, position every time, then there won't be an issue. However, lets say that the program is designed to have the G50/G92 execute when the X and Z axes are at diameter 300.0 (mm) in X and 250.0 from the workpiece in Z, then the G50/G92 Block would be as follows:

G92 X300.0 Y250.0

then, for whatever reason the program is interrupted mid cycle, broken insert etc, and the tool is moved clear of the workpiece to change the insert, but, in the heat of the moment, the axes aren't returned to the location where the theG50/G92 should be executed when the program program is restarted. If the Z axes had the tool only 100mm away from the workpiece, then the Work Coordinate System will be set such that the control will consider the tool is at Z250.0, when in fact its only at Z100.0. There's your crash waiting to happen right there.

When using Workshift Coordinate Offsets G54 - G59, the program can be started form any location and the Control will know where the tool actually is.

It happened to a new machine I purchased in 1979 (Fanuc 6T control that could only use G50 to set the Workpiece Coordinate System), installed and operated by a very experienced Mazak applications engineer, on the first day of operation. A small diameter part, so high revs and turret straight into the chuck. $14K damage in 1979, when $14K was worth something.

Regards,

Bill
 
I understand what you are saying about machine getting lost, but the Fagor has a tool inspection routine that is similar to the GE 1050 that I started on (I really miss that routine. You could move the tool any way you wanted and it would follow the same path back to the work.) If possible I will single block until tool is at position for the next feed pass then press feedhold, press tool inspect,move away from work(if needed), inspect tool(change insert), punch start and tool moves back into the work. The Anilam works the same way except that I can't make a secondary move. I will stop the spindle before changing the insert on either machine.

Since only two of us ever run these parts, I'm not too worried about getting any more lost than usual.
 
I understand what you are saying about machine getting lost, but the Fagor has a tool inspection routine that is similar to the GE 1050 that I started on (I really miss that routine. You could move the tool any way you wanted and it would follow the same path back to the work.) If possible I will single block until tool is at position for the next feed pass then press feedhold, press tool inspect,move away from work(if needed), inspect tool(change insert), punch start and tool moves back into the work. The Anilam works the same way except that I can't make a secondary move. I will stop the spindle before changing the insert on either machine.

Since only two of us ever run these parts, I'm not too worried about getting any more lost than usual.
Hello alphonso,
You're talking specific machines with specific features. Generalizing, its a widespread opinion that you have to be particularly careful when using G92/G50 to set the Workpiece Coordinate System, particularly when not using the Reference Return position as the location for executing the G92/G50 command. What Fancuku and ChipSplitter are alluding to with their trepidation in the use of Incremental Shift of the Workpiece Coordinate System with G10 is much the same; there may come a time when there is a discrepancy between where the Control and the Operator think the tool position really is.

We try, but its hard to absolutely fool proof a program, as you sometimes deal with some very talented fools. In ChipSplitter's suggested solution, for example, if the parts being made are not all that long and therefore, so no big visual clue as to which number part is being made, the operator has to choose which Workshift G Code (G54 - G56) to start from in the event of a forced Restart.

If Reset is pressed in Auto Mode, the cursor will stay in the general area of operation withing the program and therefore the operator would have a clue as to which Workshift to restart from, but if Reset is pressed in Edit Mode and no note is made as to the number part being made, then its up to the operator to make the call, or start from the beginning and cut fresh air for awhile.


Regards,

Bill
 
I am running a Doosan 700LM lathe.
I know this is an old post, but after trying some things, it works straight and easy for me as follows:

G10 L2 P1 W-1.

P1 for shifting G54 (P2 would be for G55 and so on)
W-1 is shifting G54 incrementally by -1".

Having that line written at the end of the program, just before M30, will physically change the number of G54 after each part that was ran.
So, if the machine is turned off after half of the tube is done, and continued next morning, it will still start at the right place. The operator has just to stop pressing start and making parts when he sees the stock is used up. Of course that is not for high volume, but works for applications as mentioned in the original question of this post. On our part, since the operator has to catch each ring anyways when it is parted off, the program does not need to run in a loop. If it would be ran in a loop, lets say repeating 10 times for a 10" long stock, and the operator would start it in the morning when half of the stock is used up already, then of course things would turn out bad. But as long as the operator checks the remaining stock each time he presses start, this should be totally safe.

Just thought maybe somebody will look this up again and this might help.
 
I do it the hard way. Haven't tried setting G54-G59 on our newer lathes, but it didn't work for me on the older lathes. Since part programs get moved from machine to machine, I continue to do it the same way I always have as it also works fine on the newer lathes. Usually make 5 parts per pull or stop.

Work shift is set in the EXT. G54=0
Say cut off is Z-.189 so G55=Z-.194 G56=Z-.388 G57=Z-.582 G58=Z-.776
This leaves .005 for finish facing each subsequent part.


Set-up person inputs the values. G54 drills, rough turns, rough bores (as necessary) all parts. Then a subprogram does the finish work.

G54 (BARPULL OR BARSTOP)
DO ROUGHING ON ALL PARTS

N1G54M98P1111 (1ST PART)
M1

N2G55M98P1111 (2ND PART)
M1

ETC.

Most of our lathes use G10. I know the constant on most lathes so I program the initial work shift on those. Otherwise I use a variable to set the work shift, and the set-up person supplies the necessary value for the initial work shift. EX: G10P0Z-#530

N100G10P0Z-7.54 (BARSTOP)
I use a G65 call for the barstop subprogram.
Rough machine as above.

N1M98P1111 ( 1ST PART)
G10P0W.194
M1

N2M98P1111(2ND PART)
G10P0W.194
M1

ETC.

N5M98P1111 (5TH PART)
M1
/M99
M30

If it's a Hardinge, it doesn't need the /M99 to repeat.
 
Another way for such applications can be to use a local coordinate system for each part.

Example: Assume that the length of the part, including the part-off width, is 50 mm, and the length of the workpiece, sticking out of the chuck, is sufficiently more than 200 mm, so that four pieces could be machined out of it. The available machining program is suitable for machining just one piece, the front face of which is at Z = 0. Therefore, for machining second, third and fourth pieces, the origin of Z would need to be suitably shifted to the left, so as to have Z = 0 at the front face of every new piece. The required shift to the left would be 0 mm, 50 mm, 100 mm and 150 mm, for first, second, third and fourth pieces, respectively (The first piece requires no shift). A negative sign with the shift values would be needed because the positive direction of the Z axis is towards right.

#1 = 1; (Initializing macro variable #1 which is the part counter)
#2 = 4; (Variable #2 is the total number of parts)
#3 = 50; (Variable #3 is the length of part, including part-off length)
WHILE [#1 LE #2] DO 1; (Loop to be executed #2 times, i.e., once for each part)
G52 Z−[[#1 – 1] * #3]; (Local coordinate system defined, with Z = 0 at front face)

<Machining program, including parting operation>

#1 = #1 + 1; (Part counter incremented by 1)
END 1; (End of the loop. The execution exits the loop after all parts are machined)
G52 Z0; (Local offset cancelled, which reinstates the original WCS)

If this program is required to be used for a different number of parts and/or a different part length, then variables #2 and #3 would need to be accordingly assigned the new values, in the second and the third blocks, respectively. For example, if five parts, each of the total length of 40 mm, are to be machined, then these blocks would change to

#2 = 5;
#3 = 40;

Rest of the blocks would remain unchanged. This is the beauty of macro programming which allows one to write a general program, requiring very few changes for a different requirement.
 
I'm a G10 guy all day long on the lathes!

But just the other day I was running a (large)short run job between centers, and I needed to touch off of the blank in stead of measuring out from the chuck, and so I just G50'd the machine.

Came back after a power cycle, and my zero was lost! :eek:
With G10 I never lose my zero point!


---------------------

Think Snow Eh!
Ox
 
G50 or G92 (milling machine) settings remain valid for the current machining session only. These are lost after a power cycle,
G10 is better. The method of system variables is still better.
 








 
Back
Top