Common Variable for Lathe — Example Program

N10 G14
N20 CLEAR
N30 DEF WORK
N40 PS LC,[-30,0],[30,23]
N50 END
N60 DRAW
N70 (V1=OD)
N80 (V2=Length of fin part)
N90 (V3=ID)
N100 (V4=Counterbore I.D.)
N110 (V5=Counterbore depth)
N120 (V6=Counterbore? 1=yes 0=no)
N130 (V8=Length of chamfer)
N140 (V12=Face SFM)
N150 (V13=Face Feedrate)
N160 (V14=Rough Turn, Drill, and Bore RPM)
N170 (V15=Rough Turn Feedrate)
N180 (V16=Drill Feedrate)
N190 (V18=Bore Feedrate)
N200 (V19=Cutoff SFM)
N210 (V20=Cutoff Feedrate)
N220 G50 S2000
N230 G0 X20 Z20
N240 M42 S=[3.8/V1]*V12 M3 P10
N250 (Face and Turn OD)
N260 T010101 X=V1+.2 Z0 M8
N270 G96 S=V12 G111 P15
N280 G1 X-.032 F=V13
N290 Z.05
N300 G97 S=V14 P20
N310 G0 X=V1+.03 P30
N320 G1 X=V1-.04 Z0 G42 F.02
N330 X=V1 G76 L-.005 F=V15
N340 Z-V2-.150
N350 X=V1+.08
N360 G0 X=V1+.2 Z=V2 G40
N370 G0 X20 Z20
N380 (Cutoff)
N390 T0202 X=V1+.05 Z=-V2-.125
N400 G97 S=[3.8/V1]*V19 P35
N410 G96 S=V19 G111 P37
N420 G1 X=V3-.025 F=V20
N430 G0 X=V1+.1 P40
N440 M5 M9 P50
N450 X20 Z20
N460 (BAR PULLER)
N470 T0404 G0 X0 Z.1
N480 G1 Z-1. F15 G94
N490 M84
N500 G1 Z.020 F15
N510 M83
N520 G1 Z1.00 F60
N530 G0 X20 Z20
N540 G13
N550 G50 S2000
N560 G0 X20 Z20
N570 M42 S=[3.8/V1]*V12 M3 P10
N580 (Drill )
N590 T0101 X5 Z.1 M8
N600 G96 S=V12 G111 P15
N610 G97 S=V14 P20
N620 X0 P30
N630 G1 Z-V2-.11 F=V16
N640 G0 Z.1
N650 G0 X20 Z20
N660 IF[V6 EQ 1]NCBOR
NBORE (Bore)
N670 T020202 X=V3+[V8*2]+.08 Z.1
N680 G1 X=V3+[V8*2]+.01 Z0 F.015 G41
N690 X=V3+[V8*2] F=V18
N700 X=V3 Z=-V8
N710 Z=-V2-.05
N720 G40
N730 X=V3-.01
N740 G0 Z.1
N750 GOTO NSKIP
NCBOR T020202 X=V4+.08 Z.1
N760 G1 X=V4+.01 Z0 F.015 G41
N770 X=V4 F=V18
N780 Z=-V5
N790 X=V3
N800 Z=-V2-.05
N810 G40
N820 X=V3-.01
N830 G0 Z.1
NSKIP G97 S=[3.8/V1]*V19 P35
N840 G96 S=V19 G111 P37
N850 X20 Z20
N860 (Parts Catcher)
N870 T0303 X0 Z.1
N880 G1 Z=-V2 F20 G94
N890 G0 Z.1 P40
N900 M5 M9 P50
N910 X12 Z8
N920 (DROP PART IN CHUTE)
N930 G94 F15 Z10 G1
N940 G0 X20 Z20
N950 M2

Ready to talk with a machine tool expert?

Your Hartwig representative can help connect you with the solution that will power your business’s next big innovation and efficiency.