Cnc milling programs
-
Upload
moniraghu -
Category
Engineering
-
view
571 -
download
35
Transcript of Cnc milling programs
PROFILE MILLING:-
1. To prepare a CNC part program to mill the component as per the
drawing
Assume thickness = 20mm
100
80
40
40
120
50
40
50
50
20
20
SIMULATION MODEL:-
ABSOLUTE MODE(G90)
G90 G00 G54 G17 G21 G95
T01 M06
G43 Z50 M08
S1000 M03
G90 G00 X20 Y20
G01 Z-20 F100
G90 G01 X120 Y20
G90 G01 X160 Y60
G90 G01 X160 Y140
G90 G01 X120 Y190
G90 G01 X70 Y190
G90 G01 X20 Y140
G90 G01 X20 Y20
G01 Z50
G90 G00 X250 Y250
G90 M09
G90 M05
G90 M30
2. To prepare a CNC part program to mill the component as per the
drawing
Assume thickness = 20mm
( 60, 10 )( 10 , 10 )
( 10 , 40 ) ( 20 , 40 )
( 20 , 60 )( 10 , 60 )
( 20 , 70 ) ( 40 , 70 )
( 60, 50 )
x
y
SIMULATION MODEL :-
Absolute mode (G90)
N1 G17 G21 G54 G95
N2 T01 M06
N3 G43 M08
N4 S1000 M03 Z50
N5 G90 G00 X10 Y10
N6 G01 Z-20 F100
N7 G90 G01 X60 Y10
N8 G90 G01 X60 Y50
N9 G90 G01 X40 Y70
N11 G90 G01 X20 Y70
N12 G90 G01 X10 Y60
N13 G90 G01 X20 Y60
N14 G90 G01 X20 Y40
N15 G90 G01 X10 Y40
N16 G90 G01 X10 Y10
N17 G90 G00 Z50
N18 G00 X100 Y100 Z50
N19 M09
N20 M05
N21 M30
PART PROGRAM FOR CIRCULAR INTERPOLATION AND SIMULATE
G02/03 Circular interpolation
Format N__ G02/03 X__ Y__Z__ I__ J__K__ F__ using the arc center
OR N__ G02/03 X__ Y__Z__ R__ F__ using the arc radius G02 moves along a CW arc G03 moves along a CCW arc Arc center The arc center is specified by addresses I, J and K. I, J and K are the X, Y and Z co-ordinates of
the arc center with reference to the arc start point.
Y
Arc
start
Arc end
- I - J
Arc center
X
I = X coord. of center - X coord. of start point J = Y coord. of center - Y coord. of start point K = Z coord. of center - Z coord. of start point I, J and K must be written with their signs.
RADIUS METHOD
3. To prepare a CNC part program to mill the component as per the
drawing
Assume thickness = 20 mm
10
R20
20
20
2030 20
60
60
R20
SIMULATION MODEL:-
ABSOLUTE MODE (G90)
N1 G17 G21 G54 G95
N2 T01 M06 G43 M08
N3 S1000 M03 Z50
N4 G90 G00 X30 Y10
N5 G90 Z-22 F50
N6 G01 X50 Y10
N7 G01 X50 Y30
N8 G01 X70 Y30
N9 G01 X70 Y10
N10 G01 X90 Y10
N11 G03 X110 Y30 R20 F10
N12 G01 X110 Y90
N13 G03 X90 Y110 R20 F10
N14 G01 X30 Y110
N15 G03 X10 Y90 R20 F10
N16 G01 X10 Y30
N17 G03 X30 Y10 R20 F10
N18 G90 G00 Z50
N19 G90 G00 X110 Y110 F50
N20 M05
N21 M09
N22 M30
RADIUS METHOD
4. To prepare a CNC part program to mill the component as per the
drawing
40 40 40 2020
2040
4040
20
20
SIMULATION MODEL:-
ABSOLUTE MODE (G90)
N1 G17 G21 G54 G95
N2 T01 M06 G43 M08
N3 S1000 M03 Z50
N4 G90 G00 X40 Y20
N5 G90 Z-22 F50
N6 G01 X80 Y20
N7 G02 X120 Y20 R20 F10
N8 G01 X160 Y20
N9 G03 X180 Y40 R20 F10
N10 G01 X180 Y80
N11 G02 X180 Y120 R20 F10
N12 G01 X180 Y160
N13 G03 X160 Y180 R20 F10
N14 G01 X120 Y180
N15 G02 X80 Y180 R20 F10
N16 G01 X40 Y180
N17 G03 X20 Y160 R20 F10
N18 G01 X20 Y120
N19 G02 X20 Y80 R20 F10
N20 G01 X20 Y40
N21 G03 X40 Y20 R20
N22 G90 G01 Z50
N23 G90 G00 X250 Y250
N24 M09
N25 M05
N26 M30
I, J, K METHOD
5. To prepare a CNC part program to mill the component as per the
drawing
2030 30 30 30 20
R30
2030
3030
3020
20
SIMULATION MODEL:-
ABSOLUTE MODE (G90)
N1 G17 G21 G54 G95
N2 T01 M06 G43 M08
N3 S1000 M03 Z50
N4 G00 G90 X50 Y50
N5 G90 Z-20 F50
N6 G90 G03 X110 Y50 I30 J00
N7 G90 G03 X110 Y110 I0 J30
N8 G90 G03 X50 Y110 I-30 J00
N9 G90 X50 Y50 I0 J-30
N10 G90 G01 Z50
N11 G90 G00 X150 Y150
N12 M05
N13 M09
N14 M30
I, J, K METHOD
6. To prepare a CNC part program to mill the component as per the
drawing
60
6060 O
60
6020
All the dimensions are in mm
SIMULATION MODEL:-
ABSOLUTE MODE(G90)
N1 G17 G21 G54 G95
N2 T01 M06 G43 M08
N3 S1000 M03 Z50
N4 G00 G90 X30 Y60
N5 G90 Z-20 F50
N6 G90 G03 X90 Y60 I30 J00
N7 G90 G03 X30 Y60 I-30 J00
N8 G90 G01 Z50
N9 G90 G00 X150 Y150
N10 M05
N11 M09
N12 M30
SUBROUTINE
General rules:
1. You can call subroutines (within the same program) and subprograms (separate file on disk)
using either M98 or M97 using the same syntax.
2. A subprogram can start with either N or O. Both codes are supported as a sub program
number.
3. Repetitions can be given using the L word or as the first digits of the P word (last four digits
are always program number).
4. If a subroutine number is missing in program the simulator will attempt to find a disk file
with the format O####.cnc in the same folder as the main program or in the user defined
CNC folder.
5. A subprogram can also be called with the alternative syntax M98 “mySubProgram.cnc” L…
6. Return from subprograms and subroutines can be done with either M17 or M99.
7. The L word is optional. If omitted, one call will be executed only.
Example program
Single call to subroutine, no repeats
M98 P1000
O1000
M17 (or M99)
Standard call to subroutine, repeating 4 times
M98 P1000 L4
Call to subroutine on line number 555, repeating 2 times
N100 M98 P555 L2
N555 ….
N565 M17 (or M99)
Call to subroutine with repeats in the P address
M98 P51001 (Call O1001 five times)
O1001
M17 (or M99)
Calling subprograms
If a subroutine within the same program is missing, the simulator will look for a separate program on disk.
M98 O1099 L2
If there is no O1099 or N1099 in the program, the block above will call subprogram O1099.cnc
File name syntax
M98 “DrillHoles.cnc” L2
The block above will look for subprogram DrillHoles.cnc in the same folder as the main program, or in the user
defined CNC programs folder.
Please remember to end all subprograms with either M17 or M99 for execution to continue in the main program.
SUBROUTINE (DIRECT METHOD)
7. Write a milling program for a given sketch using G-code and M-codes.
60 90 60
6090
60
O60
15 15
All dimensions are in mm
SIMULATION MODEL:-
ABSOLUTE MODE (G90)
G17 G21 G54 G95
T01 M06
G43 M08 Z50
S1000 M03
G90 G00 X45 Y60
M98 P10055
G90 G00 X135 Y60
M98 P10055
G90 G00 X45 Y150
M98 P10055
G90 G00 X135 Y150
M98 P10055
G90 G00 Z50
G90 G00 X250 Y250
M09
M05
M30
O55
G01 Z-10 F50
G91 G03 X30 Y0 R15
G91 G03 X-30 Y00 R15
G91 G00 Z50
M99
8. Write a milling program for a given sketch using G-code and M-codes.
25
55
90
120
150
25
55
90
120
150
50
All the dimensions are in mm
SIMULATIONMODEL :-
ABSOLUTE PROGRAMMING(G90)
G17 G21 G54 G95
T01 M06
G43 M08
S1000 M03 Z60
G90 G00 X32.5 Y32.5
M98 P10055
G90 G00 X97.5 Y32.5
M98 P10055
G90 G00 X97.5 Y97.5
M98 P10055
G90 G00 X32.5 Y97.5
M98 P10055
G90 Z50
M09
M05
M30
O55
G01 Z-52 F50
G91 G01 X15 Y0
G91 G01 X0 Y15
G91 G01 X-15 Y0
G91 G01 X0 Y-15
G91 Z60
M99
9. Write a milling program for a given sketch using G-code and M-codes.
20 2020 30 20 30 20
2030
2030
20
ALL DIMENSION ARE IN MM
Simulation:-
ABSOLUTE MODE (G90)
G17 G21 G54 G95
T01 M06
G43 M08 Z50
S1000 M03
G90 G00 X27.5 Y27.5
M98 P10055
G90 G00 X77.5 Y27.5
M98 P10055
G90 G00 X77.5 Y77.5
M98 P10055
G90 G00 X27.5 Y77.5
M98 P10055
G90 G01 Z50
G90 G00 X200 Y200
M09
M05
M30
O55
G01 Z-20 F50
G91 G01 X15 Y0
G91 G01 X-7.5 Y15
G91 G01 X-7.5 Y-15
G90 Z50
M99
SUBROUTINE (REPETITIVE METHOD)
10. Write a milling program for a given sketch using G-code and M-codes.
60 90 60
6090
60
O60
15 15
ALL DIMENSION ARE IN MM
SIMULATIONMODEL :-
ABSOLUTE MODE(G90)
G17 G21 G54 G95
T01 M06
G43 M08 Z50
S1000 M03
G90 G00 X45 Y60
M98 P30055
G00 Z50
G90 G00 X135 Y60
M98 P30055
G00 Z50
G90 G00 X45 Y150
M98 P30055
G00 Z50
G90 G00 X135 Y150
M98 P30055
G00 Z50
G90 G00 Z50
G90 G00 X250 Y250
M09
M05
M30
O55
G01 Z-5 F50
G91 G03 X30 Y0 R15
G91 G03 X-30 Y00 R15
M99
11. Write a milling program for a given sketch using G-code and M-codes.
15
30
60
60
20 20
2020
All the dimensions are in mm
SIMULATION MODEL:-
ABSOLUTE MODE (G90)
G17 G21 G54 G95
T01 M06
G43 M08 Z50
S1000 M03
G90 X42.5 Y42.5
M98 P30055
G90 G00 Z50
G90 G00 X500 Y500
M09
M05
M30
O55 (SUB PROGRAM)
G01 Z-5 F50
G91 G01 X15 Y00
G91 G01 X00 Y15
G91 G01 X-15 Y00
G91 G01 X00 Y-15
G91 G01 X-7.5 Y-7.5
G91 G01 X30 Y00
G91 G01 X00 Y30
G91 G01 X-30 Y00
G91 G01 X00 Y-30
G91 G01 X-7.5 Y-7.5
G91 G01 X45 Y00
G91 G01 X00 Y45
G91 G01 X-45 Y00
G91 G01 X00 Y-45
G91 Z5
G90 X42.5 Y42.5
G91 Z-5
M99
12. Write a milling program for a given sketch using G-code and M-codes. (F0URTH
QUADRANT OPERATION)
Assume thickness = 20 mm
20 60 20
2060
20
R20
All the dimensions are in mm
SIMULATION MODEL: -
ABSOLUTE MODE: -
G54 G17 G21 G94
T01 M06
G43 M08 Z50
S1000 M03
G90 G00 X50 Y00
G90 G01 Z-20 F100
G01 X50 Y30
G03 X30 Y50 I-20 J0
G01 X-30 Y50
G02 X-50 Y30 I-20 J0
G01 X-50 Y-30
G02 X-30 Y-50 I0 J-20
G01 X30 Y-50
G02 X50 Y-30 I20 J0
G01 X50 Y30
G90 G01 Z50
G90 G00 X-20 Y00
G01 Z-20
G02 X20 Y00 R20
G02 X-20 Y00 R20
G90 G01 Z50
G90 G00 X200 Y200
M09
M05
M30
MIRROR ABOUT “X” AXIS
13. Write a milling program for a given sketch using G-code and M-codes WITH MIRROR
ING.
30
X X
100
2020
60
60
20
Y
Y
20
15
All the dimensions are in mm
SIMULATON MODEL:-
MIRROR ABOUT “X” AXIS
O1234
G17 G90 G21 G54 G94
T01 M06
G43 M08 Z50
S1000 M03
M98 P10055
M70
M98 P10055
M81
Z50
G90 G00 X200 Y200
M09
M05
M30
O55
G0 X35 Y35
G01 Z-10 F100
G91 X30 Y00
G91 X00 Y30
G91 X-30 Y00
G91 X00 Y-30
G0 Z50
G90 X0 Y0
M99
MIRROR ABOUT “Y” AXIS
14. Write a milling program for a given sketch using G-code and M-codes WITH MIRROR
ING.
30
X X
100
2020
60
60
20
Y
Y
20
15
All the dimensions are in mm
SIMULATION MODEL:-
MIRROR ABOUT “Y” AXIS
O1234
G17 G90 G21 G54 G94
N10 T01 M06
G90 G00 G54 X0.0 Y0. S1000 M03
G43 M08 Z50
M98 P10055
M71
M98 P10055
M81
M05
Z10
G00 X200 Y200
M30
O55
G0 X35 Y35
G01 Z-10 F100
G91 X30 Y00
G91 X00 Y30
G91 X-30 Y00
G91 X00 Y-30
G0 Z50
G90 X0 Y0
M99
15. Write a milling program for a given sketch using G-code and M-codes WITH MIRROR
ING.
Assume thickness = 20 mm
R20
R20
10 10
2010
0
20 20
4040
All the dimensions are in mm.
SIMULATION MODEL: -
USING G90 AND G91
G54 G17 G21 G94
T01 M06
G43 M08 Z50
S1000 M03
M98 P10099
M71
M98 P10099
M80
G00 Z50
G00 X500 Y500
M09
M05
M30
O99 (SUB PROGRAM)
G90 X0 Y40
G01 Z-20 F100
G91 G01 Y40 X20
G91 G01 X20 Y00
G91 G03 X20 Y20 R20
G91 G02 X20 Y20 R20
G91 G01 X10 Y00
G91 G01 X10 Y-20
G91 G01 X00 Y-100
G91 G01 X-120 Y0
G00 Z50
G90 G00 X0 Y0
M99