1、Unit3 Programming for Numerical Control数控编程A program for numerical control consists of a sequence of directions that causes an NC machine to carry out a certain operation , machining being the most commonly used process. 数控编程由一系列方向构成,这些方向导致数控车床执行某种操作,加工是最常用的进程。Programming for NC may be done by an in
2、ternal programming department ,on the shop floor, or purchased from an outside source . 数控车床编程由内部编程部门来完成,在车间里,或者从外部源购买。 Also, programming may be done manually or with computer assistance.编程还可以手动或者在计算机辅助下来完成。The program contains conetains instructions and commands . 程序包括指令和命令。Geometric instuctions pe
3、rtain to relative movements between the tool and the workpiece . 几何指令涉及刀具和工件间的相对移动。Processing instructions pertain to spindle speeds,feeds,tools,and so on. 进程指令涉及主轴速度,进给以及道具等。Travel instructions pertain to the type of interpolation and slow or rapid movements of the tool ro worktable . 行动指令涉及插值的类型以及
4、刀具或者工作台的缓慢和快速移动。Switching commands pertain to on/off position for coolant supplies,spidle rotation,direction of spindle rotation ,tool changes,workpiece feeding,clamping, and so on . 切换命令涉及到开/关冷却液供给状况,主轴旋转,主轴方向,换刀,工件进给,夹具固定等等。(1)Manual programming . 手工编程。manual part programming conisits first of cal
5、culating the dimensional relationships of the tool,workpiece ,and work table ,based on the engineering drawings of the part,and manufacturing operations to be performed and their sequence. 手工编程包括根据部分工程图纸首先算出刀具,工件以及工作台的尺寸关系,继而决定执行的操作和工序。A program sheet is then prepared,which consits of the necessary
6、information to carry out the particular operation,such as cutting tools ,spindle speeds ,feeds,depth of cut,cutting fluids ,power ,and tool or workpiece relative positions and movements.一个包括执行特定操作所需必要信息的程序表就准备好了,例如刀具切削,主轴转速,进给,切削深度,切削液,以及刀具或者工件间的相对位置或者移动。Based on this information ,the part program i
7、s prepared . 根据这些信息,部分程序就准备好了。Usually a paper tape is first prepared for trying out and debugging the program.Depending on how often it is to be used ,the tape may be made of more durable mylar. 通常一个纸带首先被准备好用于试用和调试程序。根据纸带被使用多久,纸袋通常用更耐用的聚酯薄膜制成。Manual programming can be done by someone who is knowledg
8、eable about the particular manufactring process and is able to understand ,read,and change part progarms. 手工编程可以由那些具有特定制造工艺知识和能够理解,阅读以及更改部分程序的人来完成。Because they are familiar with machine tools and process capabilities,skilled machinists can do manual programming with some traning in programming. 因为他们
9、熟悉机床刀具和工艺流程,熟练的机械师可以做一些手工编程的编程培训。However ,the work invoveled is tedious,time-consuming,and uneconomical consequetly ,manual programming is used mostly in simple point-to-point applications. 然而,所涉及的工作是乏味的,费时的,因此不合算。手工编程大多数用于简单的点对点应用上。(2)Computer-aided programming. 计算机辅助编程。Computer-aided part programm
10、ing involves special symbolic programming languages that determine the coordinate points of corners,edges,and surfaces of the part . 计算机辅助编程是一种涉及到特殊符号的编程语言,这种语言可以决定角点的坐标,刀口以及工件的表面。Programming language is the means of communicating with the computer and involves the use of symbolic characters. 编程语言是与
11、计算机通信的方式并且涉及到符号字符。The programmer describes the component to be processed in this language,and the computer converts it to commands for the NC machine . 编程员用这种语言描述加工零件,而由计算机将零件程序转换为数控机床的执行指令。1 Several languages having various features and applicaions are commercially avaiable.The first language that
12、used Englishlike statements was developed in the late 1950s and is called APT(for Automatically Programmed Tools). 许多种商业应用上的语言有多种多样的特点和应用。第一种被使用的是类似于英语语句的语言,它在十九世纪五十年代末被开发出来并被称为APT语言。This language ,in its various expanded forms is still the most widely used for both point-to-point and continuous-pat
13、h programming. 这种语言,由于它多种多样的扩展形式,一直是最广泛的用于点对点和连续路径编程的语言。Complex parts are now machined using grahics-based,computer-aided machining programs. 复杂的工件现在使用基本的绘图进行制造,计算机辅助制造程序。A tool part is created in a largely graphic environment that is similar to a CAD program . 刀具的路径是在类似于一个CAD程序的大量的绘图环境下制造出来的。The ma
14、chine code(G-Code) is created automatically by the program. 这种机器代码由程序自动生成。Before production begins,the programs should be verified ,either by viewing a simulation of the process on a monitor or by making the part from an inexpensive material (such as aluminum ,wood,wax,or plastic),rather than from t
15、he actual material specified for the finished part. 在生产开始之前,程序应该被校验,还有就是通过一个显示器观看工艺流程的模仿或者使用廉价的材料(例如铝,木头,石蜡,或者是塑料)制作工件,而不是使用指定用于已加工零件的真实材料。Computer-aided part programming has the following significant advantages over manual metheods: 计算机辅助编程有以下几个优于人工方式的重要优点。 Relatively easy use of symbolic language.
16、 比较容易使用的符号语言。Reduced programming time.Programming is capable of accommodating a large amount of data concerning machine characteristics and process variables,such as power ,speeds,feed,tool shape,compensation for tool shape changes ,tool wear,deflections ,and coolant use. 缩短了编程时间。编程是一种容纳了大量关于机械特点和工艺
17、变量数据的一种能力,例如动力,速度,进给,刀具形状,刀具形状改变的补给量,刀具磨损,偏转,以及冷却液的使用。Reduced possibility of human error which can occur in manual programming. 减少了在人工编程中出现人为错误的可能性。Capability of simple changover of machining sequence or from machine to machine. 简单的转换加工序列或从机器到机器的能力。Lower cost because less time is required for progra
18、mming. 因为编程时所需更少的时间,降低了成本。The use of programming language not only results in higher part quality but also allows for more rapid development of machining instructions. 编程语言的使用不仅导致更高的工件质量而且考虑到了机械指令的更加快速发展。In addition,simulations can be run on remote computer terminals,to ensure that the prgram functi
19、ons as intended. 另外,模拟可以在远程计算机的终端设备上运行,这就确保了程序按照既定来运行。This method prevents unnecessary occupation of expensive machinery for debugging procedures. 这种方法可以防止昂贵的机器由于调试程序产生不必要的占用。Selection of a particular NC programming language mainly depends on the following factors: 选择某一种数控机床编程语言主要取决于以下几个因素:Level exp
20、ertise of the personnel in the manufacturing facility生产设施人员的专业水平级别。Complexity of the part工件的复杂程度Type of equipment and computers available设备的外形以及计算机的应用Time and costs involved in programming涉及编程的时间及费用Because numerical control involves the insertion of data concerning workpiece materials and processing
21、 parameters ,programming must be done by operators or programmers who are knowledgeable about the relevant aspects of the manufacturing processes being used. 因为数控涉及有关工件材料和加工参数的数据插入,编程必须由有制造业的相关方面知识的操作工和程序员来完成。Before production begins,programs should be berified,either by viewing a simulation of the
22、process on a CRT screen or by making the part from an inexpensive material ,such as aluminum ,wood,or plastic,rather than the material specified for the finished part. 在生产开始之前,程序应该被校验,还有通过一个CRT屏幕来观察工艺流程的模拟或者用廉价的材料制造工件,例如铝,木头或者塑料,而不是使用指定用于已加工零件的真实材料。NC Part Programming Languanges数控编程语言 Probably over
23、100 NC part programming languages have been developed since the initial MIT research 2 on NC programming systems in 1956. 自从1956念麻省理工学院的初步研究数控编程系统以来大概有超过100种的数控编程语言已经被开发出来了。Most of the language were developed to serve particular needs and machines and they have not survied the test of time . 大多数语言开发
24、用于特殊的需求和机械并且它们没有经受住时间的考验。However,a good number of languages are still in use today. 然而,相当多的语言在今天一直被使用。In this subsection we review some of those which are generally considered important. 在本小节,我们回顾一下那些被普遍认为是重要的语言。 APT(AUTOMATICALLY PROGRAMMED TOOLS). APT(自动编程工具)。The APT language was the product of th
25、e MIT development work on NC programming systems. APT语言是麻省理工学院研发的关于数控机床控制编程系统的成果。Its development began in June 1956,and it was first used in production around 1956. 它的研发开始于1956年六月,它第一次用于生产是在1959年左右。Today it is the most widely used language in the United States. 几天它是在美国应用最广泛的语言。Although first intende
26、d as a contouring language ,modern versions of APT can be used for both postitioning and continuous-path programming and continuous-path programming in up to five axes. 虽然第一次打算作为一种轮廓语言,APT现在的版本可用于定位和持续路径的编程而且可用于多达五个基准轴的持续路径编程。 AUTOSPOT (AUTOMATIC SYSTEM FOR POR POSITIONING TOOLS). AUTOSPOT(用于定位工具的自动
27、系统)。This was developed by IBM and first introduced in 1962 for PTP programming. 这个程序有IBM研发,在1962年第一次被引进用于PTP编程。Todays version of AUTOSPOT can be used for contouring as well. AUTOSPOT现在的版本也可应被用于修证轮廓。 COMPACT .This is a package available from Manufacturing Data Systems,Inc. 这种语言是来自于制造数据系统的封装。(MDSI),a
28、firm based in Ann Arbor,Michigan. (MDSI公司),在安阿伯,密歇根州的一家公司。The NC language is similar to SPLIT in many of its features. 数控机床控制编程的许多特点于SPLIT相似。MDSI leases the COMPACT system to its users on a time-sharing basis. MDSI公司将COMPACT II系统租赁给以分时为依据的用户。The part programmer uses a remote terminal to feed the pro
29、gram into one of the MDSI computers,which in turn produce the NC tape. 这种程序通过使用远程终端把程序传送给MDSI公司的计算机,有计算机转向产生数控的纸带。 ADAPT(ADAPTATION OF APT). ADAPT(APT的改编版本)。Several part programming languages are based directly on the APT program. 多种编程语言直接依据于APT程序。One of these is ADAPT,which was developed by IBM und
30、er Air Force Contract. 这些语言之一便是ADAPT,它是在空军合同下由IBM公司研发的。It was intended to provide many of the features of APT but to utilize a significantly smaller computer. 这种语言意图提供许多APT的特点但是用于小型计算机。ADAPT is not as powerful as APT ,but can be used to program for both positioning and contouring jobs . ADAPT不如APT一样
31、强大,但是能够被用于定位和修改轮廓工作的程序。 EXAPT(EXTENDED SUBSET OF APT). EXAPT(APT的扩展子集)。This was developed in Germany ,starting around 1964 and is based on the APT language. 这种语言是由德国研发的,开始于1964年之间,以APT语言为依据。There are three versions:EXAPT I designed for positioning (drilling and also straight-cut milling). 有三个版本:EXAP
32、T I 被设计应用于定位(钻削和直切铣)。EXAPT designed for turning,and EXAPT designed for limited contouring operations. EXAPT II被设计用于车削,还有EXAPT III被设计用于限制轮廓的操作。One of the important features of EXAPT is that it attempts to compute optimum feeds and speeds automatically. EXAPT最重要的一个特点是尝试自动地计算最佳进给量和进给速度。 APT is not only
33、 an NC language; it is also the computer program that perfoms the calulations to generate cutter positions based on APT statements. APT不仅仅是一种数控语言;它也是一种以APT声明为依据执行计算来,生成切割位置的计算机程序。 There are four types of statements in the APT language: 在APT语言中声明有四种类型: Geometry statements. 几何声明。These define the geome
34、tric elements that comprise the workpart. 这些定义好的几何元素包括了工作组。They are also sometimes called definetion statements. 它们有时也叫做定义声明。 Motion staments. 动作声明These are used to describe the path take by the cutting tool . 这些通常都是用来描述刀具轨迹。 Postprocessor statements. 后处理程序声明。These apply to the specific machine tool
35、 and control system. 这些声明用于特殊的机械工具和控制系统。They are used to specify feeds and speeds and to actuate other features of the machine. 它们用于指定进给量和进给速度而且精确了机械的其他特点。 Auxiliary statements. 辅助声明。These are miscellaneous statements used to identify the part,tool,tolerance ,and so on. 这些不同种类的声明常用作定义工件,刀具,以及公差等等。 C
36、NC programming of mills and lathes is like any other machine programming process;it requires a complete understanding of the programming language. 铣床和车床的CNC编程于其他机械编程工艺是相似的;它需要对编程语言有一个透彻的理解。The language used for NC of mills and lathes is often referred to as G-codes. 这种用作铣床和车床NC的语言通常被称为G代码。The proces
37、s used for milling machines and machining centers provides a good example of G-code use because it encompasses about 75 percent of all NC operations. 这些工序通常用于铣床机械和机加工中心,提供了一些G代码使用的经典例子,因为它包括大约了NC操作中的75%。The following five categories of programming commands and techniques are used for mill NC program
38、ming. 下面编程和工艺的五类用于铣床NC编程。(1)Basic Commands.基本指令。The following command codes and their functions are used to write an NC program for a noncomplex part.使用下面的命令代码和它们的功能写一个非复杂部分的NC程序。Motion commands(G00,G01,G02,G03)运动指令(G00,G01,G02,G03)Plane selection (G17,G18,G19)平面选择(G17,G18,G19)Positionning system se
39、lection(G90,G91)位置系统选择(G90,G91)Unit selection (G70 or G20,G71 or G21)单位选择(G70 or G20,G71 or G21)Work coordinate setting3(G92)工作坐标系设定(G92)Reference point return (G28,G29,G30)返回参考点(G28,G29,G30)Tool selection and chang (Txx M06)刀具选择与改变(Txx M06)Feed selection and input (Fxx.xx,G94,G95)进给选择与输入(Fxx.xx,G94
40、,G95)Spindle speed selection and control (Sxxxx,M03,M04,M05)主轴速度选择与控制(Sxxxx,M03,M04,M05)(2)Compensation and Offset.补偿和偏移。The following commands are used to define work coordinate systems,perform tool diameter compensations,and compensate for tool length differences.下面的命令是用来定义工作坐标系统执行刀具直径补偿,和补偿刀具长度差异
41、。Wrok coordinate compensation(G54-G59)工作坐标补偿(G54-G59)Tool diameter (radius)compensation(G40,G41,G42)刀具直径(半径)补偿(G40,G41,G42)Tool length offset (G43,G44,G49)刀具长度补偿(G43,G44,G49)(3) Fixed Cycles.固定循环。These commands in the following three categories provide a method of executing a series of reptitive mac
42、hining operations with asingle code block.5以下三种类型的程序通过单段程序代码,以一系列重复加工操作提供了方法。Standard fixed cycles(G80-G89)标准固定补偿(G80-G89)Special fixed cycles特别固定补偿。User-defined fixed cycles用户定义固定补偿。(4) Macro and Subroutine Programming.宏和子程序编程。Modern NC controllers support basic computer programming syntax that inc
43、ludes defined variables,arithmetic operations ,and execution of logical decisions to define part geometry mathematically.现代数控控制器支持计算机编程的基本语法,包括定义的变量,算术运算,定义零件几何形状的数学逻辑决定的执行。(5) Advanced Programming Features.高级编程功能。These are generally considered to be user-defined controls.这些通常被认为是用户定义的控件。A simple ex
44、ample of G-code programming illustrates how NC programming codes are used.G代码编程的一个简单的例子说明如何使用数控编程代码。Example 3-1 例3-1Write a G code program to cut the path illustrated in Fig.3.1 with a cutter speed of 9 inches per minute(IPM)写一个G代码程序,消减了每分钟9英寸的刀速度(IPM)在图3.1所示的路径。Solution:解决方案:N05 G90 Absolute coordi
45、nate system.绝对坐标系N10 G00 X 1.0 Y1.0 Rapid mode move to A(1.0,1.0).快速模式移动(1.0,1.0)N15 G00 Y6.0 F9.0 Linear interpolation ,cut from A(1.0,1.0)to B(1.0,5.0)at a rate of 9 inches per minute.直线插补,从A(1.0,1.0)下调至B(1.0,1.5)在9英寸每分钟的速度。N20 X7.0 Cut to C(7.0,5.0)切到C(7.0,5.0).N25 X 1.0 Y1.0 Cut to A(1.0,1.0).切到
46、A(1.0,1.0) Note that some commands in the previous example remain in effect after they are used .请注意,前面的例子中的一些命令生效后继续使用它们。For example ,X1.0 did not have to be repeated in line N15 if the X distance did not change,and the Y distance was not needed in line N20 for the same reason.例如,X1.0没有重复N15的路线,如果没
47、有改变的X距离,Y的距离同样的原因也不需要在N20的路线Also the feed rate was not repeated for lines N20 and N25 because no change in the cutting rate was desired.进给率不重复行N20和N25,因为所需的切割率没有变化。Manual Versus Automated Programming手动对自动变成 Programming of Ncmachines takes two forms: manual programming and code generation with the su
48、pprot of CAM sofware. NC机械编程采用两种形式:人工编程以及在CAM软件支持下的代码生成。Example 3-1 is an example of manual programming . 例3-1是一个人工编程的例子。 Starting with a cutting tool over the desired path. 它以铣削零件图为开始,编程者设计一些能够驱动切削刀具沿着预期路径运行的G代码工序。CAM-generated NC code uses a postprocessor for the target machining tool to convert the drawing of the part directly to the G-code program that will run on the machine selected. CAM生成的NC代码为了使目标机械工具能够直接转换为零件图送给G代码程序运行在已选择的机械上,从而使用一个后处理程序。The CAM software and postprocessros fell into two catagories . CAM软件和后处理程序分成两类。One type,Ma
©2010-2024 宁波自信网络信息技术有限公司 版权所有
客服电话:4008-655-100 投诉/维权电话:4009-655-100