收藏 分销(赏)

开源数控用户基础手册.doc

上传人:快乐****生活 文档编号:2951716 上传时间:2024-06-11 格式:DOC 页数:81 大小:233.04KB 下载积分:16 金币
下载 相关 举报
开源数控用户基础手册.doc_第1页
第1页 / 共81页
开源数控用户基础手册.doc_第2页
第2页 / 共81页


点击查看更多>>
资源描述
开源数控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代码设计产品有个棱角时候,轨迹规划器有几种不同轨迹规划方式解决这个棱角:例如可以减速并停在棱角所处坐标位置,然后再按照新方向加速并离开棱角;它还可以采用混合模式(blending):在通过棱角时保持进给速度,由于机床特性方面限制,这样做成果必然在棱角处产生一种圆角。因而在棱角处途径跟随就存在这样一种状况:要获得更好途径跟随效果就必要减速,要保持速度,就必然导致差一点途径跟随效果。详细如何抉择,要由程序员依照详细产品、材料、刀具等状
展开阅读全文

开通  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 

客服