51
CNC Tutorials and Exercises

r65353

Embed Size (px)

Citation preview

Page 1: r65353

CNC Tutorials and ExercisesBoxford DUET

CNC Tutorials and Exercises

Page 2: r65353

CNC Tutorials and ExercisesBoxford DUET

This tutorial gives examples of absolute co-ordinates and incremental co-ordinates.

Absolute Co-ordinates

The code G90 is used to select this type of programming.

Before programming commences the points on the path to be machined are definedrelative to the workpiece datum:

Examples of these co-ordinates are shown in the first table on the next page.

Tutorial 1: X and Y Co-ordinate Calculation -Absolute and Incremental Co-ordinates

Y+

BC

D

E

F

A

-1

Y-

X+X-

-2-3-4-5-6-7-8-9-10 1 2 3 4 5 6 7 8 9 10-1-2

-3

-4

-5

-6

-7

-8

-9

-10

12

3

4

5

67

8

9

10

G

H

ORIGINX0 Y0

Tutorial 1

Page 3: r65353

CNC Tutorials and ExercisesBoxford DUET

POINT DATUM A B C D E F G H

X 0 5 5 -14 -5 2 3 11 -2

Y 0 4 1 0 2 -10 -3 1 3

The Z axis is the vertical axis and the datum used is normally the surface of the work.

Z is positive when moving away from the surface and negative when moving towardsor into the surface.

POINT DATUM A B C D E F G H

X 0 5 10 -4 -9 -7 -4 7 5

Y 0 4 5 5 7 -3 -6 -5 -2

Incremental Co-ordinates

The code G91 is used to select this type of programming.

The points on the path to be machined are defined relative to the previous position.The points for the example on the previous page are shown in the table below.

The Z axis is again the vertical axis, and the points are defined relative to the previousposition; positive when moving away from the surface and negative when movingtowards or into the surface.

Tutorial 1

Page 4: r65353

CNC Tutorials and ExercisesBoxford DUET

Exercise 1 : Calculation of Co-ordinates

Tabulate the positions of the points A to H shown in the illustration below:

a) in absolute co-ordinates

b) in incremental co-ordinates

B

C

D

E

F

A

-1-2-3-4-5-6-7-8-1

-2

-3

-4

-5

-6

1

2

3

4

5

6

G

H

1 2 3 4 5 6 7 8

Y+

Y-

X+X-

Tutorial 1

Page 5: r65353

CNC Tutorials and ExercisesBoxford DUET

This tutorial illustrates the use of the G01 code; cutting takes place in a straight lineat a controlled feed rate.

Consider the component illustrated below; it is required to mill the two L shaped slots.

Absolute Co-ordinates

The absolute co-ordinates of the points are shown in the table below:

X

Y

45

15 20 30

80

50

1520

B C D

EFA

Material:Grooves:Tool change at:Tool used:

15mm thick Plastic5 wide x 2 deepX 0, Y 0, Z 255mm Slot Drill

Tutorial 2: Linear Interpolation

POINT A B C D E F T.C.

X 15 15 45 65 65 35 0

Y 15 35 35 35 15 15 0

The program can be written in tabulated format as shown on the following page.

Note:G00 is a default value and need not be programmed. The first tool is selected when entering the programinto the computer.

Tutorial 2

Page 6: r65353

CNC Tutorials and ExercisesBoxford DUET

ABSOLUTE PROGRAMMING N10 90

METRIC UNITS N20 71

TOOL CHANGE N30 0 0 25

SPINDLE N40 03 1500

2mm ABOVE POINT A N50 15 15 2

FEED TO 2 DEEP N60 01 –2 125

POINT B N70 01 15 35 125

POINT C N80 01 45 125

2mm ABOVE WORK N90 2

ABOVE POINT D N100 65

FEED TO 5 DEEP N110 01 –2 125

POINT E N120 01 15 125

POINT F N130 01 35 125

2mm ABOVE WORK N140 2

PARK POSITION N150 05 0 0 25

END OF PROGRAM N160 30

TUT 2/1

1 1

Tutorial 2

DUET PROGRAMMING SHEET-MILLINGDRAWINGNUMBER

TITLE PROGRAMMED BY

SHEET No. OF

SEQUENCE No.

PREPFUNCTION

MISCFUNCTION CO-ORDINATES

FEEDRATE

SPINDLESPEED

N G M Y Z J F S

NOTES

X I

Page 7: r65353

CNC Tutorials and ExercisesBoxford DUET

N10 G90N20 G71N30 X0 Y0 Z25N40 M03 S1500N50 X15 Y15 Z2N60 G01 Z-2 F125N70 G01 X15 Y35 F125N80 G01 X45 F125N90 Z2N100 X65N110 G01 Z-2 F125N120 G01 Y15 F125N130 G01 X35 F125N140 Z2N150 M05 X0 Y0 Z25N160 M30

Incremental Co-ordinates

The incremental co-ordinates for the component are shown in the table below.

Using these co-ordinates the program can be written as shown as follows:

POINT TOOL A B C D E F T.C. FROMCHANGE F

X 0 35 0 30 20 0 -30 -35

Y 0 35 20 0 0 -20 0 -15

Using compact format, the program for the component shown previously will be asfollows:

Tutorial 2

Page 8: r65353

CNC Tutorials and ExercisesBoxford DUET

DUET PROGRAMMING SHEET-MILLINGDRAWINGNUMBER

TITLE PROGRAMMED BY

SHEET No. OF

SEQUENCE No.

PREPFUNCTION

