0 BEGIN PGM 30851_EN MM 1 ;NC program for calculation and preforming 2 ;the positioning movements for machining 3 ;a concave arc segment. 4 FN 0: Q46 =+0 ;Counter of number of cuts 5 FN 0: Q52 =+0 ;Starting point in the Y axis 6 FN 1: Q53 =+Q3 + +Q23 ;Z coordinate including oversize 7 FN 0: Q56 =+Q6 ;Current radius 8 FN 0: Q57 =+Q7 ;Current angle of profile cut 9 FN 0: Q58 =+Q8 ;Current angle in the plane 10 FN 2: Q77 =+Q17 - +Q7 ;Angular lengths in the X/Z plane 11 FN 4: Q77 =+Q77 DIV +Q27 ;Stepping angle in the X/Z plane 12 FN 3: Q77 =+Q77 * +Q29 ;Stepping angle multiplied by roughing factor 13 FN 2: Q78 =+Q18 - +Q8 ;Angular lengths in the X/Y plane 14 FN 4: Q78 =+Q78 DIV +Q26 ;Stepping angle in the X/Y plane 15 FN 3: Q78 =+Q78 * +Q29 ;Stepping angle multiplied by roughing factor 16 FN 2: Q76 =+Q16 - +Q6 ;Radius change 17 FN 4: Q76 =+Q76 DIV +Q26 ;Radius change per cut 18 FN 3: Q76 =+Q76 * +Q29 ;Radius change multiplied by roughing factor 19 ;Shift the datum to the center and the top surface of machining 20 CYCL DEF 7.0 DATUM SHIFT 21 CYCL DEF 7.1 X+Q1 22 CYCL DEF 7.2 Y+Q2 23 CYCL DEF 7.3 Z+Q53 24 ; 25 LBL 1 26 ;Rotation to current angle in the plane 27 CYCL DEF 10.0 ROTATION 28 CYCL DEF 10.1 ROT+Q58 29 FN 0: Q57 =+Q7 ;Current angle equals starting angle 30 L X+Q10 R0 FMAX ;Pre-position 31 CC Z+0 X+Q10 ;Center for profile cut 32 LP PR+Q56 PA+Q57 FQ22 ;Move to starting point 33 L Y+Q52 FQ22 ;Move to starting point in the Y axis 34 LBL 3 ;Movement to end angle 35 FN 1: Q57 =+Q57 + +Q77 ;Increment the current angle 36 FN 11: IF +Q57 GT +Q17 GOTO LBL 4 ;Check whether end angle has been reached 37 LP PR+Q56 PA+Q57 R0 FQ21 ;Approach new angle 38 FN 12: IF +Q57 LT +Q17 GOTO LBL 3 ;Jump for next linear segment 39 LBL 4 40 LP PR+Q56 PA+Q17 FQ20 ;Move to end angle 41 FN 1: Q46 =+Q46 + +Q29 ;Increment the counter 42 FN 1: Q56 =+Q56 + +Q76 ;Update the radius 43 FN 1: Q58 =+Q58 + +Q78 ;Update the angle of rotation 44 FN 11: IF +Q46 GT +Q26 GOTO LBL 99 ;Check whether the number of cuts has been reached 45 LBL 5 46 ; 47 ;Rotate to new angle 48 CYCL DEF 10.0 ROTATION 49 CYCL DEF 10.1 ROT+Q58 50 FN 0: Q57 =+Q17 ;Current angle equals end angle 51 CC Z+0 X+Q10 ;Center for profile cut 52 LP PR+Q56 PA+Q57 FQ22 ;Approach starting point 53 L Y+Q52 FQ22 ;Approach starting point in Y 54 ; 55 LBL 7 ;Movement to starting point 56 FN 2: Q57 =+Q57 - +Q77 ;Update the angle 57 FN 12: IF +Q57 LT +Q7 GOTO LBL 8 ;Check whether the current angle is less the starting angle 58 LP PR+Q56 PA+Q57 R0 FQ21 ;Approach current angle 59 FN 11: IF +Q57 GT +Q7 GOTO LBL 7 ;Check whether the starting angle has been reached 60 LBL 8 61 LP PR+Q56 PA+Q7 FQ20 ;Approach the starting angle 62 FN 1: Q46 =+Q46 + +Q29 ;Increment the counter 63 FN 1: Q56 =+Q56 + +Q76 ;Update the radius 64 FN 1: Q58 =+Q58 + +Q78 ;Update the angle of rotation 65 FN 9: IF +Q46 EQU +Q26 GOTO LBL 1 ;Check whether the number of cuts has been reached 66 FN 12: IF +Q46 LT +Q26 GOTO LBL 1 ;Check whether the number of cuts has been reached 67 LBL 99 68 ;Reset rotation 69 CYCL DEF 10.0 ROTATION 70 CYCL DEF 10.1 ROT+0 71 ;Reset datum shift 72 CYCL DEF 7.0 DATUM SHIFT 73 CYCL DEF 7.1 X+0 74 CYCL DEF 7.2 Y+0 75 CYCL DEF 7.3 Z+0 76 ; 77 ;Retract 78 L Z+Q25 R0 F9999 79 END PGM 30851_EN MM