0 BEGIN PGM 7050-EN MM 1 ;Program for machining the outside of a 2 ;cylindrical surface with a ball-nose cutter. 3 ;The cylinder axis is parallel to the Y-axis. 4 ;The motions are made in contourlines, so 5 ;that the milling path is is done in 6 ;Y-direction and the motion for plunging is 7 ;in the X- and Z-sxis. 8 ; 9 BLK FORM 0.1 Z X-35 Y+0 Z-45 10 BLK FORM 0.2 X+35 Y+100 Z+0 11 ; 12 ;Input parameter 13 FN 0: Q1 =+0 ;CYLINDER CENTER IN THE X-AXIS 14 FN 0: Q2 =-40 ;CYLINDER CENTER IN THE Z-AXIS 15 FN 0: Q3 =+0 ;STARTING POINT IN THE Y-AXIS 16 ; ;MINIMUM COORDINATE 17 FN 0: Q4 =+100 ;END POINT IN THE Y-AXIS 18 ; ;MAXIMUM COORINATE 19 FN 0: Q5 =+100 ;PITCH 20 ; ;NUMBER OF CONTOURLINES 21 FN 0: Q6 =+35 ;CYLINDER RADIUS 22 FN 0: Q7 =+90 ;STRTING ANGLE IN PLANE X/Z 23 FN 0: Q8 =+270 ;END ANGLE IN PLANE X/Z 24 FN 0: Q9 =+10 ;SAFETY HIGHT 25 FN 0: Q10 =+300 ;FEED RATE FOR MILLING 26 ;Input parameter completed 27 ; 28 ;Tool call ball-nose cutter 29 TOOL CALL 157 Z S8000 30 TOOL CALL DL-Q108 ;Change in length to tool center point 31 ; 32 ; 33 ;Calculations 34 FN 2: Q13 =+Q3 - +Q108 ;Starting position in Y-axis 35 FN 1: Q14 =+Q4 + +Q108 ;End position in Y-axis 36 FN 1: Q26 =+Q6 + +Q108 ;Effectiv radius to the tool center point 37 FN 2: Q27 =+Q8 - +Q7 ;Angle range 38 FN 4: Q28 =+Q27 DIV +Q5 ;Angle step 39 FN 1: Q29 =+Q9 + +Q108 ;Pre-positioning in Z-axis 40 FN 0: Q30 =+0 ;counter 41 ;Calculations completed 42 ; 43 ;Motions 44 L Z+100 R0 FMAX ;Drive to a safe hight 45 L Y+Q13 X+Q1 R0 F9999 M3 ;Pre-positioning in X and Y 46 L Z+Q29 R0 FMAX ;Pre-positioning in Z 47 CC Z+Q2 X+Q1 ;Cylinder center 48 LP PR+Q26 PA+Q7 FQ10 ;Move to the first contourline 49 LBL 1 ;Mark 50 CP IPA-Q28 DR- FQ10 ;Plunging 51 L Y+Q14 FQ10 ;Milling path 52 FN 1: Q30 =+Q30 + +1 ;Counter 53 FN 9: IF +Q30 EQU +Q5 GOTO LBL 99 ;Compare counter and pitch 54 CP IPA-Q28 DR- FQ10 ;Plunging 55 L Y+Q13 FQ10 ;Milling path 56 FN 1: Q30 =+Q30 + +1 ;Counter 57 FN 12: IF +Q30 LT +Q5 GOTO LBL 1 ;Compare counter and pitch 58 LBL 99 59 ; 60 ;Move back and end of program 61 L Z+50 R0 FMAX M2 62 END PGM 7050-EN MM