78
CNC Programming “Turning” Module Objectives: To know the structure of an NC Program. To know the main instructions and their functions. To create NC programs for different turning operations.

CNC Programming “Turning”

Embed Size (px)

DESCRIPTION

CNC Programming “Turning”. Module Objectives: To know the structure of an NC Program. To know the main instructions and their functions. To create NC programs for different turning operations. NC Program. - PowerPoint PPT Presentation

Citation preview

Page 1: CNC Programming “Turning”

CNC Programming“Turning”Module Objectives:To know the structure of an NC

Program.To know the main instructions and

their functions.To create NC programs for different

turning operations.

Page 2: CNC Programming “Turning”
Page 3: CNC Programming “Turning”

NC ProgramThe NC program consists of a series of commands with which the CNC machine tool is instructed to manufacture a certain work part.

Page 4: CNC Programming “Turning”

ExampleNC-Program(%TP0147)

N10 G54

N15 G92 S2000

N20 T1 D1 M6

N25 G96 S200 F0.2 M4N30 G0 X43 Z0N35 G1 X-2N40 G1 Z2N45 G0 X150 Z150N50 M30

Page 5: CNC Programming “Turning”

StructureA complete NC-program consists of the following elements:%TP0147 NC program beginning

(Program Name)

N10 G54

N20 …………………..N30 G0 X43 Z0N40 G1 Z2N45 G0 X150 Z150

A series of NC-blocks with geometric and technical information for machining.(Program Core)

N50 M30 A command for ending the program.

Page 6: CNC Programming “Turning”

Part Program BlockEach line of a part program is called a Block.ExampleN35 G01 X-2 The above block can be explained as follows:

N35 Block (Line) Number

G01 G- command (Code) to move the cutting

tool in linear movement.

X-2 The coordinate at X = -2

Page 7: CNC Programming “Turning”

Instructions (Commands)

Four groups of instructions can be differentiated:

1. G – Functions2. Coordinates3. Additional Functions4. Cycles

Page 8: CNC Programming “Turning”

G Functions

Coordinates

Additional Functions

Cycles

G00G01G02

XYZ

FSTM

CYCLE 83CYCLE 95…

Four Groups of Instructions

Page 9: CNC Programming “Turning”

1. G FunctionsG functions are codes that determine the geometric part of the NC program.

Function Description

G00 Rapid positioning

G01 Feed rate positioning - linear

G02 Arc clockwise

G03 Arc counter clockwise

G04 Dwell

G20 Inch units

G21 Metric units

Page 10: CNC Programming “Turning”

Function Description

G54 Work piece coordinate setting

G90 Absolute positioning.

G91 Incremental positioning.

G92 Max. Spindle speed limit.

G95 Feed rate (F) in mm/rev.

G96 Constant Cutting Speed in m/min

G97 Cancel Constant Cutting Speed

Cont. G Functions

Page 11: CNC Programming “Turning”

2. Coordinates (X,Y and Z)

They are used in a block to locate the target point where the tool should go. In turning machines, tools follow 2 axes only, X & Z.

Page 12: CNC Programming “Turning”

3. Additional and SwitchingFunctionsFunction Description

F Feed rate

S Speed

T Tool position

M3 Spindle rotation clockwise

M4 Spindle rotation counter clockwise

M5 Spindle stop

M6 Tool change

Page 13: CNC Programming “Turning”

Function Description

M7 Flood coolant #1 ON

M8 Flood coolant #2 ON

M9 Coolant OFF

M17 Subprogram end

M30 Program end

TRANS Zero point Shift (Emco)

3. Additional and Switching Functions

Page 14: CNC Programming “Turning”

4. Cycles A cycle allows performing a complete

machining operation by specifying just one code. Cycle Description

Cycle 81 Drilling; to make a hole in one phase.

Cycle 83 Deep Drilling (Pecking); to make a deep hole, which requires introducing the tool with several phases. (Chip-breaking and chip removal)

Page 15: CNC Programming “Turning”

Cont. CyclesCycle Description

Cycle 93 Recessing; to make an internal or external groove.

Cycle 95 Canned cycle (roughing and finishing cycle); to cut the material following a pre-set contour using a subprogram.

Cycle 97 Tapping; to make an internal or external thread.

Page 16: CNC Programming “Turning”

G00 – Rapid PositioningN10 G00 X30 Z5Moves the cutting tool rapidly to the point X30 Z5.

Page 17: CNC Programming “Turning”

