0 BEGIN PGM 2150_EN MM 1 ;NC program for manufacturing a circular pocket 2 ;in which the pocket floor and lateral surface 3 ;are rounded together. 4 ;It is machined with a toroid cutter. 5 ;After you have defined the required parameters 6 ;and the tool, the control makes several calculations. 7 ;It then mills the contour with circular pockets. 8 ;This is followed by a new tool call, 9 ;however with a length compensation 10 ;about the radius R2 so that the calculated 11 ;tool length is defined in the center of the tooth. 12 ;The control subsequently calculates in a loop 13 ;the tool path in contour line in order 14 ;to machine the radius and the runs the program. 15 ;!Note! The pocket center lies at X/Y 0 16 ;and the upper edge of the pocket is Z0. 17 ;If required, you have to move the datum 18 ;to the center and the height of the pocket. 19 ; 20 ;Parameter entry 21 Q1600 = 100 ;DIAMETER 22 Q1601 = 50 ;DEPTH 23 Q1602 = 15 ;ROUNDING RADIUS 24 Q1603 = 5 ;SAFETY CLEARANCE 25 Q1604 = 50 ;2ND SAFETY CLEARANCE 26 Q1605 = 1 ;ANGLE STEP IN THE RADIUS 27 Q1606 = 12.5 ;TOOL RADIUS 28 Q1607 = 5 ;TOOL TOOTH RADIUS R2 29 Q1608 = 3000 ;MILLING FEED RATE 30 Q1609 = 5 ;PLUNGING DEPTH FOR PRE-ROUGHING 31 ;End of parameter input 32 ; 33 BLK FORM 0.1 Z X-60 Y-60 Z-70 34 BLK FORM 0.2 X+60 Y+60 Z+0 35 ; 36 ;Tool call for milling the pockets 37 TOOL CALL "TORUS_MILL_D25_5" Z S14000 38 ; 39 ;Calculations 40 FN 2: Q1610 =+Q1601 - +Q1602 ;Depth of 1st pocket 41 Q1611 = Q1600 - ( 2 * Q1602 ) ;Diameter of 2nd pocket 42 Q1612 = Q1610 + Q1605 ;2nd set-up clearance of 2nd pocket 43 ;End of calculations 44 ; 45 ;Retracting 46 L Z+100 R0 FMAX M3 47 ; 48 ;Milling the 1st pocket 49 CYCL DEF 252 CIRCULAR POCKET ~ Q215=+1 ;MACHINING OPERATION ~ Q223=+Q1600 ;CIRCLE DIAMETER ~ Q368=+0 ;ALLOWANCE FOR SIDE ~ Q207=+Q1608 ;FEED RATE FOR MILLNG ~ Q351=+1 ;CLIMB OR UP-CUT ~ Q201=-Q1610 ;DEPTH ~ Q202=+Q1609 ;PLUNGING DEPTH ~ Q369=+0 ;ALLOWANCE FOR FLOOR ~ Q206=+Q1608 ;FEED RATE FOR PLNGNG ~ Q338=+0 ;INFEED FOR FINISHING ~ Q200=+Q1603 ;SET-UP CLEARANCE ~ Q203=+0 ;SURFACE COORDINATE ~ Q204=+50 ;2ND SET-UP CLEARANCE ~ Q370=+0.4 ;TOOL PATH OVERLAP ~ Q366=+1 ;PLUNGE ~ Q385=+Q1608 ;FINISHING FEED RATE 50 L X+0 Y+0 R0 FMAX M99 51 ; 52 ;Milling the 2nd pocket 53 CYCL DEF 252 CIRCULAR POCKET ~ Q215=+1 ;MACHINING OPERATION ~ Q223=+Q1611 ;CIRCLE DIAMETER ~ Q368=+0 ;ALLOWANCE FOR SIDE ~ Q207=+Q1608 ;FEED RATE FOR MILLNG ~ Q351=+1 ;CLIMB OR UP-CUT ~ Q201=-Q1602 ;DEPTH ~ Q202=+Q1609 ;PLUNGING DEPTH ~ Q369=+0 ;ALLOWANCE FOR FLOOR ~ Q206=+Q1608 ;FEED RATE FOR PLNGNG ~ Q338=+0 ;INFEED FOR FINISHING ~ Q200=+Q1603 ;SET-UP CLEARANCE ~ Q203=-Q1610 ;SURFACE COORDINATE ~ Q204=+Q1612 ;2ND SET-UP CLEARANCE ~ Q370=+0.4 ;TOOL PATH OVERLAP ~ Q366=+1 ;PLUNGE ~ Q385=+Q1608 ;FINISHING FEED RATE 54 L X+0 Y+0 R0 FMAX M99 55 ; 56 ;Tool call for milling the radius 57 ;including a DL to the center of R2 58 TOOL CALL Z DL-Q1607 59 ; 60 L Z+100 R0 FMAX ;Moving to clearance height 61 L X+0 Y+0 R0 FMAX ;Moving to circle center 62 ; 63 ; 64 L Z+Q1603 R0 FMAX ;Moving to safety clearance 65 Q1609 = Q1600 / 2 - Q1602 ;Radius D2 66 Q1610 = Q1606 - Q1607 ;R1 tool 67 Q1611 = Q1601 - Q1602 ;Contour start in Z 68 L Z-Q1611 R0 F3000 ;Pre-positioning in Z 69 Q1612 = Q1600 / 2 - ( Q1606 - Q1607 ) - Q1607 * COS 0 ;Target position X 70 L X+Q1612 Y+0 R0 FQ1608 ;Move to contour start in X 71 CC X+0 Y+0 ;Circle center 72 C DR+ ;Moving on a circular path 73 Q1613 = 90 ;End angle 74 Q1614 = 0 ;Current angle 75 LBL 10 ;Loop 76 Q1614 = Q1614 + Q1605 ;Add current angle to stepping angle 77 Q1615 = Q1609 + Q1602 * COS Q1614 ;Calculate contour point in X 78 Q1616 = Q1611 + Q1602 * SIN Q1614 ;Calculate contour point in Z 79 ; 80 Q1617 = Q1615 - Q1610 - Q1607 * COS Q1614 ;Path position in X 81 Q1618 = Q1616 - Q1607 * SIN Q1614 ;Path position in Z 82 ; 83 L X+Q1617 Z-Q1618 ;Move to calculated X and Z values 84 C DR+ ;Move on a circular path 85 ; 86 FN 12: IF +Q1614 LT +Q1613 GOTO LBL 10 ;If current angle is smaller than final angle, repeat loop 87 ; 88 L Z+Q1604 R0 FMAX ;Move to 2nd safety clearance 89 ; 90 ;Retract and end program 91 L Z+100 R0 FMAX M30 92 END PGM 2150_EN MM