2.5 programming functions 2.5.1 feed function the function of deciding the feed rate is called the...

59
2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount of feed of the tool per minute (mm/min or inch/min) or per spindle revolution (mm/rev or inch/rev)

Upload: shona-thornton

Post on 21-Jan-2016

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

2.5 Programming Functions2.5.1 Feed FunctionThe function of deciding the feed rate is called the feed function.

Feedrates can be specified by the amount of feed of the tool

per minute (mm/min or inch/min) or per spindle revolution

(mm/rev or inch/rev)

Page 2: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

2.5.2 Spindle Speed FunctionCommands related to the spindle speed_ spindle speed function

: a value following address S (rpm)

The S word tells the control the desired RPM (revolution per minute) for the spindle.

• As for the CNC, the cutting speed can be specified by the spindle speed

Page 3: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

• N=1000v/πD

When a workpiece should be machined with a tool 100 mm in diameter at a cutting speed of 80 m/min, the spindle speed is approximately 250 rpm

Hence the following command is required:

S250;

Page 4: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

2.5.3 Tool Function

tools can be selected on the machine

: a numerical value following address T

T××××;

M06 T××;

T×× M06;

Page 5: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

2.5.4 Dimension Function specify the movement of the programming axes

Dimension words: X,Y, Z ... Codes

Page 6: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

2.5.5 Preparatory Functions (G codes)

G Codes

A preparatory function is designated by the address G followed by one or two digits to specify a CNC machine how to move.

A list of only the most commonly used G codes: ( specified by ISO and our country technological standards )

( Most controls will have some special functions that are handled by G codes. However, the specific G codes for these special features will vary dramatically from one control to another)

↓ The programmer must check in the programming manual ( 编程手册 )

for the specific machine to find the list of G codes and how each one is handled

Page 7: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

G-word Mode Group type

Function

G00 Modal a Rapid positioning motion

G01 Modal a Linear interpolation motion

G02 Modal a CW circular interpolation motion

G03 Modal a CCW circular interpolation motion

G04 Non-modal

* Dwell (暂停) for a specified time

G17 Modal b X-Y plane selection

G18 Modal b X-Z plane selection

G19 Modal b Y-Z plane selection

G20 Modal c Inch mode for all units

G21 Modal c Metric (mm) mode for all units

G28 Non-modal

* Returns tool to reference point

Page 8: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount
Page 9: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

Modal G code: remain in effect for all subsequent blocks unless replaced by another modal G code

Nonmodal G code : only affect the block in which it appears.

G codes are divided into several groups according to their functions, such as a, b, c, d ... group, etc.

Any two G codes of a same group can't be in a block.

Page 10: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

2.5.6 G codes related to coordinate system • Absolute dimension code G90

and incremental dimension code G91

G90 assigns the absolute mode of programming: each

new tool position is from a home or specified origin (0,0).

G91 specifies incremental mode of programming: to locate each new tool position by measuring from the last tool position.

Page 11: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

This is a drawing that requires a tool to go from point A to point B. If in the absolute mode (G90), the block is:

N20 G90 G01 X20. Y60. F100. ; If in the incremental mode (G91), The block is:

N20 G91 G01 X-30. Y40. F100. ;

Page 12: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

• G92: Assigning the work coordinate system

( 确定工件坐标系 )Coordinates are specified in one of three coordinate systems:

·Machine coordinate system(with a machine zero point set as its origin; set by performing

manual reference position return; remains unchanged)

·Workpiece coordinate system(used for machining a workpiece; be set or select beforehand;

can be changed by shifting its origin )

·Local coordinate system

Page 13: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

How to assign work coordinate system :specifying a value after G92

(a) is the example of turning. The block is: N20 G92 X400. Z100. ;

(b) is the example of machining center.The block is:N20 G92 X180. Y70. ;

Page 14: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

G54-G59 : Selecting work coordinate system G54-G59 are separately called work coordinate system 1,work

coordinate system 2...

Page 15: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

A programmer can choose any one of work coordinate systems.

The six work coordinate systems are assigned through setting the offsets from machine coordinate system origin.

Page 16: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

☆Discussion:

Two ways to assign program zero:

G54-59 and G92:

Page 17: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

· G17,G18 ,G19 :Selecting plane commands Three planes in Cartesian coordinate system :

XY plane, XZ plane and YZ plane G17 illustrates machining on XY plane,

G18 on XZ plane, G19 on YZ plane.

Page 18: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

2.5.7 The G codes related to tool movement (1) G00: Rapid motionused to position the CNC machine to a location

will cause the machine to

move at fastest rate

Instruction Format:

G00 X_ Y_ Z_;

any number of axis departures can be included in G00 command ;Axes not included will not move in G00

Page 19: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

(2) G01: linear interpolation (Straight-Line motion) causes the machine to move along a perfectly straight

path in one or more axes (The control will calculate the path between the start point and the end point aut

omatically, no matter what angle is involved )

interpolation (all that is required is the start point and the end point : the control fills automatically and instantaneously in the missing points

between the start point and the end point )

↓how? What really happens is that the control makes a series of small on

e-axis movements from the start point to the very end point.