MISCFUNCTION CO-ORDINATES

FEEDRATE

SPINDLESPEED

N G M Y Z J F S

NOTES

X I

Tutorial 2

1. Examine the program listed

2. Enter the program into the computer

3. Simulate the machining process and compare the movement of the cutter with theprogram

ABSOLUTE PROGRAMMING N10 90

METRIC UNITS N20 71

TOOL CHANGE N30 0 0 25

INCREMENTAL PROGRAMMING N40 91

SPINDLE START RAPID TO2mm ABOVE A N50 03 15 15 –23 1500

FEED TO mm DEPTH N60 01 –4 125

FEED FROM A TO B N70 01 0 20 125

FEED FROM B TO C N80 01 30 0 125

RAPID TO CLEARANCE PLANE N90 4

RAPID TO 2mm ABOVE D N100 20 0

FEED TO 2mm DEPTH N110 01 –4 125

FEED FROM D TO E N120 01 0 –20 125

FEED FROM E TO F N130 01 –30 0 125

RAPID TO CLEARANCE PLANE N140 4

STOP SPINDLE RAPID TOPARK POSITION N150 05 –35 –15 23

END OF PROGRAM N160 30

TUT 2/2

1 1

Using these co-ordinates the program can be written as shown as follows:

Page 9: r65353

CNC Tutorials and ExercisesBoxford DUET

POINT TOOL CHANGE A B C D E F G H

X 0 20 60 20 20 60 20 60 60

Y 0 10 10 30 20 40 40 20 30

1. For the component shown below, use a programming sheet and write a program forthe cutter to cut a groove along the path from A to H.

2. Enter your program into the computer and give it a test run.

3. Edit your program if necessary.

Absolute Co-ordinates

X

Y 80

50

B

C

D

EF

A

Material:Slots:Tool change at:Tool used:

15mm thick Plastic5 wide x 2 deepX 0, Y 0, Z 255mm Slot Drill

H

G

Exercise 2: Linear Interpolation - Absolute Co-ordinates

Tutorial 2

Page 10: r65353

CNC Tutorials and ExercisesBoxford DUET Tutorial 3

POINT A B C D

X 20 20 60 60

Y 15 35 35 15

Canned cycles are used to shorten and simplify the CNC program. This tutorial givesexamples of the G81 Hole Drilling and G88 Pocket Milling cycles.

G81 Hole Drilling

This code drills a hole at the current X and Y values to a depth of Z measuredincrementally from the face of the workpiece and then withdraws to the previous Zvalue i.e. 2mm clear.

Enter Z incremental distance from the face of the workpiece to the bottom of the hole)F (feed rate)

20 40

80

50

1520

B C

DA

Tool change at:Tool used:

X -5, Y -55mm Slot Drill

4 x Ø 5 holes10 deep

Tutorial 3: Canned Cycles -Hole Drilling and Pocket Milling

Page 11: r65353

CNC Tutorials and ExercisesBoxford DUET

ABSOLUTE PROGRAMMING N10 90

METRIC UNITS N20 71

TOOL CHANGE N30 – 5 – 5 25

RAPID TRAVERSE 2mmABOVE HOLE A N40 20 15 2

SPINDLE ON 1500 rev/min N50 03 1500

DRILL A 10mm DEEP N60 81 – 10 125

RAPID TRAVERSE TO B N70 20 35

DRILL B N80 81 – 10 125

RAPID TRAVERSE TO C N90 60 35

DRILL C N100 81 – 10 125

RAPID TRAVERSE TO D N110 60 15

DRILL D N120 81 – 10 125

SPINDLE STOP TOOL CHANGE N130 05 – 5 – 5 25

END OF PROGRAM N140 30

TUT 3/1

DUET PROGRAMMING SHEET-MILLINGDRAWINGNUMBER

TITLE PROGRAMMED BY

SHEET No. OF

SEQUENCE No.

PREPFUNCTION

MISCFUNCTION CO-ORDINATES

FEEDRATE

SPINDLESPEED

N G M Y Z J F S

NOTES

X I

TUT3/11 1

The program for the component is as follows:

Tutorial 3

Page 12: r65353

CNC Tutorials and ExercisesBoxford DUET

G88 Rectangular Milling

This code mills a rectangular pocket. The tool should be positioned 2mm above thepocket centre on the previous line.

Enter

X the side length of the rectangle

Y the side width of the rectangle

Z the distance from the workpiece face to the bottom of the pocket

J the number of cuts

F feed rate

The tool returns to its start point when the cycle is complete.

The program for the above component is shown on the following page:

Tutorial 3

40

80

50 15

Material:Pocket:Tool change at:Tool used:

15mm thick Plastic8 deepX -5, Y -55mm Slot Drill

2.5 Rad

Page 13: r65353

CNC Tutorials and ExercisesBoxford DUET

DUET PROGRAMMING SHEET-MILLINGDRAWINGNUMBER

TITLE PROGRAMMED BY

SHEET No. OF

SEQUENCE No.

PREPFUNCTION

MISCFUNCTION CO-ORDINATES

FEEDRATE

SPINDLESPEED

N G M Y Z J F S

NOTES

X I

1. Examine the two programs.

2. Enter each program into the computer.

3. Simulate the machining process for each program and compare the movement of thecutter with the program.

ABSOLUTE PROGRAMMING N10 90

METRIC UNITS N20 71

RAPID TO TOOL CHANGE N30 – 5 – 5 25

SPINDLE ON 1500 rev/min N40 03 1500