G01 – Feed Rate PositioningN20 G01 X38 Z-20 F0.4The cutting tool moves in linear motion at feed rate (F) = 0.4 mm/revolution to the point X38 Z-20

Page 18: CNC Programming “Turning”

G90 and G91 G90 : The machine controller works

on absolute dimensioning mode

G91 : The machine controller works on incremental dimensioning mode.

Page 19: CNC Programming “Turning”

Example 1:

Write two blocks of NC-program to move the tool in rapid traverse to the point shown, using absolute positioning mode?

G90N10 N20 G00 X30 Z5

Page 20: CNC Programming “Turning”

Example 2:

Write two blocks of NC-program to move the tool in rapid traverse to the point shown, using incremental positioning mode?

G91N10 N20 G00 X-12.5 Z-35

Page 21: CNC Programming “Turning”

Example 3:

Write two blocks of NC-program to move the tool in feed rate traverse to the point shown, using absolute positioning mode?

G90N10 N20 G01 X140 Z-90

Page 22: CNC Programming “Turning”

Example 4:

Write two blocks of NC-program to move the tool in feed rate traverse to the point shown, using incremental positioning mode?

G91N10 N20 G01 X20 Z-60

Page 23: CNC Programming “Turning”

G03 Arc counterclockwiseN10 G03 X60 Z-10 I0 K-10

Page 24: CNC Programming “Turning”

G02 (Arc Clockwise)N15 G02 X140 Z-106 I 45 K-20

This example is just to show the motion. Cutting tool, depth of cut, values of coordinates and parameters are not taken into consideration.

Page 25: CNC Programming “Turning”

G2, G3, I, J, and K

When an arc is to be machined, the interpolation parameters I, J & K must be specified. These parameters are used to define the center of a circle for circular movements.

Page 26: CNC Programming “Turning”

G2, G3, I, J, and K"I" is the distance between the

starting position and the circle center in the X-direction.

"J" is the distance between the starting position and the circle center in the Y-direction.

"K" is the distance between the starting position and the circle center in the Z-direction.

Since in turning there is no Y-axis, then J is always zero and no need to mention it in the block;

Page 27: CNC Programming “Turning”

Example 5

Write two blocks of NC program to cut the arc shown below using absolute positioning mode?

G01 X80 Z-50N10 N20 G03 X140 Z-80 I-15 K-45

Page 28: CNC Programming “Turning”

Example 6:

Write two blocks of NC program to cut the arc shown below using absolute positioning mode?

G01 X80 Z-40N10 N20 G02 X140 Z-106 I 45 K-20

Page 29: CNC Programming “Turning”

G95 / G94G95 and G94 specify the unit of feed

rate (F). G95: Feed rate (F) in mm/revolution (Main application for turning)

G94: Feed rate (F) in mm/min. (Main application for milling)

Page 30: CNC Programming “Turning”

G20 / G21 G20: The controller of the CNC

turning machine reads the input values in imperial system (inch).

G21: The controller of the CNC turning machine reads the input values in metric system (mm)

Page 31: CNC Programming “Turning”

G54 / TRANS G54 defines workpiece zero

point. Zero points are used to indicate the position of the workpiece on the machine.

The coordinate system is displaced from a fixed point on the machine called machine zero point (M) to the workpiece zero point (W) by G54.

Page 32: CNC Programming “Turning”

G54 / TRANSNormally the coordinate

system is shifted with G54 to a stop point (W1) at the clamping device (chuck), then the following shift to the workpiece zero points occurs with TRANS.

ExampleN10 G54 X0 Z50N20 TRANS Z150

Page 33: CNC Programming “Turning”

G04 – Dwell Time The tool movement is halted for specified

dwell time.

Example : G04 X5The tool stop moving (feed) for 5 seconds.This is required in some operations, e.g. in drilling, dwell time is used to allow the chip removal, or clean the hole ground.

Note: Different controllers have different dwell time formats.

Page 34: CNC Programming “Turning”
Page 35: CNC Programming “Turning”

G92 / G96 / G97During turning, the diameter of the

workpiece is getting smaller and smaller. In order to have a good machining results, it is advisable to keep the cutting speed (Vc) constant (specially when the difference between the starting and final diameters is large).

Page 36: CNC Programming “Turning”

G92 / G96 / G97Vc (cutting speed) = π d n

Where d = diameter of the workpiece n = spindle speed revolutions (RPM)

From the above equation, to keep “Vc” constant while “d” is getting smaller, the value of “n” must increase to compensate for the decrease in diameter (d) value. This could be achieved automatically by using G96 Command.

