Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

56
Numerical Control Programming

Transcript of Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

Page 1: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

Numerical Control Programming

Page 2: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

6.1 NC PART PROGRAMMING

Introduction• Coordinate Systems

• NC Words

Page 3: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

6.1.1 Coordinate System

Z AXIS workpiece-rotating machine: Z is parallel to the spindle tool-rotating machine: Z is parallel to the tool axis

Z

ZZ

Z // rotating spindle

Page 4: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

6.1.1 Coordinate System

X AXIS workpiece-rotating machine:

X is the direction of tool movement horizontal milling machine : X axis is parallel to the table vertical machine : +X axis points to the right when the programmer

is facing the machine.

Z

ZZ

X

X

X

X // table

Page 5: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

6.1.5 NC Words

N, G, X, Y Z, A, B, C, I, J, K, F, S, T, R, M

N: specify the sequence number

G: preparatory word to prepare for control functions (the motion of each axis,

coordinate system, coordinate plane, cutter radius compensation, tool length offset……)

M: miscellaneous word

to control miscellaneous functions (spindle on/off, start/stop the machine, turn on/off the coolant, change the tool, and rewind the program tape)

Page 6: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

6.1.5 NC Words

Page 7: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

6.1.5 NC Words

M00 Program stop M06 Tool change

M01 Optional stop M07 Flood coolant on

M02 End of program M08 Mist coolant on

M03 Spindle CW M09 Coolant off

M04 Spindle CCW M30 End of tape

M CODES

Page 8: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

6.1.5 NC Words

Modal codes and non modal codes/

• modal functions Modal functions stay active until some other command

changes it. Modal commands are arranged in sets called “modal groups”, and only one member of a modal group may be in forces at any given time.

• non-modal functions Non-modal functions have effect only on the lines on

which they occur.

Page 9: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

6.1.5 NC Words

modal groups

Page 10: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

6.1.5 NC Words

M00 Program stop M06 Tool change

M01 Optional stop M07 Flood coolant on

M02 End of program M08 Mist coolant on

M03 Spindle CW M09 Coolant off

M04 Spindle CCW M30 End of tape

M CODES modal groups

Page 11: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

6.1.5 NC Words

N, G, X, Y , Z, A, B, C, I, J, K, F, S, T, R, M

F: feed rate of the tool motion S: cutting-speed

T: tool number

Page 12: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

6.1.5 NC Words

X, Y, Z, A, B, C: provide the coordinate positions of the tool. X, Y, and Z define the three translational (Cartesian) axes of a machine. A, B and C are used for the three rotational axes about the X, Y, and Z axes.

I, J, K: specify the center for circular motion

N, G, X, Y , Z, A, B, C, I, J, K, F, S, T, R, M

Page 13: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

6.1.5 NC Words

R: specify the clearance height in canned-cycle

N, G, X, Y, Z, A, B, C, I, J, K, F, S, T, R, M

N0010 G81 X1.000 Y2.000 Z0.000 R1.300

Operations in drill cycle G81 :1. Rapid to location (1,2,2).2. Rapid down to the R plane:(1,2,1.3) 3. Feed to the Z point, the bottom of the hole:(1,2,0)4. Operation at the bottom of the hole .5. Rapid or feed to either the R plane or the initial height.

Page 14: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

NC Words

Page 15: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

G codes

Unit selection: • G70 (inch), G71(metric)

Coordinates selection: • G90(absolute), G91(incremental)

Working plane selection: • G17(X-Y), G18(Z-X), G19(Y-Z)

Page 16: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

Set up working coordinate Machine zero

• is unchangeable and usually is set up with the machine Working coordinate (is decided by the offset from the machine zero)

• G92• Be defined in program

25.2

23

Z

X

G92 X25.2 Z23.0

Machine zero

G55

G54

G56 G57 G58

G59

Page 17: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

Rapid traverse: G00

G00: • to make the machine move at maximum speed.

