0 BEGIN PGM 7040_EN MM 1 ;Program for inside machining of a vertical, 2 ;torus-shaped object. 3 ;The machining operation is performed 4 ;with a ball-nose cutter 5 ;with the milling path is in the Y/Z plane 6 ;and the infeed is lateral in the X/Y plane. 7 ; 8 ;Parameter entry 9 FN 0: Q1 =+0 ;CENTER IN 1ST AXIS 10 FN 0: Q2 =+0 ;CENTER IN 2ND AXIS 11 FN 0: Q3 =+25 ;TORUS RADIUS R 12 FN 0: Q4 =+0 ;Z-COORDINATE AT TORUS CENTER 13 FN 0: Q5 =+20 ;TORUS RADIUS r 14 FN 0: Q10 =+20 ;CLEARANCE HEIGHT 15 FN 0: Q11 =+80 ;NUMBER OF MILLING PATHS 16 FN 0: Q14 =+600 ;FEED RATE FOR MILLING 17 FN 0: Q15 =+9999 ;FEED RATE FOR PRE-POSITIONING 18 FN 0: Q16 =+300 ;PLUNGING FEED RATE 19 ;End of parameter input 20 ; 21 BLK FORM 0.1 Z X-21 Y-50 Z-51 22 BLK FORM 0.2 X+21 Y+50 Z+1 23 ; 24 ;Tool call for ball-nose cutter 25 TOOL CALL 157 Z S8000 26 TOOL CALL DL-Q108 ;Length compensation by ball radius 27 ; 28 ;Calculations 29 FN 2: Q6 =+Q5 - +Q108 ;Compensated radius 30 FN 1: Q18 =+Q6 + +Q1 ;Starting position in X 31 FN 1: Q19 =+Q2 + +Q3 ;Coordinate Y+ at torus center 32 FN 2: Q20 =+Q2 - +Q3 ;Coordinate Y– at torus center 33 FN 4: Q12 =+180 DIV +Q11 ;Stepping angle 34 FN 4: Q13 =+Q11 DIV +2 ;Number of repeats 35 FN 2: Q13 =+Q13 - +1 ;Number of repeats 36 ;Calculations completed 37 ; 38 L X+Q18 Y+Q20 Z+Q10 R0 FQ15 M3 ;Pre-position 39 L Z+Q4 FQ16 ;Plunge 40 ; 41 LBL 1 42 CC Y+Q2 Z+Q4 ;CC for the milling path 43 CP IPA+180 DR+ FQ14 ;Milling path 44 CC X+Q1 Y+Q19 ;CC for lateral infeed 45 CP IPA+Q12 DR+ FQ14 ;Infeed 46 CC Y+Q2 Z+Q4 ;CC for the milling path 47 CP IPA-180 DR- FQ14 ;Milling path 48 CC X+Q1 Y+Q20 ;CC for lateral infeed 49 CP IPA-Q12 DR- FQ14 ;Infeed 50 CALL LBL 1 REPQ13 ;Call of repetition 51 L Z+100 R0 FQ15 M30 ;Retract and end program 52 END PGM 7040_EN MM