0 BEGIN PGM 10351-EN MM 1 ;Calculations and movements for drilling with 2 ;exponentially decreasing infeed depth. 3 FN 0: Q19 =+0 ;Counter 4 FN 0: Q20 =+Q6 ;Pre-positioning 5 FN 1: Q21 =+Q6 + +Q7 ;Hight 2nd set/up clearance 6 FN 10: IF +Q7 NE +0 GOTO LBL 3 7 FN 2: Q21 =+Q6 - +Q1 ;Pre-positioning 8 LBL 3 9 FN 12: IF +Q3 LT +Q2 GOTO LBL 100 10 FN 1: Q23 =+Q6 + +Q1 ;Pre-positioning 11 FN 1: Q24 =+Q6 + +Q2 ;Pre-positioning 12 FN 1: Q25 =+Q6 + +Q1 ;Starting position 13 FN 0: Q15 =+1 ;Divisor for the plunging depth 14 L Z+Q25 R0 F9998 ;Move to the starting position 15 LBL 1 16 FN 5: Q12 = SQRT +Q15 ;Calculate plunging depth 17 FN 4: Q13 =+Q3 DIV +Q12 ;Calculate infeed depth 18 FN 12: IF +Q13 LT +Q10 GOTO LBL 4 ;Compare with minimum plunging depth 19 FN 0: Q13 =+Q10 ;plunging depth is equal to the minimum plunging depth 20 LBL 4 21 FN 1: Q20 =+Q20 + +Q13 ;Z-coordinate 22 FN 1: Q22 =+Q20 + +Q1 ;Pre-positioning for next plunging 23 FN 1: Q19 =+Q19 + +1 ;Counter 24 FN 12: IF +Q20 LT +Q24 GOTO LBL 99 ;Compare current depth to end depth 25 L Z+Q20 R0 FQ5 ;Plunging 26 FN 9: IF +Q20 EQU +Q24 GOTO LBL 99 ;Compare current depth to end depth 27 FN 12: IF +Q19 LT +Q9 GOTO LBL 2 ;Compare counter 28 L Z+Q23 R0 F9998 ;Move back 29 CYCL DEF 9.0 DWELL TIME 30 CYCL DEF 9.1 DWELLQ4 31 FN 0: Q19 =+0 ;Reset counter 32 L Z+Q22 R0 F9998 ;Move to the depth befor next plunging 33 LBL 2 34 L Z+Q22 R0 FQ5 ;Move to the depth befor next plunging 35 FN 1: Q15 =+Q15 + +Q8 ;Divisor for the next plunging 36 FN 11: IF +Q20 GT +Q24 GOTO LBL 1 ;Compare current and end depth 37 LBL 99 38 L Z+Q24 R0 FQ5 ;Move to the depth at the end 39 CYCL DEF 9.0 DWELL TIME 40 CYCL DEF 9.1 DWELLQ11 41 LBL 100 42 L Z+Q21 R0 F9998 ;Move to the 2nd set-up clearance 43 END PGM 10351-EN MM