0 BEGIN PGM 4235_EN MM 1 ;NC program for creating an inclined hole. 2 ;In order to avoid unnecessary movements 3 ;through the air, and in order to preform 4 ;the operations with as short a tool as 5 ;possible, machining takes place in defined 6 ;steps. 7 ;First you define all parameters required 8 ;for machining and the tool. Subsequently, 9 ;the control preforms several calculations. 10 ;The control then positions the tool to the 11 ;the starting point, perpendiculary to the 12 ;workpiece surface, and executes a pocket 13 ;cycle. The control uses this cycle to create 14 ;a sufficiently large hole. 15 ;The control then inclines the tool and moves 16 ;it to a depth that was previously calculated 17 ;from the milling depth and an offset, so 18 ;that the lower edge of the hole matches the 19 ;milling depth. The tool then moves an 20 ;elliptical path, thus creating the hole 21 ;contour. At the end of the program, the 22 ;control repositions the tool to the center, 23 ;returns the rotary axes to their home 24 ;positions, deactivates TCPM, and concludes 25 ;the program. 26 ; 27 ; 28 BLK FORM 0.1 Z X+0 Y+0 Z-15 29 BLK FORM 0.2 X+100 Y+100 Z+0 30 ; 31 ;Enter parameters 32 FN 0: Q1 =+40 ;HOLE RADIUS 33 FN 0: Q3 =+0 ;STARTING ANGLE 34 FN 0: Q4 =+360 ;STOPPING ANGLE 35 FN 0: Q7 =+50 ;HOLE CENTER IN X 36 FN 0: Q8 =+50 ;HOLE CENTER IN Y 37 FN 0: Q9 =+0 ;COORDINATE SURFACE 38 FN 0: Q11 =-40 ;INCLINED ANGLE A 39 FN 0: Q12 =-20 ;MILLING DEPTH 40 FN 0: Q20 =+1500 ;FEED RATE FOR PLUNGING 41 FN 0: Q21 =+2000 ;FEED RATE FOR MILLING 42 FN 0: Q25 =+5 ;SAFE POSITION Z 43 FN 0: Q26 =+360 ;PITCH 44 ;End of parameter input 45 ; 46 ;Tool call for cutter 47 TOOL CALL 8 Z S3000 48 ; 49 ;Calculations 50 Q38 = COS Q11 ;Convert inclination angle 51 FN 4: Q60 =+Q1 DIV +Q38 ;Semiaxis in Y for core hole 52 Q61 = Q12 ;Depth of the core hole 53 Q62 = SIN Q11 * Q108 ;Offset in Z for the inclined path 54 FN 12: IF +Q62 LT +0 GOTO LBL 22 ;Check whether the value of the offset in Y is negative 55 LBL 23 56 Q12 = Q12 - Q62 ;Z depth for the inclined path 57 Q1 = Q1 - Q108 ;Corrected radius for the inclined tool path 58 Q27 = Q12 * TAN Q11 ;Offset of the center point from the upper to lower contur 59 Q29 = Q27 ;Write offset into parameter for comparison 60 FN 4: Q2 =+Q1 DIV +Q38 ;Semiaxis in Y with radius compensation 61 FN 12: IF +Q29 LT +0 GOTO LBL 20 ;Check whether the value of the offset is positiv 62 LBL 21 63 Q28 = ( Q60 * 2 ) - ( Q29 * 2 ) ;Diameter of core hole 64 ;End of calculations 65 ; 66 ;Mill the core hole 67 L Z+100 R0 F9998 M3 ;Move to clearance height 68 L X+Q7 Y+Q8 R0 FMAX ;Move tool to center 69 CYCL DEF 252 CIRCULAR POCKET ~ Q215=+1 ;MACHINING OPERATION ~ Q223=+Q28 ;CIRCLE DIAMETER ~ Q368=+0.1 ;ALLOWANCE FOR SIDE ~ Q207=+Q21 ;FEED RATE FOR MILLNG ~ Q351=+1 ;CLIMB OR UP-CUT ~ Q201=+Q61 ;DEPTH ~ Q202=+5 ;PLUNGING DEPTH ~ Q369=+0 ;ALLOWANCE FOR FLOOR ~ Q206=+Q20 ;FEED RATE FOR PLNGNG ~ Q338=+0 ;INFEED FOR FINISHING ~ Q200=+Q25 ;SET-UP CLEARANCE ~ Q203=+Q9 ;SURFACE COORDINATE ~ Q204=+Q25 ;2ND SET-UP CLEARANCE ~ Q370=+1 ;TOOL PATH OVERLAP ~ Q366=+1 ;PLUNGE ~ Q385=+500 ;FINISHING FEED RATE 70 M99 ;Call cycle 71 ;Core hole finished 72 ; 73 ;Mill the inclined surface 74 ;Shift datum to center of machining 75 CYCL DEF 7.0 DATUM SHIFT 76 CYCL DEF 7.1 X+Q7 77 CYCL DEF 7.2 Y+Q8 78 CYCL DEF 7.3 Z+Q9 79 ;Incrementally shift the datum further by the offset 80 CYCL DEF 7.0 DATUM SHIFT 81 CYCL DEF 7.1 IY-Q27 82 ; 83 CC X+0 Y+0 ;Define circle center 84 L X+0 Y+0 R0 F9998 ;Pre-position in X and Y 85 L Z+Q25 ;Pre-position in Z 86 FUNCTION TCPM F TCP AXIS SPAT PATHCTRL AXIS ;Activate TCPM 87 L A+Q11 B+0 C+0 R0 F9998 ;Tilt to inclination angle 88 ; 89 CALL LBL 10 ;Call the operation 90 ; 91 L Z+100 R0 F9998 M2 ;Retract and end program 92 ; 93 ; 94 ;Subprogram for machining 95 LBL 10 96 FN 0: Q36 =+Q3 ;Current angle equals starting angle 97 FN 2: Q35 =+Q4 - +Q3 ;Angular length 98 FN 4: Q35 =+Q35 DIV +Q26 ;Stepping angle 99 FN 0: Q46 =+0 ;Counter 100 CALL LBL 2 ;Call calculation 101 L Z+Q43 R0 FQ20 ;Move to first point in Z 102 L X+Q41 Y+Q42 R0 FQ20 M3 ;Move to first point in X and Y 103 LBL 1 ;Repetitions of the program 104 FN 1: Q36 =+Q36 + +Q35 ;Calculate new angle 105 FN 1: Q46 =+Q46 + +1 ;Clock counter 106 CALL LBL 2 ;Call calculations 107 L X+Q41 Y+Q42 Z+Q43 FQ21 ;Move to new point 108 FN 12: IF +Q46 LT +Q26 GOTO LBL 1 ;Compare counters 109 L X+0 Y+0 R0 F9998 ;Move to center 110 L Z+Q25 ;Move to safe height in the Z axis 111 L A+0 B+0 C+0 R0 F9998 ;Tilt rotarz axis back to home position 112 FUNCTION RESET TCPM ;Deactivate TCPM 113 ;Reset the datum shift 114 CYCL DEF 7.0 DATUM SHIFT 115 CYCL DEF 7.1 X+0 116 CYCL DEF 7.2 Y+0 117 CYCL DEF 7.3 Z+0 118 LBL 0 ;Return jump 119 ; 120 LBL 2 ;Calculations for new position 121 FN 7: Q31 = COS +Q36 ;Calculate new X coordinate 122 FN 3: Q31 =+Q31 * +Q1 ;Calculate new X coordinate 123 FN 3: Q41 =+Q31 * +1 ;Calculate new X coordinate 124 FN 6: Q32 = SIN +Q36 ;Calculate new Y coordinate 125 FN 3: Q32 =+Q32 * +Q2 ;Calculate new Y coordinate 126 FN 3: Q42 =+Q32 * +1 ;Calculate new Y coordinate 127 FN 0: Q43 =+Q12 ;Z coordinate 128 LBL 0 129 ; 130 ;Subprogram in order to make the offset in Y positiv 131 LBL 20 132 Q29 = Q29 * - 1 ;Multiply a negativ offset by -1 133 FN 9: IF +0 EQU +0 GOTO LBL 21 ;Jump back to main program 134 LBL 0 135 ; 136 ;Subprogram in order to make the offset in Z positiv 137 LBL 22 138 Q62 = Q62 * - 1 ;Multiply a negativ offset by -1 139 FN 9: IF +0 EQU +0 GOTO LBL 23 ;Jump back to main program 140 LBL 0 141 END PGM 4235_EN MM