实例为在预先处理好的100mm×100mm×100mm合金铝锭毛坯上加工图9-22所示的零件,其中正五边形外接圆直径为80mm。一、工艺分析本例中毛坯较为规则,采用平口钳装夹即可,选择以下4种刀具进行加工:1号刀为Ф20mm两刃立铣刀,用于粗加工;2号刀为Ф10mm中心钻,用于打定孔位;4号刀为Ф10mm钻刀,用于加工孔。通过测量刀具,设定补偿值用于刀具补偿。该零件的加工工艺为:加工90mm×90mm×15mm的四边形→加工五边形×加工Ф40mm的内圆→精加工四边形、五边形、Ф40mm的内圆→加工4个Ф10mm的孔。二、编程说明手工编程时应根据加工工艺编制加工的主程序,零件的局部形状由子程序加工。该零件由1个主程序和5个子程序组成,其中,P1001为四边形加工子程序,P1002为五边形加工子程序,P1003为圆形加工子程序,P9888为中心孔加工子程序,P9777为加工孔子程序。用CAD/CAM软件系统辅助编程。首先进行零件几何造型,生成零件的几何模型,如图9-23所示。然后用CAM软件再生成NC程序。本例先从Pro/E中造型,用IGES格式转化到MasterCAM9.2中(也可以直接用MasterCAM进行零件几何造型),由MasterCAM生成NC程序。三、NC程序零件几何模型的程序见表9-5加工中心实例程序程序说明程序说明O9944主程序名M98P1001G49G40取消刀具长度补偿和半径补偿N12G01Z-4G92X0Y0Z10坐标系定位G40N10M06T01换1号刀具M98P1002调用子程序(加工五边形,分3次)S796M03M08主轴转动、打开切削液G01Z-8Y-60.0移动到开始加工位置M98P1002Z5.0Z-9.8N20G01Z-4F200开如加工(粗加工)N30M98P1002M98P1001Z10.0G01Z-8F200X0Y0M98P1001N40G01X5Y5Z-2F100螺旋下刀加工圆形(分7次)G01Z-12F200M98P1001X14.0Y0F118G01Z-14.8F200G03I-14.0G01X0N60M98P1001精加工四边形Z10.0Z-9.98G01X-5Y-5Z-4N65M98P1002精加工五边形(分2次)X14.0Y0F318Z-10.0G03I-14.0N70M98P1002G00X0Z10.0Z10.0X0Y0G01X5Y5Z-6N75G01Z-15.98F200精加工圆(分2次)X14.0Y0F318M98P1003G03I-14.0Z-16.0G00X0N80M98P1003Z10.0G00Z100.0G01X-5Y-5Z-8N85M06T03换3号刀具加工定位孔X14.0Y0F318G01X0Y0Z10G03I-14.0G90G01X-35Y-35F200G00X0Z10.0M98P9888G01X5Y5Z-10Y35.0X14.0Y0F318M98P9888G03I-14.0X35.0G00X0M98P9888Z10.0Y-35.0G01X-5Y-5Z-12M98P9888X14.0Y0F318N90M06T04换4号刀具加工孔G03I-14.0G90G01X0Y0Z10F200G00X0Z10.0G01X-35Y-35G01Z-15.8F200M98P9777X14.0Y0F318Y35.0G03I-14.0M98P9777G00X0X35.0Z10.0M98P9777G00X0Y0Y-35.0N50M06T02M98P9777X0Y-60.0Z5.0M30G01G41Z-15.0D2F200O1001四边形子程序G90G0X15.0G03X0Y-45.0R15.0X37.82Y12.36X23.512Y-31.944G01X-35.0X0G02X-45.0Y-35.0R10.0G03X-28.056Y-60.0R28.056G01Y35.0G01X0G02X-35.0Y45.0R10.0M99O1003圆形子程序G01X35.0G90G01X9.0Y-10.0F239G02X45.0Y35.0R10.0X10.0G01Y-35.0G03X20.0Y0R10.0G02X35.0Y-45.0R10.0I-20.0G01X0X10.0Y10.0R10.0G03X-15.0Y-60.0R15.0G01X0Y0M99G01X0O9888加工中心孔子程序M99G01Z-17F100O1002五边形子程序G01Z10G90G01X28.056M99G03X0Y-31.944R28.056O9777加工孔子程序G01Z-22F100G01X-23.512G01Z10X-37.82Y12.36M99X0Y40.0