0 BEGIN PGM 1010_EN MM 1 ;Program for defining a point pattern in form 2 ;of an ellipse. 3 ;For manufacturing, a cycle for the machining 4 ;process is called at the calculated points. 5 ;In this program, a drilling cycle is used 6 ;for spot-drilling and drilling. 7 ;After the definition of all necessary 8 ;parameter, the tool and the cycle 9 ;a subprogram is called. In this one at first 10 ;the complete ellipse path is calculated. 11 ;This consists of individual X and Y 12 ;coordinates.The distance of each point, 13 ;and thus the accurancy of the path, 14 ;you define by the parameter Q5=angle step, 15 ;which determines the angle between two 16 ;points. 17 ;After the complete contour is calculated, 18 ;the individual processing positions are 19 ;determined, the tool gets positioned and 20 ;the cycle is called. 21 ; 22 ;Input parameter 23 FN 0: Q1 =+46 ;ELLIPSE HALF-AXIS IN THE X AXIS 24 FN 0: Q2 =+20 ;ELLIPSE HALF-AXIS IN THE Y AXIS 25 FN 0: Q5 =+0.5 ;STEPPING ANGLE 26 FN 0: Q6 =+15 ;ROTATION OF THE ELLIPSE 27 FN 0: Q8 =+50 ;CENTER OF ELLIPSE IN X-AXIS 28 FN 0: Q9 =+40 ;CENTER OF ELLIPSE IN Y-AXIS 29 FN 0: Q12 =+2 ;SAFETY CLEARANCE 30 FN 0: Q13 =+30 ;NUMBER OF OPERATIONS 31 ;Input parameter completed 32 ; 33 BLK FORM 0.1 Z X+0 Y+0 Z-20 34 BLK FORM 0.2 X+100 Y+80 Z+0 35 ; 36 ;Tool call spot-drill 37 TOOL CALL 201 Z S1000 38 ; 39 ;Define the cycle for the machining process 40 CYCL DEF 1.0 PECKING 41 CYCL DEF 1.1 SET UPQ12 42 CYCL DEF 1.2 DEPTH-2.5 43 CYCL DEF 1.3 PLNGNG10 44 CYCL DEF 1.4 DWELL0 45 CYCL DEF 1.5 F100 46 ; 47 CALL LBL 20 ;Call the subprogram 48 ; 49 ;Tool call drill 50 TOOL CALL 225 Z S1000 51 ; 52 ;Define the cycle for the machining process 53 CYCL DEF 1.0 PECKING 54 CYCL DEF 1.1 SET UPQ12 55 CYCL DEF 1.2 DEPTH-20 56 CYCL DEF 1.3 PLNGNG10 57 CYCL DEF 1.4 DWELL0 58 CYCL DEF 1.5 F100 59 ; 60 CALL LBL 20 ;Call the subprogram 61 ; 62 ;Move back and end of program 63 L Z+100 R0 F9998 M30 64 ; 65 ;Supbrogram for determination of the positions 66 LBL 20 67 ;Datum shiht to the center of the ellipse and 68 ;set the rotation 69 CYCL DEF 7.0 DATUM SHIFT 70 CYCL DEF 7.1 X+Q8 71 CYCL DEF 7.2 Y+Q9 72 CYCL DEF 10.0 ROTATION 73 CYCL DEF 10.1 ROT+Q6 74 CALL LBL 10 ;Call the calculation for the complete ellipse 75 FN 4: Q48 =+Q40 DIV +Q13 76 FN 0: Q50 =+Q40 77 FN 0: Q36 =+0 ;Reset parameter 78 FN 0: Q40 =+0 ;Reset parameter 79 FN 0: Q46 =+0 ;Reset parameter 80 FN 0: Q47 =+0 ;Reset parameter 81 FN 0: Q50 =+1 ;Counter 82 CALL LBL 2 83 L X+Q21 Y+Q22 R0 F9999 M3 ;Move to the first position 84 L Z+Q12 M99 ;Move to set-up clearance and call the cycle 85 LBL 21 86 FN 1: Q46 =+Q46 + +Q48 87 LBL 22 88 FN 1: Q36 =+Q36 + +Q5 89 CALL LBL 2 90 CALL LBL 3 91 FN 12: IF +Q47 LT +Q46 GOTO LBL 22 92 L X+Q21 Y+Q22 M99 ;Move to the next position and call the cycle 93 FN 1: Q50 =+Q50 + +1 ;Update counter 94 FN 12: IF +Q50 LT +Q13 GOTO LBL 21 ;Compare counter 95 ;Reset rotation and datum shift 96 CYCL DEF 10.0 ROTATION 97 CYCL DEF 10.1 ROT+0 98 CYCL DEF 7.0 DATUM SHIFT 99 CYCL DEF 7.1 X+0 100 CYCL DEF 7.2 Y+0 101 LBL 0 102 ; 103 ;Calculation of the ellipse 104 LBL 10 105 FN 0: Q40 =+0 106 FN 0: Q36 =+0 ;Starting angle 107 FN 0: Q4 =+360 ;End angle 108 CALL LBL 2 109 LBL 1 110 FN 1: Q36 =+Q36 + +Q5 ;Update angle 111 CALL LBL 2 112 CALL LBL 3 113 FN 12: IF +Q36 LT +Q4 GOTO LBL 1 ;Comparison current angle to end angle 114 FN 0: Q36 =+Q4 115 CALL LBL 2 116 LBL 0 117 LBL 2 ;Calculation coordinates 118 FN 7: Q21 = COS +Q36 119 FN 3: Q21 =+Q21 * +Q1 120 FN 6: Q22 = SIN +Q36 121 FN 3: Q22 =+Q22 * +Q2 122 LBL 0 123 LBL 3 ;Calculation angle and coordinates 124 FN 1: Q37 =+Q36 + +Q5 125 FN 7: Q31 = COS +Q37 126 FN 3: Q31 =+Q31 * +Q1 127 FN 6: Q32 = SIN +Q37 128 FN 3: Q32 =+Q32 * +Q2 129 FN 2: Q34 =+Q31 - +Q21 130 FN 2: Q35 =+Q32 - +Q22 131 FN 8: Q39 =+Q35 LEN +Q34 132 FN 1: Q40 =+Q40 + +Q39 133 FN 1: Q47 =+Q40 + +0 134 LBL 0 135 END PGM 1010_EN MM