Page 20: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

The drawing intentionally exaggerates the situation: when two or more axes are programmed, the control forms a series of small one-axis movements.

The size of each step determines the resolution of the axis: The smaller the step, the better the resolution is.

Example showing what happens during linear interpolation

Page 21: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

Note : motion rate at which the axes will move.

This motion rate is programmed differently

F word to specify the desired feed rate for the command→ specify the feed rate in two ways:

feed per minute or feed per revolution ↓

(In the inch mode, this equates to inches per minute and inches per revolution;

In the metric mode, this equates to millimeters per minute and millimeters per revolution)

Page 22: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

Instruction Format: G01 X_ Y _ Z_ F_;X,Y and Z are coordinate value of end point; F is feed rate

e.g.

N30 G90 G01 X40 Z-30 F500N40 X60 Z-48

N30 G91 G01 X10 Z-30 F500N40 X20 Z-18

Page 23: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

(3) G02 and G03: Circular interpolation Circular interpolation is performed in much the same way.

Two G words: allow the programmer to specify the direction of the circular motion, clockwise motion (CW) or counterclockwise

motion (CCW).

To determine clockwise or counterclockwise, look at the motion from the plus side of the uninvolved axis.

Page 24: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

Two types of circular interpolation block Block format one:

G02 (or G03) X Y Z I J K F ; X,Y and Z are coordinate value of arc end point;

I, J and K are incremental value of the center; F is feed rate.

I (J, K) is the distance and direction from the starting point of the arc to the center of the arc along the X (Y,Z) axis;

( Direction implies that the sign of the value can be plus or minus)

(If the distance from the start point to the center is zero, it can be left out of the command, or included with a zero value)

Page 25: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

G92 X0 Y0 Z0G90 G00 X200. Y40.G03 X140. Y100. I-60. F300.G02 X120. Y60. I-50.

G92 X0 Y0 Z0G91 G00 X200. Y40.G03 X-60. Y60. I-60. F300.G02 X-20. Y-40. I-50.

Page 26: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

Block format two

G02 (or G03) X Y Z R F; (A whole circle cannot use this format.)

X, Y and Z : the coordinate value of arc end point;

R: the radius value of the arc;

( If the arc is smaller than 180º, the R is plus; If the arc is bigger than 180º , the R is minus )

Page 27: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

G90 G02 X89.83 Y63.66 R40. F100. ;

G90 G02 X89.83 Y63.66 R-40. F100. ;

G90 G02 X89.83 Y63. 66 I39.83 J3.66 F100. ;

G90 G02 X89.83 Y63.66 I-5.17 J39.66 F100.;

Page 28: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount
Page 29: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

(4) G04 Dwell Command

Format: G04 X_ ; or G04 P_ ;

(X or P specify a time)

• By specifying a dwell,

the execution of the

next block

is delayed

by the specified time.

Page 30: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

2.5.8 The G codes related to tool compensation(1) Cutter radius compensation G41, G42 and G40

Page 31: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

G41 or G42: for instating or initializing cutter radius

compensationG41 represents a cutter-left condition, G42 represents a cutter-right condition.

(G41: While looking in cutting direction, If the cutter is on the left side of the workpiece

G42: If the cutter is on the right side of the workpiece) Note: a programming word is used to specify the offset number, usually a D word is used

G40: to cancel cutter radius compensation( If forget to cancel cutter radius compensation, the

compensation will remain in effect throughout all blocks of the program, even for subsequent tools )

Page 32: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount
Page 33: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

understand basic machining practice to determine G41 or G42:

If the operation is to be a climb milling, G41 is used;

If conventional milling is to be done, G42 is used.

Page 34: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

• Two possible ways to use the offset: One is to program the actual surface of the workpiece,

the offset value must be the actual radius of the cutter. (For example, if uses a 20mm diameter end mill, the value stored in the offset w

ill be 10)

Page 35: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

The other is to actually program the centerline coordinates for a

desired tool diameter, the offset is equal to the radius deviation from the intended

cutter size: the cutter being used is larger (or smaller ) than the intended cutter, the offset value will be plus (or minus) ; (popular with CAM system)

Page 36: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

☆Discussion:

Why do we need cutter radius compensation?

Page 37: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

刀具半径补偿的优越性:可直接按零件轮廓编程,不必考虑刀具半径的半径,从而简化编程;

当刀具磨损或重磨后,刀具半径减小,只需手工输入新的半径值,而不必修改程序;可用同一程序(或稍作修改),甚至同一刀具进行粗、精加工。

Page 38: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

Instruction Format : G01 G41 D__ X__ Y__ ;      G01 G42 D__ X__ Y__ ;       G01 G40 X__ Y__ ;

D: offset number, D00 ~ D99

Page 39: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

Supplementary material 建立刀具半径补偿

Page 40: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

撤消刀具半径补偿

Page 41: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

N010 G92 X0 Y0 Z10N020 S600 M03N030 G90 G17N040 G41 G00 X20 Y10 D01N050 Z-10 M08N060 G01 Y50 F100N070 X50N080 Y20N090 X10N100 G00 Z10 M09N110 G40 X0 Y0 M05N120 M30