2mm ABOVE CENTRE OFPOCKET N50 40 25 2

MILL POCKET N60 88 40 15 8 4 125

SPINDLE STOP TOOL CHANGE N70 05 – 5 – 5 25

END OF PROGRAM N80 30

TUT3/2

1 1

Tutorial 3

Page 14: r65353

CNC Tutorials and ExercisesBoxford DUET

For the component shown below:

1. Tabulate the co-ordinates.

2. Use a programming sheet and write a program to

� drill the holes

� mill the square pocket

(For tool changing, refer to Section 9.9).

3. Enter your program into the computer and give it a test run.

4. Edit your program if necessary.

20 60

80

50

10

4 x Ø 3 through holes

30 30

30

Material:Square Pocket:Tool change at:

15mm thick Plastic5mm deepX 0, Y O

Exercise 3: Canned Cycles - Programming a Tool Change

Tutorial 3

Page 15: r65353

CNC Tutorials and ExercisesBoxford DUET

- and can be complete (90°) or partial (less than 90°), within a single quadrant:

After entering G02 the following extra information is needed:

X value �Y value �Z value �

two of these values specify the co-ordinates of where the curve finishes, theother value must be left blank.

X

Y

Z

X

Z

Y

X - Y Plane X - Z Plane Y - Z Plane

Tutorial 4: Circular Interpolation -Clockwise and Counter-clockwise

This tutorial illustrates the use of the code G02 (clockwise circular interpolation) andG03 (counter clockwise circular interpolation).

Circular Interpolation � Clockwise

This code moves the table in such a way that a clockwise circular arc is cut in the workwithin a single quadrant. The cutter is positioned at the start of the arc on the previousline of the program.

The arc may be in the X � Y, X � Z or Y � Z plane:

Tutorial 4

Page 16: r65353

CNC Tutorials and ExercisesBoxford DUET

I value � the distance from the arc centre (incremental) to the tool position at the startof the cuts measured along:

a) the X axis when cutting in X-Y or X-Z plane

b) the Y axis when cutting in the Y-Z plane

J value � the distance from the arc centre (incremental) to the tool position at the startof the cut measured along:

a) the Y axis when cutting in the X-Y plane

b) the Z axis when cutting in the X-Z or Y-Z plane

Note that I and J are unsigned values.

Alternatively the radius of the arc can be entered as the I value and J left blank.

Clockwise Circular Interpolation (G02)

a) Single quadrant 90° arc in the XY plane

To mill from A to B arc of centre C � clockwise interpolation (G02)

CUTTER STARTS AT A

G = 02 X = 35 Y = 20 I = 0 J = 10

X

Y

30

25

A

C B

Datum

10 R

Tutorial 4

Page 17: r65353

CNC Tutorials and ExercisesBoxford DUET

b) Single quadrant partial arc in the XY plane

To mill from A to B arc of centre C clockwise interpolation (G02)

G = 02 X = (25 + 5) = 30 Y = (20 + 8.66) = 28.66 I = 0 J = 10

X

Y30

25

A

C

B

10 R

30o

X

Y

60o

A

C

B

D

To calculate co-ordinates of B, construct triangle BCD

CD = 10 x cos60 = 10 x 0.5 = 5

BD = 10 x sin60 = 10 x 0.866 = 8.66

Note that I and J are unsigned values

Tutorial 4

Page 18: r65353

CNC Tutorials and ExercisesBoxford DUET

Circular Interpolation � Counter-clockwise

This code moves the table in such a way that a counter-clockwise circular arc is cut inthe work within a single quadrant. The cutter is positioned at the start of the arc on theprevious line of the program.

As with the G02 code, the arc may be in the X-Y, X-Z or Y-Z planes

- and can be complete (90°) or partial (less than 90°), within a single quadrant:

After entering G03 the following extra information is needed:

X value �Y value �Z value �

I value � the distance from the arc centre (incremental) to the tool position at the startof the cut measured along:

a) the X axis when cutting in X-Y or X-Z plane

b) the Y axis when cutting in the Y-Z plane

two of these values specify the co-ordinates of where the curve finishes, the othervalue must be left blank.

X

Y

Z

X

Z

Y

X - Y Plane X - Z Plane Y - Z Plane

Tutorial 4

Page 19: r65353

CNC Tutorials and ExercisesBoxford DUET

J value � the distance from the arc centre (incremental) to the tool position at the startof the cut measured along:

a) the Y axis when cutting in the X-Y plane

b) the Z axis when cutting in the X-Z or Y-Z plane

Note that I and J are unsigned values.

Alternatively the radius of the arc can be entered as the I value and J left blank.

Counter-Clockwise Circular Interpolation (GO3)

a) Single quadrant 90° arc in the XY plane

To mill from B to A arc of centre C � counter-clockwise interpolation (G03)

G = 03 X = 25 Y = 30 I = 10 J = 0

X

Y

30

25

A

C B

Datum

10 R

Tutorial 4

Page 20: r65353

CNC Tutorials and ExercisesBoxford DUET

b) Single quadrant partial arc in the X-Y plane

To mill from B to A arc of centre C

G = 03 X = 25 Y = 30 I = 5 J = 8.66

To calculate co-ordinates of B, construct triangle BCD

CD = 10 x cos60 = 10 x 0.5 = 5

BD = 10 x sin60 = 10 x 0.866 = 8.66

Note that I and J are unsigned values

X

Y30

25

A

C

B

10 R

30o

X

Y

60o

A

C

B

D

Tutorial 4

Page 21: r65353

CNC Tutorials and ExercisesBoxford DUET

