4 Variabile Coduri G
4 Variabile Coduri G
----
În ultimele decenii au fost dezvoltate implementări de către mai multe organizaţii (comerciale
şi necomerciale).
G-code a fost adesea folosit în aceste implementări. Versiunea standard utilizată în principal
în Statele Unite a fost stabilită de Alianţa Electronic Industries la începutul anilor 1960.
O revizuire finală a fost aprobată în luna februarie 1980, RS274D. În Europa, standardul ISO
6983 / 2009 este folosit cu prioritate. Uneori se pot folosi alte standarde, de exemplu DIN
66025 sau PN-73m-55256, PN-93/M-55251 (în Polonia).
A Absolute or incremental
position of A axis (rotational
axis around X axis)
B Absolute or incremental
position of B axis (rotational
axis around Y axis)
C Absolute or incremental
position of C axis (rotational
axis around Z axis)
Lista codurilor G
Echipamente CNC Fanuc si similare
Milling Turning
Code Description Corollary info
(M) (T)
G33 Constant-pitchthreading M
Lista codurilor M
Echipamente CNC Fanuc si similare
Milling Turning
Code Description Corollary info
(M) (T)
M02 End of program M T No return to program top; may or may not reset
register values.
M03 The speed of the spindle is determined by the
address S, in either revolutions per
minute (G97 mode; default) or surface feet per
minute or [surface] meters per minute (G96 mode
[CSS] under either G20 or G21). The right-hand
rule can be used to determine which direction is
clockwise and which direction is counter-clockwise.
Spindle on
M T
(clockwise rotation)
Right-hand-helix screws moving in the tightening
direction (and right-hand-helix flutes spinning in the
cutting direction) are defined as moving in the M03
direction, and are labeled "clockwise" by convention.
The M03 direction is always M03 regardless of local
vantage point and local CW/CCW distinction.
M04 Spindle on
(counterclockwise M T See comment above at M03.
rotation)
M05 Spindle stop M T
M06 Many lathes do not use M06 because the T address
itself indexes the turret.
Programming on any particular machine tool requires
knowing which method that machine uses. To
understand how the T address works and how it
interacts (or not) with M06, one must study the
various methods, such as lathe turret programming,
Automatic tool T (some- ATC fixed tool selection, ATC random memory tool
M
change (ATC) times) selection, the concept of "next tool waiting", and
empty tools. These concepts are taught in textbooks
such as Smid,[1] and online multimedia (videos,
simulators, etc); all of these teaching resources are
usually paywalled to pay back the costs of their
development. They are used in training classes for
operators, both on-site and remotely (e.g., Tooling
University).
M07 Coolant on (mist) M T
M08 Coolant on (flood) M T
M09 Coolant off M T
M10 Pallet clamp on M For machining centers with pallet changers
M11 Pallet clamp off M For machining centers with pallet changers
M13 Spindle on M This one M-code does the work of
(clockwise rotation) both M03 and M08. It is not unusual for specific
and coolant on machine models to have such combined commands,
which make for shorter, more quickly written
(flood)
programs.
M19 Spindle orientation is more often called within cycles
(automatically) or during setup (manually), but it is
also available under program control via M19. The
abbreviation OSS (oriented spindle stop) may be
seen in reference to an oriented stop within cycles.
M21 Mirror, X-axis M
M21 Tailstock forward T
M22 Mirror, Y-axis M
M22 Tailstock backward T
M23 Mirror OFF M
M23 Thread gradual T
pullout ON
M24 Thread gradual T
pullout OFF
M30 End of program with
M T
return to program top
M41 Gear select - gear 1 T
M42 Gear select - gear 2 T
M43 Gear select - gear 3 T
M44 Gear select - gear 4 T
M48 Feedrate override
M T
allowed
M49 This rule is also called (automatically) within tapping
Feedrate override cycles or single-point threading cycles, where feed is
M T
NOT allowed precisely correlated to speed. Same with spindle
speed override and feed hold button.
M52 Unload Last tool
M T Also empty spindle.
from spindle
M60 Automatic pallet
M For machining centers with pallet changers
change (APC)
M98 Takes an address P to specify which subprogram to
Subprogram call M T call, for example, "M98 P8979" calls subprogram
O8979.
M99 Usually placed at end of subprogram, where it
returns execution control to the main program. The
default is that control returns to the block following
the M98 call in the main program. Return to a
Subprogram end M T
different block number can be specified by a P
address. M99 can also be used in main program with
block skip for endless loop of main program on bar
work on lathes (until operator toggles block skip).
Exemplu de program
This is a generic program that demonstrates the use of G-Code to turn a 1" diameter X 1" long part.
Assume that a bar of material is in the machine and that the bar is slightly oversized in length and
diameter and that the bar protrudes by more than 1" from the face of the chuck. (Caution: This is
generic, it might not work on any real machine! Pay particular attention to point 5 below.)
Sample
G20 G90
(Inch units. Absolute mode. Call work offset values. Moving coordinate system to
N02 G54 D200
the location specified in the register D200. Cancel any existing tool radius offset.)
G40
N03 G50 S2000 (Set maximum spindle speed rev/min - preparing for G96 CSS coming soon)
G96 S854
(Constant surface speed [automatically varies the spindle speed], 854 sfm, select
N06 M42 M03
spindle gear, start spindle CW rotation, turn on the coolant flood)
M08
(Call tool radius offset. Call tool wear offset. Rapid feed to a point about 0.100"
G41 G00
from the end of the bar [not counting 0.005" or 0.006" that the bar-pull-and-stop
N07 X1.1 Z1.1
sequence is set up to leave as a stock allowance for facing off] and 0.050" from
T0303
the side)
N08 G01 Z1.0 (Feed in horizontally until the tool is standing 1" from the datum i.e. program Z-
F.05 zero)
N09 X-0.002 (Feed down until the tool is slightly past center, thus facing the end of the bar)
N10 G00 Z1.1 (Rapid feed 0.1" away from the end of the bar - clear the part)
N11 X1.0 (Rapid feed up until the tool is standing at the finished OD)
G01 Z0.0 (Feed in horizontally cutting the bar to 1" diameter all the way to the datum,
N12
F.05 feeding at 0.050" per revolution)
G00 X1.1
N13 (Clear the part, stop the spindle, turn off the coolant)
M05 M09
G91 G28 (Home X axis - return to machine X-zero passing through no intermediate X point
N14
X0 [incremental X0])
G91 G28 (Home Z axis - return to machine Z-zero passing through no intermediate Z point
N15
Z0 [incremental Z0])
N16 G90 M215 (Return to absolute mode. Turn off load monitor)
1. There is room for some programming style, even in this short program. The grouping of codes
in line N06 could have been put on multiple lines. Doing so may have made it easier to follow
program execution.
2. Many codes are "modal", meaning that they stay in effect until they are cancelled or replaced
by a contradictory code. For example, once variable speed cutting (CSS) had been selected
(G96), it stayed in effect until the end of the program. In operation, the spindle speed would
increase as the tool neared the center of the work in order to maintain a constant surface
speed. Similarly, once rapid feed was selected (G00), all tool movements would be rapid until
a feed rate code (G01, G02, G03) was selected.
3. It is common practice to use a load monitor with CNC machinery. The load monitor will stop
the machine if the spindle or feed loads exceed a preset value that is set during the set-up
operation. The jobs of the load monitor are various:
2. Warn of a tool that is becoming dull and needs to be replaced or sharpened. Thus an
operator who is busy tending multiple machines will be told by a machine,
essentially, "Hey, pause what you're doing over there, and come attend to a need
over here."
4. It is common practice to bring the tool in rapidly to a "safe" point that is close to the part - in
this case 0.1" away - and then start feeding the tool. How close that "safe" distance is,
depends on the skill of the programmer and maximum material condition for the raw stock.
5. If the program is wrong, there is a high probability that the machine will crash, or ram the tool
into the part under high power. This can be costly, especially in newer machining centers. It is
possible to intersperse the program with optional stops (M01 code) which allow the program
to be run piecemeal for testing purposes. The optional stops remain in the program but they
are skipped during the normal running of the machine. Fortunately, most CAD/CAM software
ships with CNC simulators that will display the movement of the tool as the program executes.
Many modern CNC machines also allow programmers to execute the program in a simulation
mode and observe the operating parameters of the machine at a particular execution point.
This enables programmers to discover semantic errors (as opposed to syntax errors) before
losing material or tools to an incorrect program. Depending on the size of the part, wax blocks
may be used for testing purposes as well.
6. For pedagogical purposes, line numbers have been included in the program above. They are
usually not necessary for operation of a machine, so they are seldom used in industry.
However, if branching or looping statements are used in the code, then line numbers may well
be included as the target of those statements (e.g. GOTO N99).
= de reținut