Example N20 G96 S300 (Constant cutting speed = 300

m/min)

Page 37: CNC Programming “Turning”

G92 / G96 / G97 It is important and safe to set a limit for

the increase of spindle speed while the diameter is getting smaller. G92 code is used to limit max. spindle speed.

Example: N10 G92 S2000 (The spindle speed is limited to 2000

RPM).

G97 : To cancel constant cutting speed. Use constant spindle speed

Page 38: CNC Programming “Turning”

M3 – Spindle rotatesin clockwise direction

Page 39: CNC Programming “Turning”

M4 - Spindle rotates in counterclockwise direction

Page 40: CNC Programming “Turning”

M7, M8 and M9

M7 and/or M8 : Coolant ON. M9: Coolant OFF

Why coolant is important? Cutting Steel with Coolant.aviPLG-42XL Cutting Steel with Coolan

t.flv

Page 41: CNC Programming “Turning”

T : Tool PositionT3 D1 M6Select tool number 3

Page 42: CNC Programming “Turning”

Example of CNC Programming Write an NC-program to reduce the diameter of a

workpiece 1 mm to 20 mm length. (Parallel turning)?

Use the following information:THE BLANK SIZE OF THE WORKPIECE φ40 X 60 mmAbsolute Coordinate systemConstant Spindle Speed at 1000 RPM and in

counterclockwise directionTool in Position Number 1 on the turret, and it will

move at feed rate 0.4 mm/rev.Metric System of measurement.

Page 43: CNC Programming “Turning”

Note:Topturn is defaulted with absolute coordinate system, metric system of units, constant rotational speed and feed rate in mm/rev., so it is not necessary to write the corresponding codes in your program.

Page 44: CNC Programming “Turning”

How to locate the workpiece zero point?G54

What is the dimensioning system that should be used?

G90

What will be the spindle speed and in which direction?

G97 S1000 M4

Which tool you will use? T1D1 M6

Solution:Answer the following questions writing your answers as program codes:

Page 45: CNC Programming “Turning”

What is the unit system that should be used? G21

How to move the cutting tool? G00 and G01 (Why not G02 and G03)?

How to stop machine spindle?M5

How to end your program? M30

Page 46: CNC Programming “Turning”

Workpiece before machining

φ 40

60

Page 47: CNC Programming “Turning”

Solution 1. Name your NC Program: %turning_01 2. Set workpiece zero point N10 G54 3. Use absolute dimensioningN20 G90 4. Spindle speed = 1000 in counterclockwise

directionN30 G97 S1000 M4 5. Use tool e.g. in position number 1.N40 T1D1 M6

Page 48: CNC Programming “Turning”

6. Move the cutting tool rapidly to be ready for cutting.N50 G00 X39 Z5

Drawing is not to scale

In absolute mode the value of X is the diameter value

X φ 39

Z 5Z -20X φ 40

Z -20

W

X

Z

Page 49: CNC Programming “Turning”

7. Move the cutting tool slowly at cutting feed rate 0.4 to Z=-20 N60 G01 Z-20 F0.4

X φ 39

Z 5X φ 40

Z -20

X

Z

Page 50: CNC Programming “Turning”

X φ 39

Z 5X φ 40

Z -20

X

Z

8. Move the cutting tool up to a point outside the workpieceN70 G01 X42

Page 51: CNC Programming “Turning”

φ 39 φ 40

20

9. Move the cutting tool to the tool changing point (or any safe point away from the workpiece) N80 G00 X150 Z150

Page 52: CNC Programming “Turning”

10. Stop spindle N90 M5

11. End Program N100 M30

Page 53: CNC Programming “Turning”

Complete Program %turning_01 N10 G54 N20 G90 N30 G97 S1000 M4 N40 T1D1 M6 N50 G00 X39 Z5 N60 G01 Z-20 F0.4 N70 G01 X42 N80 G00 X150 Z150 N90 M5 N100 M30

Page 54: CNC Programming “Turning”

Practical Tasks Using MTS

Prepare a setup form using steps mentioned in module 3 page 9.

Prepare a setup sheet using steps mentioned in module 3 page 13.

Write the NC program using interactive mode or editor.

Note: The prepared setup form could be used for many practical tasks if the tools required are the same, but if there is a need to add or remove tools, the “edit turret equipment” in the “setup dialog” should be used. (This will change tools for the specified job but not change the saved setup form).

Page 55: CNC Programming “Turning”

