数控车床编程例题加工程序•O0001;O机能指定程序号。N10T0101;N20S400M03;主轴正转。N30G00X40Z2;至毛坯外。N40G71U1.5R1;与N50一起根据轮廓段组N60-N150自动分配切削参数进行粗车循环,U为吃刀量,R为退刀量,均为半径值。N50G71P60Q150U0.5W0.2F0.3;P为轮廓开始段号,Q为轮廓结束段号,U为X向精加工余量(直径值),W为Z向精加工余量N60G01X18Z0;轮廓开始。N80X20Z-1;N90Z-10;N100X26;N110X28Z-11;N120Z-25;N140X35Z-31;N150Z-36;轮廓结束N160G70P60Q150S1100F0.05;根据轮廓段组N60-N150精加工轮廓。N170G00X50Z60;远离工件准备换刀N180T0202;换刀N190S200M03;割断需要降速。N210G00X37Z-40;准备割断,设对刀点在割刀的左刀尖,则右刃将割出36mm长的工件。N220G01X0F0.03;割断。N230G00X50;N240G00Z0;建议回到此处,以方便第二个工件的切削。N250M05;主轴停止。N260M02;程序结束。加工程序•O0002;O机能指定程序号。N10T0101;N20S500M03;主轴正转。N30G00X45Z2;到毛坯外。N40G71U1.5R1;与N50一起根据轮廓段组N60-N140自动分配切削参数进行粗车循环,U为吃刀量,R为退刀量,均为半径值。N50G71P60Q140U0.5W0.2F0.3;P为轮廓开始段号,Q为轮廓结束段号,U为X向精加工余量(直径值),W为Z向精加工余量N60G01X18Z0;轮廓开始。N80X20Z-1;N90Z-28;N100X27.368Z-45.042;点A。N110G03X25.019Z-54.286R14;点B。N120G02X26.806Z-60.985R6;点C。N130G03X36Z-73R18;N140G01Z-85;N150G70P60Q140S1100F0.05;N160G00X50Z60;远离工件,准备换刀。N170T0202;换割刀。N180S200M03;割槽时,要求低转速。N200G00X22Z-28;准备割第一刀。N210G01X16F0.03;割第一刀。N220G04P1000;停留1S。N230G00X22;退刀。N240Z-24;准备割第二刀。N250G01X16F0.03;割第二刀。N260G04P1000;停留1S。N270G00X22;退刀。N280Z-21;准备用右刀尖割倒角。N290G01X16Z-24F0.1;用右刀尖割倒角。N300G00X50;N310Z60;N320T0303;N330S300M03;降低转速以切螺纹。N340G00X22Z-23;准备切螺纹的第一线。N350G92X19.2Z3F3;切螺纹,导程3。N360X18.7;N370X18.3;N380X18.05;N390G00X22Z-24.5;准备切螺纹的第二线。N400G92X19.2Z3F3;N410X18.7;N420X18.3;N430X18.05;N440G00X50;N450Z60;N450Z60;N470T0202;N480S200M03;N490G00X38Z-84;准备割断。N500G01X0F0.03;割断。N510G00X50;N520Z0;停在工件右端面,方便第二个工件的加工。N530M05;N540M30;返回程序头。加工程序•O0003;N10T0101;N20S400M03;N30G00X45Z2;N40G71U2R1;N50G71P60Q140U0.5W0.2F0.2;N60G00X0;N70G01Z0;N80G03X22Z-11R11;N90G01Z-20;N100X25;N110X30Z-40;N120X34;N130X38Z-42;N140Z-80;N150G70P60Q140S1000F0.05;N160G00X50Z60;N170T0202;N180S200M03;N190G00X40Z-68;N200G01X30F0.03;N210G04P1000;N220G00X40;N230Z-64;N240G01X30F0.03;N250G04P1000;N260G00X40;N270Z-61;N280G01X32Z-65F0.2;N290G00X50;N300Z60;N310T0303;N320S500M03;N330G00X42Z-64;N340G92X37Z-38F3;N350X36.5;N360X36.2;N370X36.05;N380G00X42Z-62.5;N390G92X37Z-38F3;N400X36.5;N410X36.2;N420X36.05;N430G00X50Z60;N440T0202;N450S200M03;N460G00X40Z-79;N470G01X0F0.03;N480G00X60;N490Z0;N500M05;N510M30;加工程序•O0004;N10T0101;N20S400M03;N30G00X46Z2;N40G71U1.5R1;N50G71P60Q130U0.5W0.2F0.3;N60G0019.8;N70G01Z-18;N80X38.5;N90Z-85;N100X39.8;N110Z-111;N120X40;N130Z-120;N140G70P60Q130S1000F0.05;N150G00X50Z60;N160T0202;N170S200M03;N180G00X22Z-14;N190G01X16F0.03;N200G04P1000;N210G00X22;N220Z-18;N230G01X16F0.03;N240G04P1000;N250G00X22;N260Z-11;N270G01X16Z-14F0.1;N280G00X22;N290Z-3;N300G01X15Z0.5F0.1;N310G00X40;N320Z-81;N330G01X30F0.03;N340G04P1000;N350G00X40;N360Z-85;N370G01X30F0.03;N380G04P1000;N390G00X38;N400G01X42Z-87F0.1;N410G00Z-107;N420G01X30F0.03;N430G04P1000;N440G00X42;N450Z-111;N460G01X30F0.03;N470G04P1000;N480G00X42;N490Z-104;N500G01X34Z-108F0.1;N510G00X50;N520Z60;N530T0303;N540S500M03;N550G00X60Z-17;N560G73U9.5W0R10;N570G73P540Q600U0.5W0F0.2;N580G00X30;N590G01Z-18;N600X36.016Z-26.942;N610G03X24.758Z-47.414R19;N620G02Z-62.586R10;N630G03X38Z-77R19;N640G01Z-78;N650G73P540Q600S1000F0.05;N660S450M03;N670G00X41Z-105;N680G92X39.4Z-81F3;N690X38.9;N700X38.6;N710X38.3;N720X38.05;N730G00X41Z-106.5;N740G92X39.4Z-81F3;N750X38.9;N760X38.6;N770X38.3;N780X38.05;N790G00Z-12;N800X22;N810G92X19.4Z3F2;N820X19;N830X18.7;N840G00X50Z60;N850T0202;N860S200M03;N870G00X42Z-119;N880G01X0F0.03;N890G00X50;N900Z0;N910M05;N920M30;加工程序•O0005;N10T0101;N20S400M03;N30G00X45Z2;N40G71U1.5R1;N50G71P60Q160U0.5W0.2F0.3;N60G00X14;N70G01Z0;N80X16Z-1;N90Z-20;N100X25Z-30;N110Z-33;N120G02X25Z-45R10;N130G01Z-53;N140X28;N150G03X38Z-58R5;N160G01Z-83;N170G70P60Q160S1100F0.05;N180G00X50Z60;N190T0202;N200S200M03;N210M08;开启冷却液。注意:硬质合金刀具不要用冷却液。N220G00X18Z-20;N230G01X13F0.03;N240G04P1000;N250G00X40;N260Z-64;N270G01X34F0.03;N280G04P1000;N290G00X38;N300Z-63;N310G01X34Z-64F0.1;N320G00X38;N330Z-65;N340G01X34Z-64F0.1;N350G00X40;N360Z-82;N370G01X33F0.03;N380G00X40;N390Z-79;N400G01X34Z-82F0.1;N410G00X50;N420Z60;N430T0303;N440S450M03;N450G00X18Z-18;N460G92X15.2Z3F2;N470X14.6;N480X14.1N490X13.7;N500X13.4;N510G00X50;N520Z60;N530T0202;N540S200M03;N550G00X38Z-82;N560G01X0F0.03;N570M09;关闭冷却液。N580G00X50;N585Z0;N590M05;N600M30;