(Generated with dxf2code) (Created from file: /home/kwallace/QCAD/encoder-100ppr-3c-slots.dxf) (Material = .0625" thick aluminum sheet, hot glue bonded to base) (Tool 1 = .0626" diameter x .125"CL end mill) (Slot lead in/outs need work, but should be okay for who it's for) (20090612KW - Assembled sub programs to make this version) G21 (Unit in mm) G90 (Absolute distance mode) G64 P0.01 (Exact Path 0.001 tol.) G17 G40 (Cancel diameter comp.) G49 (Cancel length comp.) g28 T4M6 (Tool change to T1) M7 (Mist on) S3000M03 (Spindle 3000rpm cw) #7=1 (center hole roughing pass number) G0 X0 Y0 G0 Z 3.000 G0 X 0 Y 3.0000 g41 f80 g1 x1.90000 y3.00000 f50 G1 Z [-0.530*#7] F80 g3 x0.00000 y4.90000 i-1.90000 j0.00000 o180 while [#7 lt 4] f50 G1 Z [-0.530*#7] f80 g3 x0.00000 y4.90000 i0.00000 j-4.90000 #7=[#7+1] o180 endwhile g1 z1 g3 x-1.90000 y3.00000 i0.00000 j-1.90000 g40 g41 g1 x2.00000 y3.00000 g1 z [-0.530*[#7-1]] g3 x0.00000 y5.00000 i-2.00000 j0.00000 g3 x0.00000 y5.00000 i0.00000 j-5.00000 g3 x-0.7955 y4.83500 i0.00000 j-2.00000 G1 z3 G40 (G0 x0 y0) #10=0 (slot number) #11=14.4 (angle between slots) #12=1 (roughing pass number) (slot roughing points in polar coordinates) #20=22.5000 (point 0 radius, mm) #21=23.0521 (point 1 radius) #22=24.9000 (point 2 radius) #23=23.8000 (point 3 radius) #24=24.9017 (point 4 radius) #25=23.7699 (point 5 radius) #26=23.8018 (point 6 radius) #27=22.1677 (point 7 radius) #28=21.1009 (point 8 radius) #29=22.2008 (point 9 radius) #30=21.1009 (point 10 radius) #31=22.1677 (point 11 radius) #32=22.2008 (point 12 radius) #33=23.7699 (point 13 radius) #34=24.9017 (point 14 radius) #35=23.8018 (point 15 radius) #36=24.9000 (point 16 radius) #50=0.0000 (point 0 angle, degrees) #51=1.9732 (point 1 angle) #52=0.0000 (point 2 angle) #53=0.0000 (point 3 angle) #54=-0.6788 (point 4 angle) #55=-3.3597 (point 5 angle) #56=-0.7101 (point 6 angle) #57=-3.3413 (point 7 angle) #58=-0.5268 (point 8 angle) #59=-0.5007 (point 9 angle) #60=0.5268 (point 10 angle) #61=3.3413 (point 11 angle) #62=0.5007 (point 12 angle) #63=3.3597 (point 13 angle) #64=0.6788 (point 14 angle) #65=0.7101 (point 15 angle) #66=0.0000 (point 16 angle) (slot finish points in polar coordinates) #80=25.0000 (point 0a radius, mm) #81=25.0017 (point 1a radius) #82=23.7699 (point 2a radius) #83=23.8018 (point 3a radius) #84=22.1677 (point 4a radius) #85=21.0009 (point 5a radius) #86=22.2008 (point 6a radius) #87=21.0009 (point 7a radius) #88=22.1677 (point 8a radius) #89=22.2008 (point 9a radius) #90=23.7699 (point 10a radius) #91=25.0017 (point 11a radius) #92=23.8018 (point 12a radius) #93=25.0000 (point 13a radius) #94=23.8302 (point 14a radius) #95=23.8000 (point 15a radius) #110=0.0000 (point 0a angle, degrees) #111=-0.6761 (point 1a angle) #112=-3.6011 (point 2a angle) #113=-0.7101 (point 3a angle) #114=-3.6002 (point 4a angle) #115=-0.5293 (point 5a angle) #116=-0.5007 (point 6a angle) #117=0.5293 (point 7a angle) #118=3.6002 (point 8a angle) #119=0.5007 (point 9a angle) #120=3.6011 (point 10a angle) #121=0.6761 (point 11a angle) #122=0.7101 (point 12a angle) #123=0.0000 (point 13a angle) #124=-2.8864 (point 14a angle) #125=0.0000 (point 15a angle) (g0 x 0 y 0) (G0 Z 15.000) (G0 Z 3.000) (Make slots) o100 while [#10 lt 25] (run for each slot) o110 while [#12 lt 4] (three roughing passes for current slot) g40 g0 x [#20*sin[[#10*#11]+#50]] y [#20*cos[[#10*#11]+#50]] (0) f50 g1 z [#12*-.53] f80 g41 g1 x [#21*sin[[#10*#11]+#51]] y [#21*cos[[#10*#11]+#51]] (1) g3 x [#22*sin[[#10*#11]+#52]] y [#22*cos[[#10*#11]+#52]] i [[#23*sin[[#10*#11]+#53]]-[#21*sin[[#10*#11]+#51]]] j [[#23*cos[[#10*#11]+#53]]-[#21*cos[[#10*#11]+#51]]] (2,3-1) g1 x [#24*sin[[#10*#11]+#54]] y [#24*cos[[#10*#11]+#54]] (4) g3 x [#25*sin[[#10*#11]+#55]] y [#25*cos[[#10*#11]+#55]] i [[#26*sin[[#10*#11]+#56]]-[#24*sin[[#10*#11]+#54]]] j [[#26*cos[[#10*#11]+#56]]-[#24*cos[[#10*#11]+#54]]] (5,6-4) g1 x [#27*sin[[#10*#11]+#57]] y [#27*cos[[#10*#11]+#57]] (7) g3 x [#28*sin[[#10*#11]+#58]] y [#28*cos[[#10*#11]+#58]] i [[#29*sin[[#10*#11]+#59]]-[#27*sin[[#10*#11]+#57]]] j [[#29*cos[[#10*#11]+#59]]-[#27*cos[[#10*#11]+#57]]] (8,9-7) g1 x [#30*sin[[#10*#11]+#60]] y [#30*cos[[#10*#11]+#60]] (10) g3 x [#31*sin[[#10*#11]+#61]] y [#31*cos[[#10*#11]+#61]] i [[#32*sin[[#10*#11]+#62]]-[#30*sin[[#10*#11]+#60]]] j [[#32*cos[[#10*#11]+#62]]-[#30*cos[[#10*#11]+#60]]] (11,12-10) g1 x [#33*sin[[#10*#11]+#63]] y [#33*cos[[#10*#11]+#63]] (13) g3 x [#34*sin[[#10*#11]+#64]] y [#34*cos[[#10*#11]+#64]] i [[#35*sin[[#10*#11]+#65]]-[#33*sin[[#10*#11]+#63]]] j [[#35*cos[[#10*#11]+#65]]-[#33*cos[[#10*#11]+#63]]] (14,15-13) g1 x [#36*sin[[#10*#11]+#66]] y [#36*cos[[#10*#11]+#66]] (16) g40 #12=[#12+1] (increment the roughing pass number) o110 endwhile g40 (finish pass on current slot) f80 g0 x [#20*sin[[#10*#11]+#50]] y [#20*cos[[#10*#11]+#50]] (0) g41 g1 x [#90*sin[[#10*#11]+#120]] y [#90*cos[[#10*#11]+#120]] (10) g1 x [#80*sin[[#10*#11]+#110]] y [#80*cos[[#10*#11]+#110]] (0) g1 x [#81*sin[[#10*#11]+#111]] y [#81*cos[[#10*#11]+#111]] (1) g3 x [#82*sin[[#10*#11]+#112]] y [#82*cos[[#10*#11]+#112]] i [[#83*sin[[#10*#11]+#113]]-[#81*sin[[#10*#11]+#111]]] j [[#83*cos[[#10*#11]+#113]]-[#81*cos[[#10*#11]+#111]]] (2,3-1) g1 x [#84*sin[[#10*#11]+#114]] y [#84*cos[[#10*#11]+#114]] (4) g3 x [#85*sin[[#10*#11]+#115]] y [#85*cos[[#10*#11]+#115]] i [[#86*sin[[#10*#11]+#116]]-[#84*sin[[#10*#11]+#114]]] j [[#86*cos[[#10*#11]+#116]]-[#84*cos[[#10*#11]+#114]]] (5,6-4) g1 x [#87*sin[[#10*#11]+#117]] y [#87*cos[[#10*#11]+#117]] (7) g3 x [#88*sin[[#10*#11]+#118]] y [#88*cos[[#10*#11]+#118]] i [[#89*sin[[#10*#11]+#119]]-[#87*sin[[#10*#11]+#117]]] j [[#89*cos[[#10*#11]+#119]]-[#87*cos[[#10*#11]+#117]]] (8,9-7) g1 x [#90*sin[[#10*#11]+#120]] y [#90*cos[[#10*#11]+#120]] (10) g3 x [#91*sin[[#10*#11]+#121]] y [#91*cos[[#10*#11]+#121]] i [[#92*sin[[#10*#11]+#122]]-[#90*sin[[#10*#11]+#120]]] j [[#92*cos[[#10*#11]+#122]]-[#90*cos[[#10*#11]+#120]]] (11,12-10) g1 x [#93*sin[[#10*#11]+#123]] y [#93*cos[[#10*#11]+#123]] (13) g3 x [#94*sin[[#10*#11]+#124]] y [#94*cos[[#10*#11]+#124]] i [[#95*sin[[#10*#11]+#125]]-[#93*sin[[#10*#11]+#123]]] j [[#95*cos[[#10*#11]+#125]]-[#93*cos[[#10*#11]+#123]]] (14,15-13) g0 x [#20*sin[[#10*#11]+#50]] y [#20*cos[[#10*#11]+#50]] (0) g1 z3 g40 #12=1 (reset the roughing pass number for the next slot) #10=[#10+1] (increment the current slot number) O100 endwhile g40 (cut wheel perimeter detents) #1=0 (Detent number, 0-99) #2=3.6000 (Angle between detents, degrees) #3=26.9765 (Radius from wheel center to detent arc endpoints, finish, mm) #6=27.073932 (Radius from wheel center to detent arc endpoints, roughing, mm) #4=33.0000 (Radius from wheel center to arc centers, mm) #5=1 (Roughing pass number) (g0 x0 y0) g0 x -5.0000 y 28.0000 (begining of lead in) g0 z 3.0000 f50 g1 z [#5*-.53] f80 g41 g1 x [#6*sin[[#1*#2]-1.8]] y [#6*cos[[#1*#2]-1.8]] (0) o140 while [#5 lt 4] (run for each Z on roughing pass, 3 passes) f50 g1 z [#5*-.53] (set new Z depth) f80 o120 while [#1 lt 100] (run for each detent) g3 x [#6*sin[[#1*#2]+1.8]] y [#6*cos[[#1*#2]+1.8]] i [[#4*sin[#1*#2]]-[#6*sin[[#1*#2]-1.8]]] j [[#4*cos[#1*#2]]-[#6*cos[[#1*#2]-1.8]]] (1,2-0) #1=[#1+1] (increment current detent number) o120 endwhile #1=0 (reset the current detent number) #5=[#5+1] (increment current pass count) o140 endwhile g40 #1=0 (reset detent number) g1 x -5.0000 y 28.0000 (begining of lead in) g41 g1 x [#3*sin[[#1*#2]-1.8]] y [#3*cos[[#1*#2]-1.8]] (0) O130 while [#1 lt 100] g3 x [#3*sin[[#1*#2]+1.8]] y [#3*cos[[#1*#2]+1.8]] i [[#4*sin[#1*#2]]-[#3*sin[[#1*#2]-1.8]]] j [[#4*cos[#1*#2]]-[#3*cos[[#1*#2]-1.8]]] (1,2-0) #1=[#1+1] O130 endwhile G0 Z 3.000 G40 M9 (Coolant off) M5 (Spindle off) G28 M2 (Prgram end)