Tuesday 14 July 2015

CNC programs for VI Sem Diploma Mechanical

CNC programs for VI Sem Diploma  Mechanical 

Typed by R.Vigneshwara Perumal & drawn by R.Vigneswara Perumal (under the guidance of R.Ramakutty and R.Kali Muthu ). This job is initiated by R.Kali Muthu.

STEP TURNING
N1
G28 U0 W0
M01
G97 S1500 M4                                   
M06 T0101
G0 G40 X26.0 Z10.0
Z2.0
G71 U1.0 R0.3
G71 P10 Q20 U0.0 W0.0 R0.3 F0.15
N10 G01 X10.0
Z0.0
X12.0 Z-2.0
Z-20
X16.0
Z-35.0
X20.0
Z-45.0
X24.0
N20 G01 X26.0
M09
G00 G40 Z10.0
G28 U0 W0;
M05
M30
TAPER TURNING
PROGRAM

N1
G28 U0 W0
M01
M06 T0101
G97 S1800 M04
G00 X26.0 Z10.0
Z2.0 M08
G71 U1.0 R0.3
G71 P12 Q13 U0.0 W0.0 R0.3 F0.15
N12 G01 X0.0
Z0.0
G01 X15.0 Z-8.0
Z-18.0
X20.0 Z-30.0
Z-36.0
X24.0
Z-42.0
N13 G01 X26.0
M09
G00 G40 Z10.0
G28 U0 W0
M05
M30
******************
g90 - single turning cycle
Box turning cycle

N1
G28 U0 W0
M01
M06 T0101
G97 S1800 M04
G00 X26.0 Z10.0
Z2.0 M08
G90 X25. Z-42. F.15
X24.
X23. Z-36.
X22.
X21.
X20.
X19. Z-18.
X18.
X17.
X16.
X15.
G00 X15. Z0
G90 X15. Z-8. R0
R-1.
R-2.
R-3.
R-4.
R-5.
R-6.
R-7.
R-7.5
G00 X20. Z-18.
G90 X20. Z-30. R0
R-1.
R-2.
R-2.5
G28 U0 W0
M05

M30

CIRCULR INTERPOLATION 1

PROGRAM
N1
G28 U0 W0                
M01
M06 T0101
G97 S1800 M04
G00 G40 X26.0 Z10.0
Z2.0 M07
G71 U1.0 R0.3
G71 P20 Q30 U0 W0 R0.3 F0.15
N20 G01 X0.0
Z0.0
G03 X16.0 Z-8.0 R8.0
G01 X16.0 Z-18.0
G02 X20.0 Z-20.0 R2.0
G01 Z-28.0
G01 X24.0 Z-33.0
G01 Z-39.0
N30  G01 X26.0 
M09
G00 G40 Z10.0
G28 U0 W0
M05
M30
CIRCULAR INTERPOLATION 2
PROGRAM
N1
G28 U0 W0
M01
M06 T0101
G97 S1800 M04
G00 G40 X26.0 Z10.0
Z2.0 M07
G71 U1.0 R0.3
G71 P20 Q30 U0 W0 R0.3 F0.15
N20 G01 X0.0
Z0.0
G03 X12.0 Z-6.0 R6.0
G02 X18.0 Z-9.0 R3.0
G01 Z-19.0
G02 X22.0 Z-21.0 R2.0
G01 Z-29.0
N30 G01 X26.0
M09
G00 G40 Z10.0
G28 U0 W0
M05
M30
THREADING

T0101 -(ROUGH TURNING TOOL)
T0202 -(GROOVING TOOL ASSUME CUTTER WIDTH 2 MM)
T0303-(External thread tool)
*****

