NcStudio Programming Manual 6th Edition
NcStudio Programming Manual 6th Edition
6th Edition
The information contained in this manual is constantly being updated. You can login the official website of
Weihong Company www.en.weihong.com.cn to download the latest PDF edition for free.
Specialized Concentrated Focused
Preface
This manual introduces about CNC programming and the commands involved in programming. You can
learn better about NcStudio programming system and prepare for programming after reading this
manual.
With four chapters, this manual can be divided into three parts, as follows:
1) Part 1: chapter 1.This chapter gives general description to CNC programming and CNC machine
tool.
2) Part 2: chapter 2 and 3. This part gives introduction to programming structure and programming
command system.
3) Part 3: chapter 4. This part gives introduction to other info about programming system.
Revision History
You can refer to the following table for the revision records of each edition.
Contact Us
You can contact us by the following info for technical support and pre-sales / after-sales service:
Company Name: Weihong Electronic Technology Co., Ltd.
Headquarters Address: No.1590, Huhang Rd., Fengxian, Shanghai, PRC 201400
Tel: +86-21-33587550
Fax: +86-21-33587519
Website: http://en.weihong.com.cn
Preface「I」
Specialized Concentrated Focused
Precautions
Precautions can be divided into caution and warning according to the degree of possible loss or injury in
case of negligence or omission of precautions stipulated in this manual.
CAUTION
: general info, mainly for informing, such as supplementary commands and
conditions to enable a function. In case of negligence or omission of this kind of precautions, you may
not activate a function. Note that in some circumstances, negligence or omission of this kind of
precautions could cause physical injury or machine damage.
WARNING
: warning info requiring special attention. In case of negligence or omission of this
kind of precautions, you may suffer physical injury, or even death, machine damage or other losses.
「II」Preface
Specialized Concentrated Focused
Table of Contents
1 CNC Programming and Machine Tool ..................................................................................... 1
1.1 An Overview of CNC Programming ........................................................................................ 1
1.1.1 Definition of Machine Program ......................................................................................................... 1
1.1.2 Creation of Machine Program ............................................................................................................ 1
1.2 An Overview of CNC Machine Tool ........................................................................................ 2
1.2.1 Machine Tool Coordinate Axes .......................................................................................................... 2
1.2.2 Machine Origin(OM) and Machine Reference Point(Om) of Machine Coordinate System (MCS)..... 3
Table of Contents「III」
Specialized Concentrated Focused
「IV」Table of Contents
Specialized Concentrated Focused
Index of Commands
G00: Rapid Positioning ...........................................................................................................................20
G01: Linear Interpolation ........................................................................................................................20
G02/G03: Circular Interpolation ..............................................................................................................20
G04: Dwell ..............................................................................................................................................23
G17/G18/G19:Selection of Coordinate Plane .........................................................................................14
G20/G21 OR G70/G71: Input in Inch/Metric ...........................................................................................14
G28: Auto Back to Reference Point ........................................................................................................10
G34: Circle Drilling Cycle........................................................................................................................47
G35: Line Drilling Cycle ..........................................................................................................................48
G36: Arc Drilling Cycle ...........................................................................................................................49
G37: Chessboard Drilling Cycle .............................................................................................................49
G40/G41/G42: Tool Radius Compensation ............................................................................................24
G43/G44/G49: Tool Length Compensation.............................................................................................26
G50.1/G51.1: Mirroring Function ............................................................................................................19
G50/G51: Scaling Function ....................................................................................................................15
G53: Machine Coordinate System ..........................................................................................................14
G54~G59: Selection of WCS ..................................................................................................................12
G65: Subprogram Call ............................................................................................................................52
G68/G69:Rotation Function ....................................................................................................................16
G73: High-speed Peck Drilling Cycle for Deep Holes .............................................................................31
G74: Left Tapping Cycle .........................................................................................................................32
G76: Fine Boring Cycle ..........................................................................................................................33
G81: Drilling Cycle ..................................................................................................................................35
G82: Drilling Cycle of Dwell at the Bottom of Hole .................................................................................36
G83: Peck Drilling Cycle for Deep Holes ................................................................................................37
G84: Tapping Cycle ................................................................................................................................39
G85: Drilling Cycle ..................................................................................................................................40
G86: High-speed Drilling Cycle ..............................................................................................................41
G87: Fine Back Boring Cycle .................................................................................................................42
G88: Boring Cycle ..................................................................................................................................44
G89: Boring Cycle of Dwell at the Bottom of Hole ..................................................................................45
G90: Absolute Programming ....................................................................................................................8
Index of Commands「V」
Specialized Concentrated Focused
「VI」Index of Commands
Specialized Concentrated Focused
+Y +B
+Z
+X+Y+Z
+Y
+X
+X
+C +A
+Z +A+B
+Y
+C
+X
+Z
column vertical mill, if you face the spindle and looks in the column direction, right moving direction is the
positive direction of X-axis (+X);
Y: Y-axis, X-axis and Z-axis together constitute a coordinate system abiding by the Right-hand Rule.
Om
OM
B O
Address
Description (Basic (Optional
Symbol
Function) Function)
D Tool radius offset
F Feedrate
G Preparatory commands
H Tool length offset
I X-axis coordinate of arc center
J Y -xis coordinate of arc center
K Z-axis coordinate of arc center
L Repetition count
M Miscellaneous Function
N Sequence no. or block no.
O Program no.
Dwell time in milliseconds, subprogram No. call,
P custom macro No. call, block number in main
program
Depth of peck in fixed cycles
Q
Shift amount in fixed cycle
Retract point in fixed cycles
R
Arc radius designation
B O
Address
Description (Basic (Optional
Symbol
Function) Function)
S Spindle speed
T Tool function
X X-axis coordinate
Y Y-axis coordinate
Z Z-axis coordinate
Program Block
CAUTION
Even though the spindle is off, the value of S remains.
3.2 Feedrate F
Format: F_
Description:
Command F indicates the synthetic feed speed of tool relative to the workpiece being machined. Its unit
is mm/min.
With the help of feedrate override knob on the operation panel, F can be adjusted between feedrate
percent 0% ~ 120%.
Command F functions differently when collocated with different commands:
1) Command G00 specifies the rapid traverse speed, modal for the current machining procedure.
2) Command G01~G03 specify the feed speed, modal for the current machining procedure.
T command calls in tool compensation value (including length and radius) from the tool compensation
register. Although T command is a non-modal command, the value of tool compensation called is
effective until a new value is called for the next tool change.
M Command Meaning
M00 Compulsory program stop
M01 Optional program stop
M02 End of the program
M03 Spindle on (CW rotation)
M04 Spindle on (CCW rotation)
M05 Spindle stop
M08 Coolant on
M09 Coolant off
M10 Spindle clamp
M11 Spindle unclamp
M17 Subprogram return
M30 End of program, and return to program top
M98 Subprogram call
End of subprogram, and return to the beginning of main program for continuous
M99
execution
M801 String info transmission between modules
M802 Integer info transmission between modules
M901 Directly control output port
M902 Directly set REF.
M903 Change current tool No.
coordinate plane, tool compensation, coordinate offset, subprogram call, dwell, and so on.
G function has non-modal and modal forms:
1) Non-modal G function: only effective in the specified program block, and cancelled at the end of
program block.
2) Modal G function: a group of G functions that can be cancelled mutually; a G function remains
effective until another G function in the same group appears to cancel it.
45 2
Programming with G90 Programming with G91
N X Y N X Y
25 3
N01 X20 Y15 N01 X20 Y15
15 1 N02 X40 Y45 N02 X20 Y30
N03 X60 Y25 N03 X20 Y-20
20 40 60 X
Selecting the right programming mode can simplify the programming. If the drawing dimension is given
based on a fixed datum, it is better to adopt absolute programming mode; if the drawing dimension is
given on the basis of space distance between contour apexes, it is better to adopt incremental
programming mode.
30.0
X
Programming Example:
Programming with command G92 to create a WCS is as shown in Fig. 3-2.
The execution of the program block only creates a WCS without tool movement.
As a non-modal command, G92 is usually put in the first block of a machine program to create a WCS
and synchronously offset origins of other WCSs, which can be used to adjust the length of tool holder.
Method one:
G992 X_Y_Z_
1. Delete command M30 in the processing file.
2. Add the following contents at the beginning of the processing file:
#1=30 ’X offset value
#2=40 ’Y offset value
#3=30 ’machining quantity along X axis
#4=30 ’machining quantity along Y axis
G65 P3455 L=#4
G00 G90 X=-#1*#3 Y=-#2*#4
G992 X0 Y0
M30
O3455
G65 P3456 L=#3
G00 G90 X=-#1*#3 Y=#2
G906
G992 X0 Y0
M17
O3456
3. Add the following contents at the end of the processing file:
G00 G90 X=#1
G906
G992 X0
M17
Method two:
G992 I_J_K
1. Delete command M30 in the processing file.
2. Add the following contents at the beginning of the processing file:
#1=30 ’X offset value
#2=40 ’Y offset value
#3=30 ’machining quantity along X axis
#4=30 ’machining quantity along Y axis
G65 P3455 L=#4
G00 G90 X=-#1*#3 Y=-#2*#4
G992 I=-#1*#3 J=-#2*#4
M30
O3455
G65 P3456 L=#3
G00 G90 X=-#1*#3 Y=#2
G906
G992 I=-#1*#3 J=#2
M17
O3456
3. Add the following contents at the end of the processing file:
G00 G90 X=#1
G906
G992 I=#1
M17
As shown above, array machining can be realized through programming with command G992. The first
4 parameters, i.e., #1=30, #2=40, #3=30, and #4=30, can be adjusted and customized.
CAUTION
1) G992 X_Y_Z_ sets the current point as a specified point in the new coordinate system, while G992 I_J_K_
translates the original coordinate system a specified distance to create a new coordinate system.
Comparatively speaking, G992 I_J_K_ is more efficient because it avoids the redundant rapid traverse
command produced by origin offset, while G992 X_Y_Z_ sets an origin after backing to the original origin.
2) During array machining, command G92 should be deleted manually because it is not supported by the
system.
WCS G54
Z
WCS G59
Origin of
WCS G54
Y
Machine
Origin Origin of Y
Workpiece WCS G59
X Origin Offset
X
Fig. 3-4 Selection of Workpiece Coordinate System (G54~G59)
The origin value of these 6 WCSs in the MCS (offset value of workpiece origin) can be set in the [Param]
setting interface. The setting value will be saved automatically by the controller.
CAUTION
1) Once a WCS is confirmed, the following command values in absolute programming are all relative to the
origin of WCS.
2) G54~G59 are modal functions, which can be mutually cancelled. G54 is the default.
Programming Example:
As shown in Fig. 3-5, programming based on WCS to make the tool move from current point to point A,
and then to point B.
30 B
Y
40 A
Current Point→A→B
30 X N02 G59
G59 O
N03 G00 X30 Y30
...
30 X Machine Origin
G59 O
CAUTION
Set the coordinate value of each WCS origin in the MCS before using this group of commands shown in Fig. 3-5.
G17
G19
X
G18
CAUTION
When using the scaling command, pay attention to the following points.
1) Don’t set the scale factor as 0, otherwise an alarm will appear;
2) Scaling function has no effect on compensation value;
3) When executing tool radius compensation C, the scaling command G51 can’t be specified;
4) A canned cycle cannot be executed together with the scaling of Z-axis. If so, an alarm will appear;
5) Command G28, G29, G53, and G92 cannot be used in the execution process of scaling function, otherwise
the outcome may contain an error;
6) If there is G51 in the program without G50, the scaling function will be automatically closed at the end of the
program.
Programming Example:
(50,150)
Program Path before scaling
04
N
Programming Path after scaling
N03
Programming example 1:
G17G90 X0Y0Z0
G65P9999L1
G68 X0Y0R-90 ’rotating 90 degrees clockwise around the center of (0, 0)
G65P9999L1
G69 ’rotation off
M30
(100,50)
Before Rotation
(100,0)
(0,0)
X
After Rotation
(0,-100) (-50,-100)
Programming example 2:
G68 X_Y_Z_R_ ’………A
…
G68 X_Y_Z_R_ ’………B
…
G68 X_Y_Z_R_ ’………C
…
G69 ’………C’
G69 ’………B’
G69 ’………A’
Rotation that appears earlier will influence the subsequent rotation command. The subsequent rotation
center is not the one in the machine program, but the position after transformation due to the previous
rotation.
The function of G69 is to cancel the previous rotation command. In the program mentioned above, line C’
cancels G68 of line C, line B’ G68 of line B, and line A’ G68 of line A. If G69 is not used, all rotation
commands will be automatically cancelled at the end of current machining.
The following example contains the nesting of rotation command and scaling command.
G90 G0 X0 Y0 Z0
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
In a program block, a circular arc path can pass across over two quadrants, or be programmed into a
complete circle.
G02 and G03 are valid until replaced by other G commands (G00, G01 …).
Circular programming can be radius programming or centre programming. The function word of radius is
R. There are two types of arcs with the same start point, end point, radius and rotary direction. When R is
negative, an arc is larger than a semicircle (i.e. a major arc); when positive, an arc is smaller than or
equal to a semicircle (i.e. a semicircle or a minor arc). Circle center is specified by the function words I, J,
K in center programming. When I, J, K incremental mode is true, the coordinates of circle center is
relative to the start point of the arc, otherwise, relative to the coordinates of workpiece origin. (If the
coordinates of circle center is marked on a drawing, begin programming directly without calculation). X-Y
plane is the default plane in circular programming, or you can specify a circular interpolation plane via
G17, G18 or G19.
Helical interpolation is available by specifying another axis in a linear command at the same time to
move synchronously with circular interpolation.
CAUTION
1) When R>0, the radius angle is smaller than 180°; When R<0, the radius angle is larger than 180°.
2) Radius programming cannot be used for a whole circle programming, and the circle must be divided into two
parts in radius programming.
Programming Example 1:
Clockwise and counterclockwise circular interpolation, as shown in Fig. 3-10.
Y Y
10
R
X X
0 10 20 0 10 20
(a) Clockwise Circular Interpolation (b) Counterclockwise Circular Interpolation
Programming Example 2:
A full circle interpolation is as shown in Fig. 3-11.
X
0 20 40
Solution 1: Solution 2:
G00 X0 Y0 G00 X0 Y0
G02 X0 Y0 I20 J0 F300 G02 X20 Y-20 R-20 F300
G02 X0 Y0 R20 F300
Programming Example 3:
Helical programming in G03 is as shown in Fig. 3-12.
End Point
10
0 Y
30
30
Start Point
G04: Dwell
Format: G04 P_
Description:
P_: the dwell time, with unit “ms”.
G04 can be used in the following situations:
1) In machining a corner, the dwell command can be used to guarantee a sharp corner.
2) In machining a not through hole, when the tool reaches the appointed depth, G04 can be used to
stop tool feed. After the spindle rotates more than one circle, execute tool retract to get a smooth
hole bottom.
3) After boring a hole, the spindle should be stopped and dwell for 1~3s until totally stopped before tool
retract in order to avoid thread scratches and ensure the smoothness of workpiece.
4) In transverse turning, G04 can be used before retracting tool to make sure the spindle rotates at
least one circle.
5) In chamfering or centering on a lathe, the dwell command, spindle on and tool change, etc. can be
used to make sure the smoothness of chamfer surface and conical surface of center hole.
The dwell command takes effect after the motion of last program block ends (the speed is 0). G04 dwells
for the specified time, only effective in the program block containing it.
Inserting G04 between two program blocks can interrupt machining for the specified time. For example,
in free cutting, and dwell time is specified by P function word with unit as “ms”.
Programming Example:
G04 P1000 ’dwell for 1000ms
Programming Example:
The schematic diagram od tool radius compensation is as shown in Fig. 3-14.
Tool, G40
G41
G42
X,Y(10,10)
Center
G17 G01 G41 (G42) X_ Y_ F_ D_ ’executes linear interpolation and tool radius compensation
G02 X_ Y_ I_ J_ ’circular interpolation
CAUTION
During compensation or when compensation is canceled, the current tool moving direction cannot be opposite to
the previous one.
For example:
10
Current Tool
Moving Direction
0 10 20
X
Fig. 3-15 Schematic Diagram of Tool Moving Direction
Program 1 Program 2
G92 G0 X0 Y0 G92 G0 X0 Y0
G0 G41 X10 Y10 D01 F1000 G0 G41 X10 Y10 D01 F1000
G1 X20 Y10 G1 X20 Y10
0 X-axis
10
omitted, it indicates setting tool offset value for the current tool.
Programming Example: (the tool lifting program in Public.dat)
M802 P196609
M801 MSG"|D| wait for tool calibration signal"
G904 FZ-60 PZ=#CALIBRATION_SW LZ1
M801 MSG""
M802 P196608
G903 G00 G91 Z5
G923 z0
G906
G923 Z = #CURWORKPOS.Z-#MOBICALI_THICKNESS–5
CAUTION
Command G76, G87, and G88 are not supported currently.
Operation 1
Initial Point
Operation 2 Operation 6
Point R
Operation 5
Operation 3
Rapid Traverse
Operation 4
Feed
Initial Plane
Initial plane is a plane specified for a safe plunge. The distance between initial plane and workpiece
surface can be set within the safe limit.
Point R Plane
Point R plane is also named R REFER plane; it is a plane where the tool moves at a speed from rapid
traverse rate (G00) to cutting workpiece speed (GXX). The distance between workpiece surface and
point R, generally within 2~5mm, varies with the dimension of workpiece surface.
R
R
Point R Point R
Z=0
Z
Z
Point Z Point Z
Point R Point R
Q
Q
δ
δ
Q
Q
δ
δ
Q
Point Z Point Z
δ: set by parameter Pause for P δ: set by parameter Pause for P
Programming Example:
F1200 S600
M03 ’spindle CW on
G90
G00 X0 Y0 Z10 ’moving to the initial point
G17
G90 G99
’Setting coordinates of point R, point Z and hole 1, with cutting depth per time as 2.0,
and drilling speed as 800
G73 X5 Y5 Z-10 R-5 Q2 F800
X25 ’hole 2
Y25 ’hole 3
G98 X5 ’hole 4, and setting to return to the initial point
X10 Y10 Z-20 ’hole 5, and setting a new point Z as -20
G80
M05 ’spindle stop
M02
G98 G99
R R
Spindle CCW after P Spindle CCW after P
Z Z
Spindle CW after P Spindle CW after P
G98 G99
Tool
OSS (Oriented Spindle Stop) direction is specified by
parameter “Oriented Spindle Stop”:
Oriented Spindle
G17 G18 G19
Stop (OSS)
0 +X +Z +Y
Oriented Spindle 1 -X -Z -Y
Stop(OSS)
2 +Y +X +Z
3 -Y -X -Z
Offset Q
WARNING
As a modal value requested in G76 cycle, Q must be specified carefully, because it is also used in G73/G83.
Programming Example:
F1200 S600
M03 ’spindle CW on
G90
G98 G99
R R
Z Z
4) The tool retracts to the initial point (G98) or point R (G99) at G00 speed.
Programming Example:
F1200 S600
G90
G00 X0 Y0 Z10 ’moving to the initial point
G17
G90 G99
’Setting the coordinates of point R, point Z and hole 1, with machining speed as 800
G81 X5Y5 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 setting the new point Z as -20
G80
M02
G98 G99
R R
Z Z
Pause for P Pause for P
Process Description:
1) The tool moves to the specified hole position (X, Y) at G00 speed;
G98 G99
Point R Point R
Q
Q
δ
δ
Q
Q
δ
δ
Q
Q
Point Z Point Z
δ: set by parameter Pause for P δ: set by parameter Pause for P
Process Description:
1) The tool moves to the specified hole position (X, Y) at G00 speed;
2) The tool moves to the specified point R at G00 speed;
3) The tool moves down cutting depth Q with respect to current depth at G01 speed;
4) The tool retracts to the R plane at G00 speed;
5) The tool moves down until distance (specified by parameter “G73_G83 retract amount”) away from
current drill depth at G00 speed;
6) The tool goes down downs cutting depth Q with respect to current drill depth;
7) The tool retracts to the R plane at G00 speed;
8) The tool repeats above drilling operations until reaching point Z at the bottom of the hole;
9) The tool retracts to the initial point (G98) or point R (G99) at G00 speed.
Programming Example:
F1200 S600
M03 ’spindle CW on
G90
G00 X0 Y0 Z10 ’moving to the initial point
G17
G90 G99
’Specifying the coordinates of point R, point Z and hole 1, with cutting depth as 3.0, cutting speed
as 800
G83 X5 Y5 Z-10 R-5 Q3 F800
X25 ’hole 2
Y25 ’hole 3
G98 X5 ’hole 4, and setting to return to the initial point
G80
M05 ’spindle stop
M02
G98 G99
R R
Spindle CW after P Spindle CW after P
Z Z
Spindle CCW after P Spindle CCW after P
Process Description:
1) The tool moves to the specified hole position (X, Y) at G00 speed;
2) The tool moves down to the specified point R at G00 speed;
3) The tool taps down to point Z at the bottom of the hole at G01 speed;
4) The spindle CCW after P;
5) The tool retracts to point R at G01 speed;
6) The spindle rotates CW after P;
7) The tool retracts to the initial point (G98) or point R (G99) at G00 speed.
Programming Example:
F1200 S600
G90
G00 X0 Y0 Z10 ’moving to the initial point
G17
M03 ’spindle CW on
G90 G99
’Specifying the coordinates of point R, point Z and hole 1, with dwell as 2s, tapping speed as 800
G84 X5 Y5 Z-10 R-5 P2000 F800
X25 ’hole 2
Y25 ’hole 3
G98 X5 ’hole 4, and setting to return to the initial point
G80
M05 ’spindle stop
M02
G98 G99
R R
Z Z
Process Description:
1) The tool moves to the specified hole position (X, Y) at G00 speed;
2) The tool moves down to the specified point R at G00 speed;
3) The tool moves down to the point Z at the bottom of the hole at G01 speed;
4) The tool retracts to point R at G01 speed;
5) The tool retracts to initial point (G98) or point R (G99) at G00 speed.
Programming Example:
F1200 S600
G90
G00 X0 Y0 Z10 ’moving to the initial point
G17
M03 ’spindle CW on
G90 G99
’Specifying the coordinates of point R, point Z and hole 1, with machining speed as 800
G85 X5 Y5 Z-10 R-5 F800
X25 ’hole 2
Y25 ’hole 3
G98 X5 ’hole 4, and setting to return to the initial point
G80
M05 ’spindle stop
M02
F_: feed speed. Even if the canned cycle is cancelled, this modal data is still effective in the subsequent
machining.
K_: number of repeats (repeated movement and drilling, effective in G91 incremental mode).
G98 G99
Z Z
Spindle stops Spindle stops
Process Description:
1) The tool moves to the hole position (X, Y) at G00 speed;
2) The tool moves down to the specified point R at G00 speed;
3) The tool moves down to point Z at the bottom of the hole at G01 speed;
4) The spindle stops rotating;
5) The tool retracts to initial point (G98) or point R (G99) at G00 speed;
6) The spindle starts to rotate.
Programming Example:
F1200 S600
G90
G00 X0 Y0 Z10 ’moving to the initial point
G17
M03 ’spindle CW on
G90 G99
’Specifying the coordinates of point R, point Z and hole 1, with drilling speed as 800
G86 X5 Y5 Z-10 R-5. F800
X25 ’hole 2
Y25 ’hole 3
G98 X5 ’hole 4, and setting to return to initial point
G80
M05 ’spindle stop
M02
G98 Tool
OSS
Initial Point
Spindle CW
OSS
Point Z
Pause for P
Oriented Spindle
Stop(OSS)
Spindle CW Q Point R
Offset Q
Fig. 3-29 G87 Machining Process Fig. 3-30 Sketch of Oriented Spindle Stop (OSS)
OSS (Oriented Spindle Stop) direction is specified by parameter “Oriented Spindle Stop”.
Oriented spindle
G17 G18 G19
stop (OSS)
0 +X +Z +Y
1 -X -Z -Y
2 +Y +X +Z
3 -Y -X -Z
Process Description:
1) The tool moves to the hole position (X, Y) at G00 speed;
2) After OSS, offsets cutting depth Q in a direction opposed to the direction of boring tool specified by
parameter “Oriented Spindle Stop)”;
3) The tool moves down to the specified point R at G00 speed, and offsets cutting depth Q;
4) The spindle rotates CW;
5) The tool retracts to point Z at G01 speed;
6) After P, offsets cutting depth Q in a direction opposed to previous offset;
7) The tool retracts to the initial point at G00 speed;
G98 G99
Spindle CW
R R
Spindle CW
Z Z
Spindle stops after P Spindle stops after P
Process Description:
1) The tool moves to the hole position (X, Y) at G00 speed;
2) The tool moves down to the specified point R at G00 speed;
3) The tool moves down to point Z at the bottom of the hole at G01 speed;
4) The spindle stop after P;
5) The tool retracts to point R at G01 speed;
6) The tool retracts to initial point (G98) or point R (G99) at G00 speed;
7) The spindle rotates CW.
Programming Example:
F1200 S600
G90
G00 X0 Y0 Z10 ’moving to the initial point
G17
M03 ’spindle CW on
G90 G99
’Specifying the coordinates of point R, point Z and hole 1, with dwell as 2(s), boring speed as 800
G88 X5 Y5 Z-10 R-5 P2000 F800
X25 ’hole 2
Y25 ’hole 3
G98 X5 ’hole 4, and setting to return to the initial point
G80
M05 ’spindle stop
M02
G98 G99
R R
Z Z
Pause for P Pause for P
Process Description:
1) The tool moves to the hole position (X, Y) at G00 speed;
2) The tool moves down to the specified point R at G00 speed;
3) The tool moves down to point Z at the bottom of the hole at G01 speed;
4) The tool pauses for P;
5) The tool retracts to point R at G01 speed;
6) The tool retracts to initial point (G98) or point R (G99) at G00 speed.
Programming Example:
F1200 S600
G90
G00 X0 Y0 Z10 ’moving to the initial point
G17
M03 ’spindle CW on
G90 G99
’Setting coordinates of point R, point Z and hole 1, with dwell as 2.5s, machining speed as 800
G89 X5 Y5 Z-10 R-5 P2500 F800
X25 ’hole 2
Y25 ’hole 3
G98 X5 ’hole 4, and setting to return to the initial point
G80
M05 ’spindle stop
M02
3.7.1 Overview
1) Unit of length: millimeter (mm). Unit of angle: degree. 1 meter=1000mm, and one full circle= 360
degrees.
2) Special canned cycle commands (G34~37) must be used together with standard canned cycle
G34/35/36/37 instruction error: special canned cycle instructions do not match, with no designation.
2
30 N001 G91 G81 G99 Z-5 R6 F500 K1
1 N002 G34 X10 Y10 I20 J45 K8
3
20 The machine tool starts drilling from
position 1 to position 8.
4 θ 8 The included angle is θ between
10
position 1 and positive direction of X
axis. Drilling actions are specified by
G81 in program block N001.
-10 10 20 30
5 7
-10
6
-10
I: circle radius r
J: θ, the included angle between the first point to be drilled and X-axis
K: number of holes, within -9999~9999. If the number is 0, an error report will be given. If the number is
greater than 0, hole drilling will be clock-wise, but if smaller than 0, hole drilling will be counter-clockwise.
G36 drills “n” evenly-spaced holes on a circle with X, Y as center and r as radius, at the same time, the
included angle is θ between the first drilling point and X-axis, and the angle between adjacent holes is Δθ.
And the tool moves from one hole to another one at G0 speed.
The only difference between G36 and G34 is that the former specifies the included angle between two
holes.
-10
P D C
y1=100mm △y=100mm
Position before executing G37 B
A
x11=300mm △x=50mm
60
°
Programming is as follows.
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 K4
N05 X10 Y-17.321
N06 X-20 K4
N07 X-10 Y-17.321
N08 X20 K5
N09 X10 Y-17.321
N10 X-20 K6
N11 X10 Y-17.321
N12 X20 K5
N13 X-10 Y-17.321
N14 X-20 K4
N15 X10 Y-17.321
N16 X20 K3
N17 G80 M09
N18 G90 G00 Z100.
N19 X0 Y0 M05
N20 M30
’Clear the latch flag of encoder of each axis before the encoder latches data. After latch is done, the flag
will be set as 1.
O"9002"
to
G65 P9002 L2 Variable
(Customized Operation command
Variable) Control command
M17:
Fig. 3-38 is a process sketch to call and execute the subprogram P9002 twice and then continue
Function Meaning
sin sine
cos cosine
exp exponent
sqrt square root
log natural logarithm
tg tangent
ctg cotangent
asin arcsine
acos arc cosine
atg arc tangent
int round-down
abs absolute
CAUTION
Radian is the unit for the numbers in the brackets which are behind sin, cos, tg, ctg, asin, acos, atg. For example:
sin (5), 5 represents 5 radians.
Application of Expression in Program Commands:
Example one: B=1+2; ’i.e. B=3
Example two: G00 X3 Y5 Z=5+sin (5+abs (-8)); ’Assign 5+sin (5+abs (-8)) to Z
Example three: #1=4+log6
G01 X2 Y=#1; ’Assign 4+log6 to Y
10
20
30
10 10
30 20 30 20 30
X
Z
4
20
3
13
22
30
Example 2
Programming for sketch 2 as shown in Fig. 3-40:
50
5 R2
R2 5
20
15
X
135
Example 3
Programming for sketch 3 as shown in Fig. 3-41:
R2 70
0
50
60 40
40
R
50
30
40 120 X
Fig. 3-41 Sketch 3 of Workpiece Machining Process
Example 4
Programming for sketch 4 as shown in Fig. 3-42(CCW tapping):
65
R5
15
15 65 80 X
Z
3
0
5
28
Example 5
Programming for sketch 5 as shown in Fig. 3-43(requirement: amount of feed is 2mm each time in
Z-axis):
Y
60
Z 10 2
60 X
X
10
Example 6
Programming for sketch 6 as shown in Fig. 3-44:
R 14
Y
0 X
2
Z
0 X
14
Coordinate system
G68 G923 Directly Set Tool Offset
rotation
4 Others
4.1.1 Overview
General users can be satisfied with the machining workpiece operations and other basic operations
provided by the controller, such as: tool calibration, center calibration, canned cycle, etc.
The controller also provides a group of named parameters for those who need to program some
operating details, operating programs and customize canned cycles. With these parameters, you can
modify or program operation programs and customize the content of canned cycle in public.dat. In
addition, can also program directly in the program edit operation interface.
Example 1
Writing a subprogram of tool coolant and tool change with named parameters is shown as follows.
O1000 ’subprogram of tool coolant and tool change
M901 H=#COOLANT_START_PORT P1
G04 P10
IF(#ENABLE_CTP) G53 G00 G90 X=#CTP_POS.X Y=#CTP_POS.Y Z=#CTP_POS.Z
’move to the position of tool change
G00 G90 Z10 ’or lift the tool directly for tool change
M05
M17
Others「67」
Specialized Concentrated Focused
Example 2
Modifying the content of G86 canned cycle with named parameters. G86 canned cycle contains retract
amount parameter which is not set in the system.
O686
#FC50=#CANNEDCYCLE_BACK
IF (! #FC13) G90 G65 P786
IF (#FC13) G91 G65 P786 L=#FC11
M17
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---- cutting depth each time (incremental and positive); offset value in G76/G87
G99/G98--#FC12---G99->1; G98->0
G90/G91--#FC13---G91->1; G90->0
Z0--#FC14---Initial point height
「68」Others
Specialized Concentrated Focused
Mapping of port
08 OUTPORTMAP INT Status of port output
output
This height is relative to the
workpiece origin, and only valid
09 SAFEHEIGHT Safe height DOUBLE
during backing to workpiece
origin and resuming breakpoint.
Y axis as the rotary
10 ISYREVAXIS BOOL Whether to set Y as rotary axis
axis
Diameter of rotary Diameter of rotary workpiece
11 WPREVDIAM DOUBLE
workpiece being currently machined
0:angle (unit: radian)
Programming unit of
12 UNIT.YR INT 1: surface distance of rotary
rotary axis
workpiece (unit: millimeter)
Whether to stop spindle
AUTOSTOPSPIN Spindle stop when
13 BOOL automatically after machining
DLE stop
finishes
Delay when spindle Setting the delay time when
14 SPINDLE_DELAY DOUBLE
On/ Off spindle starts/ stops automatically
MOBICALI_THICK The thickness of tool Setting the thickness of tool
15 DOUBLE
NESS presetter in mobile presetter in mobile tool
Others「69」
Specialized Concentrated Focused
「70」Others
Specialized Concentrated Focused
Others「71」
Specialized Concentrated Focused
「72」Others
Specialized Concentrated Focused
Others「73」
Specialized Concentrated Focused
//CI Circle
// CI r [, qd] [;]
CAUTION
PLT format is highly expansibe and different products corresponds to different commands. If you are encountered
with any unidentifiable command, please contact us as soon as possible, so that we can develop a corresponding
interpreter for you.
「74」Others
Specialized Concentrated Focused
Prompt:
Save the figure drawn in AutoCAD as .dxf format, and then perform “Open and Load” and “Simulation
Mode” in the software. At this time, the figure shown in the track window is what you have drawn in
AutoCAD.
Others「75」