0 BEGIN PGM 3170_EN MM 1 ;Program for milling a tapered internal thread. 2 ;The tool path is divided into linear steps. 3 ;With the division you define the number 4 ;of linear element in a 360-degree path. 5 ;For each of these linear steps, the control 6 ;calculates an X,Y and Z coordinate to be moved to. 7 ;The machining goes from bottom to top. 8 ;With the rotation direction you specify whether 9 ;to make a right-hand or left-hand thread. 10 ; 11 BLK FORM 0.1 Z X+0 Y+0 Z-32 12 BLK FORM 0.2 X+100 Y+100 Z+0 13 ; 14 ;Program call for premilling the inside taper. 15 ;!Data such as tool number, cutting data and parameters 16 ;must be adapted in the called program! 17 CALL PGM 31701_en.h 18 ; 19 ;Tool call for thread cutter 20 TOOL CALL 10 Z S5000 21 ; 22 ;Parameter entry 23 FN 0: Q1 =+50 ;CENTER IN X 24 FN 0: Q2 =+50 ;CENTER IN Y 25 FN 0: Q4 =+1 ;MACHINING DIRECTION +/- 1 26 ; ;-1=CLOCKWISE 27 ; ;+1=COUNTERCLOCKWISE 28 FN 0: Q5 =+30 ;PITCH 29 FN 0: Q6 =+40 ;OUTSIDE RADIUS BELOW 30 FN 0: Q7 =+0 ;SRARTING ANGLE 31 FN 0: Q8 =+15 ;TAPER ANGLE 32 FN 0: Q9 =+3 ;PITCH 33 FN 0: Q10 =+2 ;CLEARANCE HEIGHT 34 FN 0: Q11 =+300 ;FEED RATE FOR PRE-POSITIONING 35 FN 0: Q12 =+1000 ;FEED RATE FOR MILLING 36 FN 0: Q3 =-30 ;Z-COORDINATE AT START (BELOW) 37 FN 0: Q13 =+0 ;Z-COORDINATE AT END (ABOVE) 38 FN 0: Q14 =+1 ;OVERSIZE IN X/Y PLANE 39 FN 0: Q16 =+2 ;LATERAL SAFETY CLEARANCE 40 ;End of parameter input 41 ; 42 ;Call of operation 43 CALL LBL 1 44 STOP 45 ; 46 ;Parameter input for finishing 47 FN 0: Q5 =+360 ;SCALE 48 FN 0: Q12 =+500 ;FEED RATE FOR MILLING 49 FN 0: Q14 =+0 ;OVERSIZE OF X/Y PLANE 50 ; 51 ;Call of operation 52 CALL LBL 1 53 ; 54 ;Retract and end program 55 L Z+100 R0 FMAX M30 56 ; 57 ;Machining 58 LBL 1 59 ;Calculations 60 FN 3: Q31 =+Q16 * -1 ;Calculation of lateral safety clearance 61 FN 3: Q38 =+Q108 * -1 ;Calculate tool radius 62 FN 3: Q39 =+Q14 * -1 ;Calculation of oversize 63 FN 0: Q23 =+Q3 ;Current Z coordinate 64 FN 0: Q25 =+0 ;Counter 65 FN 1: Q26 =+Q6 + +Q38 ;Tool radius compensation 66 FN 1: Q26 =+Q26 + +Q39 ;Oversize compensation 67 FN 1: Q28 =+Q26 + +Q31 ;Radius pre-positioning 68 FN 0: Q27 =+Q7 ;Current angle 69 Q36 = TAN Q8 * Q9 ;Radius change per 360 degrees 70 FN 4: Q36 =+Q36 DIV +Q5 ;Radius step size 71 FN 4: Q37 =+360 DIV +Q5 ;Angle step size 72 FN 3: Q37 =+Q37 * +Q4 ;Angle step in machining direction 73 FN 2: Q35 =+Q13 - +Q3 ;Z range 74 Q33 = Q9 / Q5 * SGN Q35 ;Step size in Z 75 Q35 = ( Q13 - Q3 ) / Q33 ;Number of Z steps 76 Q35 = ABS Q35 ;Positive counting value 77 ;End of calculations 78 ; 79 CC X+Q1 Y+Q2 ;Define the center point 80 LP PR+Q28 PA+Q7 R0 FMAX M3 ;Pre-positioning 81 L Z+Q10 R0 FMAX ;Move to set-up clearance 82 L Z+Q3 R0 FQ11 ;Move to start coordinate in Z 83 LP PR+Q26 PA+Q7 R0 FQ12 ;Move to starting radius 84 LBL 2 ;Repetition 85 FN 1: Q26 =+Q26 + +Q36 ;Update the radius 86 FN 1: Q27 =+Q27 + +Q37 ;Update the angle 87 FN 7: Q21 = COS +Q27 ;Calculation of X coordinate 88 FN 3: Q21 =+Q21 * +Q26 ;Calculation of X coordinate 89 FN 1: Q21 =+Q21 + +Q1 ;New X coordinate 90 FN 6: Q22 = SIN +Q27 ;Calculation of Y coordinate 91 FN 3: Q22 =+Q26 * +Q22 ;Calculation of Y coordinate 92 FN 1: Q22 =+Q22 + +Q2 ;New Y coordinate 93 FN 1: Q23 =+Q23 + +Q33 ;New Z coordinate 94 FN 1: Q25 =+Q25 + +1 ;Update the counter 95 L X+Q21 Y+Q22 Z+Q23 FQ12 ;Move to new coordinate 96 FN 12: IF +Q25 LT +Q35 GOTO LBL 2 ;Compare whether number of steps reached 97 LP IPR+Q31 ;Retract laterally 98 L Z+Q10 R0 FMAX ;Move to set-up clearance 99 LBL 0 100 END PGM 3170_EN MM