N1                                                      
G28 U0 W0;
T0101;
G97 S1800 M04;
G00 G40 X26.0 Z10.0;
Z2.0 M08;
G71 U.5 R0.5;
G71 P10 Q12 U0 W0 F0.15 ;
N10 G01 X10.0
G01 Z0.0;
G01 X14.0 Z-2.0;
G01 Z-35.0;
G01 X20.0 Z-40.0;
G01 X22.0
G01 Z-45.0;
N12 G01 X26.0
M09;
M00;
G01 G40 Z10.0;
G28 U0 W0;
M01;
N2;
T0202;
G97 S800 M04;
G00 G40 X17.0 Z10.0;
Z-32.0;
G75 R0.3;
G75 X8.0 Z-35.0 P200 Q1500 F0.8;   
G00 Z10.0 M09;
G28 U0 W0;
M00;
N3;
T0303;
G00 X15.0 Z12.0
G97 S500 M04;
G76 P031560 Q75 R0.05;
G76 X11.56 Z-30.0 P1220 Q100 F2.0;
G00 Z10.0 M09;
G28 U0 W0;
M05;
M30

****************************************************

N1                                                      
G28 U0 W0;
M06 T0101;
G97 S1800 M04;
G00 G40 X26.0 Z10.0;
Z2.0 M08;

G71 U1.0 R0.3;
G71 P10 Q12 U0 W0 F0.15 R0.3;
N10 G01 X15.0
G01 Z0.0;
G01 Z-20.0;
G01 X22.0 Z-25.O;
G01 Z-30.0;
N12 G01 X26.0
M09;
G01 G40 Z10.0;
N2;
G28 U0 W0;
M01;
T0202;
G97 S800 M04;
G00 G40 X17.0 Z10.0;
Z-17.0;
G75 R0.3;
G75 X10.0 Z-20.0 P100 Q1500 F0.8;   
G00 Z10.0 M09;
N3;
G28 U0 W0;
M01;
T0303;
G00 X15.0 Z12.0
G97 S1500 M04;
G76 P020060 Q75 R0.03;
G76 X13.17 Z-15.0 P915 Q100 F1.5;
G00 Z10.0 M09;
G28 U0 W0;
M05;
M30



DRILLING & BORING
T0404;(IDRILL OF RADIUS 7.5)
T0505;(BORING BAR)


PROGRAM

O0011;
N1;
G28 U0 W0;
M06 T0404;
M03 S400;
G00 X0.0 Z2.0;
G74 R3.0;
G74 X0.0 Z-33.0 Q5000 R0 F0.1;
G28 U0 W0;
N2;
M06 T0505;
G00 X15.0 Z1.0;
G71 U0.5 R0.1;
G71 P20 Q25 U0 W0 F0.1;
N20 G00 X33.0;
G01 Z0.0;
G01 X23.0 Z-5.0;
G01 X23.0 Z-11.0;
N25 G01 X15.0 Z-23.0;
G28 U0 W0;
M05;
M30;
GROOVING
PROGRAM



O003;
N1;
G21 G94;
G91;
G8 X0. Y0. Z0;
G90;
M06 T0101;
M03 S400;
M08;
G00 X0.0 Y0.0;
G00 Z5.0;
G00 X14.0 Y15.0 Z5.0;
G01 Z-5.0;
G91;
G01 X55.0 Y0.0;
G02 X15.0 Y15.0 R15.0;
G01 X0.0 Y55.0;
G01 X-55.0 Y0.0;
G03 X-15.0 Y-15.0 R15.0;
G01 X0.0 Y-55.0;
G00 Z5.0;
G90;
G00 X0.0 Y0.0;
G91 G28 X0. Y0. Z0;
M05;
M09;
M30;
DRILLING & COUNTERSINKING
PROGRAM

O0008;
N1;
G21 G94;
G91;
G28 X0.0 Y0.0 Z0.0;
G90;
M06 T01;
M03 S800;
G00 X0.0 Y0.0;
G00 Z2.0;
G98 G83 X20.0 Y25.0 Z-20.0 Q5 R1. K1. F0.1;
G91;
X60.0 Y0.0;
X0.0 Y50.0;
X-60.0 Y0.0;
X30.0 Y-25.0;
G80;
G90;
G00 X0.0 Y0.0;
N2;
G91;
G28 X0.0 Y0.0;
G90;
M06 T02;
G00 X50.0 Y50.0;
G00 Z.0;
G82 X50.0 Y50.0 Z-5.0 R1. F0.1;
G80;
G91;
G28 X0.0 Y0.0 Z0.0;
M05;
M30;

