0 BEGIN PGM 3235_EN MM 1 ;This program is used to machine a convex 2 ;radius on a workpiece edge parallel to the 3 ;X axis. 4 ;The machining is possible with a end mill 5 ;or a ball-nose-cutter. 6 ;The center and the radius are defined 7 ;by parameters. 8 ;The datum in X and Y axis must be at the 9 ;most negativ point of the workpiece. The 10 ;datum in Z must be positioned at the lower 11 ;edge of the radius. 12 ; 13 BLK FORM 0.1 Z X+0 Y+0 Z-20 14 BLK FORM 0.2 X+100 Y+100 Z+20 15 ; 16 ;Tool call of an end mill or a ball-nose-cutter 17 TOOL CALL 10 Z S5000 18 ; 19 L Z+100 R0 FMAX M3 20 ; 21 ;Input parameters 22 FN 0: Q30 =+20 ;CIRCLE CENETER IN Y 23 FN 0: Q31 =+0 ;CIRCLE CENTER IN Z 24 FN 0: Q32 =+20 ;RADIUS 25 FN 0: Q34 =+20 ;PITCH 26 FN 0: Q35 =+0 ;OVERSIZE 27 FN 0: Q36 =+20 ;MACHINING HEIGHT 28 FN 0: Q37 =+100 ;LENGTH OF WORKPIECE 29 FN 0: Q38 =+2 ;LATERAL SET-UP CLEARANCE 30 FN 0: Q39 =+1000 ;FEED RATE FOR MILLING 31 FN 0: Q40 =+0 ;SHAPE OF THE TOOL 32 ; ;BALL-NOSE-CUTTER = 1 33 ; ;END MILL = 0 34 FN 0: Q33 =+10 ;RADIUS OF BALL-NOSE-CUTTER 35 ;Input completed 36 ; 37 ;Calculations 38 Q50 = ACOS ( ( - Q31 + Q36 ) / Q32 ) ;Starting angle 39 Q51 = ACOS ( - Q31 / Q32 ) ;End angle 40 FN 2: Q52 =+Q50 - +Q51 ;Angle difference 41 Q53 = Q52 / ( Q34 + 2 ) ;Angle step 42 Q54 = Q32 + Q33 + Q35 ;Effectiv radius 43 FN 4: Q55 =+Q34 DIV +2 ;Number of repetitions 44 FN 1: Q56 =+Q108 + +Q38 ;Minimum X position 45 Q57 = Q37 + Q38 + Q108 ;Maximum X position 46 FN 0: Q58 =+0 ;Radius compensation ball-nose-cutter 47 FN 9: IF +Q40 EQU +0 GOTO LBL 2 ;Jump to calculation for end mill 48 LBL 3 49 ; 50 ;Processing 51 FN 0: Q70 =+Q50 ;Current angle equal to starting angle 52 LBL 1 ;Repetition of the processing 53 FN 2: Q70 =+Q70 - +Q53 ;Angle step 54 CYCL DEF 7.0 NULLPUNKT 55 CYCL DEF 7.1 Y+Q30 56 CYCL DEF 7.2 Z+Q31 57 Q72 = - ( COS ( Q70 ) * Q54 ) - Q58 ;Calculate new Z position 58 Q71 = SIN ( Q70 ) * Q54 - Q33 ;Calculate new Y position 59 L X-Q56 Y+Q72 R0 FMAX ;Move to X and Y position 60 L Z+Q71 FMAX ;Move to Z position 61 L X+Q57 FQ39 ;Milling the route along the X axis 62 ; 63 Q70 = Q70 - Q53 ;Angle step 64 Q72 = - ( COS ( Q70 ) * Q54 ) - Q58 ;Calculate new Z position 65 Q71 = SIN ( Q70 ) * Q54 - Q33 ;Calculate new Y position 66 L Y+Q72 Z+Q71 R0 FMAX ;Move to Y and Z position 67 L X-Q56 FQ39 ;Milling the route along the X axis 68 CALL LBL 1 REPQ55 ;Repeat the processing 69 STOP 70 ; 71 CYCL DEF 7.0 NULLPUNKT 72 CYCL DEF 7.1 X+0 73 CYCL DEF 7.2 Y+0 74 CYCL DEF 7.3 Z+0 75 L Z+Q36 FMAX ;Move Z to the starting position 76 L IZ+50 FMAX ;Move Z to a safety heigth 77 ; 78 ;End of the program 79 M30 80 ; 81 LBL 2 ;Calculation for an end mill 82 FN 0: Q33 =+0 ;Reset the values of the ball-nose-cutter 83 FN 0: Q58 =+Q108 ;Correction by the tool radius 84 FN 1: Q54 =+Q32 + +Q35 ;Effectiv radius 85 FN 9: IF +0 EQU +0 GOTO LBL 3 ;Return to LBL 3 86 LBL 0 87 END PGM 3235_EN MM