Practical Tasks Steps in Details: Click Setup dialogName your programClick Open.Enter information under Chuck deviceEnter information under Blank/Zero pointClick toolsClick select turret equipmentClick on the arrow to see drop menu of saved tools filesSelect your saved tools file or any one.Click OK If you need to change, add or remove tools click Edit

turret equipment then select your tools and close the turret equipment.

Click Ok Write your NC program using Interactive mode or Editor

Page 56: CNC Programming “Turning”

Next slides should be used along with the practical tasks given in the module. All examples and parameters values could be compared with the solution given in the module. Only selective important parameters will be covered in this presentation.

Page 57: CNC Programming “Turning”

CYCLESPerform a number of tool movement by

specifying just one code.

A cycle allows performing a complete machining operation by entering the needed parameters for the operation. After receiving all needed data from the programmer, MTS automatically generates the suitable instructions to perform the operation.

Page 58: CNC Programming “Turning”

When using MTS editor, cycles blocks are entered by “dialog program” function.

In the call up of the cycles the sequence of parameters must be kept. When a parameter is not needed, additional comma must be given in its place.Example N55 CYCLE95 ("L150",2,0,0,,0.2,0.1,0.1,1)

Page 59: CNC Programming “Turning”

Cycle 83 Deep Drilling Cycle

Page 60: CNC Programming “Turning”

Cycle 83Example: Cycle 83 (2,2,,-86,,,35,4,1,1,1,1)

Page 61: CNC Programming “Turning”

Cycle 83

Page 62: CNC Programming “Turning”

Cycle 95

N55 CYCLE95 ("L150",2,0,0,,0.2,0.1,0.1,1)

Page 63: CNC Programming “Turning”

Cycle 95 ParametersThe parameters of cycle 95 are shown below:

Page 64: CNC Programming “Turning”

Cycle 95

Cycle 95 is a roughing and finishing cycle.

Used for stock removal in outside and inside machining operations to cut the material following a pre-set contour using a subprogram.

Subprogram number (name) should be entered as the first parameter in cycle 95.

Page 65: CNC Programming “Turning”

Subprogram

Subprogram is a program to be written and prepared separately as a sequence of commands G1, G2, and G3 to describe the contour (shape) to be produced.

Subprogram could be prepared by using “Workshop Oriented Programming – WOP” from the editor menu, in which the work part is drawn and automatically translated by the simulation software to G-codes.

M17 is used instead of M30 to end the subprogram.The name of the subprogram should start with an “L”

followed by a number, e.g. “L100” .

Page 66: CNC Programming “Turning”

Example of a Subprogram

Open NC Program Give a name; e.g. “L200”. Click open Click on “editor” twice Click “yes” Start to right the program manually or using

“WOP” for complicated shapes.

Page 67: CNC Programming “Turning”

Write a subprogram for the shape shown below:

Subprogram N10 G01 X20 Z2N15 G01 Z-20N20 G01 X41N25 M17Save and exit this program. Open your main

program, then write “200” as NPP – parameter in cycle 95.

Cont. Example of a subprogram

204020

Required shape Original shape

60

40

Page 68: CNC Programming “Turning”

Cont. Cycle 95 ParametersVARI- Operation ModeDefines the kind of machining (roughing, finishing, complete), side of machining (inside or outside) and direction of machining (longitudinal, face(

Page 69: CNC Programming “Turning”

Cycle 93Recessing or grooving cycle.

N280 CYCLE93 (30,-10,7.5,2,0,0,0,-1,-1,0,0,0.2,0.3,1.5,1,5)

Page 70: CNC Programming “Turning”

Cycle 93Recessing or grooving cycle.

Page 71: CNC Programming “Turning”

Cont. Cycle 93 ParametersVARI - Operation Mode

Page 72: CNC Programming “Turning”

Cycle 97

N325 CYCLE97 (3.5,,0,35,30,30,10,0,2.15,0.02,29,0,15,2,3,1)

Page 73: CNC Programming “Turning”

Cycle 97

Used for thread cutting

Page 74: CNC Programming “Turning”

PIT and MPIT ParametersPitch and Diameter

Page 75: CNC Programming “Turning”

Cont. Cycle 97 ParametersIANG - Operation Mode

Page 76: CNC Programming “Turning”

Cont. Cycle 97 ParametersVARI - Operation Mode

Page 77: CNC Programming “Turning”

ChamferChamfer programming.

G1 X… Y… Z… CHF=6

Or G1 X… Y… Z…

CHR=11

Page 78: CNC Programming “Turning”

RoundRound programming

G1 X… Y… Z… RND=5