MIRROR
In Job/Tooling Menu > Billet Settings
Set Billet X Shift - 50,  Billet Y Shift - 50

PROGRAMS

G21 G94
G91
G28 X0. Y0. Z0.
G90
M06 T01
M03 S400
G00 X0. Y0.
G00 Z2.
M98 P1000
M70
M98 P1000
M80
M71
M98 P1000
M81
M70
M71
M98 P1000                                             
M80
M81
G91
G28 X0. Y0. Z0.
M05
M30
:1000
G00 X10. Y10.
G01 Z-5. F0.1
G91
G01 X18. Y0.
G01 X0. Y32.
G01 X14.Y-14.
G01 X-32. Y0.
G01 X0.Y-18.
G00 Z7.
G90
G00 X0. Y0.
M99


POCKETING
PROGRAM 1
G21
G21 G98 X0. Y0. Z0.
M06 T01
M03 S1500
G90
 G00 X0. Y0. Z25.
G172 I30. J30. K0. P0 Q-1 R0. X10. Y10. Z-5. 
G173 I0 K0 P75 T01 S1000 B2000 F.1 R.05 J.1 Z5
G170 I0. J0. K15. P0 Q-1 R0. X75. Y75. Z-5. 
G171 P75 T01 S1000 B2000 F.1 R.05 J.1 Z5.
G91 G28 X0. Y0.Z0.
M05
M30
****************
Rectangular Pocketing
For G172 block,
I defines the pocket X length (30).
J defines the pocket Y length (30) 
K defines the radius of corner roundness 
P defines that 0 = roughing cycle.
Q defines the pocket Z increment.(in - value)
R defines the Absolute Z 'R' point.(R defines the position of the tool to start cycle ie. 0 )
X defines the pocket corner X (Absolute position relative to the X datum position).
Y defines the pocket corner Y (Absolute position relative to the Y datum position).
Z defines the absolute Z base of pocket (-5, ie, a depth of 6mm).

For G173 block,
I defines the pocket side finish (0 as this is a roughing cycle).
K defines the pocket base finish (0 as this is a roughing cycle).
P defines the cut width percentage (75% of tool dia.).

T defines the pocket tool (tool 1).
S defines the spindle speed for roughing (1000 rpm).
R defines the roughing feed for Z (.05).
F defines the roughing feed X and Y (.1).
B defines the finishing spindle speed (2000 rpm).
J defines the finishing feed (.1).

Z defines the safety Z (5mm above 'R' point).
***************************
Circular Pocketing 
For G17Ø block,
R defines the position of the tool to start cycle ie. 0 
P defines when P is zero(0) the cycle is a roughing cycle.
Q defines the peck increment.
X defines the pocket centre in X axis (75).
Y defines the pocket centre in Y axis (75).
Z defines the pocket base (-6 mm) from job surface.
I defines the side finish allowance (0 as this is a roughing cycle only).
J defines the base finish allowance (0 as this is a roughing cycle only).
K defines the radius of pocket (15) +ve value  - cut in CW direction).(-15) negative value  - cut in CCW direction).
For G171 block,
P defines the cut width percentage.
S defines the roughing spindle speed (S1000).
R defines the roughing Feed in Z (.05).
F defines the roughing feed XY (.1).
B defines the finishing spindle speed (2000, not applicable as roughing only).

J defines the finishing  feed  (.1, not applicable as roughing only).

PROGRAM 2

G21 G94
G91 G28 X0.Y0.Z0
G90
M06 T01
M03 S400
G00 X0.Y0
G00 X10.Y10.Z6
G172 I30.J30.Q-1 X10.Y10.Z-6
G173 P70 T1 S1000 R150 F500 B2500 J200 Z6
G170 X75.Y75.Z-6.K15
G171 P75 T1 S1000 R150 F500.B2500 J200.Z6
G91 G28 X0.Y0.Z0
M05
M30

G83 peck drilling cycle
G83 peck drilling cycle perform the drilling operation in multiple pecks, this technique makes deep-hole drilling easy and economical.
Cutting feed is performed intermittently to the bottom of the hole while chips are discharged.
As the drilling is performed to the bottom of the hole with feed in multiple small steps, every time a specified depth is made and then drill retracts, then drill makes the next peck, this operation is repeated again and again until the drill depth is reached.

