Sunteți pe pagina 1din 14

CNC PROGRAMMING CONCEPT

PROGRAMS

A program is the set of instructions that the


CNC uses to instruct/direct and control the
machine movements and operations.
Each line of instructions is called a block.
Each block runs independently, thus allowing
the program to be stepped, one block at a
time.
Movement along the X-axis

(0,10)
(30,10) Tool moved
towards right by
30 unit relative to
origin
-X +X
(30,0)
(0,0) Table

Table movement
towards Left by
30 unit

Thus, for positive motion: table movement is to the left


Similarly,
Y Axis
Table movement along the Y-axis is inward and outward.
Positive motion is table movement outward; negative
motion is table movement inward

Z Axis
Spindle movement along the Z-axis is upward and
downward. Positive motion is tool movement upward
(away from the workpiece); negative motion is tool
movement downward (into the workpiece)
Defining Positions

The intersection of the X, Y and Z axes is reference


point from which to define most positions.
Refer to Point O in Fig. 2., this point is the initial
position of tool tip i.e., X0, Y0 and Z0 position.
A position two unit left, three unit back and four unit
up has coordinate X-2.0 Y3.0 z4.0

TOOL TIP REFERENCE


Positive motion
is tool movement
Z+ upward
X-2.0
Y+3.0
Z+4.0

Positive
O
motion is X+
table
movement Negative
outward motion is
table
movement
Fig. 2. Locating Position to the right
Absolute Positioning

In Absolute Mode, all positions are measured from


Absolute Zero. Absolute Zero is not a fixed position
on the machine. It is a selected point. Refer to Fig.3.

Fig. 3. Absolute positioning

We can set Absolute Zero (X0, Y0, Z0) anywhere.


Usually, it is set at a position that enable us to use
the dimensions specified on the drawing. This is
also called ‘Setting the part Zero’
Absolute Zero (or Part Zero) can be moved as
often as necessary, either manually or in a program
Incremental Positioning
Incremental positioning are measured from one point
to another, or form the machines present position. This
is convenient for performing an operation at regular
intervals. Incremental positions are measured from the
tool’s present (current) position. Refer to Fig.4.
NOTE: An incremental 0 mm move will not make a
position change because you are located at the 0
reference point (current position)

Fig. 4. Incremental positioning


Angle Measurement

Angles are measured with the 3 o’clock position (X-Y


positive axes in XY plane) as the Zero Degree
Reference.
Positive angles rotate counter-clockwise; negative
angles rotate clockwise.

Fig. 5. Absolute angle measurement


Plane Selection
Circular moves and tool diameter compensation are
confined to the plane we select. Three planes are
available: the XY plane (G17), the XZ plane (G18) and
the YZ plane (G19).
It is important to view a plane correctly when we plan a
circular move. If a plane is viewed from the wrong side,
arc directions, angle references and axis signs will
appear reversed.
The standard rule is to view a plane looking from the
positive to the negative direction along the unused axis.

Fig. 6. Plane identification


Arc Direction
The standard rule is to view arc direction for a plane
from the positive towards the negative direction
along the unused axis. Applying right hand cork
screw rule, Clockwise (Cw) and Counter-clockwise
(Ccw) arc directions can be determined .
For example, in the XY plane, we view along the Z
axis, from Z+ toward Z-, to determine Cw/Ccw
directions. The Cw/Ccw arc directions for each plane
are shown in Fig.7.

Fig. 7. Clockwise and counter clockwise arc directions


Tool Path Compensation (G41, G42)

When tool compensation is not active, the CNC positions


the tool’s center on the programmed path. This creates a
problem when programming a part profile because the
cutting edge is half a diameter away from the path. Tool
diameter compensation is used to overcome this
problem.

When tool compensation is active, the CNC offsets the


tool by half a diameter to position the cutting edge of the
tool on the programmed path. This enables to program
the coordinates along the part profile. It is not needed to
adjust the path to compensate for tool diameter. Most
moves can be compensated.

Specify right-hand or left-hand compensation. "Right" or