• It is used for positioning motion. G90 G00 X20.0 Y10.0

Start

EndG90:

absolute coordinate

s

(0,0)

(10,10)

(20,10)

Page 18: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

Linear interpolation: G01 G01:

• linear interpolation at feed speed. G91 G0l X200.0 Y100.0 F200.0

Y

100.0

XStart

End

200.0

G91: incremental coordinates

Page 19: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

Circular interpolation: G02, G03

G02, G03:

• For circular interpolation, the tool destination and the circle center are programmed in one block

• G02 is clockwise interpolation, G03 is counterclockwise interpolation

__;____

____03

0219

__;____

____03

0218

__;____

____03

0217

FKJ

RZY

G

GG

FKI

RZX

G

GG

FJI

RYX

G

GG

End point Circle center, radius

Page 20: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

Circular interpolation: G02, G03

Specify Center with I, J, K

• I, J, K are the incremental distance from the start of the arc;

• Viewing the start of arc as the origin, I, J, K have positive or negative signs.

Center

Y

Start

End

X

i

j

Page 21: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

Circular interpolation: G02, G03

R60R50

90 120 140 200

100

6040

O

Y

X

N0010 G92 X200.0 Y40.0 Z0; N0020 G90 G03 X140.0 Y100.0 R60.0 F300; N0030 G02 X120.0 Y60.0 R50.0;

G90: absolute

coordinates

G92:To define working

coordinate

Page 22: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

Circular interpolation: G02, G03

Annotation for Circular Interpolation

• I0.0, J0.0, and K0.0 can be omitted.

• If X,Y,Z are all omitted in the program, that means start and end of arc are same points.

N0020 G02 I20.0 (a full circle)

• If I, J, K, and R all appears in circular interpolation instruction, R is valid and I, J, and K are invalid

Page 23: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

Return to Machine Zero: G28

G28 The machine passes by the specified point, and then

move to the machine zero.

G91 G28 X_, Y_, Z_ X,Y,Z are the coordinate of specified point that is saved in

memory of machine. Usually this instruction is used in the beginning and end of

program.

A

Machine Zero

Specified point

G91: incremental coordinates

Page 24: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

Return to the Specified point : G29

G29 The machine passes from the machine zero by

the point that is specified in G28, and then move to the new specified point.

G29 X_, Y_, Z_ X, Y, Z are the coordinate of new specified point G28,G29 are usually used to change tool

Specified point in G28

A

Machine Zero

New specified point in G29

Page 25: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

M code

miscellaneous word miscellaneous functions:

• turn the spindle on/off

• start/stop the machine

• turn on/off the coolant

• change the tool

• rewind the program (tape)

Page 26: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

M code

M00 Program stop M06 Tool change

M01 Optional stop M07 Flood coolant on

M02 End of program M08 Mist coolant on

M03 Spindle CW M09 Coolant off

M04 Spindle CCW M30 End of tape

modal groups

Page 27: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

M code: M00, M01

M00 and M01 both stop the machine in the middle of a program.

M01 is effective only when the optional stop button on the control panel is depressed. The program can be resumed through the control panel.

Page 28: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

M code: M03, M04, M05

M03 turns on the spindle clockwise. M04 turns the spindle on counterclockwise.

(The spindle rpm must be specified in the same line or in a previous line. )

M05 turns off the spindle.

Page 29: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

M code: M07, M08, M09

M07 and M08 turn on different modes of coolant. • M07: flood coolant on

• M08: mist coolant on

M09 turns off the coolant.

Page 30: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

M code: M06

M06 signals the tool-change operation. On a machine equipped with an automatic

tool changer, it stops the spindle, retracts the spindle to the tool-change position, and then changes the tool to the one specified in the T-code.

Page 31: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

M code: M02, M30

M02 marks the end of the program. M30 marks the end of the tape. It stops the

spindle and rewinds the program (tape)

Page 32: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

Example A 2.0-in 2.0-in. square is to be milled using a 1/2-in. end