G83 X... Y... Z... R... Q... F... K...Syntax

ParameterDescription
XHole position in x-axis.
YHole position in y-axis.
ZDepth, tool will travel with feed to Z-depth starting from R plane.
RPosition of the R plane.
QDepth of cut for each cutting feed (Peck).
KNumber of cycle repetitions (if required) .
FFeed rate.
Once given in program G83 peck drilling cycle is repeated at every axis movement until G80 is given in program to end peck drilling cycle.

Usage

N150 M06 T02
N160 G90 G00 X60 Y28 Z12 S750 M03
N170 G99 G83 X60 Y28 Z-17 Q6 R2 F60
N180 G98 Y12
N190 G91 G80 G28 X0 Y0 Z0 M05
N200 M30
In the above example code first drill is done at X60 Y28 and second at Y12 and then peck drilling is cycle is ended with G80.
6mm pecks are taken to complete total drilling depth of 17mm.

Working

Here is briefly described how G83 peck drilling cycle works,
1- Rapid traverse to X, Y drilling position.
2- Rapid traverse to R-plane.
3- Drilling with feed Q deep.
4- Retraction with Rapid traverse to R-plane.
5- Rapid traverse to Q-d deep (d value is specified in parameters).
6- Drilling with feed Q+d deep.
7- Retraction with Rapid traverse to R-plane
– this whole procedure is repeated until drill reaches Z-depth position,
– then drill is retracted to R-plane or Initial-level depends on G99 or G98 which one is given in program.
G83 peck drilling cycle working
G83 peck drilling cycle working

G98 G99 Modes

After completing drilling depth the return is made with Rapid feed, the return height can be controlled through using G98 or G99.
G98 Drill will return to the Initial level
G99 Drill will return to R-plane.
G98, G99 can be used multiple times during G83 peck drilling cycle.

Example

N30 G83 X10 Y30 Z-17 Q5 R2 F75
N40 Y10
N50 G98 X30
N60 G99 Y30
N70 X90
N80 Y10
N90 G80

Repeat Drilling

G83 peck drilling cycle, drilling operation can be repeated multiple times. The drilling is repeated K times if K value is given with G83.
Repeat drilling is normally used with G91 Incremental mode, and a good example of repeated drilling is Grid-plate drilling. For working example see G81 drilling cycle.

Working Example

G83 Peck drilling cycle Example
G83 Peck drilling cycle Example
N10 M06 T1
N20 G90 G00 X12.5 Y10 Z12 S1000 M03
N30 G99 G83 X12.5 Y10 Z-17 R2 Q4 F75
N40 Y30
N50 G98 X57.5
N60 G99 Y10
N70 G91 G80 G28 X0 Y0 Z0 M05

Fanuc G85 Boring Cycle – Reaming Cycle

Tool traverses down to end depth with feed and retracts the withdrawal plane with feed.

Fanuc G85 Boring Cycle Format

G85 X Y Z R F K
X Y – Hole position Z – Boring depth (Absolute). R – Tool starting position above the hole. F – Cutting feed rate K – Number of repeats (if required)
Fanuc G85 Boring Cycle
Fanuc G85 Boring Cycle

Fanuc G85 Boring Cycle Operation

1 – After positioning along X and Y axis, rapid traverse is performed to point R. 2 – Boring/Reaming is performed from point R to end-depth-point Z with specified feed F. 3 – After completing depth Z with feed F, Tool returns with the same feed F.
Return plane is dependant on G98, G99 G-codes. If G98 is specified with G85 boring cycle the tool returns to Initial-level. If G99 is specified then tool will return to R level.

Fanuc G85 Boring Cycle Example Program

M3 S100
G90 G99 G85 X300. Y–250. Z–150. R–120. F120.
Y–550.
Y–750.
X1000.
Y–550.
G98 Y–750.
G80 G28 G91 X0 Y0 Z0
M5

G86 Boring Cycle