Page 42: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

(2) G43,G44 and G49: Tool length compensationG43: tool length positive compensation G44: tool length negative compensation G49: cancellation command At machining, the actual lengths of tools are

not equal to the specified length in programming. The differential values can be eliminated through tool length compensation.

(The tool length value: would be the length of the current tool in the

spindle)

H01

Page 43: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

Instruction Format:G43 G00/G01 Z_ H_ ; G44 G00/G01 Z_ H_ ;G49 (tool length compensation remains in effect until canceled

by a G49 word)

H: tells the control which offset number is used as the tool length compensation

Z: is the location along Z axis at which you want the tip of the tool to stop.

It is programmed relative to program zero.  

Page 44: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

G43: Actual displacement= Z+H

G44: Actual displacement= Z- H

Page 45: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount
Page 46: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

加工如图所示的三条槽, 槽深均为 3 mm , 试用刀具长度补偿指令编程。( 选择¢ 8 铣刀为 1 号刀, ¢ 6 铣刀为 2 号刀。将 1 号刀长度补偿值指定为 H01 ; 2 号

刀长度补偿值指定为 H02 。 )

Page 47: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

O0001N01 G90 G54 T01 S1000 M03 ;N02 G00 X20.0 Y20.0 ;N03 G43 Z2.0 H01 ;N04 G01 Z-3.0 F120 ;N05 X80.0 ;N06 Z2. ;N07 G00 G49 Z100.0 M05 ;N07 G00 X20.0 Y40.0 ;N08 M00 ;

N09 T02 S1000 M03 ; N10 G00 G43 Z2.0 H02 ; N11 G01 Z-3.0 F120 ; N12 X80.0 ; N13 Z2. ; N14 G00 X20.0 Y60.0 ; N15 G01 Z-3.0 ; N16 X80.0 ; N17 Z2. ; N18 G00 G49 Z100. M05 N19 X0. Y0. ; N20 M02 ;

Page 48: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

2.5.9 M Codes: Miscellaneous Machine Functions

M codes are used to specify miscellaneous or auxiliary functions

(functions not related to dimensional or axes movements, they do not prepare the controller to act in a particular mode, they direct the controller to immediately execute the machine function )

M codes are usually classified into two main groups:

A: executed with the start of axis movements

B: executed after the completion of axis movements

Page 49: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount
Page 50: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

(1) M00: causes a program stop, turn off spindle, coolant, etc, rewind the memory to

the next block ↓ (If the cycle start button on the panel is pressed, the next block

will be executed)

(2) M01: an optional stop. It works in conjunction with an on/off switch on the panel.

(switch is on: the machine will stop executing the program. The cycle is activated again by pressing the cycle start button → the control will continue executing the program from the point of the M01.

switch is off: the control will ignore the M01 command entirely)

The purpose : to give the operator a way to stop the machine , to confirm that the tool has machined correctly during a program's verification

Page 51: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

(3) M02: a program end.

(4) M30: a program end, rewind the memory back to the beginning of the same

program, the control stops.

Page 52: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

(5) M03: to turn the spindle on in forward or clockwise direction( used with right-hand tooling)

(6) M04: to turn the spindle on in counterclockwise direction

(7) M05: to turn the spindle off

(used prior to a tool change, spindle speed change, spindle reverse rotation)

Page 53: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

(8) M06: used for tool change

( exchanges the tool in the waiting magazine with the tool in the s

pindle)

Format 1: M06 T02;

Format 2: T02 ;      M06 ;

Page 54: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

e.g.Without manipulator :G91 G28 Z0

M06 T03;..G91 G28 Z0

M06 T04;

With manipulator :T01;

G91 G28 Z0;

M06 T03;..G91 G28 Z0;

M06 T04;

Page 55: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

M08: to turn on the (flood) coolant

M09: to turn off the coolant

( before the motion to the machine's automatic tool change position to keep from drenching the work area and operator)

Page 56: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

(4) Other Words in the Format (other words besides G and M words)

specify other functions

A word: to specify the fourth-axis how to rotate

B word: to specify the fifth-axis how to rotate

D word: to select the offset number of tool radius compensation F word: to control the desired feed rate

O word: to assign program's number

Page 57: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

S word: to tell the control the desired RPM

(revolutions per minute) for the spindle

T word: to rotate the tool magazine to the desired position

H word: to use the offset

P word: to tell the program number of the subprogram to

be executed

L word: to specify how many times the subprogram is to

be executed

Dimension words (X,Y,Z ... Codes): to specify the movement of the programming axes

Page 58: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

Supplementary material

Page 59: 2.5 Programming Functions 2.5.1 Feed Function The function of deciding the feed rate is called the feed function. Feedrates can be specified by the amount

Ⅴ. G codes related to canned cycles The controller stores a number of fixed cycles that can be

recalled for use when needed.

A fixed cycle causes the machine to execute the required movement.

This reduces programming time and length of programs.

In machining centers,G80-G89 are the commands usually used for canned cycles.

In turning centers,G33-G35 and G70-G79 are the commands usually used for canned cycles.