Variable Programming - Critique My Code, Please

NiCu2829

Registered
Registered
Joined
Jan 9, 2019
Messages
6
I've attached the blueprint of the part to be made and my code to machine the 5 slots in the OD. My goal is to have a program that regardless of the tool diameter, programmed radius or # of passes/DOC can be changed with relative ease. I'd like to make #527 passes where each pass is #528/#527 deep (the actual DOC is [#528/#527]/2 because the Y axis is diametrical).
I've never used variables to this extent so I'm hoping y'all will look it over and critique my code.

In the program I accounted for the key cutter tool radius when I programmed the tool path, so the R value on the offset screen=0.

I'm cutting on the minus(-) side of Y0. on a Swiss style machine(Citizen L32).

Thanks in advance!


O208()
(PROGRAM IS IN METRIC)

$1

(I'd like to make #527 passes where each pass is #528/#527 deep (the actual DOC is [#528/#527]/2 because the Y axis is diametrical))

#522=12.7(KEY CUTTER TOOL RADIUS)
#523=12.954(PROGRAMMED RADIUS FOR KEY CUTTER)
#527=10(# OF REPEATS FOR KEY CUTTER)
#528=16.154(G50V SHIFT AMOUNT)
#529=4.83(4.699)(KEY CUTTER THICKNESS)

(KEY CUTTER)
(CARBIDE TOOL)
(*R VALUE ON OFFSET SCREEN=0*)
(#522=TOOL RADIUS)
(#523=PROGRAMMED RADIUS)
(#527=# OF REPEATS)
(#528=G50V SHIFT AMOUNT)
(#529=KEY CUTTER THICKNESS)

(G10L10P7X0Y0Z15.Q0R0.)
(G11)

/MB7
G40G97G98
M5
M80S3=900
T0700
M18C0
G50W-15.
G50V#528
G0X#814+2.5Y-[[21.946+[#522*2]+31.08]]Z[[14.986-[#523-#522]]-13]T07
G0X-#529
G19
M98H100L#527
G0V-#528
G0C45.
M98H100L#527
G0V-#528
G0C90.
M98H100L#527
G0V-#528
G0C135.
M98H100L#527
G0V-#528
G0C180.
M98H100L#527
G0V-#528
G0X#814+2.5
G18
G50V-#528
G50W15.
G0Z-4.5
G0Z-4.5T0
M82
M20
M5
G18G99
/MB7
M1




N100


G0V[#528/#527]
G0G41V26.Z[14.986-[#523-#522]]
G1V21.438F201.
G3V.508Z14.986R#523
G3V-.508Z[14.986+[#523-#522]]R#523
G1(G0)V-21.438
G0G40V-26.Z[[14.986+[#523-#522]]+13]
Z[[14.986-[#523-#522]]-13]

M99
 

Attachments

  • 208.txt
    1.2 KB · Views: 4
  • DWG.pdf
    203.1 KB · Views: 4
Back
Top