Fanuc G86 Boring Cycle is used to bore the hole(s). The tool travels to the bottom of the hole with feed and then retracts back out of the hole at rapid feedrate.

G86 Boring Cycle Format

G86 X Y Z R F K
Parameters X Y –  Hole position data. Z – Boring depth (Absolute). R – Tool starting position above the hole. F – Cutting feed rate. K – Number of repeats (if required).
G86 Boring Cycle
G86 Boring Cycle

G86 Boring Cycle Operation

1 – After positioning along the X– and Y–axes, rapid traverse is performed to point R. 2 – Drilling is performed from point R to point Z. 3 – When the spindle is stopped at the bottom of the hole, the tool is retracted in rapid traverse.
Tool Return Position Return plane is dependant on G98, G99 G-codes. If G98 is specified with G86 boring cycle the tool returns to Initial-level. If G99 is specified then tool will return to R level.

G86 Boring Cycle Program Example

M3 S2000 
G90 G99 G86 X300. Y–250. Z–150. R–100. F120. 
Y–550. 
Y–750. 
X1000. 
Y–550. 
G98 Y–750. 
G80 G28 G91 X0 Y0 Z0 
M5
COMPANY PROGRAMS
DRIVE SHAFT
PROGRAM

O0628;
N1;
G95;
T0000 S0;8
G0 X0.0 Z-150.0;
T0404 M07;
M04 S300;
G0 X16.0 Z1.0;
G0 Z-17.50;
G1 X13.0 F0.5;
Z-56.0 F0.15;
G0 X15.0 Z-18.50;
X14.0;
G01 X12.2 F0.3;
G01 X12.2 Z-52.73 F0.1;
G02 X14.25 Z-57.35 R4.0 F0.08;
G01 X14.25 Z-74.50 F0.06;
G0 X16.0 Z3.0;
T0000 M09;
G0 X0.0 Z-150.0;
M01;
M30;
N2;
G95;
T0000 S0;
T0303 M07;
M03 S3000;
G0 X14.25 Z2.0;
G01 Z-18.50 F0.06;
G0 X19.0 Z1.0;
T000 S0 M09;
G0 X0.0 Z-150.0;
M01;
M30;

ALUMINIUM BUSH
PROGRAM
O0120;
NI G95;
T000 G97;
G0 X0.0 Z-25.0;
T0303 M07;
M04 S3000;
G0 X21.0 Z0.5;
G71 U1.5 R0.5;
G71 P10 Q20 U0.5 W0.0 F0.3;
N10 G01 X16.21 Z0.0 F0.25;
G01 X16.36 z-8.50;
G01 x16.78 z-22.50;
G01 x16.85 z-27.50;
G01 x19.81 z-170.74;
G01 X20.49 Z-173.9;
G01 X20.54 Z-175.40;
G01 X20.60 Z-179.40;
N20 G0 X22.0 Z2.0;
G70 P10 Q20
T0000 S0 M09;
G0 X0.0 Z-25.0;
M05;
M01;
M30;

