You are on page 1of 7

Lesson Nine: G10 Data Setting Command

G10 Data Setting Command


Though its barely mentioned in most basic CNC courses, the G10 command is an
extremely important basic CNC feature. It allows you to input data from within CNC
programs. This data can be in the form of tool offsets, geometry offsets, fixture offsets,
and/or even parameter values. Note that while Fanuc considers this G code to be an
optional function, most machine tool builders make it part of their standard package of G
codes.
How G10 works
As stated, G10 allows you to enter data from within programs. An L word in the G10
command tells the control what kind of data. Note that the L word is a kind of code
number, and it does vary from one Fanuc model to another. It also varies among a given
model, based upon which offset option the control has. This means youll have to
confirm the L word numbering for the control/s youre working with. With the 10M,
11M, and 15M Fanuc controls equipped with tool compensation memory A, for
example, here is how the L word is specified.
L2 - fixture offsets
L10 - geometry offsets (length and radius compensation)
L11 - wear offsets (length and radius compensation)
L50 - parameter entry
Depending upon the kind of data entry, other letter addresses are used to specify the
values being entered. With geometry and wear offsets, for example, an R word specifies
the value being set. With fixture offsets, X, Y, and Z specify the values being set. With
parameters, an R word is used to specify the value.
A P word in the G10 command specifies the data number (offset number, fixture offset
number, or parameter number). P5, for example, specifies data number five.
Note that the G10 command is also influenced by the current specification of absolute
and incremental mode (G90 and G91 for most controls). If in the absolute mode, the
control will overwrite the value in the data register with the value specified in the G10
command. If in incremental mode, the control will increase or decrease the value in the
data register with the value in the G10 command.
Here are a few examples (given for a 15M Fanuc control with tool compensation memory
A) that should help you understand how G10 works.
G90 G10 L10 P1 R4.5 (Set tool geometry offset number one to 4.5)
G91 G10 L10 P32 R0.005 (Increase geometry offset number thirty-two by
0.005)
G90 G10 L2 P1 X-12.3737 Y-9.2387 Z-11.2745 (Set fixture offset number one
to values given)
Note that parameter setting is a little different. The L50 specification sets a parameter
entry mode that must be canceled by a G11. Here is an example of setting parameter
number 5141 (final depth of cut for G76 threading cycle) to 0.0002 inch.

Lesson Nine: G10 Data Setting Command


.
.
G10 L50
N5141 R0020
G11
.
.
The N word specifies the parameter number and the R word specifies the value. Note
that if you have more parameters to set, you simply do so before the G11 command.
Also note that some parameters are related to axes and have one value per axis. For these
parameters, a P word in each value setting command specifies the axis number.
Entering tool length and cutter radius compensation values for machining centers
Many CNC users assemble and measure cutting tools while the machine is in production.
In essence, theyre getting ready for the next setup while the machine is still producing.
Most companies that do this have someone in the tool crib (commonly the tool setter)
assembling and measuring tools. That is, it is not commonly the responsibility of the
CNC operator or setup person in these companies to assemble and measure cutting tools.
While this can dramatically reduce the amount of time the machine is down between
production runs, many tool setters simply write down tool length and cutter radius
compensation values and the setup person is expected to enter these values into the
control during setup.
One great application for G10 will minimize (almost eliminate) the amount of time it
takes to enter offsets into the CNC control. It will also eliminate the setup persons
potential for making mistakes while doing so. After measuring each tool (length and/or
radius), the tool setter can enter its value in a G10 command. A special template program
will really help. It can be called up on a CNC text editor right at the tool setters work
station. Heres an example of the template program:
O5000 (Tool offset setting program)
G90 G10 L10 P1 R20.0 (Set offset number one)
G90 G10 L10 P2 R20.0 (Set offset)
G90 G10 L10 P3 R20.0 (Set offset)
G90 G10 L10 P4 R20.0 (Set offset)
G90 G10 L10 P5 R20.0 (Set offset)
G90 G10 L10 P6 R20.0 (Set offset)
G90 G10 L10 P7 R20.0 (Set offset)
G90 G10 L10 P8 R20.0 (Set offset)
G90 G10 L10 P9 R20.0 (Set offset)
G90 G10 L10 P10 R20.0 (Set offset)
G90 G10 L10 P11 R20.0 (Set offset)
G90 G10 L10 P12 R20.0 (Set offset)
G90 G10 L10 P13 R20.0 (Set offset)
G90 G10 L10 P14 R20.0 (Set offset)
G90 G10 L10 P15 R20.0 (Set offset)
G90 G10 L10 P16 R20.0 (Set offset)

Lesson Nine: G10 Data Setting Command


