Ncstudio V9 Programming Manual-R5.1
Ncstudio V9 Programming Manual-R5.1
Programming Manual-V9R5.1
NAIKY
Address:
Zip Code:
200032
Tel:
400-882-9188
Fax:
Web site:
http://www.naiky.com
http://www.weihong.com.cn
E-mail:
[email protected]
[email protected]
NAIKY
NAIKY
Contents
1 New Functions..........................................................................- 1 2 Summarization of CNC Programming......................................- 3 2.1 Summarization for CNC Programming......................................................................- 3 Definition for Machining File...................................................................................- 3 Creation for Machining File......................................................................................- 3 2.2 Summarization for CNC Machine Tool......................................................................- 4 Machine Tool Coordinate Axis.................................................................................- 4 Machine Origin (MO) and Machine Reference (REFER) Point of Machine
Coordinate System (MCS)................................................................................................- 5 -
3 Configuration of Machining File................................................- 7 3.1 Address Symbol and Function Symbol.......................................................................- 7 3.2 Format of Program block............................................................................................- 8 3.3 Format of Subprogram................................................................................................- 9 -
4 Programming Instruction System............................................- 10 4.1 Spindle Function (S), Feed Function (F) and Tool Function (T)..............................- 10 Spindle Function S..................................................................................................- 10 Feed Speed F...........................................................................................................- 10 Tool Function (T Feature).......................................................................................- 11 4.2 Miscellaneous Function M Code..............................................................................- 11 4.3 Preparatory Function G Code...................................................................................- 12 Commands Related to Coordinate System and Coordinate....................................- 12 -
Tel: (00)86-400-882-9188 Fax: (00)86- (0)21-64038574, 51502738 Web Site: http://www.naiky.com iii
[email protected] Address: Room 305, 1221 Xietu RD, Shanghai, China. (200032)
NAIKY
Feed Control Instruction.........................................................................................- 25 Tool Command........................................................................................................- 30 Canned Cycle Function...........................................................................................- 34 Canned Cycle Operations........................................................................................- 35 Canned Cycle Codes...............................................................................................- 37 Canned Cycle Commands.......................................................................................- 38 Special Canned Cycle.............................................................................................- 59 Customize the Canned Cycle..................................................................................- 64 4.4 Advanced Function....................................................................................................- 65 4.5 Expressions Used in Program Instructions...............................................................- 70 Current Definition for Expression:.........................................................................- 70 Definition for Assignment Expression:...................................................................- 70 4.6 Comments in Program..............................................................................................- 71 4.7 Demonstration for Machining File Programming....................................................- 72 4.8 G Command Appendix..............................................................................................- 78 -
5 Naming Parameters................................................................- 81 6 Customize the Extended Command M...................................- 89 7 PLT Support............................................................................- 91 8 DXF Support...........................................................................- 92 -
NAIKY
1 New Functions
1)
New command M802 P458752 is used for clearing the external offset. For detailed
information please refer to chapter 4.4.
2)
New command G921 is used for specifying the workpiece coordinate of the current
point in the current coordinate system. Detailed introduction please turn to chapter 4.3
commands related to coordinate system and coordinate.
3)
New command G922 is used for setting the mechanical coordinate of the origin of the
specified workpiece coordinate system. Detailed introduction please refer to chapter
4.3 commands related to coordinate system and coordinate.
4)
New support for circle, bias and chessboard drilling cycle command (G34, G35, G36,
and G37). Detailed introduction please refer to chapter 4.3 special canned cycle.
5)
6)
New mirror image function commands G50.1/G51.1, detailed introduction please refer
to section 4.3 mirror image function commands G50.1/G51.1.
7)
New command G923 is used for directly tool offset setting, detailed introduction
please refer to chapter 4.3 tool function.
8)
Strengthened function for command G906 is used to test if the specified port is
timeout. Detailed introduction please refer to chapter 4.4.
9)
New command M903 is used for modifying the current tool number. Detailed
introduction please refer to command M list in chapter 4.4.
10) Command G92 is taken as invalid command in the array machining. It demands user to
delete manually. Detailed introduction please refer to chapter 4.3, commands related
to coordinate system and coordinate.
11)
12) Improvement for command G904: the usage of PLC address, Keywords of PX, PY, PZ
is compatible with PLC address and equal mark expression
NAIKY
13) Improvement for G901 and G906: the usage of PLC address, new keywords PLC
and LEVERL, and PLC keywords are compatible with [PLC address] and equal
mark expressions.
14) New function for command G992 allows the transverse movement of the coordinate
system. Detailed introduction please refer to temporary WCS setting G992 in chapter
4.3. (WCS: workpiece coordinate system).
15) New command G28 is used for backing to the reference point. Detailed introduction
please refer to chapter 4.3, auto back to reference point G28.
NAIKY
2 Summarization of CNC
Programming
2.1 Summarization for CNC Programming
Definition for Machining File
Machining file is composed of a series of instructions written in a programming language
which is specially used for CNC device, and it will be transferred into motion control to the
machine tool by CNC device. The most commonly used storage mediums are punched tape and
disk.
NAIKY
2.2
standardized the naming to coordinate axes and direction of CNC machine tool. Linear feeding
coordinate axes are denoted by X, Y and Z, which is normally referred as basic coordinate axes.
The correlation of axes follows the Right Hand Rule, see in Fig. 2 -2 . The thumb points in
the +X direction, the index finger points in the +Y direction, and the middle finger points in the
+Z direction.
NAIKY
Z: Z-axis is in line with the main spindle, the direction of tool moving away from workpiece
is positive direction (+Z);
X: X-axis is perpendicular to Z-axis and parallel to clamp interface. If it is milling machine
of detached column, facing the spindle of tool, looking in the column direction, the direction of
moving towards right is positive direction of X-axis (+X);
Y: Y-axis, X-axis and Z-axis together constitute the coordinate system abiding by right hand
rule.
NAIKY
NAIKY
Address Symbol
Meaning
Symbol
Basic
Function
O
Function
Selection
D
BO
Feedrate
Preparatory function
BO
NAIKY
BO
BO
Number of repeats
BO
Miscellaneous function
Sequence no.
Program no.
OB
cycle
R
OB
for arc
S
Tool function
X coordinate
Y coordinate
Z coordinate
NAIKY
3.3
Format of Subprogram
Subprogram is a section of machining codes which can be called repeatedly. It must begin
with address word O and subprogram no. as the first line and end with M17 as the last line. On
principle, commands, such as M30 and M17, are not allowed to appear among the subprogram,
but nested subprogram is acceptable.
NAIKY
Feed Speed F
Command Form: F_
Description:
Command F indicates the synthetic feed speed of tool relative to workpiece when
machining, with unit mm/min.
By the knob of feedrate percent on the operation panel, F can be adjusted between feedrate
percent 0% -120%.
F will result in different meaning when it is used with different command:
G00 command, specify the rapid transverse speed, and it is modal for the current
machining procedure.
G01~G03 command, specify the feed speed, and it is modal for the current machining
procedure.
NAIKY
Non-modal M function: it is effective only in the program block which includes it.
M Code
Meaning
M Code
Meaning
M00
Program stop
M11
Spindle release
M01
Optional stop
M17
Subprogram return
M02
Program end
M30
M03
Spindle rotates CW
M98
Subprogram call
NAIKY
M04
M99
M05
Spindle stop
M801
M06
Tool change
M802
M08
Coolant on
M901
M09
Coolant off
M902
M10
Spindle clamp
M903
4.3
It is used to specify the machining operations, such as the moving track of tool relative to
workpiece, machine coordinate system, coordinate plane, tool compensation, coordinate offset,
subprogram call, dwell, and so on.
G function has two forms, non-modal and modal G function:
Non-modal G function: it is only effective in the specified program block, and it will
be cancelled at the end of program block.
NAIKY
coordinate axis is corresponding to the last position, and the value equals the distance that tool
moves along axes.
G90 and G91 are modal functions, can be mutually cancelled. G90 is default. They cannot
be used in the same program block. For example, G90 G91 G0 X10 is unallowable
Programming Example:
As shown in Fig. 4 -6 below, programming with G90, G91: the tool moves in sequence
from origin to point 1, 2, and 3.
NAIKY
NAIKY
P_: Specifying offset type. -4: external offset; -1: current WCS (default); 0~5:
corresponding to G54~G59.
Set the coordinate value of the specified axiss offset, there is no need for the unlisted axes
modification.
G922 command can be used for measuring workpiece surface and workpiece center or
verge.
NAIKY
The command is used for implementing array function. The steps are as shown below.
Method one:
1 Delete M30 command in the processing file.
2 Adding at the beginning of the processing file:
#1=30
X offset value
#2=40
Y offset value
#3=30
#4=30
X offset value
NAIKY
#2=40
Y offset value
#3=30
#4=30
Note:
G992 X_Y_Z_: Set the current point as a specified point in the new coordinate
system.
G992 I_ J_ K_: Translate the previous coordinate system a specified distance to
form into a new coordinate system. Comparatively speaking, G992 I_ J_ K_ can
avoid the redundant move instruction of dry run produced by origin offset; but not
like G992 X_Y_Z_, back to origin and then set origin. So G992 I_ J_ K_ is more
efficient than G992 X_Y_Z_.
During array machining, G92 command is not supported by system. It need user to delete it
manually.
NAIKY
Note:
Once these WCS are confirmed, the following instruction value in absolute
programming are all corresponding to the origin of WCS.
G54~G59 is modal function, can be mutually cancelled, and G54 is default.
Programming Example:
As shown in Fig. 4 -10
Fig. 4-10
NAIKY
Before using this group of instructions, please firstly set the value of each coordinate system
origin in MCS.
Fig. 4-11
NAIKY
G21/71: metric.
This G code is defined at the beginning of the program block. If a G code is specified, the
units of all subsequent operation will be changed. If not specified, the default unit is metric.
When executing cutter radius compensation C, the scaling (G51) instruction cannot be
specified.
The canned cycle cannot be executed together with the specified scaling function of Zaxis. If do so, an alarm will appear.
These G codes cannot be used in the execution process of scaling function: G28, G29,
G53, and G92, or else the outcome may contain an error.
If it is G51 but not G52 being specified in the program, the scaling function will be
automatically closed at the end of the program.
Programming Example:
NAIKY
G01
Y150.0
F1000
linear
cutting
with
feedrate
Fig. 4-12
Command Form:
G68 X_Y_Z_R_
G69
Description:
X_Y_Z_ Specify the center of rotation.
R_: specify rotation angle with unit of degree. Clockwise is negative, and counterclockwise
is positive.
NAIKY
The instruction can be used for rotary contour machining. The selected machining contour
rotates degrees specified by R around the center. G68 is swivel on, and G 69 is swivel off.
Meaning of R: put a watch on the current plane, and let the watch surface towards the
positive direction of the third axes; counterclockwise is positive, and clockwise is negative.
At the process of swiveling, coordinate of the third axis perpendicular to the current plane
is constant. Respectively, swiveling in XY plane, the coordinate of Z-axis keeps still; swiveling
in YZ plane, the coordinate of X-axis keeps still; and swiveling in ZX plane, the coordinate of Yaxis keeps still.
For example:
G17G90 X0Y0Z0
G65P9999L1
G68 X0Y0R-90 Rotate clockwise 90 degrees around center
of (0, 0)
G65P9999L1
G69 Rotation off
M30
NAIKY
Fig. 4-13
The instruction can be nested:
G68 X_Y_Z_R_
G68 X_Y_Z_R_
G68 X_Y_Z_R_
G69
G69
G69
Rotation that appears earlier will influence the following rotation instruction. The
subsequent rotation center is not the one that you get from the machining file and it has been
changed by the previous rotation, and the actual rotation center is the latest transformed position.
The function of G69 is to cancel the latest rotation transform. The above-mentioned code of
line C in the program is to cancel G68 of line C, for the same reason, B corresponds to B, and
A corresponds to A. If not using G69, the function of rotation transform will be automatically
cancelled at the end of the current machining.
The example is shown as below, the rotation transform and scaling change are nested.
G90 G0 x0 y0 z0
NAIKY
G91G65 P9999 L1
G65 P9998 L10
M30
O9999
G1 x200
y-100
x-200
y100
M17
O9998
G68 x50 y50 R45
G65 P9999 L1
G51 x50 y50 p0 5
G65 P9999 L1
M17
The outcome is shown in Fig. 4 -14
NAIKY
Fig. 4-14
Command Form
G51.1 X_Y_Z_
G50.1 X_Y_Z_
Description:
X_Y_Z_ For G51.1, specifying mirror image center; for G50.1, specifying the invalid
axes of mirror image function.
The instruction indicates to machining to the mirror image of machining contour. G51.1
denotes mirror image on and G50.1 denotes mirror image off.
For G51.1, the center of mirror image can be a line, and also a point. For example, G51.1
X10, specifies the mirror image of the contour corresponding to line X=10. G51.1 X10 Y10 Z10,
specifies the mirror image of the contour corresponding to the point (10, 10, 10)
For G50.1, X_Y_Z_ is used to specify the invalid axis of mirror image function. For
example, G50.1 X0, close the mirror image function of X-axis; G50.1 YO, Z0, close the mirror
image functions of Y-axis and Z-axis. If all the mirror images of X, Y and Z axes are specified or
no one is specified, it denotes the mirror image functions of all the axes are closed.
NAIKY
NAIKY
rapid move
end of program
Note:
NAIKY
When R>0, angle corresponding to the circular arc is less than 1800;
When R<0, angle corresponding to the circular arc is more than 1800.
Programming Example:
Interpolation for clockwise circle and counterclockwise circle, as shown in Fig. 4 -15
For Fig. 4 -15 (a)
Solution 1:
G17 G90 G02 X20 Y10 I-2 J-14 F300
Solution 2:
G17 G90 G02 X20 Y10 R12 F300
For Fig. 4 -15 (b)
Solution 1:
G17 G90 G03 X10 Y22 I-12 J-2 F300
Solution 2:
G17 G90 G03 X10 Y22 R12 F300
NAIKY
Fig. 4-16
NAIKY
Fig. 4-17
Helical Programming
Dwell G04
NAIKY
dwell 1000ms
Tool Command
Command Form:
G41 D_
G42 D_
G40
Description:
G40: cancel cutter radius compensation
G41: left cutter compensation (compensation on the left flank)
G42: right cutter compensation (compensation on the right flank)
D_: parameter of G41/G42, that is tool compensation no. (D00~D07), denotes the radius
compensation value related to the tool compensation list.
The switch among cutter radius compensation planes must be executed under the mode of
compensation off.
The establishment and cancel of cutter radius compensation can only use G00 or G01
command but not G02 or G03.
When using cutter radius compensation, the radius value must be measured accurately and
then save this value into the memory as the cutter path offset (cutter radius value). It should also
be programmed with D code to make cutter offset no. corresponding to cutter radius value.
NAIKY
When G41 (G42) is used, cutter will move a radius distance to the offset position. The tool
is immediately located to the perpendicular position of the program blocks start position, and the
value of movement depends on the offset.
NAIKY
Note:
At the process of compensation and compensation off, the current moving
direction of the cutter cannot be opposite to last moving direction.
Fig. 4-20
For example:
G92 G0 X0 Y0
G0 G41 X10 Y10 D01 F1000
G1 X20 Y10
If adding G1 X5 Y10 here, error will appear, the
moving direction is opposite to the one above-mentioned. So G1 X1
Y50 can be used instead, or cancel opposite direction command
here.
G0 G40 X0 Y10
this instruction is wrong, and the
moving direction of cutter is opposite to the last one. It is
right to change into G0 G40 X0 Y0.
Command Form:
G43 H_
G44 H_
G49
Description:
G49: tool length compensation off
G43: compensation along positive direction (end point value of compensation axis adds
offset value)
NAIKY
G44: compensation along negative direction (end point value of compensation axis
subtracts offset value)
H_: parameter of G43/G44, that is tool length compensation offset no. (H00~H07), denotes
length compensation value related to the tool compensation list.
Tool length compensation is used to compensate the deviation of tool length. It is command
value of Z-axis plus or minus the tool offset value existing in memory.
G43 and G44 have modal function. When G43 or G44 is programmed, they will be always
effective until G49 command appears to cancel them.
Fig. 4-21
Programming Example:
Shown in Fig. 4 -21
G90 G00 X5 Z0 F300
G43 G0 Z10 H1
NAIKY
Drilling
operation
Cutter
Application
lifting
operation
G73
Intermittent
----
feed
G74
Cutting
feed
clockwise
Rapidly
positioning
cycle
Cutting feed
NAIKY
G76
G80
G81
Cutting
Rapidly
feed
displacement value
positioning
----
----
Cutting
----
feed
G82
Cutting
Dwell
Intermittent
----
feed
G84
G85
Rapidly
Cycle off
Drilling cycle
positioning
feed
G83
----
Rapidly
positioning
Rapidly
positioning
Cutting
Cutting feed
Taping cycle
feed
dwell
Cutting
----
Cutting feed
Boring cycle
Spindle dwell
Rapidly
Boring cycle
feed
G86
Cutting
feed
*G87
positioning
Cutting
feed
*G88
Cutting
feed
G89
Cutting
Dwell
feed
Rapidly
positioning
side
cycle
Cutting feed
Notes: G74, G76, G84, G87, G88 command is not supported for the time being.
Operation 1: positioning of X axis and Y axis---it makes tool locate to the position of hole
NAIKY
machining rapidly.
Operation 2: rapidly feed to point R----tool rapidly feeds from start point to point R.
Operation 3: hole machining----executing hole machining at the mode of cutting feed.
Operation 4: operations at hole bottom----including dwell, exact stop of spindle, tool
movement, and so on.
Operation 5: return to point R----select point R to continue hole machining and safely
moving the cutter.
Operation 6: return to the initial point rapidly----choose the initial point after the hole
machining is completed.
Fig. 4-22
Initial Plane
Initial plane is a plane specified for a safe start of machining. The distance between initial
plane and workpiece plane can be set within the safe limit.
Point R Plane
Point R plane is also named R REFER plane, it is the critical plane on which tool declines
from executing G00 (the rapid moving speed) to executing GXX (the cutting workpiece speed).
The distance from workpiece surface mainly takes workpiece surface dimension diversification
into consideration. Normally the distance ranges from 2~5 mm.
NAIKY
Data Form
Data of Address R and Address Z in canned cycle command is specified by increment mode
(G91), R indicates the distance from initial point to point R, and Z indicates the distance from
point R to point Z on the hole bottom plane(refer to the following Fig. 4 -23 )
Fig. 4-23
Canned Cycle
NAIKY
Z_: the position of point Z of hole bottom plane (absolute programming); the distance from
point R to point Z of hole bottom plane (incremental programming)
R_: the position of point R (absolute programming); the distance from the initial point to
point R (incremental programming)
Q_: the cutting depth for each time increment and positive
P_: the dwell time at the hole bottom, with the same time unit with P in G04 (ms), with no
decimal point.
F_: feed speed, this command is modal, even if cancel the canned cycle, it is still effective
at the subsequent machining.
K_: number of repeat times, default K1. K (non-modal command) is effective only within
the block where it is specified. Under G91 mode, with one program block, this parameter can
implement the machining of several isometric holes distributed in one straight line. Under G90
mode, this parameter can specify the repeated machining times on the same position.
Command of hole machining mode, with command of Z, R, Q, and P, are all modal. They
will remain in effect until hole machining mode is cancelled. So these commands only need to be
specified at the beginning of the program, it is unnecessary to specify again in following
consecutive machining; if there is only a certain hole machining data changed (such as: hole
depth), you only need to modify this data.
G80 command is used to cancel hole machining mode; if any G code of Group 01
(G00/G01/G02/G03) appears in the program block, the hole machining mode will be
automatically cancelled. In other words, in the aspect of canceling canned cycle, G80 has the
same function with any G code of Group 01.
NAIKY
R_: the position of point R (absolute programming); the distance from the initial point to
point R (incremental programming)
Q_: the cutting depth for each time (incremental and positive, minus mark will be ignore
F_: feedrate, this command is modal, even if cancel canned cycle, it is still effective at the
subsequent machining.
K_: number of repeat times
Hole-machining process is shown in Fig. 4 -24 . Intermittent feeding along Z-axis makes it
easy to break and remove the chips from the hole. Q specifies each time cutting depth, and the
retraction is set by parameter (G73_G83 retraction).
G98
G99
(X, Y)
Initial point
Point R
Q
Point R
Q
: Parameter setting
Point P
D w ell p (s)
Fig. 4-24
Point Z
: Parameter setting
D w ell p (s)
Description:
1. Move tool rapidly to the specified hole position (X, Y);
2. Locate tool to the appointed point R;
3. Drill down Q depth corresponding to the present drilling depth;
4. Retract upward distance (set by parameter retract quantity);
5. Repeat above drilling operations until reaching point Z at the hole bottom;
NAIKY
G90
G00 X0 Y0. Z10. Move to the initial point.
G17
G90 G99 Set the coordinate of point R, point Z and
hole 1, cutting rate is 2.0, and drilling speed is 800
G73 X5. Y5. Z-10. R-5. Q2. F800
X25. hole 2
Y25. hole 3
G98 X5. hole 4, and set to return to the initial
point.
X10. Y10. Z-20. hole 5, and set new point Z as -20
G80
M05 drill stops
M02
NAIKY
NAIKY
NAIKY
G98
G99
(X,Y) Initial point
R otate C C W
D w ellP(s)
OSS
R otate C C W
D w ellP(s)
R
Z
OSS
Fig. 4-26
tool
OSS
(Oriented Spindle Stop)
Fig. 4-27
offset
Description:
1. At the beginning of machining, use G00 to move to the hole specified position(X, Y);
2. Use G00 to go down to the specified point R (not include spindle positioning)
3. Use G01 to go down to the point Z at the bottom of the hole, dwell P, and stop the drill
with spindle positioning;
4. Offset the tool distance;
5. Use G00 to rise to the initial point (G98) or point R (G99);
6. Start drill to rotate reverse.
Alarm
Q is a Modal Value requested in G76 cycle we must specify the Q value
carefully because it is also used in G73/G83.
OSS(Oriented Spindle Stop) direction is decided by parameter Oriented Spindle Stop
NAIKY
Form 4-4
Oriented Spindle Stop
G17
G18
G19
+X
+Z
+Y
-X
+Y
+X
-Y
-X
OSS
-Z
-Y
+Z
-Z
Programming Example:
F1200 S600
M03 Start drill to rotate forward.
G90
G00 X0 Y0 Z10 Move to the initial point.
G17
G90 G99 Specify the coordinate of point R , point Z
and hole 1, tools displacement at the bottom of hole is 2.0,
dwell time is 5s, and machining speed is 800.
G76 X5. Y5. Z-10. R-5. Q2. P5000. F800
X25. hole 2
Y25. hole 3
G98 X5. hole 4, and set to return to initial point
X10. Y10. Z-20. hole 5, and specify the new point Z to
be -20.0
G80
M05 Drill stops.
M02
NAIKY
G98
G99
(X, Y) Initial point
Fig. 4-28
NAIKY
G90 G99
Set the coordinate of point R, point Z and hole 1, and
machining rate of drilling is 800
G81 X5. Y5. Z-10. R-5. F800
X25. hole 2
Y25. hole 3
G98 X5. hole 4 and return to initial point
X10. Y10. Z-20. 'hole 5, and set new point Z to be 20
G80
M02
NAIKY
G98
G99
(X, Y) Initial point
D w ellP(s)
Fig. 4-29
D w ellP(s)
Description:
1. At the beginning of the machining, use G00 to move to the specified position (X, Y);
2. Use G00 to go down to the specified point R;
3. Use G01 to go down to point Z at the bottom of the hole;
4. Dwell P(s);
5. Use G00 to rise to the initial point (G98) or point R (G99)
Programming Example:
F1200. S600
G90
G00 X0. Y0. Z10. Move to the initial point.
G17
M03 Drill start to rotate forward
G90 G99 Set the coordinate of point R, point Z and
hole 1, dwell time is 2 s, and drilling speed is 800
G82 X5. Y5. Z-10. R-5. P2000. F800
X25. hole 2
Y25. hole 3
G98 X5.hole 4, and set to return to the initial point.
G80
M05 Drill stops.
NAIKY
M02
NAIKY
G98
G99
(X, Y) Initial point
Point P
Point R
: parameter setting
D w ellP(s)
Point Z
Fig. 4-30
Point Z
: parameter setting
D w ellP(s)
Description:
1. At the beginning of the machining, use G00 to move to the specified hole position (X, Y);
2. Use G00 to go down to the specified point R;
3. Use G01 to drill down Q distance corresponding to the present depth;
4. Use G00 to rise point R;
5. Use G00 to go down the depth which is higher than the present drilling position;
6. Use G01 to drill down Q distance corresponding to the present depth;
7. Use G00 to rise to point R of workpiece surface;
8. Repeat above drilling operations until reaching point Z at the bottom of the hole;
9. Use G00 to rise to the initial point (G98) or point R (G99).
Programming Example:
F1200. S600
M03 Drill starts to rotate forward
NAIKY
G90
G00 X0. Y0. Z10. Move to the initial point
G17
G90 G99 Specify the coordinate of point R, point Z and
hole 1, each time cutting rate is 3.0, cutting speed is 800
G83 X5. Y5. Z-10. R-5. Q3. F800
X25. hole 2
Y25. hole 3
G98 X5. hole 4, and set to return to the initial point
G80
M05
Drill stops
M02
NAIKY
G98
G99
(X,Y) Initial point
(X,Y)
Initial point
NAIKY
M02
G98
G99
(X, Y) Initial point
R
Z
Fig. 4-32
Description:
1. At the beginning of the machining, use G00 to move to the hole position (X, Y);
2. Use G00 to go down to the specified point R;
3. Use G01 to go down to the point Z at the bottom of the hole;
4. Use G01 to rise to point R.
5. Use G00 to rise to initial point (G98) or point R (G99)
Programming Example:
F1200. S600
NAIKY
G90
G00 X0. Y0. Z10. Move to the initial point
G17
M03 Start drill to rotate forward
G90 G99 Specify the coordinates of point R, point Z and
hole 1, and the machining speed is 800
G85 X5. Y5. Z-10. R-5. F800
X25. hole 2
Y25. hole 3
G98 X5. hole 4, and set to return to the initial point
G80
M05 Drill stops
M02
NAIKY
G98
G99
(X, Y) Initial point
D rillstartto rotate
R
R
D rillstartto rotate
Z
D rillstops
D rillstops
Fig. 4-33
Description:
1. At the beginning of the machining, use G00 to move to the hole position (X, Y);
2. Use G00 to go down to the specified point R;
3. Use G01 to go down to point Z at the bottom of the hole;
4. Drill stops;
5. Use G00 to rise to initial point (G98) or point R (G99);
6. Drill rotates.
Programming Example:
F1200. S600
G90
G00 X0. Y0. Z10. Move to the initial point
G17
M03 Start drill to rotate CW
G90 G99 Specify the coordinate of point R, point Z and
hole 1, and the drilling speed is 800
G85 X5. Y5. Z-10. R-5. F800
X25. hole 2
Y25. hole 3
G98 X5. hole 4, and set to return to initial point
NAIKY
G80
M05 Srill stops
M02
G98
OSS
Initial point
R otate C W
OSS
D w ellP(s)
R otate C W
Fig. 4-34
Z point
R point
NAIKY
Tool
OSS
(Oriented Spindle Stop)
Fig. 4-35
offset
Description:
1. At the beginning of the machining, use G00 to move to the hole position (X, Y);
2. After OSS stops, offset the tool Q distance in the reverse direction which is specified by
parameter 4020;
3. Use G00 to go down to the specified point R, and offset the tool Q distance;
4. Drill rotates CW;
5. Use G01 to rise to point Z;
6. Offset the tool Q distance in the reverse direction after dwell P;
7. Use G00 to rise to the initial point;
8. Offset the tool Q distance after drill rotates CW.
Alarm
Q is a Modal Value requested in G76 cycle we must specify this Q value
carefully because it is also use in G73/G83.
OSS(Oriented Spindle Stop) direction is decided by parameter No. 4020
Form 4-5
Oriented spindle stop
G17
G18
G19
+X
+Z
+Y
-X
OSS
-Z
-Y
NAIKY
+Y
+X
-Y
-X
+Z
-Z
Programming Example:
F1200. S600
G90
G00 X0. Y0. Z10. Move to the initial point
G17
M03
NAIKY
F_: feed speed, this command is modal, even if cancel the canned cycle, it is still effective
at the subsequent machining.
K_: number of repeated times (repeated movement and drilling, effective under G91
incremental mode).
G98
G99
(X,Y) Initial point
D rill rotate C W
R point
Z point
Z point
D rill stops after dw ell P(s)
Description:
1. At the beginning of the machining, use G00 to move to the hole position (X, Y);
2. Use G00 to go down to the specified point R;
3. Use G01 to go down to point Z at the bottom of the hole;
4. Drill stops after dwell P(s);
5. Use G01 to move to point R;
6. Use G00 to rise to initial point (G98) or point R (G99);
7. Drill rotates CW.
Programming Example:
F1200. S600
G90
G00 X0. Y0. Z10. Move to the initial point
G17
M03 Drill starts to rotate CW
G90 G99 Specify the coordinate of point R, point Z and
hole 1, dwell 2(s), boring speed is 800
NAIKY
G98
G99
(X,Y) Initial point
R point
R point
Z point
Z point
D w ellP(s)
Fig. 4-37
D w ellP(s)
G89 Machining Process
NAIKY
Description:
1. At the beginning of the machining, use G00 to move to the hole position (X, Y);
2. Use G00 to go down to the specified point R;
3. Use G01 to go down to point Z at the bottom of the hole;
4. Dwell time P;
5. Use G01 to rise to point R;
6. Use G00 to rise to initial point (G98) or point R (G99)
Programming Example:
F1200. S600
G90
G00 X0. Y0. Z10. Move to the initial point
G17
M03 Start drill CW
G90 G99m Specify the coordinate of point R, point Z
and hole 1, dwell 2.5(s), machining speed is 800
G89 X5. Y5. Z-10. R-5. P2500 F800
X25. hole 2
Y25. hole 3
G98 X5. hole 4, and set to return to the initial point
G80
M05 Drill stops
M02
NAIKY
instructions (G73-89).
For example:
G81 Z-20 R-5 F100 K0
G34 X10 Y10 I10 J90 K10
Standard canned cycle instructions must be given out before special canned cycle
instructions; when execution of canned cycle instruction has been finished, the standard canned
cycle instruction remains effective until canceled.
For example:
G81 Z-20 R-5 F100 K0 specify the cycle motion
G34 X10 Y10 I10 J90 K10 hole
total 10 holes
X100
previous G34
drilling
along
circle,
If there is no standard canned cycle instruction when executing special canned cycle
instruction, the system will report error.
If executing the instructions as below:
G0 X0 Y0 Z0
G34 X10 Y10 I10 J90 K10
NAIKY
Fig. 4-38
NAIKY
linear direction which has one certain included angle with X-axis, move between the holes by G0
speed.
Fig. 4-39
NAIKY
Fig. 4-40
NAIKY
Fig. 4-42
Canned Cycle
NAIKY
Machining Repeatedly
Take the repeated canned cycle to drill holes shown in Error: Reference source not found
Program List:
N01 G90 X0. Y0. Z100.
N02 G00 X-50. Y51.963 M03 S800
N03 Z20. M08 F4000
N04 G91 G81 X20. Z-18. F4000 R-17. L4
N05 X10. Y-17.321
N06 X-20. L4
N07 X-10. Y-17.321
N08 X20. L5
N09 X10. Y-17.321
N10 X-20. L6
N11 X10. Y-17.321
N12 X20. L5
N13 X-10. Y-17.321
N14 X-20 L4
N15 X10 Y-17.321
N16 X20. L3
N17 G80 M09
N18 G90 G00 Z100.
N19 X0. Y0. M05
N20 M30
NAIKY
Fig. 4-43
Shown in Fig. 4 -43
NAIKY
G03.
Programming Example:
G905 G903 G01 X10 Y20 Z0 F600 Force F (feedrate) to
be 600 mm/min
NAIKY
NAIKY
Programming Example:
M801 Hello; to transfer hello
M802 P131072
M802 P131073
M802 P458752
NAIKY
4.5
by assignment expressions.
No characters of space type are allowed to exist in the expression, such as Space, Tab and
Enter. Whats more, expression must be ended with valid separator.
Meaning
Sin
sine
Cos
cosine
NAIKY
exp
exponent
sqrt
square root
log
natural logarithm
tg
tangent
ctg
cotangent
asin
arcsine
acos
arc cosine
atg
arc tangent
int
integer downward
abs
absolute value
Note:
numbers in the brackets which are behind
sin cos tg ctg asin acos atg represent radian.
For example: sin (5), 5 represents radian.
Application of Expression in Program Instructions:
Instance one: G=1+2; That is G3
Instance two: G00 X3 Y5 Z=5+sin (5+abs (-8)); Assign
5+sin (5+abs (-8)) to Z
Instance three: #1=4+log6
G01 X2 Y=#; Assign 4+log6 to Y
4.6
Comments in Program
Comment in program is applied with single quotation mark:
end-of-line pattern, content behind the single quotation mark does not function.
For example:
NAIKY
G00 X3 Y5
Rapidly move to X3 Y5
The content behind the single quotation mark can only act as comment and will not be
executed when you run the program.
Fig. 4-44
NAIKY
Fig. 4-45
N01 G92 X0 Y0 Z0
N02 G90 G41 G00 X45 Y15 D01 M03 S600 M08 Use absolute
coordinates, radius compensation for cutter, rapidly move to X45,
Y15, spindle rotates forward at 600r/min, and open cool pump.
N03 G17 G02 X45 Y65 I0 J25 F700
Circular interpolation till X45, Y65, radius 25mm,
feed speed 700mm/min.
N04 G01 X135 Y65
linear
interpolation
till
X135,
Y65
NAIKY
Circular
interpolation
Fig. 4-46
N01 G92 X0 Y0 Z0
N02 G91 G41 G00 X40 Y30 D01 M03 S600 M08
Use incremental coordinates, radius compensation
for cutter, rapidly move to X40, Y30, spindle rotates in positive
direction at 600r/min, and open cool pump.
N03 G17 G01 X0 Y70 F800 Linear interpolation till
X135,Y65 feed speed 800mm/min.
N04 G02 X20 Y20 I20 J0 circular interpolation till
X60, Y120, radius 20mm.
N05 G01 X40
direction of X-axis.
N06 Y-50
of Y-axis.
linear
interpolation
40mm
in
positive
N07 X40
direction of X-axis.
linear
interpolation
40mm
in
positive
NAIKY
N08 Y50
linear
direction of Y-axis.
interpolate
N09 X70
linear
direction of X-axis.
interpolation
N10 Y-40
direction of Y-axis.
linear
interpolate
50mm
70mm
40mm
in
positive
in
positive
in
reverse
interpolate
120mm
along
NAIKY
65
R 5
15
65
15
80
28
Fig. 4-47
rapidly
move
to
X65,
Y65,
and
start
tapping.
N07 G80
NAIKY
Fig. 4 -49
(requirement: feed
Subprogram 9001
N120 X50
N130 Y-50
N140 X-60
NAIKY
Y
R 14
60
10
60
10
14
Workpiece Machining
Sketch
Example 6 Programming for the Workpiece Shown in Fig. 4 -49
N01 G92 X10 Y0 Z0 Set workpiece Coordinates system
N02 G91 G00 X-10 D01 M03 S1000 M08
Use incremental coordinates, and spindle rotates
forward at 1000r/min, and opens the cool pump.
N03 G00 Y14 Z-16 Rapidly move to X0 Y14 Z-16.
N04 G02 X0 Y0 I14 J0 F600 Start circle interpolation,
feed speed 600mm/min.
N05 G01 X1 Z1 F600
Linear interpolation, advance 1mm
along both X-axis and Z-axis.
N06 G02 X0 Y0 I13 J0 F600
N07 G01 X1 Z1 F600
N08 G02 X0 Y0 I12 J0 F600
N09 G01 X1 Z1 F600
N10 G02 X0 Y0 I11 J0 F600
N11 G01 X1 Z1 F600
N12 G02 X0 Y0 I10 J0 F600
NAIKY
4.8
G Command Appendix
Form of G Command Appendix is show as below:
Name
command
Name
command
G00
G65
Subprogram call
G01
Linear
G68
Rotation function on
interpolation,
NAIKY
cutting feed
G02
Circular
interpolation
G69
interpolation
G70
Input in inch
(clockwise)
G03
Circular
(counterclockwise)
G04
Dwell time
G71
G17
XY plane selection
G73
Input in mm
High
speed
reciprocating
ZX plane selection
G74
G19
YZ plane selection
G76
G20
Input in inch
G80
G81
G82
G21
Input in mm
G28
Return
to
reference
position
G34
bottom
G83
G35
G84
Tapping cycle
G36
G85
Drilling cycle
G37
G86
G40
Cancel
radius
G87
radius
G88
Boring cycle
cutter
compensation
G41
Left
cutter
compensation
NAIKY
G42
Right
cutter
radius
G89
compensation
G43
Tool
length
positive
G90
negative
G91
length
G92
Setting of WCS
compensation
G44
Tool
length
compensation
G49
Cancel
tool
compensation
G50
Scaling off
G98
G51
Scaling on
G99
Return to point R
G50.1
G903
G51.1
Mirror image on
G904
G53
MCS selection
G905
G54
WCS 1 selection
G906
Synchronization command
G55
WCS 2 selection
G907
G56
WCS 3 selection
G908
G57
WCS 4 selection
G921
G58
WCS 5 selection
G922
G59
WCS 6 selection
G992
NAIKY
5 Naming Parameters
For common user, the machining workpiece operations and other basic operations provided
by the system can meet their demands, such as: tool calibration, center calibration, canned cycle,
etc.
While for the advanced user who needs to modify some operating details, write operating
programs and customize canned cycles, the system provides a group of fast and convenient
naming parameters with them. With these parameters, it is not only convenient for user to
modify, write operation programs in public.dat file, and customize the content of canned cycle to
meet the machining demand, but also convenient for writing programs based on the program edit
operation interface.
Example 1, Use the naming parameter to compile a subprogram of tool coolant and tool
change, programming as below:
O1000
change.
M901 H=#COOLANT_START_PORT P1
G04 P10
IF(#ENABLE_CTP)
Y=#CTP_POSY Z=#CTP_POSZ
G00 G90 Z10
G53
G00
G90
X=#CTP_POS
X
move to the position of tool change.
change
M05
M17
Example 2, Use the naming parameter to modify the content of G86 canned cycle
(parameter with retraction existed; the canned cycle G86 provided by system hasnt been
specified its retraction)
O686
#FC50=#CANNEDCYCLE_BACK
NAIKY
O786
G00 X=#FC1 Y=#FC2
G90 G00 Z=#FC4
G90 G01 Z=#FC4-ABS (#FC5) F=#FC7
G65 P886 L=INT(ABS(#FC4-#FC3 /ABS #FC5 -1
G90 G01 Z=#FC3 F=#FC7
M05
G90 G00 Z=#FC4
IF (!#FC12)G90 G00 Z=#FC14
M03
IF (#FC13) G91
M17
O886
G91 G00 Z=#FC50
G91 G00 Z=-#FC50
G91 G01 Z=-ABS (#FC5) F=#FC7
M17
The variables defined in the canned cycle and their meanings
X--#FC1----X-coordinate of the hole center
Y--#FC2---- Y-coordinate of the hole center
Z--#FC3----workpiece coordinate of Z plane ( hole depth, negative)
R--#FC4---- workpiece coordinate of R plane (changing from the rapid traverse speed to the
cutting speed in R plane, >0)
Q--#FC5---- each time cutting depth (incremental and positive); it represents offset value in
NAIKY
G76/G87
G99/G98--#FC12---G99->1; G98->0
G90/G91--#FC13---G91->1; G90->0
Z0--#FC14---Initial point height
The list of naming parameters is shown blow:
No.
01
Parameter
CURMACHPOS.X
Parameter Name
Mechanical coordinate of
Type
DOUBLE
CURMACHPOS.Y
Mechanical coordinate of
CURMACHPOS.Z
Mechanical coordinate of
DOUBLE
CURWORKPOS.X
Workpiece coordinate of
DOUBLE
CURWORKPOS.Y
Workpiece coordinate of
DOUBLE
CURWORKPOS.Z
Workpiece coordinate of
Workpiece coordinate of
current point (X axis)
DOUBLE
Mechanical coordinate of
current point (Z axis)
Mechanical coordinate of
current point (Y axis)
Mechanical coordinate of
current point (X axis)
Remarks
Workpiece coordinate of
current point (Y axis)
DOUBLE
Workpiece coordinate of
current point (Z axis)
07
INPORTMAP
INT
08
OUTPORTMAP
INT
09
SAFEHEIGHT
Safe height
DOUBLE
10
ISYREVAXIS
BOOL
NAIKY
axis
11
WPREVDIAM
Diameter of swivel
DOUBLE
workpiece
12
UNIT.YR
Programming unit of
INT
swivel axis
0:angle(unit: radian)
1:distance between the two
point on the surface of swivel
workpiece (unit: millimeter)
13
AUTOSTOPSPINDL
BOOL
14
SPINDLE_DELAY
DOUBLE
starts/stops
15
16
MOBICALI_THICK
NESS
FIXEDCALI_POS.X
DOUBLE
DOUBLE
calibration clump(X-axis)
17
FIXEDCALI_POS.Y
DOUBLE
calibration clump(Y-axis)
18
FIXEDCALI_POS.Z
DOUBLE
calibration clump(Z-axis)
19
ENABLE_CTP
BOOL
NAIKY
a fixed point
20
CTP_POS.X
point (X axis
21
CTP_POS.Y
point (Y axis
22
CTP_POS.Z
BKREF_SW1.X
Mechanical coordinate of a
fixed point Y axis
DOUBLE
point Z axis
23
Mechanical coordinate of a
Mechanical coordinate of a
fixed point Z axis
INT
coarse positioning
switch
24
BKREF_SW1.Y
INT
coarse positioning
switch
25
BKREF_SW1.Z
INT
coarse positioning
switch
26
BKREF_SW2.X
INT
BKREF_SW2.Y
BKREF_SW2.Z
BKREF_F1.X
INT
DOUBLE
NAIKY
30
BKREF_F1.Y
DOUBLE
positioning phase(Y-axis)
31
BKREF_F1.Z
DOUBLE
positioning phase(Z-axis)
32
BKREF_F1_DIR.X
INT
positioning phase(X-axis)
33
BKREF_F1_DIR.Y
INT
positioning phase(Y-axis)
34
BKREF_F1_DIR.Z
INT
positioning phase(Z-axis)
35
BKREF_F2.X
DOUBLE
36
BKREF_F2.Y
DOUBLE
37
BKREF_F2.Z
DOUBLE
38
BKREF_F2_DIR.X
INT
NAIKY
BKREF_F2_DIR.Y
INT
40
BKREF_F2_DIR.Z
INT
41
BKREF_BACK.X
DOUBLE
axis
42
BKREF_BACK.Y
DOUBLE
axis
43
BKREF_BACK.Z
DOUBLE
axis
44
FIXEDCALI_SW
INT
46
MOBICALI_SW
CALIBRATION_SW
INT
signal
signal
INT
NAIKY
47
SPINDLE_START_P
INT
ORT
48
COOLANT_START_
PORT
INT
49
DD_BKREF_DELTA
MO difference between
DOUBLE
double-driving shaft
FIXEDCYCLE_BAC
DOUBLE
51
FIXEDCYCLE_OSS
INT
stops
plane (G17)
0/1:(G17:+X/-X)
2/3:(G17:+Y/-Y)
52
FIXEDCALI_REC
Z-axis workpiece
DOUBLE
calibration
NAIKY
spindle
rotates
CCW
(only
one
direction
O204
M901 H2 P1
G04 P5
M17 spindle stops rotating
O205
M901 H2 P0
G04 P5
M17
NAIKY
coolant on
O208
M901 H24 P1
G04 P5
M17
coolant off
O209
M901 H24 P0
G04 P5
M17
NAIKY
7 PLT Support
At present, the system supports PLT instructions as below:
//PU
Pen Up
Pen Down
// PD [ X, Y [,...]] [;]
//PA
Plot Absolute
AA X, Y, qc [, qd] [;]
//AR
//
AR X, Y, qc [, qd] [;]
//CI
Circle
// CI r [, qd] [;]
//EA
// EA X, Y [;]
//ER
// ER X, Y [;]
//EW
Edge Wedge
Notes:
PLT format has strong expansibility and different product has different
instructions. If you meet unidentifiable instructions, please contact with us as soon as
NAIKY
8 DXF Support
At present, the system supports Entities as below:
LINE
LWPOLYLINE
ARC
CIRCLE
ELLIPSE
SPLINE
Prompt:
Save the figure drawn with Auto CAD as DXF format, perform Open and
Load and Simulation Mode, the figure shown in track window is what you have
drawn with Auto CAD