POINT A B C D E F G

X 10 20 30 40 50 60 70

Y 10 20 30 40 30 20 10

Example

10

80

50 BC

D

A

Tool change at: X -5, Y -5

10

EF

G

Cutter: Ø 5Arcs: 2 deepRadius: 10

The program for the above component is shown on the following page.

Note:Blocks N70 to N90 define the arc in terms of its radius.Blocks N100 to N120 define the arc in terms of the co-ordinates of its centre

Tutorial 4

Page 22: r65353

CNC Tutorials and ExercisesBoxford DUET

DUET PROGRAMMING SHEET-MILLINGDRAWINGNUMBER

TITLE PROGRAMMED BY

SHEET No. OF

SEQUENCE No.

PREPFUNCTION

MISCFUNCTION CO-ORDINATES

FEEDRATE

SPINDLESPEED

N G M Y Z J F S

NOTES

X I

ABSOLUTE PROGRAMMING N10 90

METRIC UNITS N20 71

TOOL CHANGE N30 – 5 – 5 25

SPINDLE START N40 03 1500

POINT A N50 10 10 2

FEED TO DEPTH N60 01 – 2 125

A TO B N70 02 20 20 10

B TO C N80 03 30 30 10

C TO D N90 02 40 40 10

D TO E N100 02 50 30 0 10

E TO F N110 03 60 20 10 0

F TO G N120 02 70 10 0 10

RAPID OUT N130 2

SPINDLE STOP TOOL CHANGE N140 05 – 5 – 5 25

END OF PROGRAM N150 30

1. Examine the program.

2. Enter the program into the computer.

3. Simulate the machining process and compare the movement of the cutter with theprogram.

TUT4

1 1

Tutorial 4

Page 23: r65353

CNC Tutorials and ExercisesBoxford DUET

For the cutter path shown above:

1. Tabulate the co-ordinates A to J.

2. Use a programming sheet to write a program for the path of the cutter centre line.

3. Enter your program into the computer and give it a test run.

4. Edit your program if necessary.

Note:The curve must be programmed in a series of quadrants (90°).

10

80

50B

C

D

A

Tool change at: X 0, Y 0

25

E

F

G

Material: 15mm deep PlasticSlot: 5 wide, 2 deep

HJ

10 Rad

10 Rad10 Rad

Exercise 4: Circular Interpolation

Tutorial 4

Page 24: r65353

CNC Tutorials and ExercisesBoxford DUET

1. Mill the steps (8mm diameter cutter)

2. Drill the holes (5mm diameter drill)

3. Mill the 30mm diameter pocket (10mm diameter cutter)

Note: Tool ChangingThe program for the above component illustrates the method of programming a tool change; block N120moves the cutter to a tool change position and block N130 calls up a new tool.

M06 denotes a tool change -

I gives the tool type,

J the tool diameter, and

This tutorial uses some cutters not supplied with the machine. It illustrates how toolchanges can be made and a number of operation can be carried out on one component.

Sequence of Operations

20 40

80

50

1520

B C

DA

Tool change at: X 0, Y 0

4 x Ø 5 holes15 13

5 5

E F

D G

Material: Plastic

Ø30

Tutorial 5: Combining Operations and Tool Changing

Tutorial 5

Page 25: r65353

CNC Tutorials and ExercisesBoxford DUET

DUET PROGRAMMING SHEET-MILLINGDRAWINGNUMBER

TITLE PROGRAMMED BY

SHEET No. OF

SEQUENCE No.

PREPFUNCTION

MISCFUNCTION CO-ORDINATES

FEEDRATE

SPINDLESPEED

N G M Y Z J F S

NOTES

X I

The program is as follows:

ABSOLUTE PROGRAMMING N10 90

METRIC UNITS N20 71

TOOL CHANGE ø CUTTER N30 – 5 – 5 25

RAPID TRAVERSE 2mm ABOVE A N40 1 54 2

SPINDLE ON 1500 rev/min N50 03 1500

FEED TO DEPTH N60 01 – 2 125

MILL FIRST STEP N70 01 – 5 125

RAPID TRAVERSE 2mm ABOVE C N80 79 – 5 2

FEED TO DEPTH N90 01 – 2 125

MILL SECOND STEP N100 01 55 125

TOOL CHANGE POSITION N120 05 – 5 – 5 25

TOOL CHANGE (5mm DRILL) N130 06 2 6

RAPID TRAVERSE OVER HOLE D N140 20 15 2

SPINDLE ON N150 03 1500

DRILL D 17mm DEEP N160 81 – 17 125

RAPID TRAVERSE OVER HOLE N170 20 35

DRILL E N180 81 – 17 125

RAPID TRAVERSE OVER HOLE F N190 60 35

DRILL F N200 81 – 17 125

RAPID TRAVERSE OVER HOLE G N210 60 15

DRILL G N220 81 – 17 125

TOOL CHANGING POSITION N230 05 – 5 – 5 25

TUT 5

1 2

Tutorial 5

Page 26: r65353

CNC Tutorials and ExercisesBoxford DUET

DUET PROGRAMMING SHEET-MILLINGDRAWINGNUMBER

TITLE PROGRAMMED BY

SHEET No. OF

SEQUENCE No.

PREPFUNCTION

MISCFUNCTION CO-ORDINATES

FEEDRATE

SPINDLESPEED

N G M Y Z J F S

NOTES

X I

1. Examine the program.

2. Enter the program into the computer.

3. Simulate the machining process and compare the movements of the cutters with theprogram.