G90 G10 L10 P17 R20.0 (Set offset)
G90 G10 L10 P18 R20.0 (Set offset)
G90 G10 L10 P19 R20.0 (Set offset)
G90 G10 L10 P20 R20.0 (Set offset)
M30
This template program assumes you have a machine will twenty tool capacity and youre
using the tools length as the offset value. When the tool setter measures a tool, they will
modify the corresponding R20.0 value, entering the actual value theyve just measured.
When theyre finished, this program will be saved in the companys distributive
numerical control (DNC) system. The setup person will call up this program and run it
once in order to have all the tool length and cutter radius compensation offset values
entered.
Note the very large (20 inch) default value that is in each command. If for some reason,
the tool setter cannot assemble a given tool, they will leave the value twenty inches. The
setup person, seeing a twenty inch value in an offset will know that this tool must be
measured at the machine. But if they forget to do so and run the program with the 20
inch value in the offset, and since twenty inches is larger than the longest tool, the worst
that will happen is that the machine may over-travel in the Z axis.
Again, this minimizes downtime between production runs and eliminates the potential for
setup person entry errors. But the tool setter could still make a mistake entering the tool
offset value in the text editor. For this reason, the setup person must still be cautious with
each tools first approach to the workpiece.
Note that some tool length and cutter radius measuring devices have the ability to output
their current setting (the tool length or radius) through a communications (serial) port. If
interfaced with a computer and with a special computer program, the offset values can be
automatically placed in G10 commands. This further automates the process, eliminating
the potential for tool setting person entry errors. Most tool measuring device
manufacturers offer the interface cable and special software needed for doing this.
Retaining fixture offset values for qualified setups
If a machining center setup is truly qualified, the position of the program zero point will
remain exactly the same from one time the setup is made to the next. This means the
same program zero assignment values that worked the last time the setup was made will
work the next time it is made. Yet many setup people (wastefully) measure program zero
assignment values every time they make even a repeated qualified setup. One obvious
way to eliminate the repeated measurements is to document the fixture offset values for a
qualified setup right on the setup sheet. But as with tool length and radius offsets, this
still opens the door to setup person entry errors - and of course - it takes time.
The G10 command can be used to automatically enter program zero assignment values.
If, for example, the program zero assignment values for a repeated qualified setup are 10.2322 in X, -12.2388 in Y and -9.2833 in Z, and if fixture offset number one (G54) is
being used, the G10 command will be
G90 G10 L2 P1 X-10.2322 Y-12.2388 Z-9.2833

Lesson Nine: G10 Data Setting Command


Note that many setup people will not wanting this command executed every time the
program is run. If any fine tuning of fixture offsets is necessary (though they
shouldnt be if the setup is truly qualified), this command will overwrite whatever
minor modifications they make. A better way to include this command in the program
yet ensure that it is only executed once (during setup) is to include it in a special series
of commands after the end of program command (usually M30 or M02). Here is an
example.
O0002 (Program number)
.
.
.
(Normal cutting operations)
.
.
.
N505 M30 (End of program)
N999 G90 G10 L2 P1 X-10.2322 Y-12.2388 Z-9.2833 (Set fixture offset)
N1000 M30 (Second end of program command)
If the setup person wants to enter the fixture offset, theyll scan to N999 and execute
from there. The control will execute the G10 command and in line N1000, return to the
beginning of the program. It will never see line N999 again, unless the setup person
manually scans to it.
Note that Fanuc controls have a special parameter that controls when the control will stop
reading CNC programs from your distributive numerical control (DNC) system. If the
parameter is set to stop the read as soon as the control reads an M30, M99, or M02, the
N999 sequence will not be loaded into the program. If you intend to use this technique,
you must confirm that the control will not stop reading the program until an end of file
character (the percent sign for most controls) is read.
You may be questioning the ability to make truly qualified setups. You may also be
wondering what happens to the programmed G10 command fixture offset values if you
have a crash and the machine is slightly out of position. Well discuss this application
(qualifying setups) further during our discussion of fixture offsets (see G54 through
G59).
Running out of fixture offsets?
Though Fanuc offers an option (of forty-eight) for fixture offsets, most Fanuc controls
come with but six fixture offsets. If you constantly find yourself wishing you had more,
you should buy the option. But for occasional problems we offer a technique that should
help you keep from running out of fixture offsets. In essence, youll be creating a
separate subprogram for each coordinate system (fixture offset) you wish to set. In this
subprogram youll be using a G10 command to overwrite the registers for fixture offset
number one. Then youll include a G54 to invoke the values just set. (Only one fixture
offset will be required for this technique!) From your main (cutting) program, youll use
an M98 to command that the appropriate subprogram be executed. Heres an example

Lesson Nine: G10 Data Setting Command


