Well, I came back here to cheat off of my own test and struggled to understand what I did a while back. Therefore, in case anyone else is using this or for me in another year when I need this again, here is what I stumbled on:
#1 = 10 (Roughing Passes)
#2 = 2 (finishing passes)
#3 = [#1 + #2] (total passes)
#4 = 0.013 (Rough DOC)
#5 = 0.004 (Fine DOC)
#6 = [[#1 * #4]+[#2*#5]] (total material removed)
#7 = 0 (Z holding place value)
(DEBUG, #1 = num rough)
(DEBUG, #2 = num fine)
(DEBUG, #3 = total passes)
(DEBUG, #6 = material to remove)
M1
(----- Start of G-code -----)
()
G7 (Dia. Mode)
G18 (XZ Plane)
G90 (Absolute Distance Mode)
G40 (Turn Cutter Compensation Off)
G91.1 (Arc Incremental IJK)
G20 (units in inches)
G54 (Work Offset)
G30 (Park Tool)
(*****************\ /* \ /* \ /* \ / *\ / Replace \ / * \ / * \ / * \ / * \ / *)
T0505
G96 S 351 D 2500
G95 F 0.0120 (Units per Revolution Mode)
(/ \ */ \ */ \ */ \ */ \ Replace / \ */ \ */ \ */ \ */ \ *******************)
M8 (Flood Coolant ON)
M3 (Spindle ON, Forward)
G0 z0.5 (go to known position)
G10 L20 P1 Z[0.5 -#6] (move enough for total material removal)
o101 while [#3 GT 0]
G0 X1.3000 ( go to safe X, then start Z before issuing G71)
G0 Z0.2600
(G71 P1192 D0.0100 F0.0120 J0.0060 L6 I0.0030 K0.0030 R0.0100 E1)
(*****************\ /* \ /* \ /* \ / *\ / Replace \ / * \ / * \ / * \ / * \ / *******************)
(Finish Pass)
G96 S 600 D 2500
G95 F 0.0020 (Units per Revolution Mode)
G0 X2.0000 ( go to safe X)
G0 Z0.2600 ( go to start Z)
G42 (Cutter compensation - on)
G0 X0.0000 Z0.2600
G1 X0.0000 Z0.0000
G3 X0.1250 Z-0.0312 I0.0153 K-0.0476
G2 X0.1850 Z-0.0625 I0.0393 K0.0076
G1 X1.0000 Z-0.0625
G2 X1.0320 Z-0.0312 I-0.0240 K0.0320
G1 X1.4000 Z-0.0312
G2 X1.4700 Z0.0000 I-0.0041 K0.0398
G1 X1.8000
G40 (cutter compensation - off)
G1 X2.0000 ( go to safe X)
G0 Z0.2600 ( go to safe Z)
(******************/ \ */ \ */ \ */ \ */ \ Replace / \ */ \ */ \ */ \ */ \ *******************)
(In order for the math to work out ^ Z must land at 0.4)
o103 IF [#1 LT 2] (check to see if that was the last roughing pass or any finish pass)
M1
G10 L20 P1 Z[0.4+ #5]
#2=[#2-1]
(DEBUG, #1 = num rough)
(DEBUG, #2 = num fine)
o103 ENDIF
o102 IF [#1 GT 1] (check to see if still roughing after this)
(DEBUG,#1)
M1
G10 L20 P1 Z[0.4+ #4]
#1=[#1-1]
(DEBUG, #1 = num rough)
(DEBUG, #2 = num fine)
o102 ENDIF
#3 = [#1 + #2] (total passes)
(DEBUG, #3 = total passes)
o101 endwhile
(“o-code subroutine for profile”)
(Note: all profile subroutine code is in parenthesis)
(o1192 SUB)
( G1 X0.0000 Z0.2600)
( G1 X0.0000 Z0.0000)
( G1 X0.1185 Z-0.1310)
( G2 X1.0923 Z0.0000 I0.1051 K0.5795)
( G1 X1.2000 Z0.0000)
(o1192 ENDSUB)
M9 (All Coolant Off)
M5 (Spindle OFF)
G30 (Park Tool)
()
(----- End of Profiling -----)
M30 (end program)