Before operating, please refer to the specifications from the machine. manufacturer to ensure that the functions are ava
SIEG CNC Milling Programming Manual
Version: Version:
V 1.2 1.2
SIEG CNC Milling Programming Manual
Preface This manual refers to the method of programming NC code in the SIEG CNC Milling software. Please read this manual carefully before using the software. And the familiarity of the safety items concerned will guarantee the safe operation on software. In this programming manual, the contents of SIEG CNC Milling software concerned will be described as particular as possible, the no specific items are considered as “Impossible” or “Unallowed”. CAUTION If the conflicts exist between this Manual’s Limitation concerned and the Operation Manual of the machine manufacturer, please follow the latter. The operations with no description are supposed to be impossible. The prerequisite of editing this manual is that the machine is fully equipped with the operation function. Before operating, please refer to the specifications from the machine manufacturer to ensure that the functions are available. The operation of the CNC system concerned, please refer to “SIEG CNC Milling Operating Manual”.
1
SIEG CNC Milling Programming Manual
Table of Contents Chapter 1 Summary ........................................................................5 1.1 Tool movement along workpiece figure ─ Interpolation ............................ 5 1.1.1 Tool movement along a straight line ................................................. 5 1.1.2 Tool movement along an arc............................................................. 5 1.2 Feed—Feed Function ................................................................................. 6 1.3 Part Drawing and Tool Movement ............................................................... 7 1.3.1 Reference Position ........................................................................... 7 1.3.2 Coordinate system on part drawing and coordinate system specified by CNC system ................................................................................................. 8 1.3.3 Coordinate system and reference point ........................................... 11 1.3.4 How to indicate Command Dimensions for Moving the Tool— Absolute, Incremental Commands .................................................................. 12 1.4 Cutting Speed - Spindle Speed Function .................................................. 13 1.5 Miscellaneous Function ............................................................................ 13 1.6 Overview of Programming ........................................................................ 14 1.6.1 General Progress of Programming ................................................. 14 1.6.2 Overview of Programming Language ............................................. 15 1.6.3 Blocks of code ................................................................................ 16 1.6.4 Address Descriptions ...................................................................... 16 1.6.5 Program block and repetition .......................................................... 17 1.6.6 Main program and subprogram ...................................................... 18 1.7 Tool Figure and Tool Motion by Program .................................................. 18 1.7.1 Machining using the End of the tool – Tool Length Compensation Function .......................................................................................................... 18 1.7.2 Machining using the Side of the tool – Tool radius Compensation Function .......................................................................................................... 19
Chapter 2 Preparatory Function.....................................................20 2
SIEG CNC Milling Programming Manual
2.1 G Function Table....................................................................................... 20 2.2 Interpolation Function ............................................................................... 22 2.2.1 G00 Positioning .............................................................................. 22 2.2.2 G01 Linear Interpolation ................................................................. 24 2.2.3 G02/G03 Circular Interpolation ....................................................... 26 2.3 Feed Functions ......................................................................................... 31 2.3.1 Rapid Traverse ............................................................................... 31 2.3.2 Cutting Feed ................................................................................... 31 2.3.3 G61/G64 Cutting Feedrate Control ................................................. 33 2.3.4 G04 Dwell ....................................................................................... 34 2.4 Coordinate Value and Dimension ............................................................. 34 2.4.1 G20/G21 Inch/Metric Conversion ................................................... 34 2.4.2 G90/G91 Absolute and Incremental Programming ......................... 35 2.5 Reference Position ................................................................................... 36 2.5.1 G28 Reference Position return (non-modal) ................................... 36 2.5.2 G29 Automatic Return from the reference position (non-modal)..... 36 2.6 Tool Compensation Function .................................................................... 38 2.6.1 Tool Radius Compensation ............................................................. 38 2.6.2 Tool Length Offset........................................................................... 50 2.7 Coordinate System ................................................................................... 53 2.7.1 G53 Selecting Machine Coordinate System ................................... 53 2.7.2 Workpiece Coordinate System ....................................................... 54 2.7.3 G17/G18/G19Plane Selection ........................................................ 56 2.8 G98/G99 Return point level ...................................................................... 57
Chapter 3 Spindle Speed Function ................................................58 Chapter 4 Auxiliary Function ..........................................................59 4.1 M00 Program Stop .................................................................................... 59 3
SIEG CNC Milling Programming Manual
4.2 M01 Optional stop..................................................................................... 59 4.3 M02 Program Stop .................................................................................... 59 4.4 M20 End of Program, recycle automatically ............................................. 60 4.5 M30 End of Program(return to the beginning) .......................................... 60 4.6 M03 Spindle CW Rotation ......................................................................... 60 4.7 M04 Spindle CCW Rotation ...................................................................... 60 4.8 M05 Spindle Stop ...................................................................................... 61 4.9 M98/M99 Call Subprogram/Subprogram Return....................................... 61
Chapter 5 Canned Cycle ...............................................................63 5.1 G73 High–speed Peck Drilling Cycle ........................................................ 66 5.2 G74 Left–handed Tapping Cycle ............................................................... 68 5.3 G80 Canned Cycle Cancel ....................................................................... 70 5.4 G81 Drilling Cycle, Spot Drilling ................................................................ 70 5.5 G82 Drilling Cycle Counter Boring Cycle .................................................. 71 5.6 G83 Peck Drilling Cycle ............................................................................ 73 5.7 G84 Tapping Cycle ................................................................................... 74 5.8 G85 Boring Cycle...................................................................................... 76 5.9 G86 Boring Cycle...................................................................................... 77 5.10 G89 Boring Cycle.................................................................................... 78
Chapter 6 Other Notes on Programming .......................................80 6.1 Comment .................................................................................................. 80 6.2 “//” Optional Block Skip command............................................................. 80
Chapter 7 Error Lists .....................................................................81
4
SIEG CNC Milling Programming Manual
Chapter 1 Summary This chapter is to explain the basic conceptions mentioned in the manual.
1.1 Tool movement along workpiece figure ─ Interpolation During machining, the tool moves along the straight lines and arcs constituting the workpieces figure. In the actual processing, some machines move tables instead of tools but this manual assumes that tools are moved against workpieces.
1.1.1 Tool movement along a straight line
fig 1.1 Tool movement along a straight line
1.1.2 Tool movement along an arc
Command: G03 X_ Y_ R_ WorkPiece Tool
fig 1.2 Tool movement along an arc
The tool is commanded to move along a straight line or an arc in the way described above, 5
SIEG CNC Milling Programming Manual
this function is referred as the interpolation in the NC system. Symbols of the programmed commands G01, G02, G03 … are called preparatory function which specifies the type of interpolation conducted in the CNC system.
fig 1.3 Interpolation function
1.2 Feed—Feed Function
fig 1.4 Feed function
Movement of the tool at a specified speed for cutting a workpiece is called the feed. Feedrate can be specified by using actual numeric value. For example, to feed the tool at a rate of 50 mm/min, specify the following command in the program: F 50.0. The function of specifying feed rate is called feed function.
6
SIEG CNC Milling Programming Manual
1.3 Part Drawing and Tool Movement 1.3.1 Reference Position A specific position is provided in a CNC machine, normally tool change and programming of absolute zero point are performed at this position. This specific position is called the reference point (reference position).
fig 1.5 Reference Point
The tool can be moved to the reference point in two ways. (1) Manual Reference Point Return. See “SIEG CNC Milling Operating Manual”. (2) Automatic Reference Point Return. See Command G28.
7
SIEG CNC Milling Programming Manual
1.3.2 Coordinate system on part drawing and coordinate system specified by CNC system
fig 1.6 Coordinate system
The following two coordinate systems are specified at different positions. Coordinate system on part drawing (1) The coordinate system is written on the part drawing. The coordinate values on this coordinate system are used for the program data. (2) Coordinate system specified by the CNC. The coordinate system is set on the machine tool. This can be achieved by programming the distance from the current position of the tool to the zero point of the coordinate system to be set.
8
SIEG CNC Milling Programming Manual
fig 1.7 Coordinate system specified by CNC
When the workpiece is fixed on the table, the relative relation of the two coordinate systems comes into being.
fig 1.8
The tool moves on the coordinate system specified by the CNC in accordance with the command program generated with respect to the coordinate system on the part drawing, and cuts a workpiece into a shape on the drawing. Therefore, in order to correctly cut the workpiece as specified on the drawing, the two coordinate systems must be set at the same position. In order to define two coordinate systems at the same location, the following method is usually used according to the figure and the number of the workpiece to be machined: (1) Using a standard plane and point of the workpiece. Bring the tool center to the workpiece standard point. And set the coordinate system specified by CNC at this position.
9
SIEG CNC Milling Programming Manual
(2) Mounting a workpiece directly against the jig. Meet the tool center to the reference position. And set the coordinate system specified by CNC at this position. (Jig shall be mounted on the predetermined point from the reference position.)
(3) Mounting a workpiece on a pallet, then mounting the workpiece and pallet on the jig (Jig and coordinate system shall be specified by the same as 2)).
10
SIEG CNC Milling Programming Manual
1.3.3 Coordinate system and reference point A special position is set by a CNC machine, the tool change and absolute programmed zero setting are generally conducted at this position, and this position is called machine reference point. The machine coordinate system zero point is also called mechanical zero point, reference point or machine original point; please ask the manufacturer for the position in the machine. The workpiece coordinate system zero point is also called programmed zero point or program original point, its position is set arbitrarily, and defined by aligning the tool after fixing the workpiece. It is another coordinate system relative to the original point of the machine coordinate system. The differences of the wokpiece original point result in the differences of the coordinate value, even if the tool tip is in the same machine position. The workpiece coordinate system original point must be set in order to guarantee the sole coordinates value of the tool tip. The relations between the machine coordinate system original point, the machine reference point and workpiece coordinate system original point see fig 1.9.
fig 1.9 The coordinate system original point, the machine reference point and workpiece coordinate system original point 11
SIEG CNC Milling Programming Manual
1.3.4 How to indicate Command Dimensions for Moving the Tool— Absolute, Incremental Commands There are two coordinate values for the tool movement command, absolute, incremental commands. (1) Absolute commands Absolute value command is that the tool moves to “the point at a certain distance from the coordinate system zero point”, namely, the tool moves to the position of command coordinate values.
When the tool moves from point A to point B, command as below: G90 G00 X10.0 Y30.0 Z20.0 (2) Incremental commands Specify the distance from the previous tool position to the next tool position. Z A 30 (10,30,20)
40 B Y
X
12
10
SIEG CNC Milling Programming Manual
The tool moves from point A to point B, command as below: G91 G00 X40.0 Y-30.0 Z-10.0
1.4 Cutting Speed - Spindle Speed Function
fig 1.10 Spindle speed function
The speed of the tool with respect to the workpiece when the workpiece is machined is called the cutting speed. The cutting speed unit: mm/min or inch/min. Commands related to the spindle speed are called the spindle speed function. The spindle speed unit: rpm. Example: When a workpiece should be machined with a tool 100 mm in diameter at a cutting speed of 80 mm/min. The spindle speed is approximately 250 rpm, which is obtained from N=1000v/πD. Hence the following command is required: S250 .
1.5 Miscellaneous Function When machining is actually started, it is necessary to rotate the spindle, and feed coolant. For this purpose, on–off operations of spindle motor and coolant valve should be controlled.
13
SIEG CNC Milling Programming Manual
fig 1.11 Miscellaneous function
The function of specifying the on–off operations of the components of the machine is called the miscellaneous function. In general, the function is specified by an M code. For example, when M03 is specified, the spindle is rotated clockwise at the specified spindle speed.
1.6 Overview of Programming 1.6.1 General Progress of Programming Programming is the first step for machining a part on a CNC milling machine, and then machine the part. A general progress of programming is shown below.
14
SIEG CNC Milling Programming Manual
fig 1.12 the progress of programming
Organization of Technology Plan The tool, tool path and allowance and the like can be specified according to the analysis of workpiece figure, technical condition, blank cast and technology plan. calculate the coordinate value of the tool path According to the shape of part, operation path and coordinate system, the coordinate value of the tool path can be calculated, such as a coordinate value of the start point ,the end point and center of an arc. writing programs According to the coordinate value of the tool path, movement sequence, tool number, cutting parameter and auxiliary action, writing program block by block following the command and format. input program After programming, you should input it into CNC system. machine first part The program can be confirmed through dry run function. When the first part is correct according to the result of dry run, machine the part directly.
1.6.2 Overview of Programming Language The SIEG part programming language consists of blocks of code made up of F codes, G codes, M codes, N codes, S codes, etc. By specifying the commands, the tool is moved along a straight line or an arc, or the spindle is rotated or stopped. The commands are specified in the sequence of actual tool movement in the program. Blocks and structure of blocks are shown below.
15
SIEG CNC Milling Programming Manual
fig 1.13 structure of blocks
1.6.3 Blocks of code The G-code coding system is made up of words. A word is an address followed by numbers. The address defines the meaning of the number that follows the address. These words are strung together to form blocks of code. A block of code (or “instruction”) is one or more words together that are grouped together on one line. A typical block of code starts with the sequence number of the block, the block and the program have the following configurations. As shown in fig 1.14.
fig 1.14 Block configuration
1.6.4 Address Descriptions The address defines the meaning of the number that follows the address. List as follows. ADDRESS A D F
DESCRIPTION A axis absolute or incremental coordinate value designation Tool compensation index Feedrate 16
SIEG CNC Milling Programming Manual
G I J K
L M N P
Q R
S X
Y
Z
Preparatory function X Axis distance from the start point to the center of an arc (with sign) (G02, G03) Y Axis distance from the start point to the center of an arc (with sign) (G02, G03) 1. Z Axis distance from the start point to the center of an arc (with sign) (G02, G03) 2.repetition times for drilling, tapping or boring cycles (G73, G74, G81, G82, G83, G84, G85, G86, G89) The name of subprogram Miscellaneous function sequence number 1.Subprogram repetition 2.Dwell time in milliseconds (G04) 3.Dwell time at the bottom of hole (G74, G82, G84, G89) Depth of cut for each cutting feed (G73, G83) 1.arc radius designation (G02, G03) 2.Distance to point R level from initial level (G73, G74, G81, G82, G83, G84, G85, G86, G89) Spindle speed 1.X axis absolute or incremental coordinate value designation (or end point, center point, coordinate component, etc.) 2.dwell time in seconds (G04) 3.hole position data for the X axis (G73, G74, G81, G82, G83, G84, G85, G86, G89) 1.Y axis absolute or incremental coordinate value designation (or end point, center point, coordinate component, etc.) 2.hole position data for the Y axis (G73, G74, G81, G82, G83, G84, G85, G86, G89) 1.Z axis absolute or incremental coordinate value designation 2.hole position data for the Z axis (G73, G74, G81, G82, G83, G84, G85, G86, G89)
1.6.5 Program block and repetition It’s very important for each block to be on a separate line. If you try to put two blocks on the same line, a serious error may happen. This could have serious consequences: let’s say you wanted to move from Point A to Point B in the first block and from Point B to Point C in the second block. If you put both blocks on the same line, this block can’t be executed for too many parameters. For instance, in the block “N100 G00 X13.0 Z3.0 X2.0 X9.5” , an error information ‘More than one X-Axis 17
SIEG CNC Milling Programming Manual
instruction, delete and edit them.’ will be displayed. Programmer should correct it until the program is right.
1.6.6 Main program and subprogram When machining of the same pattern appears at many portions of a program, a program for the pattern is created. This is called the subprogram. On the other hand, the original program is called the main program. The name of a subprogram must begin with character ‘O’ and it must be ended with ‘.SUB’. the middle of it represents the subprogram index. For instance, ‘O100.SUB’. The name of a main program must be ended with ‘.txt’. this file should contain information for operation with correct format. When a subprogram execution command appears during execution of the main program, commands of the subprogram are executed. When execution of the subprogram is finished, the sequence returns to the main program.
fig 1.15 Main program and subprogram
1.7 Tool Figure and Tool Motion by Program 1.7.1 Machining using the End of the tool – Tool Length Compensation Function Usually, several tools are used for machining one workpiece. The tools have different tool length. It is very troublesome to change the program in accordance with the tools. 18
SIEG CNC Milling Programming Manual
Therefore, the length of each tool used should be measured in advance. By setting the difference between the length of the standard tool and the length of each tool in the CNC, machining can be performed without altering the program even when the tool is changed. This function is called tool length compensation.
fig 1.16 Tool length compensation function
1.7.2 Machining using the Side of the tool – Tool radius Compensation Function Because a tool has a radius, the center of the tool path goes around the workpiece with the tool radius deviation. If the radius values of the tools are stored in the CNC, the tool can be moved by tool radius apart from the machined part figure. This is called tool radius compensation function.
fig 1.17 Tool radius Compensation Function
19
SIEG CNC Milling Programming Manual
Chapter 2 Preparatory Function The preparatory function is programmed by the address G following a two-digit number. G function is always located at the beginning of the block, which is used to define workpiece geometry and CNC operation states, such as interpolation, tool compensation, canned cycle and etc.. G codes are divided into the following two types: Type One-shot G Code Modal G Code
Meaning The G code is effective only in the block in which it is specified. The G code is effective until another G code of the same group is specified.
Example: G01 and G00 are modal G codes in modal group 01. G01X Z X
G01 is effective in this range.
G00Z
2.1 G Function Table Group 01 00 02 04 00 00 05
G code G00* G01 G02 G03 G04 G17* G18 G19 G20 G21* G28 G29 G40* G41
Function Positioning Linear interpolation Circular interpolation CW Circular interpolation CCW Dwell XY plane selection ZX plane selection YZ plane selection Input in inch Input in mm Return to reference position Return from reference position Tool radius compensation cancel Tool radius compensation left 20
SIEG CNC Milling Programming Manual
06
11
13
10
03 00 14 12
G42 G43 G44 G49* G53 G54* G55 G56 G57 G58 G59 G61* G64 G73 G74 G80* G81 G82 G83 G84 G85 G86 G88 G89 G90* G91 G92 G94* G95 G98* G99
Tool radius compensation right Tool length compensation positive direction Tool length compensation negative direction Tool length compensation cancel Machine coordinate system selection Workpiece coordinate system 1 selection Workpiece coordinate system 2 selection Workpiece coordinate system 3 selection Workpiece coordinate system 4 selection Workpiece coordinate system 5 selection Workpiece coordinate system 6 selection Exact stop mode Cutting mode Peck drilling cycle Counter tapping cycle Canned cycle cancel Drilling cycle, spot boring cycle Drilling cycle or counter boring cycle Peck drilling cycle Tapping cycle Boring cycle Boring cycle Boring cycle Boring cycle Absolute command Incremental command Changing workpiece coordinate system Feed per minute Feed per revolution (Unsupported) Return to initial point in canned cycle Return to R point in canned cycle
CAUTION The so-called “modal” means that G function remains effective until it is cancelled by other incompatible G functions in the same group or “Emergency Stop” and “Reset” key. The G function marked with “*” are enabled when the CNC enters the clear state due to power-on, or the execution of M02 or M30, pressing “Emergency Stop” or “Reset” button. G00, G01, G02 and G03 are mutually exclusive, that is, only one of these codes can be specified in the same block. G17, G18 and G19 are mutually exclusive in the same block. 21
SIEG CNC Milling Programming Manual
G40, G41 and G42 are mutually exclusive in the same block. G54 to G59 are mutually exclusive in the same block. G61 and G64 are mutually exclusive in the same block. G20 and G21 are mutually exclusive in the same block. G90 and G91 are mutually exclusive in the same block. G94 and G95 are mutually exclusive in the same block. G98 and G99 are mutually exclusive in the same block. G80- G89, G73 and G74 are mutually exclusive in the same block. G04, G28, G29 and G92 are mutually exclusive in the same block.
2.2 Interpolation Function 2.2.1 G00 Positioning Format:G00 X_ Y_ Z_ X_ Y_ Z: the coordinates of an end position in the absolute command or the distance the tool moves in the incremental command. The G00 command moves a tool to the position in the workpiece coordinate system specified with an absolute or an incremental command at the speed of the parameter “G00 Feedrate” setting value. Tool path in G00 positioning is divided into two types, which is determined by the parameter “Rapid Locate Interpolation” setting. Linear Interpolation Positioning The axes reach the target position simultaneously at the vectored speed of the parameter “G00 Feedrate” setting value. Tool path is the same with that of linear interpolation (G01). Non-linear Interpolation Positioning Each axis independently reaches the target position at the speed of the parameter “G00 Feedrate” setting value. Tool path generally does not become a straight line. The setting of system parameters “G00 Feedrate” and “Rapid Locate Interpolation”, please refer to “SIEG CNC Milling Operating Manual”.
22
SIEG CNC Milling Programming Manual
Start position
Linear positioon
Non linear position End position fig 2.1 Tool path of G00 Positioning
Example:
Y
End position 10
Start position 13.245
X
0 fig 2.2 G00 Example
As shown in fig 2.2 the tool makes a rapid movement by -13.245mm from the start point along X-Axis direction, and then by 10mm along Y -Axis direction. The codes are listed as follows: N100
G91
G00 X-13.245
Y10
CAUTION The rapid traverse rate is not necessarily specified in the G00 block, which is set by system parameter. G00 command is modal and incompatible with G01, G02 and G03. 23
SIEG CNC Milling Programming Manual
G00 command won’t disable the feedrate F specified before G00 is specified, that is, if G01, G02 and G03 are specified in the blocks following G00 and no F value is specified, the last F value before G00 remains effective.
2.2.2 G01 Linear Interpolation Format:G01 X_ Y_ Z_ F_ X_ Y_ Z_: the coordinates of an end position in the absolute command Or the distance the tool moves in the incremental command. F_: Feedrate Command G01 makes a tools move along a line to the specified position at the feedrate specified in F, generally used for cutting process. Command G01 can control a single axis movement and 2-axes/3-axes simultaneous movement. The movement specified by G01 moves along a line at the feedrate specified in F. When two axes move simultaneously, the tool path is a line between the start position and the end position. The machine moves along the linear path at the feedrate F. Feedrate of each axis is calculated according to the compound path in CNC. The feedrate specified in F is effective until a new value is specified. It need not be specified for each block. The feedrate commanded by the F code is measured along the tool path.If F is not specified, an error information “Movement block lacks of F instruction, edit it.” will be displayed. The feedrate for a movement along each axis as follows: G01 Xα Yβ Zγ Ff;
α Feedrate of X axis direction : FX = L × f
β Feedrate of Y axis direction : FY = L × f
γ Feedrate of Z axis direction : FZ = L × f
α + β +γ 2
L=
2
2
Example 1: As shown in fig2.3, the tool moves from the start position to the end position at a speed of 24
SIEG CNC Milling Programming Manual
200 mm/min. N100
G91
G01
X-20.3
Y-10
F200
Y 20.3
Start position 10
End position X
0 fig 2.3 G01 Example 1
Example 2: In fig2.4, the tool moves from the start position to the end position at a speed of 300 mm/min. Codes are as follows (Absolute command): N200
G90
G01
Y20.3
Z10
F300
Z
Start position End position 20.3 10
Y
0 fig 2.4 G01 Example 2
25
SIEG CNC Milling Programming Manual
CAUTION: The axis whose coordinate value is not specified in the block should not move. G01 command is modal and incompatible with G00, G02 and G03. G00 mode is active once power-on, or the execution of M02 /M30, pressing “Emergency Stop” or “Reset” button.
2.2.3 G02/G03 Circular Interpolation G02: CW Circular Interpolation G03: CCW Circular Interpolation Commands G02 and G03 are used for moving a tool along a circular path (arc). The relations between G02 (clockwise)/G03 (counterclockwise) and the coordinate axes are shown as fig 2.5. Circular Interpolation movement can be performed in three planes (XY, ZX, YZ), which are specified by commands G17, G18, G19. Please refer to G17/G18/G19 Plane selection.
fig 2.5 Definitions of Arc Direction
Commands G02/G03 can move the tool to the specified coordinate position along a circular arc at a specified feedrate F, generally used for the cutting process, which can span different quadrants automatically. During circular programming, circular direction (G02/G03), feedrate (F), distance from the start point to the center of an arc (I, J, K) or arc radius ±R (If the arc radian is no more than 180°, the R value is positive; if the arc radian is more than 180°, the R value is negative. In the absolute command (G90), absolute coordinate value of arc end position (X, Y, Z) shall be given; in the incremental command (G91), the coordinate value of arc end position relative to start position (X, Y, Z) shall be given, as shown in fig 2.6.
26
SIEG CNC Milling Programming Manual
Y Path taken with clockwise circular interpolation
Center point
End point specified with X,Y and Z parameters
radius I
K
Path taken with counterclockwise circular interpolation X
Start position
fig 2.6 Circular Interpolation
Format:
Item
Specified Contents
1
Circular Direction
Comman d G02 G03
2
3
End Positio n
Meaning Circular Interpolation CW Circular Interpolation CCW
Absolute command
X,Y,Z
The coordinates of end point(G90)
Incremental command
X,Y,Z
Distance from start point to end point(G91)
I
X Axis distance from the start
Distance from the start
27
SIEG CNC Milling Programming Manual
point to the center of an arc
4
point to the center of an arc (with sign) J
Y Axis distance from the start point to the center of an arc (with sign)
K
Z Axis distance from the start point to the center of an arc (with sign)
Arc radius
R
Arc radius(with sign)
Feedrate
F
Feedrate along the arc
Example 1: In fig 2.7, in XY plane, the tool moves from the start point (X20,Y20) to the end point (X30,Y10) at the feedrate of 60 mm/min along a circular path. The coordinate value of the arc center relative to start point is(I0,J-10), codes as follows: N100 G02 X30 Y10 I0 J-10 F60; Absolute command N100 G91 G02 X10 Y-10 R10 F60; Incremental command with R programming:
fig 2.7
Circular interpolation example
Notes: Command G90/G91 specifies the coordinates in absolute / incremental way. The feedrate specified by the F code in circular interpolation specifies the tangential speed of the arc. G02 and G03 are modal and mutually incompatible. Also, they are mutually incompatible with G00 and G01. They also can be written in G2 and G3. X, Y and I, J or R is programmed for the arc in G17 plane; 28
SIEG CNC Milling Programming Manual
X, Z and I, K or R is programmed for the arc in G18 plane; Y, Z and J, K or R is programmed for the arc in G19 plane; X, Y, Z can not be specified in the same G02/G03 block. I, J, K can not be specified in the same G02/G03 block. I, J, K ,R can not be specified in the same G02/G03 block. To program a full circle, omit coordinates for the end point (or specify an end point which is the same as the start point), and specify the center points of the circle using the I, J and K arc center modifiers. The end point will then be considered the same as the start point, and a 360° arc (a circle) will be specified. Arc radius R can be specified as plus or minus. A plus R will generate a arc of 180°or less, while a minus R will generate a arc of 180° or wider, as shown in the following figure: Y
Path taken if arc radius is specified as negative(i.e. R-5.0)
Path taken if arc radius is specified as positive (i.e. R5.0) Center End point specified with X,Y and Z parameters
Start point
radius
radius
Center X
fig 2.8 Positive and Negative Arc Radii for Circular Interpolation
Warning: If the end point is located at the same position as the start point when R is used, an arc of 0° is programmed, the tool does not move. If you specify the arc radius with the R parameter, and the end point is not along the arc specified by that radius, an error message “Interpreter error 9:Radius is incorrect or end point is out of limitation.” Will be displayed. This only occurs when the distance between the end point 29
SIEG CNC Milling Programming Manual
and the start point is greater than twice the specified radius.
fig 2.9 Unacceptable Parameters for Circular Interpolation
Example 2:
Y 100 R50
60
R60
End point
Start point
40 0
90 120 140
The tool path above can be programmed as follows; (1) Absolute programming G92X200.0 Y40.0 Z0 G90 G03 X140.0 Y100.0 R60.0 F300 G02 X120.0 Y60.0 R50.0 or
30
200
X
SIEG CNC Milling Programming Manual
G92X200.0 Y40.0 Z0 G90 G03 X140.0 Y100.0 I–60.0 F300 G02 X120.0 Y60.0 I–50.0 (2) Incremental programming G91 G03 X–60.0 Y60.0 R60.0 F300 G02 X–20.0 Y–40.0 R50.0 or G91 G03 X–60.0 Y60.0 I–60.0 F300 G02 X–20.0 Y–40.0 I–50.0
2.3 Feed Functions The feed functions control the feedrate of the tool. The following two feed functions are available:
2.3.1 Rapid Traverse When the positioning command (G00) is specified, the tool moves at a rapid traverse feedrate set in the parameter “G00 Feedrate”.
2.3.2 Cutting Feed The tool moves at a programmed cutting feedrate. The tool feedrate is specified by the numeric value after F ode(mm/min or inch/min) linear interpolation (G01), circular interpolation (G02, G03).
2.3.2.1 Tangential speed constant control Cutting feed is controlled so that the tangential feedrate is always set at a specified feedrate.
31
SIEG CNC Milling Programming Manual
Y
End point
Y
Fx
Start point
Fy F
F
Fy Start point
Fx
End point
Center
X
X
Circular interpolation
Linear interpolation F: Tangential speed Fx: X-speed Fy: Y-speed
2
F= FX + FY
2
2.3.2.2 G94 Feed per minute After specifying G94, the amount of feed of the tool per minute is specified by the numeric value after F. G94 is modal. Once G94 is specified, it is valid until G95 (feed per revolution) is specified. At the time of power–on, or resetting CNC, or the execution of M02/M30, G94 is active.
fig 2.10 Feed per minute
2.3.2.3 G95 Feed per revolution— — Unsupported After specifying G95, the tool feed amount of per spindle revolution is specified by the numeric value after F code. This command is not supported now.
2.3.2.4 Cutting Feedrate Clamp The parameter “Maximum Speed” is set to control the upper limit of cutting feedrate for 32
SIEG CNC Milling Programming Manual
each axis.
2.3.3 G61/G64 Cutting Feedrate Control Cutting feedrate can be controlled, as indicated in the following table. Table 1 Cutting feedrate control Function name
G code
Validity of G code
Description
Exact stop
G61
Once specified, this function is valid until G64 is specified.
Cutting mode
G64
Once specified, this function is valid until G61 is specified.
The tool is decelerated at the end point of a block, then an in–position check is made. Then the next block is executed. The tool is not decelerated at the end point of a block, but the next block is executed.
The inter–block paths followed by the tool in the exact stop mode, and cutting mode are different.
fig 2.11 Example of tool paths from block ~ to block
Explanations: G61 and G64 are modal G codes. They can`t be specified in a block simultaneously. When the power is turned on or the system is reset to the clear state or M02 or M30 is executed, G64 take effect automatically in its modal group.
33
SIEG CNC Milling Programming Manual
2.3.4 G04 Dwell Format: G04 X_ or P_ X_ delay time, Unit: s P_ delay time, Unit: ms Command G04 is specified to dwell the block. The execution of the next block is delayed by the specified time.
Example N1010 G04 X20X10.3
dwell for 2010.3s
N1010 G04 U20.3
dwell for 20.3s
N1010 G04 P203
dwell for 203 ms
G00,G01,G02,G03,G04,G28 and G29 can`t be specified in a block simultaneously. G04 can be written in G4.
2.4 Coordinate Value and Dimension 2.4.1 G20/G21 Inch/Metric Conversion Format: G20: Inch Input G21: mm Input Commands G20 and G21 are used to determine the unit of data input in inch or mm. However, the unit of data input for degrees remains unchanged. The unit systems for the following values are changed after G20/G21 is specified: (1) Feedrate commanded by F code (2) Positional Command (3) Movement distance in incremental feed
Example 1: N100
G21
G91
G00
X10.2
Y20.3
This block means the tool moves the distance: 10.2mm along X-axis direction, 20.3 mm along Y-axis direction. 34
SIEG CNC Milling Programming Manual
Example 2: N100
G20
G91
G00
X10.2
Y20.3
This block means the tool moves the distance: 10.2 inch along X-axis direction, 20.3 inch along Y-axis direction. G20 and G21 command are modal. G21 is the default. At the time of CNC power-on, and the execution of M02, M30, or pressing “Emergency Stop” or “Reset” button, G21 mode is active. G20 and G21 are mutually incompatible in the same block.
2.4.2 G90/G91 Absolute and Incremental Programming G90 and G91 are used to command absolute or incremental programming respectively.
Format: G90: Absolute command, coordinate value of end position. G91: Incremental command, the distance of the tool movement G90 and G91 are modal. G90 and G91 are mutually incompatible in the same block. At the time of power-on and the execution of M02, M30, or pressing “Emergency Stop” or “Reset” button, G90 mode is active.
Example:
fig 2.12 G90/G91 Absolute and Incremental Programming
Start point is P0(X50 Y10). 35
SIEG CNC Milling Programming Manual
Absolute Programming:
N10 G90 G01 X30 Y20
;
P0->P1
N20
;
P1->P2
;
P0->P1
;
P1->P2
X20 Y30
Incremental Programming: N10 G91 G01 X-20 Y10 N20
X-10 Y10
2.5 Reference Position 2.5.1 G28 Reference Position return (non-modal) The reference position is a fixed position on a machine tool to which the tool can easily be moved by the reference position return function. G28 performs the positioning to the intermediate point and returning the reference positions for each axis at the rapid traverse rate. As shown in fig 2.13.
Format: G28 X_ _
Y_ _
Z_ _ 4th_ _
X_,Y_,Z_or 4th_: The coordinates of the intermediate point In this manual, dimension word “4th” represents any one of A, B, C.
fig 2.13 Automatic Return To Reference Point (G28)
For safety, the tool offset compensation should be cancelled before executing this command.
2.5.2 G29 Automatic Return from the reference position (non-modal) Command G29 performs the positioning to the target point through the intermediate point specified in G28 block from the reference position for each axis at the rapid traverse rate 36
SIEG CNC Milling Programming Manual
(G00).
Format: G29 X_ _
Y_ _
Z_ _ 4th_ _
X_,Y_,Z_or 4th_: The coordinates of the target point for an absolute command. In this manual, dimension word “4th” represents any one of A, B, C.
fig 2.14 Automatic Return From Reference Point (G29)
In general, G29 is specified immediately following the G28 command.
Example: G28 G90 X1000 Y500; point A to the reference position R through the intermediate point B. (Changing the tool at the reference position) G29 X1300 Y200; the tool moves from the reference point R to the end point C through the intermediate point B.
37
SIEG CNC Milling Programming Manual
fig 2.15 Reference Position Return and return from the reference position
2.6 Tool Compensation Function 2.6.1 Tool Radius Compensation During machining figure, since a tool has a certain radius (the radius of milling tool for the milling), the tool centre path did not coincide with the programmed path of the part to be machined. Tool radius compensation enables the contour of the part to be programmed directly without taking the dimensions of the tool into account.When the tool is moved, the tool path can be shifted by the radius of the tool. There are two kinds cutter compensation mode with three commands. G40: Cancel radius compensation G41: Radius compensation left. As shown in fig 2.16 G42: Radius compensation right. As shown in fig 2.16.
38
SIEG CNC Milling Programming Manual
fig 2.16 Tool radius compensation
2.6.1.1 G41/G42 Tool Radius Compensation(Left/ / Right) G41/G42 creates an offset vector with a length equal to the radius of the tool. They must cooperate with G00, G01 to start tool radius compensation.
Format: G00 (or G01) G41 (or G42) X_ Y_ Z_ D_ G41: Tool radius compensation left G42: Tool radius compensation right X, Y, Z: Axis for movement D:
Code for specifying the tool compensation value
G41 offsets the tool towards the left of the workpiece as you see when you face in the same direction as the movement of the cutting tool.
fig 2.17 tool radius compensation left(G41)
G42 offsets the tool towards the right of the workpiece as you see when you face in the same direction as the movement of the cutting tool.
39
SIEG CNC Milling Programming Manual
fig 2.18 tool radius compensation right(G42)
Explanations (1) The establishment and cancellation of radius compensation is not permitted to be in G02/G03 block. Otherwise an error information “The establishment or cancellation of radius compensation is specified in the non-linear movement block, delete and edit it.” will be displayed. (2) D code is modal; it is effective until another D code is specified. The compensation number consists of two numeric values after address D, such as D03 which means the third tool compensation value is to be selected. In the system, up to 20 groups of tool offset value are available (D01-D20). The tool compensation value corresponding to offset No.0, that is, D00 always gets 0. It is impossible to set D00 to any other tool compensation value. (3) Change of the cutter compensation value The offset amount is changed generally when the tool is changed in the offset cancel mode, but can be changed in the offset mode only in positioning (G00) or linear interpolation (G01).If the tool compensation value is changed in offset mode (G41/G42), the vector at the end point of the block is calculated with the new tool compensation value.
fig 2.19 Changing the cutter compensation value
40
SIEG CNC Milling Programming Manual
2.6.1.2 G40 Cancel Tool Radius Compensation Format: G00 (or G01) G40 X_ Y_ Z_ In the offset mode (G41/G42), when G40 is commanded, the equipment enters the offset cancel mode. Specify positioning (G00) or linear interpolation (G01) for cancel mode, if circular interpolation (G02, G03) is specified, alarm information will be displayed.
fig 2.20 Cancel tool radius compensation(G40)
Notes: The system must be in the offset cancel (G40) mode at the end of program. Otherwise, an error message “Tool radius compensation is not canceled, edit G40 instruction.” will be displayed. G40, G41, G42 are modal. They can’t be specified in a block simultaneously. When the power is turned on or the system is reset to the clear state or M02 or M30 is executed, G40 is active automatically.
Example:
41
SIEG CNC Milling Programming Manual
N5
250R
C1(700,1300) C3(-150,1150)
C2(1550,1550) P4(500,1150)
650R
650R
P5(900,1150)
N4
N6
N3
N7 P7(950,900)
P2 P3(450,900) (250,900)
P7 (1150,900)
N8
N2 P9 (700,650)
P1 (250,550)
P8 (1150,550)
N10 N1
N11
N9
Y axis Unit:mm
Start position
G92 X0 Y0 Z0 N1 G90 G17 G00 G41 D07 X250.0 Y550.0
N2 G01 Y900.0 F150 N3 X450.0 N4 G03 X500.0 Y1150.0 R650.0 N5 G02 X900.0 R-250.0 N6 G03 X950.0 Y900.0 R650.0 N7 G01 X1150.0 N8 Y550.0 N9 X700.0 Y650.0 N10 X250.0 Y550.0 N11 G00 G40 X0 Y0
X axis
Specifies absolute coordinates. The tool is positioned at the start position (X0, Y0, Z0). Starts cutter compensation (start–up). The tool is shifted to the left of the programmed path by the distance specified in D07. In other words the tool path is shifted by the radius of the tool (offset mode) because D07 is set to 15 beforehand (the radius of the tool is 15 mm). Specifies machining from P1 to P2. Specifies machining from P2 to P3. Specifies machining from P3 to P4. Specifies machining from P4 to P5. Specifies machining from P5 to P6. Specifies machining from P6 to P7. Specifies machining from P7 to P8. Specifies machining from P8 to P9. Specifies machining from P9 to P1. Cancels the offset mode. The tool is returned to the start position (X0, Y0, Z0). 42
SIEG CNC Milling Programming Manual
2.6.1.3 Details of Tool Compensation C This section provides a detailed explanation of the movement of the tool for tool compensation C. When an angle of intersection created by tool paths specified with move commands for two blocks is over 180°, it is referred to as ‘inner side ’. When the angle is between 0° and 180°, it is referred to as ‘outer side ’ Outer side
Inner side
Programming path
α
Work piece
Work piece
α
Programming path 0°≦ α < 180°
180°≦ α
fig 2.21 Inner side or outer side of tool path
1.Tool Movement in Start–up Tool movement around an inner side of a corner (α≥180°) Linear - Linear Linear - Circular
Tool movement around the outside of a corner at an obtuse angle (90°≤α