that should help you understand. Though were using but two subprograms, you can
have as many as youd like.
Coordinate system setting subprograms:
O6001 (Set coordinate system number one)
G90 G10 L2 P1 X-12.1277 Y-11.8227 Z9.2138 (Set fixture offset number one
as needed)
G54 (Invoke fixture offset number one)
M99 (End of subprogram)
O6002 (Set coordinate system number two)
G90 G10 L2 P1 X-9.1288 Y-12.2846 Z8.9947 (Set fixture offset number two as
needed)
G54 (Invoke fixture offset number one)
M99 (End of subprogram)
Note that when the setup person enters coordinate system values, they must do so in these
subprograms. This eliminates one important advantage of fixture offsets (separating
program zero assignment from programs) and is the reasons why its better to purchase
the option for additional fixture offsets if you need them on a regular basis.
Here is the main program (first tool only) that machines two identical workpieces
O0001 (Main program)
N005 T01 M06 (Place center drill in spindle)
N010 M98 P6001 (Invoke coordinate system number one)
N015 G90 S1200 M03 T02 (Select absolute mode, start spindle, get tool two
ready)
N020 G00 X1.0 Y1.0 (Move to first XY position relative to coordinate system
number one)
N025 G43 H01 Z0.1 (Instate tool length compensation, move to just above
work surface)
N030 G81 X1.0 Y1.0 R0.1 Z-0.2 F5.0 (Center drill first hole)
N035 X2.0 (Second hole)
N040 X3.0 (Third hole)
N045 G80 (Cancel cycle)
N050 M98 P6002 (Invoke coordinate system number two)
N055 G81 X1.0 Y1.0 R0.1 Z-0.2 F5.0 (Center drill first hole)
N060 X2.0 (Second hole)
N065 X3.0 (Third hole)
N070 G80 (Cancel cycle)
N075 G91 G28 Z0 M19 (Move to tool change position, orient spindle)
N080 M01 (Optional stop)
.
.
.

Lesson Nine: G10 Data Setting Command


Entering tool nose radius compensation values (turning centers)
Many turning center programmers use tool nose radius compensation (G41 & G42) on a
regular basis. If youre one of them, and if you use a computer aided manufacturing
(CAM) system to help you prepare programs, remember that you can have your CAM
system generate the motions for single point turning tools and boring bars based upon the
tool nose radius you intend to use, assuming your setup people and operators continue
using this size tool nose radius throughout the production run (as most do). If you do,
you will have no need for CNC control based tool nose radius compensation.
If you do use G41 and G42 in your turning center programs on a regular basis, your setup
people must, of course, enter the tool nose radius and the tool type in the appropriate
offset registers. And if your setup people and operators will always be using the size of
tool nose radius specified, you can eliminate the need to enter these offset values by using
the G10 command. Consider these commands for a Fanuc control.
.
.
N003 G10 P2 R0.0316 T3
N004 G10 P6 R0.0152 T2
.
.
These commands tell the control that tool number two is a 1/32 radius turning tool and
tool number six is a 1/64 radius boring bar. Having these commands in the program
eliminates the possibility of a setup person forgetting to enter them manually.
What about reading offset values from within your programs?
Unfortunately G10 is a one-way street with Fanuc controls. You can only write to your
offset table from within CNC programs with G10. However, there is a way, if you have
custom macro, to read offset values from within your program. Combined with the other
features of parametric programming (variables, arithmetic, logic, and the ability to
generate alarms), this has tremendous implications. Since incorrect offset setting is the
most common cause of crashes and scrapped workpieces, you can make your machines
much safer to run if you fully understand parametric programming. Its such an
important topic, we devote an entire module of this course to parametric programming.
Setting parameters from within CNC programs
Weve already mentioned the importance of parameters. You now know that they control
many CNC machine functions. As you know, many parameters are related to how your
programs function. And with G10, you can even modify certain parameters (especially
those related to CNC programs) right from within your CNC program.
Consider, for example, the G76 threading cycle on turning centers. With most controls
(except the 0 and 3 series), you have no way to control, from within a program, three
important variables: the minimum depth of cut, the final depth of cut, and the number of
spring passes (note that the 0 and three series controls do allow these important values to
be modified in the G76 commands). Yet these values can be modified through parameter
settings.
You might, for example, have two dramatically different threads on the same workpiece
that require different settings for these important thread-related variables. Prior to

Lesson Nine: G10 Data Setting Command


machining the first thread, you can give the G10 commands that set the parameters in the
manner you wish them set for the first thread. After machining the first thread with G76,
give the G10 commands that set the values for the second thread. Then you can give the
G76 command for the second thread. Heres an example for a 15T control (remember,
parameter numbers vary from one control model to another).
.
.
.
G10 L50
N6218 R0030
N6219 R0002
N6220 R3
G11
N045 G00 X3.2 Z0.2
N050 G76 X2.92 Z-0.75 K0.040 D0100 F0.0625 (Machine first thread)
G10 L50
N6218 R0070
N6219 R0004
N6220 R2
G11
N055 G00 X5.2
N060 Z-2.8
N065 G76 X4.8 Z-0.75 K0.1 D0250 F0.1875 (Machine second thread)
.
.
.
As you can see, these are two substantially different threads. The first is a 1/16 pitch,
0.04 deep thread. The second is a 3/16 pitch, 0.1 deep thread. The minimum depth of cut
(parameter 6218) is set to 0.003 for the first thread but 0.007 for the second. The final
pass depth (parameter 6219) is set to 0.0002 for the first thread and 0.0004 for the
second. And the number of spring passes (parameter 6220) is three for the first thread
and two for the second.
Though the need to set parameters from within CNC programs is rare (well be pointing
out a few more), it is quite important that you know its possible.

You might also like