0 BEGIN PGM 7130-EN MM 1 ;Program for inside machining of a 2 ;hemisphere with a ball-nose cutter. 3 ;The process is done in a spiral motion. This 4 ;movement is divided into individual linear 5 ;movements. The pitches define in how many 6 ;linear movements the path is devided, and 7 ;thus influence the accuracy and quality of 8 ;the surface. 9 ; 10 BLK FORM 0.1 Z X-40 Y-40 Z-40 11 BLK FORM 0.2 X+40 Y+40 Z+0 12 ; 13 ;Input parameter 14 FN 0: Q1 =+0 ;SPHERE CENTER IN THE X-AXIS 15 FN 0: Q2 =+0 ;SPHERE CENTER IN THE Y-AXIS 16 FN 0: Q3 =+0 ;SPHERE CENTER IN THE Z-AXIS 17 FN 0: Q4 =+30 ;VERTICAL PITCH 18 ; ;DEFINES HOW MANY 360DEGREE 19 ; ;PATHS ARE DONE FROM THE TOP 20 ; ;TO THE BOTTOM 21 FN 0: Q5 =+120 ;HORIZONTAL PITCH 22 ; ;DEFINES IN HOW MANY LINEAR 23 ; ;PATHS, A 360 DEGREE CIRCLE 24 ; ;IS DIVIDEED 25 FN 0: Q6 =+35 ;SPHERE RADIUS 26 FN 0: Q7 =+0 ;VERTICAL STARING ANGLE 27 FN 0: Q8 =+0 ;STARTING ANGLE IN PLANE X/Y 28 FN 0: Q10 =+150 ;FEED RATE FOR PLUNGING 29 FN 0: Q11 =+1000 ;FEED RATE SPIRAL PATH 30 FN 0: Q12 =+3 ;SET UP CLEARANCE 31 FN 0: Q13 =+8 ;BALL RADIUS TOOL 32 FN 0: Q17 =-89.999 ;VERTICAL END ANGLE 33 ;Input parameter completed 34 ; 35 ;Tool call ball-nose cutter 36 TOOL CALL 159 Z S9000 DL-Q13 37 ; 38 ;Pre positioning 39 L X+Q1 Y+Q2 R0 FMAX M3 40 FN 1: Q18 =+Q12 + +Q13 41 L Z+Q18 FMAX 42 CALL LBL 1 ;Call spiral motion 43 ; 44 ;End of program 45 L Z+100 R0 F9999 M30 46 ; 47 ;Spiral motion 48 LBL 1 49 Q26 = Q6 - Q13 ;Effectiv radius to the tool center 50 FN 0: Q27 =+Q7 ;Current angle vertical=vertical strting angle 51 FN 0: Q28 =+Q8 ;Current angle plane X/Y=strating angle plane X/Y 52 Q37 = ( Q17 - Q7 ) / Q4 / Q5 ;Vertical angle step 53 Q38 = - 360 / Q5 ;angle step plane X/Y 54 CALL LBL 10 ;Call calculations 55 L X+Q21 Y+Q22 Z+Q23 R0 FQ10 ;Move to the first position 56 LBL 2 57 CALL LBL 10 ;Call calculations 58 L X+Q21 Y+Q22 Z+Q23 FQ11 ;Move to the new position 59 FN 11: IF +Q27 GT +Q17 GOTO LBL 2 60 L Z+Q18 FMAX ;Move back 61 LBL 0 62 ;Calculation X,Y,Z position and new angles 63 LBL 10 64 Q20 = COS Q27 * Q26 65 Q21 = COS Q28 * Q20 + Q1 66 Q22 = SIN Q28 * Q20 + Q2 67 Q23 = SIN Q27 * Q26 + Q3 68 Q27 = Q27 + Q37 69 Q28 = Q28 + Q38 70 LBL 0 71 END PGM 7130-EN MM