0 BEGIN PGM 2035_EN MM 1 ;Program for milling a spiral in the X/Y plane 2 ;From the input parameters, the tool path is 3 ;calculated, which consists of single linear 4 ;blocks, of which in each case the end points 5 ;in X and Y are determined. With the entered 6 ;pitch is defined in how many linear blocks a 7 ;360 degree path is divided. The input slope 8 ;is also divided on this 360 degree path.The 9 ;tool moves in the Z-axis vertically. 10 ; 11 BLK FORM 0.1 Z X+0 Y+0 Z-20 12 BLK FORM 0.2 X+100 Y+100 Z+0 13 ; 14 ;Tool call milling tool 15 TOOL CALL 5 Z S4000 16 ; 17 ;Input parameters 18 FN 0: Q1 =+50 ;CENTER X-AXIS 19 FN 0: Q2 =+50 ;CENTER Y-AXIS 20 FN 0: Q3 =-15 ;DEPTH 21 FN 0: Q4 =+1 ;ROTATIONAL DIRECTION 22 ; ;+1=COUNTERCLOCKWISE 23 ; ;-1=CLOCKWISE 24 FN 0: Q5 =+180 ;PITCH (NUMBER OF LINEAR 25 ; ;BLOCKS ON A 360 DEGREE PATH) 26 FN 0: Q6 =+10 ;START RADIUS 27 FN 0: Q16 =+47 ;END RADIUS 28 FN 0: Q7 =+90 ;STARTING ANGLE 29 FN 0: Q8 =+10 ;SLOPE IN MM ON 360 DEGREE 30 FN 0: Q10 =+2 ;SET UP CLEARANCE 31 FN 0: Q11 =+100 ;FEED RATE FOR PLUNGING 32 FN 0: Q12 =+300 ;FEED RATE FOR MILLING 33 FN 0: Q14 =+0 ;ALLOWANCE FOR SIDE 34 FN 0: Q15 =+0 ;RADIUS CORRECTION 35 ; ; 0=NO CORRECTION 36 ; ;+1=TOOL MOVES OUTSIDE THE 37 ; ;CONTOUR 38 ; ;-1=TOOL MOVES INSIDE THE 39 ; ;CONTOUR 40 ;Input parameter completed 41 ; 42 L X+Q1 Y+Q2 R0 FMAX M3 ;Pre positioning 43 L Z+Q10 R0 FMAX 44 CALL LBL 1 45 ;Emd of program 46 L Z+100 R0 FMAX M5 M2 47 ; 48 ; 49 LBL 1 ;Calculations 50 CC X+Q1 Y+Q2 ;Set center point 51 FN 3: Q38 =+Q108 * +Q15 ;Calculate radius correction 52 FN 3: Q39 =+Q14 * +Q15 ;Calculate allowance 53 FN 1: Q26 =+Q6 + +Q38 ;Starting radius with radius correction 54 FN 1: Q26 =+Q26 + +Q39 ;Effectiv starting radius (including allowance) 55 FN 0: Q27 =+Q7 ;Current angle = starting angle 56 FN 4: Q36 =+Q8 DIV +Q5 ;Radius step 57 FN 8: Q36 =+Q36 LEN +0 ;Define, that allways positive values are used 58 FN 4: Q37 =+360 DIV +Q5 ;Angle step 59 FN 3: Q37 =+Q37 * +Q4 ;Angle step for rotational direction 60 ; 61 ; 62 LP PR+Q26 PA+Q7 R0 F9999 M3 ;Move to starting position 63 L Z+Q3 FQ11 ;Plunging 64 ; 65 LBL 2 ;Repetitions 66 FN 1: Q26 =+Q26 + +Q36 ;Update radius 67 FN 1: Q27 =+Q27 + +Q37 ;Update angle 68 ;Calculate X and Y positions 69 FN 7: Q21 = COS +Q27 70 FN 3: Q21 =+Q21 * +Q26 71 FN 1: Q21 =+Q21 + +Q1 72 FN 6: Q22 = SIN +Q27 73 FN 3: Q22 =+Q22 * +Q26 74 FN 1: Q22 =+Q22 + +Q2 75 ;Comparison whether end radius is reached 76 FN 11: IF +Q26 GT +Q16 GOTO LBL 99 ; 77 ;Move to the new X and Y position 78 L X+Q21 Y+Q22 Z+Q3 FQ12 79 ;If end radius is not reached, jump to 80 ;repetitions 81 FN 12: IF +Q26 LT +Q16 GOTO LBL 2 82 ; 83 LBL 99 ;Spirai completed 84 L Z+Q10 F9999 ;Move to set up clearance 85 LBL 0 86 END PGM 2035_EN MM