NC300 GCode Programming Manual
NC300 GCode Programming Manual
Table of contents
Chapter 1 Chapter 1 Table of commands
Milling machine G code supporting table .......................................................... 1-1
Chapter 3 M commands
3.1 M00 to stop a program from running ........................................................ 3-1
3.2 M01 to stop program selection ................................................................. 3-1
3.3 M02 to end a program .............................................................................. 3-1
3.4 M30 to end a program and return to its source command ........................ 3-2
3.5 M98 to call a sub-routine .......................................................................... 3-2
3.6 M99 to return from a sub-routine .............................................................. 3-3
3.7 Table of commonly used M codes ............................................................ 3-4
Command description: A G00 command moves the cutter center to position given by
coordinates X, Y, and Z at fast speed. Movement speed is set by the Rapid Feed Rate key
of the secondary control panel but not the F_commands. If the X, Y, and Z spindles'
maximum movement speed is set at 15m/min as specified in the maximum movement
speed parameter, then the actual movement speed under different Rapid Feed Rate key
settings should be:
(1). 15 m/min, the maximum speed when the setup value is 100%;
(2). 7.5 m/min when the setup value is 50%;
(3). 3.75 m/min when the setup value is 25%;
(4). Spindles move at speed set by parameter values when the setup value is 0%.
The G00 command positions the spindle rather than feeds the cutting. For example, it
quickly moves the spindle from mechanical origin to cutting origin and positions the X and Y
axis after cutting.
[Illustrations]
See figure below for moving cutters from point A to point B at fast speed.
Origin of
workpiece
Command description: This command enables a cutter to linear cut from the current
position to a given position at F feed rate. The ending position of the cutting is given by the
X, Y, and Z coordinates. You can have all three spindles, any two or one of them as desired.
The feed rate is set by the F parameter along with the optional Feed Rate of the secondary
control panel in unit of mm/ min.
[Illustrations]
Regarding the method of G01, see figure below for milling in direction of +Y from program
origin.
The F parameter remains active unless being changed as shown in program codes listed
above where the F parameters are omitted in subsequent statements.
Command description: G02 or G03 is the arc cutting command. The arc cutting direction
(G02 or G03) for a three-dimensional workpiece in individual planes is shown in Figure 1.
The cutting direction is defined by the right hand coordinate system. Look against the
positive direction of the plane's vertical axis; G02 is for clockwise direction while G03 is for
counterclockwise.
Center
In the figure above if R = 50mm and the absolute coordinates of the end point are (100.0,
80.0), then
(1) the arc of central angle > 180° (path B) can be expressed as "G90 G03 X100.0 Y80.0
R-50.0 F80" and;
(2) The arc of central angle ≤180° (path A) can be expressed as "G90 G03 X100.0 Y80.0
R50.0 F80".
2. The Center method: Here parameters I, J, and K define the relative distance from the
arc start point to the arc center (the end point). That is, the increments from the start
point to the center in X, Y, and Z directions respectively. See the figure below for
illustrations.
Start
Start point point
Start
Center
point Center
Center
Center
The arc motion expressed in the radius or center method can be used in program coding for
selecting conditions.
To cut milling a sphere you can use the center but not the radius method. Generating a
sphere by connecting two semi-spheres bears too large a roundness deviation to be
acceptable.
[Illustrations]
The command syntax for cut milling a sphere as shown in the figure below may look like
"G02 I-50.0".
Use of commands G01, G02, and G03 is illustrated in the figure below. Here is the tool cut
milling from program origin upward along the shape.
O0100
G90 G54 X0 Y0 S500 M3
G90 G01 Y15.0 F80 =>program origin → A
G02 X41.0 Y40.0 R41.0 => A → B
G91 G01 X40.0 => B → C
G02 X10.0 Y-10.0 R10.0 => C → D
G01 Y-20.0 => D → E
X-15.0 Y-10.0 => E → F
X-20. => F → G
G90 G03 X20.0 R18.0 => G → H
G01 X0.0 => H → program origin
(1) Most systems default to G17 (X – Y plane) after power on. The G17 command can
be omitted when cut milling arc in X – Y plane.
(2) When I, J, and R parameters show in one statement only the R parameter remains
active while I and J are ignored.
(3) Parameter I0, J0, and K0 can be omitted.
(4) When end point X, Y, and Z coordinates are omitted, it means the start and end
points are the same and a sphere is to be cut and milled. The tool remains
motionless for command in the radius method.
(5) The system prompts an alarm message when the end point does not intersect with
the given radius value.
(6) For arc cutting following a linear cutting the G command must convert to command
G02 or G03 and G01 for straight line cutting.
(7) Please rotate the spindle before applying cutting command G01, G02 and G03 and
must designate the value of F feed rate.
Command description: This command sets up a pause of the current node. Both X and P
parameters define the time of pause while X accepts decimal values and P does not.
Command scope:
Range of pause time by X parameter
Valid values UOM
0.001~99999.999 Seconds
Range of pause time by P parameter
Range of valid values UOM
1~99999999 0.001 second
[Illustrations]
G04 X1.5 or
G04 P1500
Both commands cause a pause span during program execution for 1.5 seconds.
Command description: For tools operating in a constant feed rate, a minute round corner
angle may be generated by continuous motion as the operation of the next node starts
accelerating before the current one is completed. G09 command aims to eliminate the
round angle at corners. With G09 in effect, the system is positioned before doing any node
of motion. The next node is executed only after being positioned correctly. As a result,
minor discontinuity exists between nodes when G09 status is in effect. This improves
precision at the cost of speed. This command applies to cutting commands (G01~G03) of
the current node only.
Tool movement
direction
With G09 in
Workpiece use
Without G09
in use
[Illustrations]
G09 G01 X100.0 F150 → Start executing the next node only after the deceleration is
stopped and positioning is confirmed.
G01 Y-100.
Command description: The G10 command in the syntax of G10 L2 Pˍ Xˍ Yˍ Zˍ is used for
workpiece coordinate system data entry. The system is set to the offset coordinate of the
workpiece coordinate system when the value of parameter P is set to 0. Parameters P1~P6
correspond to G54~G59 of the workpiece coordinate system while X, Y, and Z represent
the origin of the given coordinates system. The P parameter in L20 command syntax can
assign the values of P1~P64 for the corresponding expansion workpiece coordinates
system. The command format G10 L10 Pˍ Rˍ sets up the tool length compensation value
where parameter P is the compensation number and R is the actual compensation value for
tool radius and length. The setting of P1 from G10 L21 P is for the first forward software
limit, P2 is for the first backward software limit, P3 is for the second forward software limit
and P4 is for the second backward software limit.
In absolute status, the G10 command is the absolute input. It also can do data entry setup
in incremental status.
In incremental status, the G10 command can input the value in incremental way.
[Illustrations]
Set length compensation value of Tool 1 to H-300.0 and H-100.0 for Tool 2.
P: Compensation number or workpiece coordinate number
R: Tool compensation value
Note:
(1) The G10 command is non-continuous and so is effective in statements
containing the command. The compensation values of the offset coordinates
and job coordinates system are given relative to the origin of the mechanical
coordinates system. You can execute command G11 to cancel data entry
settings.
(2) During program execution the command coordinates data changed by L2
command takes effects in next motion node. The tool compensation data
Command description: Command G15 cancels polar coordinates mode and returns the
program to move in the path of the original coordinates system and values.
X__ Y__: In a G17 plane the X__ parameter specifies the radius and
Y__ the angle coordinates of the polar coordinates system.
Z__ X__: In a G18 plane the Z__ parameter specifies the radius and X__
the angle coordinates of the polar coordinates system.
Y__ Z__: In a G19 plane the Y__ parameter specifies the radius and Z__
the angle coordinates of the polar coordinates system.
Command description: The polar coordinates command employs radius and angle as its
setup format. If the first axis (X-axis) of the plane is selected for radius then the second one
(Y-axis) is set for angle value. The counterclockwise angle assumes a positive value while
the clockwise one assumes a negative value. When a radius specified by a negative value,
the radius command value is regarded as the absolute one and the angle command value
will add an additional 180 degrees. The angle values can be in absolute or incremental
format.
[Illustrations]
Angle (Y_)
Radius (X_)
Command description: The plane selection function selects different planes for cutting.
They are not needed when all three axes move at the same time. G17~G19 commands set
up the active plane for straight line and arc cutting or tool compensation. The system
defaults to the G17 plane after power on. If X-Y plane is desired, you do not need to set it
with the G17 command.
Command description: This command sets the metric or inch unit of measure for the
system. Command G21/G20 applies to the linear axis but not the rotation axis. It must be
executed in a single standard prior to the coordinate system setup command in a program.
During the command execution, metric and inch input command cannot be switched. All
relevant values which influences the system includes F value of feed rate, coordinates
position value, workpiece coordinates offset amount, tool compensation amount and
movement distance. G21/G20 is continuous effective command. When the program
specifies a system unit, it means its unit is metric or inch unit. Moreover, G21 and G20
cannot be used in one program at the same time.
Command description: This command instructs the tool to fast move (G00) from the
reference point given by the command to the mechanical origin. It is designed to return to
the mechanical origin by moving to the reference point given by the command to avoid any
intersection with the workpiece or the machine equipment.
[Illustrations]
Mechanical origin
G90 G28 Z50 → Return to mechanical origin from point A through reference point B
(Z-axis).
[Illustrations]
Status of G90/G91 differs in the process of returning to the mechanical origin when
command G28 is executed. See figure below for details.
G91G29 Xˍ Yˍ Zˍ
Command description: Command G29 moves a tool from the mechanical origin to a point
defined by the command through a reference point. Parameter XˍYˍ Zˍ assigns coordinates
of the final point reached by command G29. Command G29 and G28 must be used in pair
to move the tool to a reference point defined by G28 then to the final point given by G29.
The actual distance from reference point to mechanical origin need not be calculated.
When running command G29 without accompanying G28 (for reference point setup), the
system stops running and prompts an alarm message.
[Illustrations]
Tool replacement
point
Arguments XˍYˍZˍ designate coordinates of the intermediate point. The tool moves back to
the second, third, or fourth reference point from the current location through the designated
intermediate point. The coordinates of the second, third, or fourth reference point are
defined by the system parameters. This command is most commonly used for tool
replacement. For command status in absolute value the G30 Z0.0 motion command
accomplishes the required motions by moving the Z axis to the intermediate point and the
second reference point in turn.
Please cancel the tool compensation (executing G40 and G49) before running commands
G28 and G30. The tool radius and length compensation are cancelled automatically when
executing command G28 and G30. The tool compensation function is resumed only after
executing command G43/G44 before the next node is executed. The tool radius
compensation function is resumed at the next node after G28 or G30.
Mechanical origin
Second origin
As shown in the figure above, in the G90 mode the G30 Z0 command moves the Z axis to
the intermediate point (the mechanical origin in this example) before being returned to the
G30 (second origin) point to accomplish the second origin homing.
[Illustrations]
G90 G30 P2 X100. Y80. G91 G30 P2 X0. Y0. (without intermediate
point)
The second
The second reference point
reference point
Command description: This command aborts the running path and jumps to execute the
command in next node by accepting an external skip message when moving in a straight
line along a given axis direction. This is a valid G command in a single node. Thus, the
command is effective only in one node. G31 command cannot run in tool compensation
mode. Please cancel tool compensation before command execution.
[Illustration 1]
Skip signal
G90 G00 X0 Y0
G01 G31 X80.0 F500.0
Y40.0
As shown in the figure above the motion path remains straight (solid line) if there is no skip
signal. When a skip signal is applied, the program aborts execution of the current statement
and starts executing the movements given in the next statement (dotted line).
[Illustration 2]
Skip path
Program
path
Skip signal
G90 G00 X0 Y0
G01 G90 G31 X50.0 F150.0
X80.0 Y40.0
If no skip signal is applied, the actual path is shown as the solid line shown in the figure
above. If a skip signal is applied, the actual path is shown as the dotted line as the tool
starts executing motions of the next node from the signal input point.
Command description: This command cancels the tool compensation function when it is not
needed in the tool path. As a status command the compensation command remains active
unless cancelled by another command. Command G40 resets the tool compensation status
to avoid path error caused by tool offset for compensation.
In addition, the tool compensation function pauses when returning to the reference point in
a reference point resetting command and resumes at the next motion node. In addition,
function of tool radius compensation cannot be cancelled during arc motion.
As illustrated in the figure above, a workpiece after machining may have a dimension one
tool diameter greater or smaller caused by the tool diameter when cutting along the profile
of workpiece.
The leftward or rightward compensation of a tool is defined as below: Along the cutting
direction, the tool radius shall be compensated rightward for tools moving to the right of the
workpiece and made by command G42. Otherwise, the tool radius shall be compensated
leftward for tools moving to the left of the workpiece and made by command G41.
The argument Dˍ is the tool radius code represented by binary digits. This is the tool
compensation data number contained in the controller's OFS group functions. For example:
argument D11 indicates that the tool radius compensation number is 11. If number 11
represents value 4.0 then the tool radius is 4.0mm. Executing command G41 or G42
means the controller will then read the tool radius data in its OFS group function as the
compensation length based on the tool radius compensation number given by the
argument D.
(1) This command may be assigned together with G00 or G01 in the same node.
The tool compensation is activated only after the tool moves (enable the tool
radius compensation command). It does not work together with commands G02
and G03. The compensating tool radius in the arc path must specify the
compensation in advance in the straight line motion path. While the tool radius
compensation is active, it cannot be cancelled in arc path. See below for
illustration.
Compensation value
Program path
See below for program codes for moving from point A to point C and activate the tool radius
rightward compensation command:
(2) When designing the program, the tool compensation number, e.g. D11 and D12,
defined in a program must correspond to the one code contained in the
compensation table. These tool radius compensation values are numbers
entered by the operator in the tool entry function of the OFS group in advance.
(3) Change in compensation value, from positive to negative or vice versa, changes
the compensation direction of G41 and G42. For example, for positive
Point B is the
program origin
G40 → Cancel compensation after the cutter is far away from the
workpiece.
(6) Under compensation status the straight line movement distance and inner arc
cutting radius must be greater than or equal to the tool radius or over cutting may
be caused by compensation vector interference. In a case like this, the controller
stops operation and prompts alarm messages as shown in the figure below.
Straight line
Program path movement amount
Over cutting
Program path
Program path
There are two compensation types: Type A and B. Type A does not compensate the starting
and ending points in a path while Type B compensates both points. See the figure listed in
the left for the motion tracks generated by Type A.
Program path
Program path
Starting point
Starting point
Center Center
Program path
Inward curved angle: Arc to line Outward curved angle: Arc to line
Program path
Center Program path
Intersection point
Inward curved angle: Arc to arc Outward curved angle: Arc to arc
Center
Program path Program
path
Tool path
Tool path
Intersection point Center
Center Arc center
Compensation path toggle switch: When a motion path without compensation enters a path
with compensation the motion track of the tool center is as shown in the figure below.
During the compensation period the motion track remains active. When compensation path
execution is cancelled (G40) or switched to compensation in another direction directly, the
motion track looks like the figure below.
G40→G41 G40→G42
Starting point
Tool path
Program path
Program path
Starting point
Tool path
G41→G42 G42→G41
Workpiece Workpiece
Workpiece
Tool path Tool path
Workpiece
Workpiece Workpiece
Workpiece Workpiece
Workpiece
Workpiece
Program path
Program path
Workpiece
Workpiece
Tool path
Tool path
G41→G40 G42→G40
Program path Tool path
G43: Tool length positive compensation. For positive tool length the tool
axis moves in the positive direction.
G44: Tool length negative compensation. For negative tool length the
tool axis moves in the negative direction.
Command description: Most NC machine may use multiple tools with different lengths in
one machining program. This command enables operators to define individual tool length
ID for length compensation. It ensures machining depth complies with program
specifications and simplifies the program designation tasks.
Z: The coordinate position of tool movement from the zero-coordinates based on Z axis
plus the tool length compensation.
H: Tool length compensation data ID expressed in binary digits. The tool length
compensation represented by given data ID will be taken as the height compensation of
this program. Take H01 as an example, if the tool length compensation ID is 01 and the
value represented by ID 01 is -412.8, then the tool length compensation value of this tool is
-412.8mm. After the G43 or G44 command is executed, the controller takes the value
represented by the tool length compensation ID given by argument H as the tool length
compensation value.
G43 ZˍHˍ: If the value represented by the compensation ID is positive then tool
compensates upward, otherwise, it compensates downward. G44 ZˍHˍ: If the value
represented by the compensation ID is positive then tool compensates downward,
otherwise, it compensates upward.
Z axis mechanical
origin
Z axis program
Workpiece
origin
Work bench
Note:
(1) The system cancels the tool length compensation value automatically before
executing commands G53, G28, and G30 when tool length compensation is
active. Later the program runs without tool length compensation unless another
Hˍ argument is assigned by command G43/G44.
(2) Parameter 307 is for setting the moving mode of tool length compensation when
G43/G44 and G49 execute without Z command. When the setting value is 0, it
means G43/G44 and G49 move the tool length compensation without Z
command. If the setting value is 1, it means when G43/G44 and G49 has no Z
command, the compensation is completed by the internal system.
(3) The active tool length compensation (by G43 or G44) remains active when
G28/G30 reaches the reference point and then cancelled when returned to the
mechanical origin. The tool length compensation will not be resumed in later
motion nodes.
(4) The active tool length compensation will be cancelled by the system and
switched to G49 status when commands M30 and M02 are executed
successfully.
(5) The active tool length compensation will be cancelled by the system and
switched to G49 status when a RESET signal is received by the system.
Scaled up path
Original path
As shown in above figure the original tool path is converted into a new path by executing
command G51 with scaling ratio set by argument P. The scaling function does not change
tool radius compensation, tool length compensation, and tool position compensation as the
compensation action and value are made after scaling. When executing commands M02
and M30 or when the NC300 controller is reset, the scaling mode will be cancelled. The
reset key also can cancel scaling. Execute command G50 in program to reset the scaling
function as well as return to original scale status and cut in the normal path.
Command description: Users can set up a sub-coordinates system based on the workpiece
coordinates system for easy path coordinates designation when program coding. This
sub-coordinates system, also known as the local coordinates system, can be defined as a
one current workpiece coordinates system (G54~G59) by command G52 with arguments of
absolute coordinates data. It is valid for absolute supplier status but not the incremental
system (G91) status. Command G52 with argument zero cancels the local coordinates
system setup. The tool radius compensation command is suspended when command G52
is applied.
[Illustration 1]
Tool path
G90 G54 X0 Y0
G52 X40.0 Y40.0
G00 X20.0 Y20.0
[Illustration 2]
00 coordinates system
Converting the current job coordinates system to another coordinates system with an active
G52 command gives the converted workpiece coordinates system the same offset effects
of G52.
Users can cancel a local coordinates system by executing command G52 with three
argument coordinates (X, Y, and Z) in value zero. That is, an assignment of "G52 X0 Y0 Z0"
command format.
Command description: Coordinates X, Y, and Z are the actual ending point in mechanical
coordinates system specified by the program coordinates. Machine suppliers use this
command to set up the tool replacement position with the reference point given in
mechanical coordinates. It cannot be changed once created. The command format must be
in absolute coordinates status. This command is ignored when in incremental status.
Command G53 is a non-continuous G command and is valid for the statement containing it.
Before using a G53 command to set up a coordinates system the origin must be reset
manually or automatically in advance. After the G53 command is executed, the system
moves in G00 mode, the tool radius compensation is paused and tool length compensation
cancelled automatically; the former resumes at the next motion node and the latter
becomes active only by re-assigning it again.
Note:
(1) Command G53 functions only at G90 status. It is ignored in G91 mode. However,
a status command contained in the same statement of G53, G00/G01 or
G90/G91, changes the status and affects the motion status of the next node.
(2) If the statement containing command G53 also contains a specific axial
command, then the axis moves to a specified point. Otherwise, there is no
position command.
(3) If both commands G53 and G28 are set in the same statement, the one read
later becomes active. When command G53 is active, the motion position refers
to the mechanical coordinates. If command G28 is active, then the absolute
coordinates are referred to.
(4) A correct specified coordinate is needed in G53 command format. G53 has to
connect to the specified coordinate. Any other G command is not allowed to
insert in the single node command so as to prevent the incorrectness of the
motion command.
For example,
G90 G00 G53 X10.0 Y10.0 Z-20.0------------------(Correct command combination)
G90 G53 G00 X10.0 Y10.0 Z-20.0----------------(Incorrect command combination)
[Illustrations]
Example 1.
G91G53X150.Y-150. This command is ignored.
X-30.Y-30. This command is changed to incremental motion mode.
Example 2.
G90G53X50.Y-50.Z0. Move to X50.Y-50.Z0. in actual mechanical coordinates.
Example 3.
G1G53X100.Y-100.F1000 This command executes in G00 status.
X50.Y50. The system moves in G01F1000 motion status.
Command description: Command G54~G59 assigns any one of the six fundamental
coordinates system as the workpiece coordinates system. A workpiece coordinates system
is created by moving the tool from the mechanical origin to the desired program origin (with
proper X and Y distance), registering this position data in the workpiece coordinates system
setup (G54~G59) in the controller OFS group function, and executing the workpiece
coordinates system code, then you can set up the workpiece coordinates origin. The
system also features a designation function out of 64 sets of expansive workpiece
coordinates system options. This is done by assigning values to argument P_ (with valid
value range of 1~64) in command G54. For example, G54 P10 X_ Y_ Z_. It means the
tenth coordinates system of expanded workpiece coordinates system is used.
[Illustrations]
Workpiece
The setting of workpiece coordinates command enables easier program path calculation
and design as well as creating multiple work bench coordinate systems to be used
alternatively by multiple programs. As shown in the figure above, you don't need to change
the program when coordinates of origin are modified. The machining process can be
started simply by changing the data value of workpiece coordinates.
Command description: Command G61 functions the same as command G09 does, except
that the later is a non-continuous (becomes active only when being assigned) status
command while the former is a continuous statement instead. After command G61 is
executed, each execution of commands G01, G02, and G03 mandates the system to
decelerate to fully stop for inspection. This mode remains active until an execution of
command G64 (cutting mode).
[Illustrations]
Command description: After command G64 is executed, the system remains moving at a
certain speed to transit into the execution of the next motion node instead of decelerating to
full stop at the end of each motion command. Normally, the initial status of the system is set
to G64 cutting mode. When command G64 is used the NC machines enter smooth cutting
plane mode. Command G64 differs from G61 in that it cuts at a constant feed rate and does
not decelerate to a full stop between motion nodes.
In cases listed below the system decelerates to a full stop for positioning checking even
after command G64 is assigned:
(1) Statement with fast positioning (G00) mode
(2) Statement with rigorous stops command (G09)
(3) There is no movement command in the next node
Command description: Command G65 calls a macro program. A macro program is used for
various calculations, MLC interface data input and output, and commands for control,
judgment, and branching as well as for calculation and measurements.
A macro program is a subroutine containing variables, calculation and control commands
accompanied by exclusive control mechanism. These designated functions (macros) can
be used in the main program by a specific macro calling command. Macros are called as
command M98, except that it is non-continuous. See below for the macro calling command:
[Illustrations]
After a macro is executed, it returns to the statement next to the one containing it. That is,
the program continues executing from the statement next to the G65 command. In the
sample described above, the value of the #1 variable A5.0 is 5.0. Please refer to the table
below.
[Illustration]
Command G65/G66 can nest macros up to 8 layers. When used together with subroutine
calling command M98, the program nest layers remain at eight.
Command description: Command G66 functions the same as G65 except that instead of
being active for a single step, the former keep on calling the macro in later statements until
it is reset by command G67. Before being reset by command G67, the macro continues to
be called.
[Illustrations]
Command description: The coordinates rotation command G68 rotates the original
machining program at a given zero point in a specific angle. For a workpiece placed on the
workbench in an angle against the program command position, users may rotate the
coordinates system in that angle to simplify the calculation of the program path and reduce
the time required for program coding by using command G68.
[Illustrations]
Workpiec
The original program (at the top of the figure) machines workpiece is in the path shown with
a dotted line. If the workpiece is placed in another direction (here it is rotated 90 degrees),
the program can still function without any modification by adding command G68 to rotate
the program path.
Command G69 resets the rotation given by command G68. The program motion path
returns back to its original motion track after the rotation effect is removed.
Command description: This command sets the machine to retreat a constant distance "d"
after drilling a distance (depth) of "Q" and keeps on drilling to the desired hole depth of "Z".
The back-and-forth intermittent Z-axis feeding enables easier chip dispelling during drilling
deep hole. Here value Q is absolute value. Value d is the moving distance specified by
parameter. If the setting value is 1 mm, it means the default value of retraction amount d is
1 mm. See the figure below for the operation specified by this command.
[Illustrations]
Action in steps
Action in steps
Back to
Starting point starting point Starting point
Z point Z point
Note:
(1) The tool radius compensation function is ignored by the peck drilling loop
command.
(2) Run command G80 to cancel the loop cutting motion.
(3) Value Q cannot be specified as a negative value. Otherwise the alarm will
display G code error.
(4) The value of parameter K will be rounded down to the nearest whole number;
e.g., K2.6 round down to K2 and K0.6 to K0.
(5) When K value is in absolute status, it executes the cycle command for specified
number of times at the origin position. When it is in incremental status, it
executes the cycle command for specified number of times according to the
specified distance.
(6) K value is specified as 0. When executing this node, it only changes the
command to cyclic status and moves according to the command issued by XY
axis but not executing cycle command.
(7) When K value is specified as a negative value and smaller than -1, e.g. K-1.5, it
will be regarded as the result of K1.
(8) When K value is specified as a negative value, a decimal and bigger than -1, e.g.
K-0.8, it will be regarded as the result of K0.
[Illustrations]
M03 S1000
G17 G90 G00 G54 X0. Y0.
G00 Z100.
G99 G73 X0. Y0. Z-30. R10. Q4. K1 F100. ---------------------------------------------------------- (1)
X-15. ----------------------------------------------------------------------------------------------------------- (2)
X-30. ----------------------------------------------------------------------------------------------------------- (3)
X-30. Y15. ---------------------------------------------------------------------------------------------------- (4)
G80 G91 G28 X0. Y0. Z0.
M05
Starting point
R point
(Tool retreat)
[Illustrations]
M03 S1000
G17 G90 G00 G54 X0. Y0.
G00 Z100.
G98 G73 X0. Y0. Z-30. R10. Q4. K1 F100. ---------------------------------------------------------- (1)
X-15. ----------------------------------------------------------------------------------------------------------- (2)
X-30. ----------------------------------------------------------------------------------------------------------- (3)
X-30. Y15. ---------------------------------------------------------------------------------------------------- (4)
G80 G91 G28 X0. Y0. Z0.
M05
Starting point
(Tool retreat)
R point
Command description: This command is for left-handed threading and requires left-handed
tapping cutter and reverse turning spindle to execute command G74. It sets the machine to
move as described below:
- fast move the tool to position set by coordinates (X, Y)
- fast position to height R
- tapping at speed set by F till the depth of Z
- set the spindle to turn in positive direction
- retreat the Z-axis in positive direction to height R
- set the spindle reverse turn after reaching height R and prepare for reverse
Action in steps
Action in steps
Back to
Starting point starting point Starting point
Z point Z point
In tapping cycles the machine cuts at the speed given by parameter (100% program value)
and the spindle revolution factor and feed rate of the control panel are set to inactive.
Furthermore, the program stop key will be ignored to ensure thread accuracy. The stop key
is active only after the thread cutting or before the tapping operation.
[Illustrations]
Starting point
R point
(Tool retreat)
[Illustrations]
Starting point
(Tool retreat)
R point
Command description: This command is for fine boring. It sets the machine to move as
described below:
- cut into the given depth and stay for time set by parameter P_
- the spindle stops turning and positions
- the tool center move away from the workpiece surface for a distance set by program Q_
- the tool returns to height R or starting point without scratching the workpiece surface
- the tool center offsets to the distance set by parameter Q_
- the spindle resumes turning after the Z-axis returns to the original starting position.
Action in steps
Action in steps
Back to
Starting point Starting point
starting point
Z point Z point
Tool
The spindle
stops at given
direction
Offset amount Q
See below for movements set by this command (refer to Figure 1):
- the boring cutter fast positions to point (X, Y) and height R
- cut to depth Z in F feed rate
- the spindle stops and positions
- point the cutter tip to the positioning direction
- offset the boring cutter for distance Q away from the hole wall (Figure 2) such that the
cutter can move out of the hole without scratching the machining surface
- the tool center moves back to the original center position after the boring cutter moves to
point R or the starting point
- the spindle resumes turning.
The offset amount shown in Figure 2 is given by parameter Q. The value of parameter Q
must be positive (if a negative value is given its absolute value will be used instead; to
offset 1.0mm, set the parameter to Q1.0). The offset direction can be set by coordinates
(+X, +Y) or (-X, -Y). Do not give too big a value to parameter Q as the tool center may hit
the workpiece as a result.
The Q value for number of constant cycle is a status value and applies to the cutting
amount of commands G73 and G83 as well as the offset amount of command G87. Set
proper Q value for commands G73, G76, G83, G87 to avoid improper collision for
commands G76 and G87 or cutting for commands G73 and G83.
[Illustrations]
M03 S1000
G17 G90 G00 G54 X0. Y0.
G00 Z100.
G99 G76 X0. Y0. Z-30. R10. P1000 Q5. K1 F100. ------------------------------------------------- (1)
X-15. ----------------------------------------------------------------------------------------------------------- (2)
X-30. ----------------------------------------------------------------------------------------------------------- (3)
X-30. Y15. ---------------------------------------------------------------------------------------------------- (4)
G80 G91 G28 X0. Y0. Z0.
M05
Starting point
R point
(Tool retreat)
[Illustrations]
M03 S1000
G17 G90 G00 G54 X0. Y0.
G00 Z100.
G98 G76 X0. Y0. Z-30. R10. P1000 Q5. K1 F100. ------------------------------------------------- (1)
X-15. ----------------------------------------------------------------------------------------------------------- (2)
X-30. ----------------------------------------------------------------------------------------------------------- (3)
X-30. Y15. ---------------------------------------------------------------------------------------------------- (4)
G80 G91 G28 X0. Y0. Z0.
M05
Starting point
(Tool retreat)
R point
Command description: All cycle commands are status commands. Please cancel the cycle
command status before resuming normal cutting operations. Command G80 cancels the
cycle status set by commands G73, G74, G76 and G81~G89.
[Illustrations]
Command description: Command G81 is used for general purpose drilling loops. It drills to
given depth Z in one shot without any retreat. The drilling cycle is completed by returning
the cutter to point R or the initial point after being drilled to given depth Z with G00
movement. See the figure below for reference.
Action in steps
Action in steps
Back to
Starting point starting point Starting point
Z point Z point
[Illustrations]
M03 S1000
G17 G90 G00 G54 X0. Y0.
G00 Z100.
G99 G81 X0. Y0. Z-30. R10. K1 F100. ---------------------------------------------------------------- (1)
X-15. ----------------------------------------------------------------------------------------------------------- (2)
X-30. ----------------------------------------------------------------------------------------------------------- (3)
X-30. Y15. ---------------------------------------------------------------------------------------------------- (4)
G80 G91 G28 X0. Y0. Z0.
M05
Starting point
R point
(Tool retreat)
[Illustrations]
M03 S1000
G17 G90 G00 G54 X0. Y0.
G00 Z100.
G98 G81 X0. Y0. Z-30. R10. K1 F100. ---------------------------------------------------------------- (1)
X-15. ----------------------------------------------------------------------------------------------------------- (2)
X-30. ----------------------------------------------------------------------------------------------------------- (3)
X-30. Y15. ---------------------------------------------------------------------------------------------------- (4)
G91 G80 G28 X0. Y0. Z0.
M05
Starting point
(Tool retreat)
R point
Command description: Command G82 functions the same as command G81 except that
the former can designate pause time P_ in a single step. That is, command G82 differs from
G81 only in that it can set up a pause time P after cutting to the bottom of the hole.
Command G82 is ideal for drilling counter bore, spot facing, and for machining holes that
need precise depth. Command G82 can set the tool to stay within a specified time span
after cutting to the bottom of the hole for a more smooth hole wall and accurate hole depth.
Action in steps
Action in steps
Back to
Starting point starting point Starting point
Z point Z point
[Illustrations]
M03 S1000
G17 G90 G00 G54 X0. Y0.
G00 Z100.
G99 G82 X0. Y0. Z-30. R10. P1000 K1 F100. ------------------------------------------------------ (1)
X-15. ----------------------------------------------------------------------------------------------------------- (2)
X-30. ----------------------------------------------------------------------------------------------------------- (3)
X-30. Y15. ---------------------------------------------------------------------------------------------------- (4)
G80 G91 G28 X0. Y0. Z0.
M05
Starting point
R point
(Tool retreat)
[Illustrations]
M03 S1000
G17 G90 G00 G54 X0. Y0.
G00 Z100.
G98 G82 X0. Y0. Z-30. R10. P1000 K1 F100. ------------------------------------------------------ (1)
X-15. ----------------------------------------------------------------------------------------------------------- (2)
X-30. ----------------------------------------------------------------------------------------------------------- (3)
X-30. Y15. ---------------------------------------------------------------------------------------------------- (4)
G80 G91 G28 X0. Y0. Z0.
M05
Starting point
(Tool retreat)
R point
Command description: Command G83 functions the same as command G73 except that
the former returns back to height R after each deep drilling so that cutting debris can be
fully removed and cutting fluid may flow into the hole for better cooling.
The machine is set to move as described below:
- the tool returns back to point R after each cutting of depth Q
- then positioned to a point higher than the last drill ending point of distance "d"
- start drilling for depth "q+d" in the next drilling process
- drill to given position Z before returning back to position R or the initial point to finish
drilling a deep hole.
Action in steps
Action in steps
Back to
Starting point starting point Starting point
Z point Z point
[Illustrations]
M03 S1000
G17 G90 G00 G54 X0. Y0.
G00 Z100.
G99 G83 X0. Y0. Z-30. R10. Q4 K1 F100. ----------------------------------------------------------- (1)
X-15. ----------------------------------------------------------------------------------------------------------- (2)
X-30. ----------------------------------------------------------------------------------------------------------- (3)
X-30. Y15. ---------------------------------------------------------------------------------------------------- (4)
G80 G91 G28 X0. Y0. Z0.
M05
Starting point
R point
(Tool retreat)
[Illustrations]
M03 S1000
G17 G90 G00 G54 X0. Y0.
G00 Z100.
G98 G83 X0. Y0. Z-30. R10. Q4 K1 F100. ----------------------------------------------------------- (1)
X-15. ----------------------------------------------------------------------------------------------------------- (2)
X-30. ----------------------------------------------------------------------------------------------------------- (3)
X-30. Y15. ---------------------------------------------------------------------------------------------------- (4)
G80 G91 G28 X0. Y0. Z0.
M05
Starting point
(Tool retreat)
R point
Command description: Command G84 taps right-handed threads. It functions the same as
command G74 except that the turning direction of G84 is opposite to that of command G74.
All the remaining operations and notes are the same as command G74.
Action in steps
Action in steps
Back to
Starting point starting point Starting point
Z point Z point
[Illustrations]
Starting point
R point
(Tool retreat)
[Illustrations]
Starting point
(Tool retreat)
R point
Action in steps
Back to
Starting point starting point Starting point
Z point Z point
[Illustrations]
M03 S1000
G17 G90 G00 G54 X0. Y0.
G00 Z100.
G99 G85 X0. Y0. Z-30. R10. K1 F100. ---------------------------------------------------------------- (1)
X-15. ----------------------------------------------------------------------------------------------------------- (2)
X-30. ----------------------------------------------------------------------------------------------------------- (3)
X-30. Y15. ---------------------------------------------------------------------------------------------------- (4)
G80 G91 G28 X0. Y0. Z0.
M05
Starting point
R point
(Tool retreat)
[Illustrations]
M03 S1000
G17 G90 G00 G54 X0. Y0.
G00 Z100.
G98 G85 X0. Y0. Z-30. R10. K1 F100. ---------------------------------------------------------------- (1)
X-15. ----------------------------------------------------------------------------------------------------------- (2)
X-30. ----------------------------------------------------------------------------------------------------------- (3)
X-30. Y15. ---------------------------------------------------------------------------------------------------- (4)
G80 G91 G28 X0. Y0. Z0.
M05
Starting point
(Tool retreat)
R point
Command description: See the figure below for the motions set by this command. After
bored to given depth Z, the spindle stops turning and lifts to the initial height with fast
feeding command G00. A full boring cycle is completed after the spindle returns to the initial
height and resumes positive direction turning. There is no Q parameter in this command
and so it lacks any offset or peck cutting motion. As the tool keeps contacting the working
surface constantly and is not turning when lifting off the hole, the hole wall may be left with
minor scratches. Command G86 is thus usually used for rough boring.
Action in steps
Action in steps
Back to
Starting point starting point Starting point
Z point Z point
[Illustrations]
M03 S1000
G17 G90 G00 G54 X0. Y0.
G00 Z100.
G99 G86 X0. Y0. Z-30. R10. K1 F100. ---------------------------------------------------------------- (1)
X-15. ----------------------------------------------------------------------------------------------------------- (2)
X-30. ----------------------------------------------------------------------------------------------------------- (3)
X-30. Y15. ---------------------------------------------------------------------------------------------------- (4)
G80 G91 G28 X0. Y0. Z0.
M05
Starting point
R point
(Tool retreat)
[Illustrations]
M03 S1000
G17 G90 G00 G54 X0. Y0.
G00 Z100.
G98 G86 X0. Y0. Z-30. R10. K1 F100. ---------------------------------------------------------------- (1)
X-15. ----------------------------------------------------------------------------------------------------------- (2)
X-30. ----------------------------------------------------------------------------------------------------------- (3)
X-30. Y15. ---------------------------------------------------------------------------------------------------- (4)
G80 G91 G28 X0. Y0. Z0.
M05
Starting point
(Tool retreat)
R point
Command description: The tool fast positions to the position set by coordinates (X, Y)
before the spindle moves to the position the cutter tip in a given direction. The tool center
then offsets a distance of value Q. In this way, the cutter blade does not contact the
machining surface when moving to height R. After fast positioning to height R, the tool
center moves to the original position given by coordinates (X, Y) and the spindle starts to
turn forward. The tool now starts cutting from point R to point Z. The tool center then offsets
a distance Q and the spindle positions after reaching point Z. The tool then returns back to
the Z-axis initial point with fast positioning and resets the offset after reaching the initial
point. The offset value Q equals the one set by command G76 in both magnitude and
direction. Please note that command G87 does not support operation in G99 mode.
Action in steps
Back to
Starting point starting point
R point
Z point
[Illustrations]
M03 S1000
G17 G90 G00 G54 X0. Y0.
G00 Z100.
G98 G87 X0. Y0. Z-30. R10. P1000 Q5. K1 F100. ------------------------------------------------- (1)
X-15. ----------------------------------------------------------------------------------------------------------- (2)
X-30. ----------------------------------------------------------------------------------------------------------- (3)
X-30. Y15. ---------------------------------------------------------------------------------------------------- (4)
G80 G91 G28 X0. Y0. Z0.
M05
Starting point
(Tool retreat)
R point
Command description: Command G88 sets the tool to cut from point R to given point Z and
pause at point Z for the time specified in parameter P. The spindle stops turning and
execution (same as executing command M00) after a pause period and fast retreats the
tool to point R or the initial point only after the program execution key is pressed.
In addition, the operator may manually move (by switching the system to "manual" mode)
the tool upward in Z+ direction after cutting to point Z. Switch the system mode back to
"Auto" and press the program execution key to resume program control. After the Z-axis is
lifted to point R (G99) or the initial point (G98) a full cycle of command G88 is accomplished.
This command is used for blind hole boring.
Action in steps
Action in steps
Back to
Starting point starting point Starting point
Z point Z point
[Illustrations]
M03 S1000
G17 G90 G00 G54 X0. Y0.
G00 Z100.
G99 G88 X0. Y0. Z-30. R10. P1000 K1 F100. ------------------------------------------------------ (1)
X-15. ----------------------------------------------------------------------------------------------------------- (2)
X-30. ----------------------------------------------------------------------------------------------------------- (3)
X-30. Y15. ---------------------------------------------------------------------------------------------------- (4)
G80 G91 G28 X0. Y0. Z0.
M05
Starting point
R point
(Tool retreat)
[Illustrations]
M03 S1000
G17 G90 G00 G54 X0. Y0.
G00 Z100.
G98 G88 X0. Y0. Z-30. R10. P1000 K1 F100. ------------------------------------------------------ (1)
X-15. ----------------------------------------------------------------------------------------------------------- (2)
X-30. ----------------------------------------------------------------------------------------------------------- (3)
X-30. Y15. ---------------------------------------------------------------------------------------------------- (4)
G80 G91 G28 X0. Y0. Z0.
M05
Starting point
(Tool retreat)
R point
Command description: Command G89 is for blind hole reaming. It functions the same as
command G85 except that a pause P can be added at point Z. Both its downward and
upward movement of the tool in the Z-axis is in F feed rate. With added pause at point Z,
the depth and diameter of the hole can be greatly improved by keeping the tool staying a
while when cut to position Z.
Action in steps
Action in steps
Back to starting
Starting point point Starting point
Z point Z point
[Illustrations]
M03 S1000
G17 G90 G00 G54 X0. Y0.
G00 Z100.
G99 G89 X0. Y0. Z-30. R10. P1000 K1 F100. ------------------------------------------------------ (1)
X-15. ----------------------------------------------------------------------------------------------------------- (2)
X-30. ----------------------------------------------------------------------------------------------------------- (3)
X-30. Y15. ---------------------------------------------------------------------------------------------------- (4)
G80 G91 G28 X0. Y0. Z0.
M05
Starting point
R point
(Tool retreat)
[Illustrations]
M03 S1000
G17 G90 G00 G54 X0. Y0.
G00 Z100.
G98 G89 X0. Y0. Z-30. R10. P1000 K1 F100. ------------------------------------------------------ (1)
X-15. ----------------------------------------------------------------------------------------------------------- (2)
X-30. ----------------------------------------------------------------------------------------------------------- (3)
X-30. Y15. ---------------------------------------------------------------------------------------------------- (4)
G80 G91 G28 X0. Y0. Z0.
M05
Starting
point
R point
[Illustrations]
From point 1 of coordinates (X10,Y10) to point two (X30,Y30) the tool moves an actual
distance of X20 and Y20 as shown in the figure below.
Actual
movement
O1000
G01 G90 X10.0 Y10.0 F500.0
X30.0 Y30.0
Command description: The increment command G91 sets all axial movements in a single
node motion program from the current position to a given distance. The G91 command is a
status command that cancels command G90 once it is activated.
[Illustrations]
From point 1 of coordinates (X10, Y10) to point two (X20, Y20) the tool moves an actual
distance of X20 and Y20 to point (X30, Y30) of the actual mechanical coordinates as shown
in the figure below.
Mechanical coordinates
Actual
movement
O1001
G01 G91 X10.0 Y10.0 F500.0
X20.0 Y20.0
O0010
G01 G90 X0 Y0 F1000
X40.0
G91 Y20.0
X-5.0 Y5.0
G90 X5.0
X0 Y20.0
Y0
M30
Command description: Command G92 X0 Y0 Z0 sets the current tool position as the zero
point of an absolute coordinates system. The absolute command in the program calculates
positions relative to this point. Values of absolute coordinates and current positions are all
refreshed with new values given by parameters of command G92 Xˍ Yˍ Zˍ (as long as any
of the three parameters X, Y and Z have values assigned to them).
Note:
(1) Mode sets by command G92 will be cancelled, if it is activated, when the program
ending command M02/M30 is executed.
(2) You may reset the status set by command G92 by pressing the RESET key.
[Illustrations]
Workpiece
O0005
G00 G90 G54 X0.0 Y0.0
G00 G92 X0.0 Y0.0
G01 X100.0 Y0.0 F1000.0
X100.0 Y50.0
X0.0 Y50.0
X0.0 Y0.0
M30
Command description: The feed rate set by command G94 is in the unit of mm/min. This
status set command remains effective. It sets the tool to cut at the speed given by
parameter F in the unit of mm/min. G94 can be executed along with the motion node
simultaneously. It can be executed in single node alone as well. It is commonly used by
most milling machines for feed rate calculation.
Workpiece
Command description: Command G98/G99 is a status command for returning the tool back
to a specified height after the execution of a fixed loop command ends. Command G98
returns the tool back to its initial point after a cycle command. After the execution of a fixed
cycle command ends, the G98 command in the program returns the tool back to its initial
point of this fixed cycle command. Command G98 can be reset by command G99. At the
system initialization phase, you may set command G98 to direct the system on how to
resume the initial points as illustrated in the figure below.
Action in steps
Back to
Starting point starting point
R point
Z point
Command description: Command G98/G99 is a status command for returning the tool back
to a specified height after the execution of a fixed cycle command ends. Command G99
returns the tool back to its reference point (R) after a cycle command. Please use command
G98, instead of G99, to return the tool back to its initial point after a cycle command.
Action in steps
Starting point
Back to
R point starting point
Z point
Chapter 3 M Commands
The auxiliary function M commands are used in turning the on and off functions of the
machine. Its format is a capital letter M suffixed with three digits. Some systems-defined M
commands can be actuated for program control without any MLC coding.
Command description: M01 command functions the same way as M00 command does
except that it does not stop a program from running on its own. Its
real effects come only when the selected stop key function of the
second control panel is enabled. If the selected stop key function of
the second control panel is not activated, the program ignores M01
command and keeps on running until an M00 or program ending
command appears or the selected stop key function is pressed.
Command description: You may group fixed or repetitive actions in a program into a
sub-routine to simplify the structure and reduce the length of the
program. The main program calls a sub-routine which in turn can
call another sub-routine in a next level, up to eight layers.
When the controller reads an M98 command, it jumps to the
designated sub-routine and execute it according to the setting
number of times.
Pˍ: indicates program code of the subroutine; Lˍ: Indicates the
number of times the subroutine is to be executed.
[Illustrations]
Command description: M98 command can run a sub-routine from the main program. If the
user desires to back to the main program, command M99 again.
Thus, after executing to the node of M99, the sub-routine of the
main program will call the next node and then start to execute the
command. If P_ is added as the suffix of M99, the sub-routine will
not return to the next node of M98 P_L_, but the P program series of
the main program.
[Illustrations]
Variable types
#[<expression>] description
# [#20] (Valid)
#[#20∆3] (Valid) where ∆ represents operators =, +, -,
*, and /
##20 (Invalid), there cannot be two variable
symbols (#) in a sequence.
#[#20] = … (Valid)
#20 = … (Valid)
#[#20 - #10] = … (Valid), no operator can precede an equal (=)
symbol
#[- #20]= … (Valid)
[WHILE]
︴
ENDW
Illustration:
WHILE [#80<=360.] (Enters the cycle for repetitive execution when #80 is less than
or equal to 360.)
WHILE [#60>=20.] (Enters the second cycle for execution when #60 is greater than
or equal to 20.)
#60=#60-2.
ENDW (The second cycle ends when ENDW is encountered.)
#80=#80+15.
#50=#50-0.05
ENDW (The first cycle ends when the second ENDW is encountered.)
Branch conditions
IF [discriminant] GOTON (N is the sequence number in the procedure)
When the IF statement is true, the program branches (GOTO) to statement number N for
execution. Otherwise, the program executes the next node again.
∫
N10 #12=#10 #13=#11+2;
IF〔#2=1〕GOTO200; When Branch
#12=#10-#3; #2=1, search
#13=#11-#4; branch to
N200 X#12 Z#13; N200.
#5=#5+2;
∫
Note 1: When searching the sequence number in branch, it starts from the beginning. If not,
an alarm (B61C) occurs. If there are more than one sequence number, it executes
from the first searched one.
Illustration:
#100 = 1.234; (Assign value 1.234 to #100)
#100 = #101; (Assign value of #100 to #101)
#100 = [[#101+#102]/2.0]; (Assign value of #100 to be the average of #101 and #102)
#100 = #102+2; (Assign value of #100 to be the sum of #102 and 2)
#100 = SIN[#102];
Restrictions: In a macro program that uses a macro to call the G, M or T code, the
parameter G code is set as a general one and cannot call another macro.
Restrictions: In a macro program that uses a macro to call a G, M or T code, the parameter
M code is set as a general one and cannot call another macro.
Restrictions: In a macro program that uses a macro to call G, M or T code, the parameter T
code is set as a general one and cannot call another macro.
Summary:
(1) Local variable: #1~#50 (for read and write)
(4) MLC logic output: #1801~#1832 MLC->NC (read only) at macro input point
M1024_32
(5) MLC data output: #1833~#1848 MLC->NC (read only) at macro input point
D1024_16
(6) MLC logic input: #1864~#1895 NC->MLC (write only) at macro output point
M2080_32
(7) MLC data input: #1896~#1911 NC->MLC (write only) at macro output point
D1336_16