TOOL CHANGE 10mm DRILL N240 06 2 10

RAPID TRAVERSE 2MM ABOVECENTRE OF POCKET N250 40 25 2

SPINDLE ON N260 03 1500

MILL POCKET N270 89 30 0 5 3 125

SPINDLE OFF, RAPID FEED TOTOOL CHANGE POSITION N280 05 – 5 – 5 25

END OF PROGRAM N290 30

2 2

TUT 5

Tutorial 5

Page 27: r65353

CNC Tutorials and ExercisesBoxford DUET

For the component shown above:

1. Write down the sequence of operations required to produce the part.

2. Tabulate the co-ordinates required.

3. Use a programming sheet to write a program.

4. Enter your program into the computer and give it a test run.

5. Edit your program if necessary.

5

50

80

5mmGroove

O25O35

15 2

5

Material:Tool change at:

15mm thick PlasticX 0, Y 0

Exercise 5: Combining Operations

Tutorial 5

Page 28: r65353

CNC Tutorials and ExercisesBoxford DUET

A subroutine can be regarded as a personalised canned cycle for use in a program whichhas repetitive shapes.

The illustration below shows such a component; the milled grooves can be programmedas a subroutine.

The codes used for subroutines are:

M43 subroutine create

On entering M43, a prompt is made for an identifying number to be given to theroutine. The number is entered in the I column and may have a value from 1 to 99. Theuser should note this reference number and the purpose of the routine.

The mode of programming is now changed: the line number automatically reverts to10 and co-ordinate entry, if absolute, becomes incremental.

There is no restriction on the range of G codes (except G25) and all the canned cyclesare available.

Tutorial 6: Subroutines

20

3015

50

5

5

15

2055

Material:

Tool change at:

15mm thick Plastic

X 0, Y 0Grooves: 5 wide x 3 deep

B

A

A,B start positions for subroutines:

Tutorial 6

Page 29: r65353

CNC Tutorials and ExercisesBoxford DUET

M44 subroutine terminate

On entry of the signal to end the subroutine the line numbers of the original programare restored and the current absolute position of the tool is shown in the X, Y and Zcolumns. If the program was previously being entered with absolute co-ordinates, itreverts to its former style.

M45 subroutine call

On entering M45 a prompt is made to input the reference number of the subroutinein the I column. A search is made in the subroutine file and the first file found withthat reference number is executed.

Note:Care is needed when allocating subroutine identification numbers.

The program for the previous illustration shows subroutine blocks S10 onwards beingtyped into the system immediately after block N50. After this the cutter is repositionedbefore calling up the subroutine and completing the program.

Editing of subroutines

The program EDIT facility can be used. If this is brought into use the program isdisplayed for editing but a further option (SUB) is offered:

SUB HELP MENU

If SUB is chosen, then the subroutine is displayed for editing.

1. Examine the program.

2. Enter the program into the computer.

3. Simulate the machining process and compare the movements of the cutters with theprogram.

Tutorial 6

Page 30: r65353

CNC Tutorials and ExercisesBoxford DUET

N10 90

N20 71

TOOL CHANGE N30 0 0 25

N40 03 1500

POINT A N50 5 5 1

SUBROUTINE FOR GROOVES N60 45 1

POINT B N70 55 30

SUBROUTINE FOR GROOVES N80 45 1

N90 05 0 0 25

N100 30

ENTERED S10 43 1

IMMEDIATELY AFTER BLOCK S20 01 – 3 125

S30 01 15 125

S40 01 20 125

THE SUBROUTINE S50 01 – 15 125

MACHINES THE GROOVES S60 01 – 20 125

(INCREMENTALLY) S70 3

S80 44

N50

TUT 6

1 1

Tutorial 6

DUET PROGRAMMING SHEET-MILLINGDRAWINGNUMBER

TITLE PROGRAMMED BY

SHEET No. OF

SEQUENCE No.

PREPFUNCTION

MISCFUNCTION CO-ORDINATES

FEEDRATE

SPINDLESPEED

N G M Y Z J F S

NOTES

X I

Page 31: r65353

CNC Tutorials and ExercisesBoxford DUET

20

30

50

5

5

15

20

55

Material: 15mm thick PlasticGrooves: 5 wide x 2 deep

20

80

25

20

20

20

20

Exercise 6: Subroutines

For the component shown above:

1. Tabulate the co-ordinates required.

2. Use a programming sheet to write a program; the L shaped grooves can be programmedusing a subroutine.

3. Enter your program into the computer and give it a test run.

4. Edit your program if necessary.

Tutorial 6

Page 32: r65353

CNC Tutorials and ExercisesBoxford DUET

21

4

3

This tutorial demonstrates how a program written as a subroutine can be reflectedabout the X axis or about the Y axis or about both the X and the Y axes. It supportsboth linear and circular interpolation.

Consider the shape shown in illustration A, which has been drawn in the sequence 1-2, 2-3, 3-4 and 4-1.

Tutorial 7: Mirror Images

Alternatively, if the X co-ordinates are kept constant and the Y co-ordinates reflected,the outcome is:

2 1

4

3

with the 1-2, 2-3, 3-4 and 4-1 sequence maintained

If the X co-ordinates are reflected with Y co-ordinates unchanged, the shape becomes:

2 1

4

3

A

B

C

Tutorial 7

Page 33: r65353

CNC Tutorials and ExercisesBoxford DUET

If both the X and y co-ordinates are reflected the result becomes:

If a program which calls a subroutine containing the original shape is written, then anyor all of the above variations may be implemented. The �as programmed� case isachieved by the usual method of calling the subroutine. The mirror facility isaccomplished by inserting a line in the program after positioning the tool at the startof the cycle but prior to calling the subroutine.

The entry is:

G value 28X value 0 or 1Y value either 0 or 1

For example

To reflect the X co-ordinate with Y unchanged:

Enter G28 with X = 1, Y = 0 B

To reflect the Y co-ordinate with X unchanged:

Enter G28 with X = 0, Y = 1 C

To reflect both the X and the Y co-ordinates:

Enter G28 with X = 1, Y = 1 D

To cancel the mirror facility:

Enter G28 WITH X = 0, Y =0

Note:For mirror image programming incremental co-ordinates must be used.

21

4

3

D

Tutorial 7

Page 34: r65353

CNC Tutorials and ExercisesBoxford DUET

Example

In the program for the above illustration, note that blocks S10 to S80 onwards are typedinto the system immediately after block N40.

1. Study the program.

2. Enter the program into the computer.

3. Simulate the machining process and compare the cutter movements with the program.

20

30

15

50

Material:

Tool change at:

15mm thick Plastic

X 0, Y 0Slots: 5 wide x 3 deep

50

80

30 10 B

C D

A

A'

D' C'

B'

10

Tutorial 7

Page 35: r65353

CNC Tutorials and ExercisesBoxford DUET

DUET PROGRAMMING SHEET-MILLINGDRAWINGNUMBER

TITLE PROGRAMMED BY

SHEET No. OF

SEQUENCE No.

PREPFUNCTION

MISCFUNCTION CO-ORDINATES

FEEDRATE

SPINDLESPEED

N G M Y Z J F S

NOTES

X I

1 2

TUT 7

MIRROR IMAGE REFLECT BOTHX AND Y CO-ORDINATES

Tutorial 7

ABSOLUTE PROGRAMMING N10 90

METRIC UNITS N20 71

TOOL CHANGE N30 0 0 25

SPINDLE ON POINT A N40 03 30 20 1 2000

CALL SUBROUTINE N50 45 7

POINT B N60 50 20

N70 91

N80 28 1 0

CALL SUBROUTINE N90 45 7

S20 TI S80 REPEAT

CANCEL MIRROR IMAGE N100 28 0 0

ABSOLUTE PROGRAMMING N110 90

START OF SHAPE C N120 30 30

INCREMENTAL PROGRAMMING N130 91

N140 28 0 1

CALL SUBROUTINE N150 45 7

S20 TO S80 REPEATS

CANCEL MIRROR IMAGE N160 28 0 0

ABSOLUTE PROGRAMMING N170 90

START OF SHAPE D N180 50 30

INCREMENTAL PROGRAMMING N190 91

N200 28 1 1

MIRROR IMAGE REFLECT XCO-ORDINATE Y UNCHANGED

MIRROR IMAGE REFLECT YCO-ORDINATE X UNCHANGED

Page 36: r65353

CNC Tutorials and ExercisesBoxford DUET

DUET PROGRAMMING SHEET-MILLINGDRAWINGNUMBER

TITLE PROGRAMMED BY

SHEET No. OF

SEQUENCE No.

PREPFUNCTION

MISCFUNCTION CO-ORDINATES

FEEDRATE

SPINDLESPEED

N G M Y Z J F S

NOTES

X I

2 2

TUT 7

Tutorial 7

CALL SUB ROUTINE N210 45 7

S20 TO S80 REPEATS

CANCEL MIRROR IMAGE N220 28 0 0

ABSOLUTE PROGRAMMING N230 90

TOOL CHANGE N240 05 0 0 25

END OF PROGRAM N250 30

SUBROUTINE CREATE S10 43 7

FEED TO DEPTH S20 01 0 0 – 3 100

S30 01 – 10 0 0 100

S40 01 0 – 10 0 100

S50 01 10 – 5 0 100

S60 01 0 15 0 100

S70 0 0 3

SUBROUTINE TERMINATE S80 44

Tutorial 7

SUBROUTINE SHAPE AINCREMENTAL

Page 37: r65353

CNC Tutorials and ExercisesBoxford DUET

Exercise 7: Mirror Images

2030

15

50

Material:

Tool change at:

15mm thick Plastic

X 0, Y 0Slots: 5 wide x 2 deep

50

80

3020

For the component shown above:

1. Write a program to machine the grooved triangles using the mirror image technique.

2. Enter your program on the computer and simulate the cutting action.

3. Edit your program if necessary.

The manufacture of the component shown below uses the G86 and G87 canned cycles.

Tutorial 7

Page 38: r65353

CNC Tutorials and ExercisesBoxford DUET

Tutorial 8: Further Canned Cycles -Pitch Circle Drilling and Dish Milling

The manufacture of the component shown below uses the G86 and G87 canned cycles.

80

50

Tool change at: X 0, Y 0

6 x Ø 5 holes5 deepon 40mm PCD

Material: 15mm thick Plastic

Dished pocketØ30, 5 deepØ10 at bottom

G86 Canned Cycle � Pitch Circle Diameter Drilling

This code produces a series of holes on a circular pitch.

The tool is positioned at a 2mm stand off point above the centre of a hole on the PCDon the previous line.

Enter:

X � number of holes to be drilled (must not be less than two)

Z � incremental distance from the face of the workpiece to the bottomof the hole

I � the distance from the circle centre (incremental) to the first holemeasured along the X axis

J � as the I value but measured along the Y axis

F � Feed rate

Tutorial 8

