top of page
Writer's pictureMike Lynch

How is G50 used to assign program zero on turning centers?

I am a CNC operator who recently took a job teaching entry level CNC. Some of the machines here at the training center are pretty old - and use G50 to assign program zero (not geometry offsets). I am used to a G50 designating a max. spindle speed. When it comes to assigning program zero, I understand the setting of a reference point but am having trouble understanding the hows and whys of accumulating offsets. If you assign program zero with G50, should the geometric offsets be set at zero? Is that where the machine is getting these offsets that it accumulates? I'd be grateful if you can either explain this or point me in the right direction so I can do some research. Thank you. M. Piecek


Response:

Mr. Piecek,


Frankly speaking, geometry offsets were designed to replace G50 for assigning program zero on turning centers (though they have nothing to do with spindle limiting). The only reason people use the G50 command today is that they have older machines that don't have geometry offsets (like you) or they don't understand geometry offsets.


With G50, you include the distances from program zero to the tool tip at the time the G50 is executed. If, for example, you plan on starting the program from the zero return position, the G50 values will be equal to the geometry offset values (but positive).


One major problem with G50 is that the machine must absolutely-positively be at the planned position when the program is executed. If it is not, the control will "believe" the G50 values and move accordingly - this is a major source of machine crashes - the operator activates the cycle with the turret out of position. Note that this can't happen with geometry offsets. The control will automatically take the machine's current position (relative to the zero return position) into consideration when making axis movements.


When using G50, each tool requires its own G50 command, meaning at the end of each tool, you must keep track of G50 values. The easiest way to do this is to send each tool back to the zero return position for tool changing - which wastes time.


Another little problem. G50 is not compatible with geometry offsets. If you give a G50 command, subsequent geometry offsets will not be correct. (If you give the command G50 X0 Z0 while the machine is at its zero return position, you return geometry offsets to normal.) When using G50 to assign program zero, all geometry offsets must be set to zero.


One more point about offset accumulation. When you use G50 to assign program zero, the wear offset is instated with the second two digits of the T word. When you're done with each tool, you must remember to cancel the wear offset to keep it from corrupting the subsequent G50 command. Some people refer to this as accumulating offsets. (You don't have to cancel wear offsets when using geometry offsets.) To cancel when using G50, you can include two trailing zeros after the tool station number (T0300 cancels wear offset number three) or simply commanding T0 (cancels any tool's wear offset).


Here is an example program that uses G50 to assign program zero.

  • O0002 (Program number)

  • (Rough facing tool)

  • N005 G20 G23 G40 (Ensure that initialize modes are still in effect)

  • N010 G28 U0 W0 (Send machine to zero return position)

  • N015 G50 X______ Z______ S5000 (Assign program zero, limit spindle speed to machine’s maximum)

  • N020 T0100 M41 (Index turret, select spindle range)

  • N025 G96 S400 M03 (Start spindle in forward direction at 400 sfm)

  • N030 G00 X2.2 Z0.005 T0101 M08 (1) (Rapid to position, instate offset, start coolant)

  • N035 G99 G01 X-0.062 F0.012 (2) (Select per revolution feedrate mode, face workpiece at 0.012 ipr)

  • N040 G00 Z0.1 (3) (Rapid away)

  • N045 G28 U0 W0 T0 (Rapid to zero return position, cancel offset)

  • N050 M01 (Optional stop)

  • (7/8 drill)

  • N055 G50 X______ Z______ (Assign program zero)

  • N060 T0200 M41 (Index turret, select spindle range)

  • N065 G97 S354 M03 (Start spindle forward at 354 rpm)

  • N070 G00 X0 Z0.1 T0202 M08 (4) (Rapid into position, instate offset, start coolant)

  • N075 G01 Z-2.2 F0.008 (5) (Drill hole at 0.008 ipr)

  • N080 G00 Z0.1 (4) (Rapid out of hole)

  • N085 G28 U0 W0 T0 (Rapid to zero return position, cancel offset)

  • N090 M01 (Optional stop)

  • (3/4 rough boring bar)

  • N095 G50 X______ Z______ (Assign program zero)

  • N100 T0300 M42 (Index turret, select spindle range)

  • N105 G96 S350 M03 (Start spindle forward at 350 sfm)

  • N110 G00 X1.19 Z0.1 T0303 M08 (6) (Rapid into position, instate offset, start coolant)

  • N115 G01 Z-1.37 F0.007 (7) (Begin boring operation at 0.007 ipr)

  • N120 X0.875 (8) N125 G00 Z0.1 (9) (Rapid out of hole)

  • N130 G28 U0 W0 T0 (Rapid to zero return position, cancel offset)

  • N135 M01 (Optional stop)

  • (3/4 finish boring bar)

  • N140 G50 X______ Z______ (Assign program zero)

  • N145 T0400 M42 (Index turret, select spindle range)

  • N150 G96 S400 M03 (Start spindle forward at 400 sfm)

  • N155 G00 X1.375 Z0.1 T0404 M08 (10) (Rapid into position, instate offset, start coolant)

  • N160 G01 Z0 F0.005 (11) (Begin finish boring at 0.005 ipr)

  • N165 G02 X1.25 Z-0.0625 R0.0625 (12)

  • N170 G01 Z-1.375 (13)

  • N175 X1.1 (14)

  • N180 X1.0 Z-1.425 (15 )

  • N185 Z-2.0 (16)

  • N190 G00 X0.8 (17)

  • N195 Z0.1 (18) (Rapid out of hole)

  • N200 G28 U0 W0 T0 (Rapid to zero return position, cancel offset)

  • N205 M01 (Optional stop)

  • (Finish face and turn tool)

  • N210 G50 X______ Z______ (Assign program zero)

  • N215 T0500 M42 (Index turret, select spindle range)

  • N220 G96 S450 M03 (Start spindle forward at 450 sfm)

  • N225 G00 X2.075 Z0 T0505 M08 (19) (Rapid into position, instate offset, start coolant)

  • N230 G01 X1.05 F0.006 (20) (Start finish facing and turning at 0.006 ipr)

  • N235 G00 Z0.1 (21)

  • N240 X1.75 (22)

  • N245 G01 Z0 (23)

  • N250 G03 X1.875 Z-0.0625 R0.0625 (24)

  • N255 G01 Z-1.0 (25)

  • N260 X2.2 (26)

  • N265 G28 U0 W0 T0 (Rapid to zero return position, cancel offset)

  • N270 M30 (End of program)

Let me reiterate the points made earlier for this example program. Since we're not using geometry offsets, they must all be set to zero. In line N010, we're ensuring that the machine is at the zero return position (minimizes potential for operator error). In line N015, we give the G50 command for the first tool. These values are exactly the same as their geometry offset counterparts, but they're positive instead of negative. Note that you cannot use the work shift feature when G50 is used to assign program zero.


To ensure that the turret won't jump by the amount of wear offset, in line N020 we index the turret without invoking an offset. The wear offset is instated in line N030 during the tool's first movement command.


When the tool is finished (line N045) we send the turret back to the zero return position with G28. Though it's not mandatory in this case (at the completion of G28 the turret will be at the zero return position), we're also canceling the wear offset in line N045.


In line N055, the whole process begins again and is repeated for each tool.

4,837 views0 comments

Recent Posts

See All

How does G66 work?

G66 is one of the more misunderstood custom macro B commands. Fanuc calls it a modal custom macro call. It looks just like a G65 command....

What are directional vectors?

Current model CNC controls make it easy to create circular commands. You simply specify the direction (G02: clockwise or G03: counter...

Comments


bottom of page