CNC Programming “Turning”

Post on 15-Jan-2016

190 views 25 download

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

Transcript of 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.

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

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

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.

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

Instructions (Commands)

Four groups of instructions can be differentiated:

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

G Functions

Coordinates

Additional Functions

Cycles

G00G01G02

XYZ

FSTM

CYCLE 83CYCLE 95…

Four Groups of Instructions

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

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

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.

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

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

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)

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.

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

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

G90 and G91 G90 : The machine controller works

on absolute dimensioning mode

G91 : The machine controller works on incremental dimensioning mode.

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

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

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

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

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

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.

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.

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;

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

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

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)

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)

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.

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

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.

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).

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)

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

M3 – Spindle rotatesin clockwise direction

M4 - Spindle rotates in counterclockwise direction

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

T : Tool PositionT3 D1 M6Select tool number 3

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.

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.

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:

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

Workpiece before machining

φ 40

60

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

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

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

X φ 39

Z 5X φ 40

Z -20

X

Z

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

φ 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

10. Stop spindle N90 M5

11. End Program N100 M30

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

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).

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

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.

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.

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)

Cycle 83 Deep Drilling Cycle

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

Cycle 83

Cycle 95

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

Cycle 95 ParametersThe parameters of cycle 95 are shown below:

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.

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” .

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.

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

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(

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)

Cycle 93Recessing or grooving cycle.

Cont. Cycle 93 ParametersVARI - Operation Mode

Cycle 97

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

Cycle 97

Used for thread cutting

PIT and MPIT ParametersPitch and Diameter

Cont. Cycle 97 ParametersIANG - Operation Mode

Cont. Cycle 97 ParametersVARI - Operation Mode

ChamferChamfer programming.

G1 X… Y… Z… CHF=6

Or G1 X… Y… Z…

CHR=11

RoundRound programming

G1 X… Y… Z… RND=5