Page 39: r65353

CNC Tutorials and ExercisesBoxford DUET

G87 Canned Cycle � Dish Milling

This code will mill out a circular dish-shaped pocket. The dish is produced by cuttinga series of concentric circular pockets starting at X diameter, with successive circlesgetting deeper as they reduce in diameter, until the last circle is at Y diameter and depthZ. The total number of circles is J. Increasing the number of cuts will produce a betterdish but the time taken will be greater.

Enter

X � the top diameter

Y � the bottom diameter of the dish

Z � The incremental distance from the face of the workpiece to thebottom of the dish

I � For a complete dish enter zero, or for hollow circles (an outlinearound the edge) enter a value

J � is the number of cuts to produce the dish

F � the feed rate at which the dish is to be milled

The cycle is best used in two stages. For the first stage enter I = 0; this will rough outa pocket, leaving a stepped profile. On calling the code again for the second stage entera value for I = 1; this will mill around the circumference of the circles, thus smoothingthe profile.

The program for the illustration shown earlier is shown on the following page.

1. Study the program.

2. Enter the program into the computer.

3. Simulate the machining process and compare the cutter movement with the program.

4. View the component in 3D.

Tutorial 8

Page 40: r65353

CNC Tutorials and ExercisesBoxford DUET

SPINDLE ON, Move to Centreof Pocket

SPINDLE ON, Move to Centreof P.C.D.

1 1

TUT 8

Tutorial 8

ABSOLUTE PROGRAMMING N10 90

METRIC UNITS N20 71

TOOL CHANGE ø5 DRILL N30 0 0 25

N40 03 40 25 2 2000

DRILL HOLES ON P.C.D. N50 86 6 5 0 20 80

TOOL CHANGE N60 05 0 0 25

TOOL CHANGE N70 06 2 5

N80 03 40 25 2 2000

ROUGH MILL DISH N90 87 30 10 5 0 5 80

FINISH MILL DISH N100 87 30 10 5 1 5 80

PARK POSITION N110 05 0 0 25

END OF PROGRAM N120 30

DUET PROGRAMMING SHEET-MILLINGDRAWINGNUMBER

TITLE PROGRAMMED BY

SHEET No. OF

SEQUENCE No.

PREPFUNCTION

MISCFUNCTION CO-ORDINATES

FEEDRATE

SPINDLESPEED

N G M Y Z J F S

NOTES

X I

Page 41: r65353

CNC Tutorials and ExercisesBoxford DUET

80

50

Tool change at: X 0, Y 0

8 x Ø 5 holes5 deepon 40mm PCD

Material: 15mm thick Plastic

Dished pocketØ25, 5 deepØ10 at bottom

25

Exercise 8: Use of Canned Cycles -Pitch Circle Drilling and Dish Milling

For the component shown above:

1. Write a program to machine

� the holes on the P.C.D.

� the dished pocket.

2. Enter your program on the computer and simulate the cutting action.

3. Edit your program if necessary.

Tutorial 8

Page 42: r65353

CNC Tutorials and ExercisesBoxford DUET

20

35

45

Tool change at: X 0, Y 0

45

80

30

5

60

50

5

3

4 2

1

7

All grooves15 radius2 deep5 wide

20

6 8

The following program uses a subroutine which will mill a 90° arc of radius 15mmcounter-clockwise and 2mm deep. It then uses the G28 Mirror Image routine to millthe other three arcs.

The program is shown on the following page.

1. Study the program.

2. Key in the program and run the simulation.

3. Compare the cutter movements with the program.

Tutorial 9: Subroutines, Mirror Images andCircular Interpolation

Tutorial 9

Page 43: r65353

CNC Tutorials and ExercisesBoxford DUET

DUET PROGRAMMING SHEET-MILLINGDRAWINGNUMBER

TITLE PROGRAMMED BY

SHEET No. OF

SEQUENCE No.

PREPFUNCTION

MISCFUNCTION CO-ORDINATES

FEEDRATE

SPINDLESPEED

N G M Y Z J F S

NOTES

X I

ABSOLUTE PROGRAMMING N10 90

METRIC UNITS N20 71

TOOL CHANGE POSITION N30 0 0 25

SPINDLE START N40 03 1500

OVER POINT 1 N50 60 30 1

SUBROUTINE CREATE S10 43 9

FEED TO DEPTH S20 01 -3 125

MILL QUADRANT S30 03 -15 15 15 125

WITHDRAW TOOL S40 3

SUBROUTINE TERMINATE S50 44

SUBROUTINE CALL N60 45 9

POINT 2 N70 90 45 45 1

ABOVE POINT 3 N80 20 30

INCREMENTAL PROGRAM N90 91

N100 28 1 0

SUBROUTINE CALL N110 45 9

CANCEL MIRROR IMAGE N120 28 0 0

POINT 4 N130 90 35 45 1

ABOVE POINT 5 N140 20 20

INCREMENTAL PROGRAM N150 91

N160 28 1 1MIRROR IMAGEREFLECT BOTH X AND Y

MIRROR IMAGEREFLECT X, Y UNCHANGED

1 2

TUT 9

SUBROUTINE CALL N170 45 9

Tutorial 9

Page 44: r65353

CNC Tutorials and ExercisesBoxford DUET

DUET PROGRAMMING SHEET-MILLINGDRAWINGNUMBER

TITLE PROGRAMMED BY

SHEET No. OF

SEQUENCE No.

PREPFUNCTION

MISCFUNCTION CO-ORDINATES

FEEDRATE