milling cutter (end mill). Write an NC part program to

make the square.

Page 33: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

Part program Explanation

N0010 G41 S1000 F5 M03

N0020 G00 X6.000 Y6.000 N0030 G01 Z-1.000 N0040 G01 Y8.000 N0050 G01 X8.000 M96N0060 G01 Y6.000 M96N0070 G01 X6.000 M96N0080 G01 Z1.000N0090 G40 M30

Begin compensation ( left ) , set feed and speed, spindle on ( CW)

Move to lower left cornerPlunge down the toolCut to upper left cornerCut to upper right corner with external curveCut to lower right corner with external curveCut to lower left corner with external curveLift the toolEnd the composition, stop the machine

Example

Page 34: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

G codes with animations

http://www.cncezpro.com/gcodes.cfm

Page 35: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

Manual Part Programming Example

Tool size = 0.25 inch,Feed rate = 6 inch per minute,Cutting speed = 300 rpm,Tool start position: 2.0, 2.0Programming in inches

(4, 4)

(2, 2)

5”

p0

p1

p2

5”

2.5”

1”

45°

p3p4

p5

Motion of tool:p0 p1 p2 p3 p4 p5 p1 p0

Page 36: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

Spindle CCW

(4, 4)

(2, 2)

5”

p0

p1

p2

5”

2.5”

1”

45°

p3p4

p5

1. Set up the programming parameters

N010 G70 G90 G94 G97 M04

Programming in inches

Use absolute coordinates

Spindle speed in rpm

Feed in ipm

Page 37: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

Flood coolant ON

(4, 4)

(2, 2)

5”

p0

p1

p2

5”

2.5”

1”

45°

p3p4

p5

2. Set up the machining conditions

N020 G17 G75 F6.0 S300 T1001 M08

Machine moves in XY-plane

Feed rate

Tool no.

Spindle speed

Use full-circle interpolation

Page 38: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

(4, 4)

(2, 2)

5”

p0

p1

p2

5”

2.5”

1”

45°

p3p4

p5

3. Move tool from p0 to p1 in straight line

N030 G01 X3.875 Y3.698

Linear interpolation

target coordinates

Page 39: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

(4, 4)

(2, 2)

5”

p0

p1

p2

5”

2.5”

1”

45°

p3p4

p5

4. Cut profile from p1 to p2

N040 G01 X3.875 Y9.125

Linear interpolation

target coordinates

N040 G01 Y9.125

X-coordinate does not change no need to program it

or

Page 40: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

(4, 4)

(2, 2)

5”

p0

p1

p2

5”

2.5”

1”

45°

p3p4

p5

5. Cut profile from p2 to p3

N050 G01 X5.634 Y9.125

Linear interpolation

target coordinates

1”

p3

.125

(x, y)

(6.5, 9)

y = 9 + 0.125 = 9.125(6.5 - x)2 + 0.1252 = (1 - 0.125)2

x = 5.634

Page 41: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

coordinates of center of circle(4, 4)

(2, 2)

5”

p0

p1

p2

5”

2.5”

1”

45°

p3p4

p5

6. Cut along circle from p3 to p4

N060 G03 X7.366 Y9.125 I6.5 J9.0

circular interpolation, CCW motion

target coordinates

N060 G03 X7.366 Y9.125 I0.866 J-0.125

Page 42: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

(4, 4)

(2, 2)

5”

p0

p1

p2

5”

2.5”

1”

45°

p3p4

p5

7. Cut from p4 to p5

N070 G01 X9.302

target coordinates (Y is unchanged)

Linear interpolation

Page 43: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

(4, 4)

(2, 2)

5”

p0

p1

p2

5”

2.5”

1”

45°

p3p4

p5

8. Cut from p5 to p1

N080 G01 X3.875 Y3.698

target coordinates (see step 3)

Linear interpolation

Page 44: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

(4, 4)

(2, 2)

5”

p0

p1

p2

5”

2.5”

1”

45°