"left" refers to the side of the path to which the tool
offsets, as viewed from behind a moving tool. If the tool
is to the left of the work, use G41. If the tool is to the right
of the work, use G42.
Tool Path Compensation (G41, G42)

LEFT HAND TOOL COMPENSATION RIGHT HAND TOOL COMPENSATION

With left-hand tool With right-hand tool


diameter compensation diameter compensation
(G41) active, the tool (G42) active, the tool
offsets to the left of the offsets to the right of the
programmed path (as programmed path (as
viewed from behind a viewed from behind a
moving tool). moving tool).

Programmed path
Tool path
Tool

Fig. 8. Tool Compensation


Cancel Mode in Tool
Compensation: G40

At the end of a cutting sequence that performs tool


compensation (G41 or G42), one must use G40 to
cancel compensation.
The following example describes a part programmed
in the XY plane using G41.

NOTE: You must make an X and/or Y move with or


after G40, before changing the active tool number.

Example:
N4 G17 G0 G41 Xn Yn
N5 etc...
.
.
N20 G0 G40 Xn Yn
N21 etc...

Program G40 on a line with G0 or G1 (unless G0 or


G1 is already active).
G40 programmed with or immediately following G2 or
G3 will generate an alarm message.
Circular Interpolation (G2 and G3)
The interpolation parameters together with the axis
commands determine the circle or arc. The starting
point A is determined by the previous block. The end
point E is fixed by the axes values of the plane in
which the circular interpolation is programmed.
The circle center point O is determined by
(a) either through the interpolation parameters
(b) or by specifying the circle radius
Y
Circular interpolation parameters
-I The parameter vectors are positive in the
E -J A direction of increasing coordinate values
O with respect to their respective axis , the
vectors are negative otherwise.
X

Arc input Format: G02 Xx Yy Zz Ii Jj Kk


Arc input Format: G03 Xx Yy Zz Ii Jj Kk
Radius Format: G02 Xx Yy Rr
Radius Format: G03 Xx Yy Rr

NOTE: For circular interpolation in another plane, make


the plane change prior to the G2 or G3 block. Arc
examples use the most common plane, G17 (XY).

NOTE: If the values of X, Y, Z are unchanged or


I, J, or K is zero, omit it.
Circular Interpolation
Table 1- Parameters for Circular Interpolation
Parameter Description

G02 CW (clockwise) motion


G03 CCW (counterclockwise) motion

XYZ Endpoint of arc motion in Absolute or Incremental


Mode.
I (X) Distance from the tool location to the
arc center. I = X center, J = Y center,
J (Y)
and K = Z center.
K (Z)
NOTE: Arc centers are incremental by default.

R Arc Radius.
NOTE: If Arc is greater than 180°, enter the R
value as a negative value
(For example, R-.5).

Examples: Y
P1
30 R O
J
Circular Interpolation 15
P2
Using Interpolation I=0
Parameters
45
X
60
N5 G17 G42 …. LF
N10 G02 G90 X45 Y30 I0 J15 … LF The tool moves from P2 to P1
N10 G41 G03 G90 X60 Y15 I15 J0 LF The tool moves from P1 to P2
Circular Interpolation by Specifying the Radius
N10 G02 G90 X45 Y30 R15 … LF The tool moves from P2 to P1
N10 G03 G90 X60 Y15 R15 LF The tool moves from P1 to P2
Examples of Circular Interpolation
Partial Arcs (XYIJ)

The Figure illustrates an arc moving between P2 and P3.

P3 4.5 in (114.3 mm)


P4
P2
0.5 in (12.7 mm)
2.5 in
(63.5 mm)
P5
P1 (X0Y0)
Fig.9. Circular interpolation
Table 2 - Circular Interpolation in Absolute Mode, Inches

Address Format Description


Word
N1 G20 G90 G17 G1 Y2.5 F.1 Active Inch and Absolute
Mode.
Set Feed rate to IPR.
Activate plane. Feed to
P2
N2 G2 X.5 Y3.0 I.5 J0 Arc move to P3.

N3 G1 X5 Feed to P4

N4 Y0 Feed to P5

N5 X0 Feed to P1

N6 M2 End Program

S-ar putea să vă placă și