Every
CNC programmer and most of CNC machine operators have a simple chart of all
common G-commands (G-codes) and M-functions (M-codes), usually tucked away
somewhere under the lid of their tool box or they have them posted on any
convenient machine side or cork board. This chapter covers most of those
G-codes that are either uncommon, seldom used, special, or outright mysterious.
Keep in mind that machine manufacturers often add G-codes and M-codes of their
own. These special codes or functions cannot be covered in a general
publication, such as this handbook.
Miscellaneous
functions (M-functions) are not covered here at all, as they are often very
much dependent on the machine tool manufacturer - for that reason, they are not
part of this chapter. The situation is much different with various G-codes,
some standard, some optional - they are covered here.
These
special and less frequently used G-codes are as important as those used on a
daily basis, even if only as accepting them for possible future use.
Programmers often forget that there are many preparatory commands available
that are not used very frequently. In this chapter, the focus will be on those
G-codes that may sometimes become the key to solving a particular problem or
achieving a particular programming goal. Some of these preparatory G-codes have
a direct relationship with each other, in which case, all related commands will
be considered together and explained together.
Divided
into seven groups, seventeen preparatory commands covered in this chapter are:
Before
studying this section, please take note:
Spindle
speed is programmed in revolutions per minute (r/min or rpm). For example, the
program may contain S1000 M03, selecting 1000 r/min at normal rotation.
Ideally, the spindle should run at the constant 1000 r/min, however, that is
not always the case. The actual spindle speed will fluctuate slightly, which is
normal. Just watch the display of the spindle speed at the control. In most
cases, the speed fluctuation (also called spindle speed variation) can be
ignored, as it presents no problem. For those cases, when the fluctuation is
high, the control system provides two preparatory commands:
Note
that the G26 command does not actually remove the fluctuation, it only
detects it
. It only monitors it, and issues and alarm if
the spindle is
overheated
- the main reason for spindle
fluctuation is heat. The format for G26 uses three entries (Fanuc 16-18 format
shown:
P = Time in milliseconds to start the
check
Q = Percentage of allowed tolerance
R = Percentage of spindle speed fluctuation
The
above descriptions are rather brief, and do not indicate what exactly happens.
Using an example for spindle speed of 1000 r/min, the meaning of individual
entries should becomes clearer.
The
P
value is the time in milliseconds (ms) that is
counted from the spindle rotation function
S
to
the start of check for possible overheating. The checking will start only if
the programmed spindle speed is actually established during the time specified
by
P
. If
P
is
P2000
it is selected as 2000 ms; the system will check
if the programmed spindle speed is reached within 2 seconds.
The
Q
value is specified as a percentage of allowed
tolerance from the programmed spindle speed. For example,
Q5
is 5% of S1000, which is 1000/100
_
5 =
50. Subtracting 50 from the programmed speed results in 950 r/min for the
spindle speed to reach. If the programmed speed is within 950 and 1000 r/min,
the check of actual spindle speed begins.
The
R
value is the percentage of spindle speed
fluctuation where the spindle speed is too fast and overheating is possible.
R10
is 10% of the programmed spindle speed, and
1000/100
_
10 = 100. Subtracting 100 from the programmed
speed results in 900 r/min as the speed when alarm will be generated. Alarm
will be issued if overheating is likely to occur.
Often
the critical speeds are known, in which case the individual values of
Q
and
R
have to be calculated. There
are two formulas to use for this purpose:
A = Actual spindle speed
H = High speed at which overheating is
possible
S = Programmed spindle speed
For
example, if
A =
950, H = 900
and
S = 1000
, then:
Q = (1 - 950 / 1000)
_
100 = 5
R = (1 - 900 / 1000)
_
100 = 10
Copyright © 2006
Industrial Press Inc.