p3p4

p5

9. Return to home position, stop program

N090 G01 X2.0 Y2.0 M30

end of data

target coordinates (see step 3)

Linear interpolation

N100 M00

program stop

Page 45: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

10. Complete RS-274 program

N010 G70 G90 G94 G97 M04 N020 G17 G75 F6.0 S300 T1001 M08 N030 G01 X3.875 Y3.698 N040 G01 X3.875 Y9.125 N050 G01 X5.634 Y9.125 N060 G03 X7.366 Y9.125 I0.866 J-0.125 N070 G01 X9.302 N080 G01 X3.875 Y3.698 N090 G01 X2.0 Y2.0 M30

Page 46: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

Automatic Part Programming

Software programs can automatic generation of CNC data

Make 3D model

Define Tool

CNC data

Simulatecutting

Page 47: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

Automatic part programming and DNC

Very complex part shapes very large NC program

NC controller memory may not handle HUGE part program

computer feeds few blocks ofNC program to controller

When almost all blocks executed,controller requests more blocks

Page 48: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

Assignment (Learn this software)

CNC Simulator Download from

http://cnc-simulator.com/download/get.php?f=CncSetup453.exe

Page 49: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

2004 49

A system in which a central computer downloads the NC programs block by block to many NC machine tools simultaneously is called Direct Numerical Control (DNC) system.

Direct Numerical Control (DNC):

Page 50: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

DNC

Direct numerical control (DNC) – control of multiple machine tools by a single (mainframe) computer through direct connection and in real time 1960s technology Two way communication

Distributed numerical control (DNC) – network consisting of central computer connected to machine tool MCUs, which are CNC Present technology Two way communication

Page 51: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

2004 51

This system used to work with the early NC machine tools which can not read more than a block of information at a time. The central computer feed the program information one block at a time. When the machine execute the information, the next block of information would be fed.

Direct Numerical Control (DNC):

Page 52: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

2004 52

Distributed NC is known by the same acronym as Direct Numerical Control (DNC). After the introduction of CNC, the machine tools have had the capability of storing large amount of information. Therefore, there have been no need to have drip feed information system, like, Direct Numerical Control. Instead, Distributed Numerical Control is introduced. In such a system, a host computer communicate with many CNC machine tools via networks and download or upload programs.

Distributed Numerical Control (DNC):

Page 53: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

2004 53

With Distributed Numerical Control systems, it is possible to monitor the activities in individual CNC machine tools on host computer.

Therefore, better shop floor control can be achieved.

Distributed Numerical Control (DNC):

Page 54: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

20042004 5454

TYPES of CNC CONTROL TYPES of CNC CONTROL SYSTEMSSYSTEMS

Open-loop controlOpen-loop control Closed-loop controlClosed-loop control

Page 55: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

20042004 5555

OPEN-LOOP CONTROL OPEN-LOOP CONTROL SYSTEMSYSTEM

In open-loop control system step motors In open-loop control system step motors are usedare used

Step motors are driven by electric pulsesStep motors are driven by electric pulses Every pulse rotates the motor spindle Every pulse rotates the motor spindle

through a certain amountthrough a certain amount By counting the pulses, the amount of By counting the pulses, the amount of

motion can be controlledmotion can be controlled No feedback signal for error correctionNo feedback signal for error correction Lower positioning accuracy Lower positioning accuracy

Page 56: Numerical Control Programming. 6.1 NC PART PROGRAMMING Introduction Coordinate Systems NC Words.

20042004 5656

CLOSED-LOOP CONTROL CLOSED-LOOP CONTROL SYSTEMSSYSTEMS

In closed-loop control systems DC or In closed-loop control systems DC or AC motors are usedAC motors are used

Position transducers are used to Position transducers are used to generate position feedback signals generate position feedback signals for error correctionfor error correction

Better accuracy can be achievedBetter accuracy can be achieved More expensiveMore expensive Suitable for large size machine toolsSuitable for large size machine tools