SPINDLESPEED

N G M Y Z J F S

NOTES

X I

2 2

TUT 9

CANCEL MIRROR IMAGE N180 28 0 0

POINT 6 N190 90 35 5 1

ABOVE POINT 7 N200 60 20

INCREMENTAL PROGRAM N210 91

N220 28 0 1

SUBROUTINE CALL N230 45 9

CANCEL MIRROR IMAGE N240 28 0 0

POINT 8 N250 90 45 5 1

SPINDLE STOP. TOOL CHANGE N260 05 0 0 25

END OF PROGRAM N270 30

MIRROR IMAGEREFLECT X, Y UNCHANGED

Tutorial 9

Page 45: r65353

CNC Tutorials and ExercisesBoxford DUET

21

36

44

44

80

29

59

60

6

All grooves15 radius2 deep5 wide

21

Material:Tool change at:Tool used:

15mm thick PlasticX 0, Y 05mm Slot Drill

For the component shown above:

1. Write a program to mill the curved slots using a subroutine and mirror images.

2. Key in the program and run the simulation.

3. Edit your program if necessary.

Exercise 9: Subroutines and Mirror Images

Tutorial 9

Page 46: r65353

CNC Tutorials and ExercisesBoxford DUET

For programs with repetitive elements, and as an alternative to creating a subroutine(M43), a datum shift (G57) can be used in conjunction with Jump to Block (G25) andReturn from Jump (G26).

Details of the above codes are:

G25 Jump to Block

This code enables a section of a program to be executed again. There are tworestrictions on the use of G25:

(a) a G25 loop must not be called from within a subroutine,

(b) a subroutine must not be called from within a G25 loop.

Enter in the S column the line number to which the jump is to be made.

G26 Return from Jump

After using a G25 the program executes from the line specified in the S column untila G26 is encountered. The program then reverts to the line following that from wherethe G25 call was made. The G26 is only operative after a G25 loop has been called.At all other times it is transparent.

G57 Datum Shift

This code enables the X Y datum to be altered by an amount specified in the X andY columns.

Enter X value - new absolute X datum

Enter Y value - new absolute Y datum

Note:The Z datum cannot be altered with G57.

G53 Cancel Datum Shift

This code is used to cancel a G57 datum shift, i.e. it makes X and Y shift equal to zero.

The above techniques are illustrated in the following example.

Tutorial 10: Datum Shift and Jump to Line

Tutorial 10

Page 47: r65353

CNC Tutorials and ExercisesBoxford DUET

The program is shown on the following page.

1. Study the program.

2. Key in the program and run the simulation.

3. Compare the cutter movements with the program.

2050

80

50

10

Material:Slots:Tool change at:Tool used:

15mm thick Plastic5 wide x 2 deepX 0, Y 05mm Slot Drill

15

15

20

15

15

Tutorial 10

Page 48: r65353

CNC Tutorials and ExercisesBoxford DUET

DUET PROGRAMMING SHEET-MILLINGDRAWINGNUMBER

TITLE PROGRAMMED BY

SHEET No. OF

SEQUENCE No.

PREPFUNCTION

MISCFUNCTION CO-ORDINATES

FEEDRATE

SPINDLESPEED

N G M Y Z J F S

NOTES

X I

ABSOLUTE PROGRAMMING N10 90

METRIC UNITS N20 71

TOOLPARK POSITION N30 0 0 25

DATUM SHIFT TO X20 Y10 N40 57 20 10

N50 03 0 0 2 1500

INCREMENTAL PROGRAMMING N60 91

FEED TO DEPTH N70 01 -4 125

CUT FIRST L SHAPE N80 01 15 125

CUT FIRST L SHAPE N90 01 15 125

RAPID TO CLEAR N100 4

RAPID TO NEW POSITION N110 -15 -15

ABSOLUTE PROGRAMMING N120 90 -15 -15

RETURN FROM JUMP N130 26

CANCEL DATUM SHIFT N140 53

DATUM SHIFT TO X50 Y20 N150 57 50 20

JUMP TO BLOCK N60 N160 25 60

CANCEL DATUM SHIFT N170 53

TOOL PARK N180 0 0 25

STOP SPINDLE N190 05

END OF PROGRAM N200 30

TUT 10

SPINDLE STARTMOVE OVER NEW DATUM

1 1

Tutorial 10

Page 49: r65353

CNC Tutorials and ExercisesBoxford DUET

For the component shown above:

1. Write a program to mill the L-shaped slots using the Datum Shift and Jump to Linecodes.

2. Key in the program and run the simulation.

3. Edit your program if necessary.

Exercise 10: Datum Shift and Jump to Line

45

80

50

10

Material:Slots:Tool change at:Tool used:

15mm thick Plastic5 wide x 2 deepX 0, Y 05mm Slot Drill

20

10

20

25

20

25

Tutorial 10

Page 50: r65353

DUET OPERATIONS SHEET - MILLINGDRAWINGNUMBER

TITLE MATERIAL

SHEET No. OF

OPERATIONSPINDLE

FEEDTOOL

REQUIREDOPERATIONSNUMBER

TOOLFEED

OPERATIONS SHEET

Page 51: r65353

DUET PROGRAMMING SHEET-MILLINGDRAWINGNUMBER

TITLE PROGRAMMED BY

SHEET No. OF

SEQUENCE No.

PREPFUNCTION

MISCFUNCTION CO-ORDINATES

FEEDRATE

SPINDLESPEED

N G M Y Z J F S

NOTES

X I

PROGRAMMING SHEET