N1(PCNLR)
PROGRAM
G28 U0 W0
G50X677.13 2564.85T1100 S350
G0 G96 X520.250. T0101.M11 S150
G0 25.
G01 21.F5.
Z0.2 F0.2
G01 X444. F0.15
G01 X235. F0.22
W1.F5.
X520.F20.
G01 Z-1.4 F0.5
X444. F0.15
X346.  F0.2
U1. W1. F50
X520.F20.
Z-2.8 F0.3
G01 X444 F0.15
X346 F0.2
Z-1.2 F0.15
U1 F5
Z5
G0 Z50
G
28 U0 W0 M12
M01 
N2(S50BOREROUGH) PCLNR
G28 U0 W0
G50 X732.2 Z450.80 T0200 S350
G96 X234.0 250.0 T0202 S150 M10
G0 25.
G01 Z1.F5
Z-43 FO.22
U-2
Z1. F8.
X246.5
G01 Z-43. F0.22
X239.5 W-9.62
Z1. F6.
X250.
Z-43. F0.2
X243 W-9.62 F0.18
Z1. F6.
X256.25
Z0.0 F0.15
X253.25 Z-1.6
Z-43.0 F0.2
F246.25 W-9.62 F0.18.
X242. F0.25
G01 Z-84.75 F0 .2
U-2 W1. F5.
Z-50
X240.25  Z-84.75  F0.2
U-2 W1. F5
X220.0
Z-89.
G01 X240. F0.2
U-1 W1 F5
Z-84.
X242.0
Z-90.0 F02
U-1 W1. F5.
X220.
Z-92.95
G01 X242.0  F.2
U-2. W1. F5.
Z-84.75
X246 Z5 F0.2
G01 X243.37 Z-92.92 F0.15
U-1 W1 F0.5
X228.0
Z-93.5 F0.2
X2250  Z-104.8  F0.15
G01 U-2.W0.5 F5.
Z1. F10
G0 Z50
G28 U0 W0
M01
N3
G28 U0 W0
G50 X444.78 Z 546.78 T0606 S350
G90 X344.25 Z50 T0606 S150 M10
Z5
G01 Z1 F5
Z0.0 F0.15
G01 X345.25 Z-0.5 F0.15
Z-2.7
U1 W1 F5
X520 F20
Z-3 F0.3
G01 X444 F0.15
X345.25 F0.2
Z-2.7
U1 Z0 F5
X250 F0.2
W1 F5
G0 Z50
G28 U0 W0
N4 (BORE FINISHING)
G28 U0 W0
G50 X746.86 Z452.60 T0400 S350
G0 G96 X257.45 Z50.0 T0404 S150 M10
Z5
G01 Z1  F5
Z0.0 F0.15
X254.25 Z-1.6 F0.15
Z-43.0
X247.25 Z-52.67 F0.1
Z-84.75
G01 X244.37 Z-92.92
X231.5
W1 F5
Z-93.75 F0.2
G01 X226.6 Z-104.8 F0.18
U-1 W1 F5
Z-93.78

G01 X242.4 F0.15
G02 X244.37 Z-92.92 R1 F0.2
G01 U-1 W0.5 F1
U2 F5
Z1 F10
G0 Z50
G28 U0 W0 M12
M01
M30
%
PISTON ROD
PROGRAM

O0290
M99 P5
N5
G99
G0 G40 T0505
G0 Z50.0
G0 X-50.8
Z10.0
Z-2.25
M00
G0 Z5.0
X10.0
S1700 M04
M08
G0 Z1.0
G01 Z-37.50F0.1
 G0 X11.0  Z1.0
X9.0
G1 Z-6.0 F0.10
X12.0
G0 Z1.0
G1 X5.50 Z0.5 F0.25
G1 Z0.0 F0.25
G1 X7.90 Z-1.20 F0.05
Z-6.20 F0.08
G1 X9.01 Z-7.55 F0.05
G1 X9.06 Z-32.90 F0.08
G1 X11.08 Z-33.90 F0.05
G0 X12.0
G0 Z40.40
X-45.40
Z30.40
M05
M09
M00
G0 Z39.4
M08
X12.0
Z0.0
M04
S1500
X9.75
G1 X9.85 Z-31.35 F0.12
G1 X10.4
G11.4 Z-31.85 F0.05
G0 X12.0
M09
Z75.0
M01
M11
M30
WASHER
PROGRAM
O0273
N1
G0 G40 T0101
G0 M08 Z50.0
M04 S1200
G0 X13.0
G0 Z3.0
Z1.0
G01 Z-6.0 F0.08
X12.8
G0 Z1.0
X15.0
G01 Z-6.0 F0.08
X14.8
G0 Z1.0
X17.0
G01 Z-6.0
F0.08
X16.7
G0 Z1.0
G01 X19.2 Z0.1 F0.15
G01 X18.05 Z-0.5 F0.05
G01 Z-6.0 F0.08
G0 X17.0 Z5.0
G0 Z50.0
M05
M01
M00
G0 Z50.0 (SECOND SLIDE ANGLE)
M04 S1200
Z1.0
G01 X19.2 Z0.1 F0.15
G01 X18.05 Z-0.5 F0.05
G0 X17.0 Z5.0
G0 Z5.0
M09
M05
M01
M30