0 BEGIN PGM 7125-EN MM 1 ;Program for outside machining of a 2 ;hemisphere with a toroid 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. 8 ; 9 BLK FORM 0.1 Z X-30 Y-30 Z-40 10 BLK FORM 0.2 X+30 Y+30 Z+0 11 ; 12 ;Input parameter 13 FN 0: Q1 =+0 ;SPHERE CENTER IN THE X-AXIS 14 FN 0: Q2 =+0 ;SPHERE CENTER IN THE Y-AXIS 15 FN 0: Q3 =-30 ;SPHERE CENTER IN THE Z-AXIS 16 FN 0: Q4 =+45 ;VERTICAL PITCH 17 ; ;DEFINES HOW MANY 360DEGREE 18 ; ;PATHS ARE DONE FROM THE TOP 19 ; ;TO THE BOTTOM 20 FN 0: Q5 =+180 ;HORIZONTAL PITCH 21 ; ;DEFINES IN HOW MANY LINEAR 22 ; ;PATHS, A 360 DEGREE CIRCLE 23 ; ;IS DIVIDED 24 FN 0: Q6 =+30 ;SPHERE RADIUS 25 FN 0: Q7 =+90 ;VERTICAL STARTING ANGLE 26 FN 0: Q8 =+0 ;STARTING ANGLE IN PLANE X/Y 27 FN 0: Q10 =+150 ;FEED RATE FOR PLUNGING 28 FN 0: Q11 =+1000 ;FEED RATE SPIRAL PATH 29 FN 0: Q13 =+3 ;TOOL CUTTING EDGE RADIUS 30 FN 0: Q15 =+2 ;SET UP CLEARANCE 31 FN 0: Q17 =+0 ;VERTICAL END ANGLE 32 ;Input parameter completed 33 ; 34 ;Tool call toroid cutter 35 TOOL CALL 112 Z S3000 DL-Q13 36 ; 37 ;Pre positioning 38 L X+Q1 Y+Q2 R0 FMAX M3 39 FN 1: Q16 =+Q15 + +Q13 40 L Z+Q16 FMAX 41 CALL LBL 1 ;Call spiral motion 42 ; 43 ;End of program 44 L Z+100 R0 FMAX M30 45 ; 46 ;Spiral motion 47 LBL 1 48 Q14 = Q108 - Q13 ;Calculation tool radius 49 Q26 = Q6 + Q13 ;Effective radius to the center of the cuts 50 FN 0: Q27 =+Q7 ;Current vertical angle=vertical starting angle 51 FN 0: Q28 =+Q8 ;Current angle in plane X/Y=Starting angle plane x/Y 52 Q37 = ( Q17 - Q7 ) / Q4 / Q5 ;Vertical angle step 53 Q38 = - 360 / Q5 ;Angle step in plane X/Y 54 CALL LBL 10 55 L X+Q21 Y+Q22 Z+Q23 R0 FQ10 ;Move to the first position 56 ; 57 ;Call calculations, angle comparison and at 58 ;the end a full circular path 59 LBL 2 60 CALL LBL 10 61 L X+Q21 Y+Q22 Z+Q23 FQ11 ;Move to the new position 62 FN 11: IF +Q27 GT +Q17 GOTO LBL 2 63 ;Full circular path 64 CC X+Q1 Y+Q2 65 CP IPA-360 DR- FQ11 66 LBL 0 67 ; 68 ;Calculate X,Y,Z position and new angles 69 LBL 10 70 Q20 = COS Q27 * Q26 + Q14 71 Q21 = COS Q28 * Q20 + Q1 72 Q22 = SIN Q28 * Q20 + Q2 73 Q23 = SIN Q27 * Q26 + Q3 74 Q27 = Q27 + Q37 75 Q28 = Q28 + Q38 76 LBL 0 77 END PGM 7125-EN MM