Examples of code to run the machine

Warning!  be sure you change the font in Notepad so that it displays the slashed zero.  O, the character is used to define a subroutine in this example O23 and O22.  This ate my lunch the first time.

This is used to round a 90" piece using side cutting with a up cut end mill.  Starting at X0 tool moves in .02" on Y axis and then moves 90" on X axis.  A axis rotates 2 degrees and tool returns to X0.  This repeats till A has rotated 360 degrees and then the cycle repeats.   This gave me a nice finish on the fir that I was turning.  I will have to work with different cutters to find out which will give me the best cuts. 

G90 Z1 F300
G90 X0 Y0 Z0 M3
M98 P23 L2
M30

O23
G91 Y-.02
M98 P22 L90
M99

O22
G91 A2
G90 X90
G91 A2
G90 X0
M99


This is a rope twist of 4 starts and 4 revolutions in 16".   This was before I learned subroutines. 

g90 z1 f150 m3
g90 x0 y0 a0
g90 z-.11
g91 x16 a1440
g90 z-.13
g91 x-16 a-1440
g90 z-.15
g91 x16 a1440
g90 z-.17
g91 x-16 a-1440
g90 z-.19
g91 x16 a1440
g91 z-.21
g91 x-16 a-1440
g90 z1
g0 x0 a0(end of 1st twist)
g0 z1

g91 a90
g90 z-.11
g91 x16 a1440
g90 z-.13
g91 x-16 a-1440
g90 z-.15
g91 x16 a1440
g90 z-.17
g91 x-16 a-1440
g90 z-.19
g91 x16 a1440
g91 z-.21
g91 x-16 a-1440
g90 z1

(end of 2nd twist)
g91 a90
g90 z-.11
g91 x16 a1440
g90 z-.13
g91 x-16 a-1440
g90 z-.15
g91 x16 a1440
g90 z-.17
g91 x-16 a-1440
g90 z-.19
g91 x16 a1440
g91 z-.21
g91 x-16 a-1440
g90 z1

(end of 3d twist)
g91 a90
g90 z-.11
g91 x16 a1440
g90 z-.13
g91 x-16 a-1440
g90 z-.15
g91 x16 a1440
g90 z-.17
g91 x-16 a-1440
g90 z-.19
g91 x16 a1440
g91 z-.21
g91 x-16 a-1440
g90 z1
(end of 4 twist)
g90 z1

M30

 

This is the same using subroutine

G90 Z1 F300 M3
G90 X0 Y0 Z0 A0
M98 P27 L4
G90 Z0
G91 A90
M98 P27 L4
G90 Z0
G91 A90
M98 P27 L4
G90 Z0
G91 A90
G90 Z0
M98 P27 L4

M30


O27
G91 Z-.05
G90 X16 A1440
G91 Z-.05
G90 X0 A0
M99
 


 

Send mail to akransom@tx.rr.com with questions or comments about this web site.
Last modified: February 19, 2008