Structure of A CNC Programming Block
Structure of A CNC Programming Block
DEPARTMENT OF DESIGN
NATIONAL UNIVERSITY OF INDUSTRIAL
THE SILVER
STRUCTURE OF A N G X Y Z F S T M
BLOCK OF
CNC PROGRAMMING Auxiliary Functions
Tool Number
Spindle speed
Feed rate
Block number
(*) These are the instructions that the numerical control assumes by default.
when it is started, or after M02, M30, EMERGENCYRESET.
(**)MODALMeans that once the instruction appears, this
remains active until it is replaced by another instruction or by
M02,M30,EMERGENCYRESET
G00 They are the displacements according to the safety plan (Clearance Height)
POSITIONING at the maximum speed of the machine. This plane is defined by a
FAST enZque ensures that the tool will be able to move without crashing.
with an obstacle. Movements cannot be programmed G00
interpolated in 2 or more planes. Normally, it is programmed first the
exit in Z (e.g. to the security plan) and then, in another block, the
repositioning in XY. For this block, the machine will first search
the cotaX and then the
Y. That is to say, it will not interpolate. Although this mode is the most common,
It can vary depending on the different brands of numerical control.
The function G00 is modal and incompatible with G01, G02, G03, and G33.
In some controls, G00 does not override the last programmed F, in others it does.
so it needs to be reprogrammed after the execution of an G00.
G01 They can be movements with simultaneous variation in the 3 axes. This
INTERPOLATION it means that they can be spatial trajectories not parallel to any of
LINEAR the axes. The CNC will calculate the relative speeds according to each of the
axes, so that the result of the combination is a trajectory
rectilinear. ElG01 is executed as programmed, although this can be
then varied during the execution of the program. NormallyFes
modal.G01 cannot be included in the same block with G00, G02,
G03yG33.
G02 Y G03 Their trajectories follow arcs of circles. They can only be executed in
INTERPOLATIONS a determined plane: XY, XZoYZ. In this case, the CNC must not only
CIRCULARS calculate the relative speeds of each axis as well as the acceleration
and deceleration of the movements to achieve a circular trajectory.
The way to program it is as follows (for plane XY):
They define the center of the arc according to the axes X and Y, respectively.
Normally the incremental IyJson values regarding the point of
start of the circular trajectory (that is, the pair of coordinates X and Y of the block
previous). However, this may vary depending on the brand of the CNC. In
Some CNC values of IyJ must be programmed in absolute.
In CNCs that define center in incremental, a can be programmed
G02/G03 including a G06 in the block. The values I J must
always include them even if they are equal to 0. Normally the modalFes
for these functions. A G02/G03 can also be programmed.
next form:
G09 Allows you to program an arc by defining the endpoint and a point.
TRAJECTORY intermediate. The starting point is defined by the previous block. It is not
DEFINED CIRCULAR modal. Does not allow complete circles.
FOR 3 POINTS
N10 G01 X10 Y10
N20 G09 X90 Y30 I40 J40
G31 and G32 G31 allows you to save the coordinate origin that is being used for
SAVE AND establish a new origin with G53/G59. If necessary
RECOVER ORIGIN return to the initial origin, an G32 will be programmed. This function retrieves the
OF COORDINATES data saved with unG31.
G36 Allows for controlled rounding of trajectory inflections without
ROUNDING need to program circular interpolations. It must be programmed in
CONTROLLED BY the section of the trajectory whose end you want to round. The radius of the
ARISTAS rounding must be positive.
G37 This function allows for tangentially connecting the defined trajectory in
ENTRY the following block. It is used to prevent the tool from leaving marks
TANGENTIAL undesirables in the part. It is the typical case of surface machining.
convex (e.g. males) in which the tool attacks laterally to the
material.
The resulting trajectory is that of the dashed line. G38 must be programmed.
in the block from which it exits.
G39 This function allows for the joining of two straight paths through a
flourishing third, also straight, without the need to calculate the points of
intersection.
R specifies the distance between the beginning and the end of the bevel and the
intersection of the two trajectories.
G40, G41 and G42 G40 Tool Radius Compensation Cancel. G41
COMPENSATION OF Compensation of Radio to the right of the trajectory. G42
RADIOS OF Left trajectory radio compensation.
TOOL
Suppose we want to machine a cube with a side of 100 mm.
a Ø20 strawberry. As the CNC trajectories are defined by the
The "tip" of the tool (its lowest central point) needs to be recalculated.
the trajectory 10 mm. outside of the cube. If this is not done, and if
programming along the lines that define the cube, a form of would be obtained
90 mm on each side. Recalculate the trajectories to obtain a cube.
not be difficult. But doing it for a complex form can be very
complicated.
Applying the Radio Compensation functions, this is not necessary.
recalculation. For this, the tool must be specified at the beginning of
program with the format Txx.pp.
the two-digit number with which a certain tool is
archived (at the moment when the CNC is configured, it can be created
a table of available tools.
yes a correction value of the nominal diameter of the tool. These
Corrections are usually necessary due to wear and tear.
These correction values are also stored in memory.
permanent of the CNC. final dimensions of the piece. They must be included in the previous block
Scheduled a to those who wish to execute with compensation. These functions are
G41/G42 canceled by unG40. This cancellation must be included in the block that
they will be able
to program oneself the define the last compensated trajectory. Only one G40 can be included
trajectories according to the a straight trajectory.
G53 A G59 In certain machining jobs, it can be useful to relocate the origin.
TRANSFERS OF from coordinates to another point of the piece. For example, when one wants
ORIGIN repeat a shape in another(s) place(s). Normally in a single
The program allows up to 7 source changes to be entered. The format of
the application is the following:
G72 This function allows you to enlarge or shrink the dimensions of a piece without
FACTOR OF change the program. It can be applied in two ways
ESCALATED
N10 G72 K+/-2.4
This is the factor by which all the quotas will be multiplied. This way
scale the piece according to the three axes.
This mode will scale the piece according to the factor only on the X axis.
the same way can be scaledI. Normally this function does not
should be applied in programs that apply compensations of
tool.
G73 This function is a programming aid similar to mirroring.
ROTATION OF this case allows reproducing a pre-programmed machining by rotating it
SYSTEM OF regarding the origin of coordinates.
COORDINATES
(from the previous block) X-20 Y0
N10 G03 X-50 I-15 J0
N20 G01 X-20
N30 G73 A-45
N40 G25 N10.20.3
It is the angle of rotation. In the example, it has a negative sign (-) because the
CNC programming takes the direction as positive by default.
counterclockwise, and clockwise as negative. The function G25 calls
repeat to the blocks defined by N, that is, the blocks from 10 to 20. The
The third digit (3) indicates the number of times the rotation will be repeated.
Note that the value of Aes is incremental.
FIXED CYCLES Fixed cycles allow the definition of a series in a single block.
cyclical operations characteristic of a specific machining process. The cycles
The most common fixed ones are those used for drilling and those used for cashiers.
G81 The fixed cycle drilling blocks have the following configuration:
DRILLED
N4 G81 G98/99 X/Y/Z+/-4.3 I+/-4.3 K2.2 N2
FIXED CYCLES OF Operations for emptying molds are referred to as Cashiers (Pockets).
cashiers closed. They can be Rectangular Drawers or Circular Drawers. In these
operations the tool not only goes around the outline of the figure but also
that also carries out all the necessary movements to withdraw the
material included within the figure.
RECTANGULAR
G87
CASHIER
The format of X/Y/Z: Quotas of the cashier's center.
block of this I: Total depth of the drawer. In absolute terms, relative to the zero part.
function is the In increments, with respect to the reference plane.
next Distance in X from the center to the edge of the cashier.
Distance in Y from the center to the edge of the cashier.
N4 G87 X/Y/Z+/- Incremental deepening per pass.
4.3 I+/-4.3 J+/- C: Lateral increment (Step-over).
4.3 K+/-4.3 B4.3 D: Distance between the PR and the surface of the piece.
C4.3 D4.3 N2 N:Number of times the cycle will be repeated. Only in G91.
G88 It has the same format as the Rectangular Cashier. It differs in that J
CIRCULAR CASHIER define the radius of the Cashier and the valueK is not included.
D: Distance between the PR and the surface of the piece.
N:Number of times the cycle will repeat. Only in G91.
OTHER FUNCTIONS As can be seen in the complete list of functions of
CNC programming, there are many others that have not been explained in
this note. These correspond to execution operations
circumstantial and are rarely applied. The explained functions are the
of more frequent use.
FUNCTIONS CAM systems apply only 4 functions: G00, G01, G02 and
USED BY They can eventually generate Fixed Drilling, Tapping Cycles,
THE CAM SYSTEMS etc., and generate programs with Tool Offsets. From
made a CAM is a basic but extremely fast programmer.
Much faster than manual programming. If the 100 are analyzed
functions of the list, it can be concluded that the vast majority have the
function to alleviate the task of manual programming. The CAM does not apply
these aids.
Although this course concludes with the learning of system operations.
CAM is considered that, to achieve the proposed objectives, the student
must have a minimum base of programming knowledge
manual.