收藏 分销(赏)

开源数控用户手册.doc

上传人:精*** 文档编号:3550349 上传时间:2024-07-09 格式:DOC 页数:95 大小:236.04KB 下载积分:20 金币
下载 相关 举报
开源数控用户手册.doc_第1页
第1页 / 共95页
开源数控用户手册.doc_第2页
第2页 / 共95页


点击查看更多>>
资源描述
开源数控EMC2用户手册 第 1 章  前言 Foreword EMC2 is modular and flexible. These attributes lead many to see it as a confusing jumble of little things and wonder why it is the way it is. This page attempts to answer that question before you get into the thick of things.     EMC2是模块化设计的,柔性很强。很多人都觉得它是由一些令人迷惑的小东西堆叠而成,很奇怪它是如何做到的。那么在进入实质内容以前,让我们一方面试图回答这个问题。 EMC started at the National Institute of Standards and Technology in the USA. It grew up using Unix as it’s operating system. Unix made it different. Among early Unix developers there grew a set of code writing ideas that some call the Unix way. These early EMC authors followed those ways.     EMC项目起源于NIST(美国国家标准与技术研究院)。它起初是在Unix操作系统下运营的,这使它与众不同。初期Unix开发者规定了一些代码编写的原则或方法,称为Unix编程方法(Unix way),EMC项目的作者们遵循了这些方法。 Eric S. Raymond, in his book The Art of Unix Programming, summarizes the Unix philosophy as the widely-used engineering philosophy, "Keep it Simple, Stupid" (KISS Principle). He then describes how he believes this overall philosophy is applied as a cultural Unix norm, although unsurprisingly it is not difficult to find severe violations of most of the following in actual Unix practice: * Rule of Modularity: Write simple parts connected by clean interfaces. * Rule of Clarity: Clarity is better than cleverness. * Rule of Composition: Design programs to be connected to other programs. * Rule of Separation: Separate policy from mechanism; separate interfaces from engines.     Eric S. Raymond在他的著作《The Art of Unix Programming》中把Unix的哲学上升为普遍合用的工程哲学,即“KISS原则”(Keep it Simple, Stupid)(保持简朴化、傻瓜化)。然后他描述了这个KISS原则和Unix规范之间的文化纽带,尽管他也明明知道在Unix的编程实践中找到违反这些规则的例子代码也是不困难和不令人惊奇的。     模块化原则:写出具有清楚接口的简朴模块。     简洁性原则:简洁比聪明更重要。     组合性原则:设计程序是为了和其它程序对接。     分离性原则:把策略从机制中分离出来,把接口从上分离出来。(译者注:这句太难懂了,个人理解:从面向对象的角度说,就是把解决问题的方法和问题自身分离,也就是方法和数据分离;然后把接口从方法中分离出来。) Mr Raymond offered several more rules but these four describe essential characteristics of the EMC2 motion control system.     Raymond先生还提出了一些其它的原则,但这四个原则就是EMC2运动控制系统最重要的特性。 The Modularity rule is critical. Throughout these handbooks you will find talk of the interpreter or task planner or motion or HAL. Each of these is a module or collection of modules. It’s modularity that allows you to connect together just the parts you need to run your machine.     模块化原则是最关键的原则。纵观EMC2系列手册,你会发现无论是G代码解释器、任务规划器、运动控制器,还是硬件抽象层(HAL),它们都是模块或模块的集合。模块化使你能把需要的功能集成起来构成一个系统,而不需要的部分则可以去掉。 The Clarity rule is essential. EMC2 is a work in progress – it is not finished nor will it ever be. It is complete enough to run most of the machines we want it to run. Much of that progress is achieved because many users and code developers are able to look at the work of others and build on what they have done.     简洁性原则是最重要的原则。EMC2项目已经可以在很多机器系统上运营,但它仍然是一个正在进行的项目,它永远也不会停止。EMC2的成功归功于许多用户以及代码开发人员。由于遵守了简洁性编程的原则,人们才可以互相看到彼此的工作,并很容易的理解代码以及为其添加新的内容。 The Composition rule allows us to build a predictable control system from the many modules available by making them connectable. We achieve connectability by setting up standard interfaces to sets of modules and following those standards.     组合性原则促使开发人员为模块提供可连接性,这样使用人员就可以从许多模块中只选择他们需要的模块来构成目的系统。EMC2的组合性是通过标准的接口以及符合该接口标准的模块实现的。 The Separation rule requires that we make distinct parts that do little things. By separating functions debugging is much easier and replacement modules can be dropped into the system and comparisons easily made.     分离性原则规定开发人员尽量分解系统功能,并用不同的部件实现它们。这么做的好处一是便于调试,二是可以方便的比较同一功能的不同实现(由于它们有相同的接口,可以很容易的组合进系统中进行测试)。 What does the Unix way mean for you as a user of EMC2. It means that you are able to make choices about how you will use the system. Many of these choices are a part of machine integration, but many also affect the way you will use your machine. As you read you will find many places where you will need to make comparisons. Eventually you will make choices, "I’ll use this interface rather than that” or, “I’ll write part offsets this way rather than that way." Throughout these handbooks we describe the range of abilities currently available.     那么Unix规范对于使用者又意味着什么呢?它意味着你可以选择如何配置EMC2系统的功能以适应你的数控系统,也就是说配置EMC2系统是设计数控机床工作的一部分。同时EMC2的某些功能或配置又反过来影响你设计数控机床的方法和过程。在阅读系列手册的过程中,你会一边看一边比较,最后你也许说:“我将使用这个接口而不使用那个接口”,或者“我将这样使用部件偏移而不会那样使用”。继续看下去吧,在系列手册中,我们将讨论所有这些功能和配置。 As you begin your journey into using EMC2 we offer two cautionary notes:2 Praphrasing the words of Doug Gwyn on UNIX: "emc2 was not designed to stop its users from doing stupid things, as that would also stop them from doing clever things." Likewise the words of Steven King: "emc2 is user-friendly. It just isn’t promiscuous about which users it’s friendly with."     在你继续阅读之前,我们提供两条注意事项: EMC2不会防止它的使用者干傻事,由于那会同样防止它的使用者干聪明的事。 EMC2肯定是用户和谐的,只但是它在对哪个用户和谐的问题上,用情比较专一而已。 第 2 章  EMC2 The Enhanced Machine Control   2.1  关于本手册 The focus of this manual is on using EMC. It is intended to be used once EMC is installed and configured. For standard installations see the Getting Started Guide for step by step instructions to get you up and going. For detailed information on installation and configuration of EMC see the Integrator Manual.     本手册的焦点是如何使用EMC2 。当EMC2安装并配置完毕后应当阅读本手册。关于简易安装EMC2的问题,请参见入门手册“Getting Started Guide”。关于安装和配置的具体信息,请参见综合手册“Integrator Manual”。   2.2  EMC2如何工作 The Enhanced Machine Controller (EMC2) is a lot more than just another CNC mill program. It can control machine tools, robots, or other automated devices. It can control servo motors, stepper motors, relays, and other devices related to machine tools. There are four main components to the EMC2 software: a motion controller, a discrete I/O controller, a task executor which coordinates them, and graphical user interfaces. In addition there is a layer called HAL (Hardware Abstraction Layer) which allows configuration of EMC2 without the need of recompiling.     可不敢把EMC2想象成此外一个CNC数控加工程序,它能做的可多了。它可以控制机床、机器人、自动化设备,还能控制伺服电机、步进电机、继电器以及其它机床电器。     EMC2由四个重要部分:运动控制器、离散IO控制器、任务执行器(用来协调这四个部件)、图形用户界面。此外尚有一个硬件抽象层HAL(Hardware Abstraction Layer),有了HAL,无需重新编译EMC2,就可以按照实际需要配置EMC2的硬件。 Figure 2.1 shows a simple block diagram showing what a typical 3-axis EMC2 system might look like. This diagram shows a stepper motor system. The PC, running Linux as its operating system, is actually controlling the stepper motor drives by sending signals through the printer port. These signals (pulses) make the stepper drives move the stepper motors. The EMC2 can also run servo motors via servo interface cards or by using an extended parallel port to connect with external control boards. As we examine each of the components that make up an EMC2 system we will remind the reader of this typical machine.     图2.1(参见英文原版图片)的方框图展示了一个典型的3轴数控系统看起来的样子。这是一个步进电机系统。PC机上运营着Linux操作系统和EMC2程序,控制信号则从打印口(并口)传送到电机驱动器上,电机驱动器根据控制信号驱动步进电机(当然EMC2也可以通过伺服接口卡或使用与扩展并口相连的外部控制卡来控制伺服电机)。我们接下来会介绍EMC2系统的每一个组成部分,在介绍的过程中也许会反复提到这幅图片。   2.3  用户接口 A user interface is the part of the EMC2 that the machine tool operator interacts with. The EMC2 comes with several types of user interfaces: AXIS an OpenGL-based GUI (Graphical User Interface), with an interactive G-Code previewer. This interface is one of the few that are still under active development and improvement. Keystick a character-based screen graphics program suitable for minimal installations (without the X server running). Xemc an X Windows program two Tcl/Tk-based GUIs named TkEMC and Mini a HAL based user interface called halui, which allows to control emc2 using knobs and switches a telnet based user interface called emcrsh, which allows commands to be sent to emc2 from remote computers     用户接口是EMC2的一部分,机床操作员与这个接口交互从而达成操作机床的目的。EMC2提供了几种不同的用户接口供用户选择使用:     AXIS 界面:是一个基于“OpenGL”的图形用户界面,有一个交互式的G代码预览器。AXIS界面目前仍然处在连续开发升级的过程中。     Keystick界面:是一个基于字符的界面,没有图形,只但是字符排列有规律,看起来像图形同样。只能用键盘操作。假如目的系统没有X server,还想使用EMC2的话,就只能用这个将就了。     Xemc界面:一个X Windows的图形用户界面。     TkEMC界面和Mini界面:两个基于“Tcl/Tk”的图形用户界面。     halui用户接口:基于HAL的用户接口,允许使用开关、旋钮控制EMC2系统。     emcrsh用户接口:基于telnet的用户接口,允许用远程计算机发来的命令控制EMC2系统。 2.4  语言 EMC2 uses translation files to translate EMC User Interfaces into many languages. You just need to log in with the language you intend to use and when you start up EMC it comes up in that language. If your language has not been translated contact a developer on the IRC or the mailing list if you can assist in the translation.     EMC2使用翻译文献把用户接口翻译成多种语言。你只需用你想使用的语言登录进操作系统,然后当你启动EMC2时,你看到的界面就已经采用你想使用的语言了。假如你想使用的语言还没有被翻译,而你恰好想帮忙翻译,可以通过“IRC”或邮件列表的方式与开发人员取得联系。 2.5  像机床操作员同样思考 This book will not even pretend that it can teach you to run a mill or a lathe. Becoming a machinist takes time and hard work. An author once said, "We learn from experience, if at all." Broken tools, gouged vices, and scars are the evidence of lessons taught. Good part finish, close tolerances, and careful work are the evidence of lessons learned. No machine, no computer program, can take the place of human experience. As you begin to work with the EMC2 program, you will need to place yourself in the position of operator. You need to think of yourself in the role of the one in charge of a machine. It is a machine that is either waiting for your command or executing the command that you have just given it. Throughout these pages we will give information that will help you become a good operator of the EMC2 mill. You will need some information right up front here so that the following pages will make sense to you.     本书不能教你如何开动一台铣床或车床,成为这方面的专家需要时间和艰苦的努力。有位作家曾经说过:“假如我们学到了什么,那一定是在亲身经历中学到的”。破损的刀具、凿坏的工装、伤痕累累的产品是我们得到的教训,完美的收刀、精密的加工、精细的产品是我们得到的经验。没有任何机床、计算机软件能取代人的阅历 和经验。     现在要和EMC2一起工作了,你需要把自己放到机床操作员的位置,要知道是你主宰着机床,而机床就在等待你的命令,执行你的命令。当然通过学习系列手册,你会得到一些信息,它们将帮助你成为一名好的EMC2铣床操作员。在继续之前,你也许需要一些基本信息,接下来的一些篇幅将帮助你找找感觉。 2.6  操作方式 Modes of Operation When an EMC2 is running, there are three different major modes used for inputting commands. These are Manual, Auto, and MDI. Changing from one mode to another makes a big difference in the way that the EMC2 behaves. There are specific things that can be done in one mode that can not be done in another. An operator can home an axis in manual mode but not in auto or MDI modes. An operator can cause the machine to execute a whole file full of G-codes in the auto mode but not in manual or MDI.     当一个EMC2系统运营时,输入命令的方式重要有三种:手动、自动、MDI。在这三种方式下,EMC2 的行为表现差异很大。有些事情在一种方式下可以,在另一种方式下却不可以。比如在手动方式时,操作员可以原点复归某个轴,但在自动和MDI方式下却不行。又比如在自动方式下,操作员可以执行一个所有是G代码的文献,但在手动和MDI方式下却不行。 In manual mode, each command is entered separately. In human terms a manual command might be "turn on coolant" or "jog X at 25 inches per minute". These are roughly equivalent to flipping a switch or turning the hand wheel for an axis. These commands are normally handled on one of the graphical interfaces by pressing a button with the mouse or holding down a key on the keyboard. In auto mode, a similar button or key press might be used to load or start the running of a whole program of G-code that is stored in a file. In the MDI mode the operator might type in a block of code and tell the machine to execute it by pressing the <return> or <enter> key on the keyboard.     在手动方式下,每个命令是分开输入的,用人类的语言讲,这些命令类似于“启动冷却”或者“在X轴上每分钟前进25英寸”等等,它们大体相称于拨动一个开关或者转动某个轴上的手轮,具体操作则是在某个图形用户界面上用鼠标点击某个按钮或按住键盘上的某个按键完毕的。在自动方式下,点击一个按钮就可以装载或启动预先存储在某个文献里面的所有G代码程序。在MDI方式下,操作员可以键入一批代码,然后按回车键命令机床执行。 Some motion control commands are available and will cause the same changes in motion in all modes. These include ABORT, ESTOP, and FEED RATE OVERRIDE. Commands like these should be self explanatory. The AXIS user interface hides some of the distinctions between Auto and the other modes by making Auto-commands available at most times. It also blurs the distinction between Manual and MDI because some Manual commands like Touch Off are actually implemented by sending MDI commands. It does this by automatically changing to the mode that is needed for the action the user has requested.     有些运动控制命令在所有操作方式下均可使用,效果也相同。涉及ABORT、 ESTOP、FEED RATE OVERRIDE等。这些命令都具有自解释的特点。     AXIS用户界面有一个特点,就是它隐藏了一些如上所述的三种操作方式的区别。它在大部分情况下都能提供自动命令,从而隐藏了自动方式和其它两种方式的区别;它也淡化了手动方式和MDI方式的区别,像“Touch Off”这种手动命令也可以通过发送MDI命令来执行。在用户提出请求时,它会自动切换到相应的操作方式,从而实现这种隐藏,而用户在感觉上没有什么异常。 第 3 章  用户概念 User Concepts This chapter covers important user concepts that should be understood before attempting to run a CNC machine with g code.     本章包含重要的用户概念,在使用G代码运营一个CNC机床之前,应当理解本章的概念。 3.1  轨迹控制 Trajectory Control 3.1.1  轨迹规划 Trajectory Planning Trajectory planning, in general, is the means by which EMC follows the path specified by your G Code program, while still operating within the limits of your machinery. A G Code program can never be fully obeyed. For example imagine you specify as a single-line program the following move: G1 X1 F10 (G1 is linear move, X1 is the destination, F10 is the speed) In reality, the whole move can’t be made at F10, since the machine must accelerate from a stop, move toward X=1, and then decelerate to stop again. Sometimes part of the move is done at F10, but for many moves, especially short ones, the specified feed rate is never reached at all. Having short moves in your G Code can cause your machine to slow down and speed up for the longer moves if the "naive cam detector" is not employed with G64 Pn. The basic acceleration and deceleration described above is not complex and there is no compromise to be made. In the INI file the specified machine constraints such as maximum axis velocity and axis acceleration must be obeyed by the trajectory planner.     轨迹规划是指EMC2跟踪G代码所指定途径的方法,轨迹规划时不能超过机床工作台的运营范围。从某种限度讲,G代码程序永远不能被机床严格执行。就比如下面这一行程序:     G1 X1 F10 (G1 表达线性移动, X1 是目的位置, F10 代表速度)     事实上,这个动作不也许完全以F10的速度完毕,由于机床必须从静止开始加速,向 X=1的位置进发,在要到达目的位置之前还要减速最后停止。这样就只有部分运动是以F10完毕的,假如路程比较短,也许 F10这个速度主线就不会达成。在“G64 Pn”的方式下,假如不指定“ naive cam detector”参数即“Q-”参数,则采用短运动段会让机床运营变慢,采用长运动段可以让机床运营的快一点。     机床加速性能和减速性能取决于机床自身,经实验拟定以后,作为机床的特性固定下来,没什么要讨论的。此外机床最大速度也是机床的一个特性。这些特性参数都保存在INI文献中,轨迹规划器必须遵守这些特性。 3.1.2  途径跟随 Path Following A less straightforward problem is that of path following. When you program a corner in G Code, the trajectory planner can do several things, all of which are right in some cases: it can decelerate to a stop exactly at the coordinates of the corner, and then accelerate in the new direction. It can also do what is called blending, which is to keep the feed rate up while going through the corner, making it necessary to round the corner off in order to obey machine constraints. You can see that there is a trade off here: you can slow down to get better path following, or keep the speed up and have worse path following. Depending on the particular cut, the material, the tooling, etc., the programmer may want to compromise differently. Rapid moves also obey the current trajectory control. With moves long enough to reach maximum velocity on a machine with low acceleration and no path tolerance specified, you can get a fairly round corner.     途径跟随的问题要稍微简朴一些。当你用 G代码设计的产品有个棱角的时候,轨迹规
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传

当前位置:首页 > 包罗万象 > 大杂烩

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服