搜索
bottom↓
回复: 4

常用G 码的功能简介 【恢复】

[复制链接]

出0入20汤圆

发表于 2009-1-12 11:16:35 | 显示全部楼层 |阅读模式
G0 rapid positioning 



G1 linear interpolation 



G2 circular (clockwise XY Plane Only) 



G3 circular (counterclockwise XY Plane Only) 



G4 Dwell 



G10 coordinate system origin setting 



G17 xy plane selection 



G20 inch system selection 



G21 millimeter system selection 



G40 cancel cutter diameter compensation 



G41 start cutter diameter compensation left 



G42 start cutter diameter compensation right 



G43 tool length offset (plus) 



G49 cancel tool length offset 



G53 motion in machine coordinate system 



G54 use preset work coordinate system 1 



G55 use preset work coordinate system 2 



G56 use preset work coordinate system 3 



G57 use preset work coordinate system 4 



G80 cancel motion mode (including any canned cycle) 



G81 drilling canned cycle 



G83 chip-breaking drilling canned cycle 



G85 boring, no dwell, feed out canned cycle 



G86 boring, spindle stop, rapid out canned cycle 



G87 back boring canned cycle 



G88 boring, spindle stop, manual out canned cycle 



G90 absolute distance mode 



G91 incremental distance mode 



G92 offset coordinate systems 



G92.2 cancel offset coordinate systems 



G93 inverse time feed mode 



G94 feed per minute mode 



G98 initial level return in canned cycles 



G99 R-point level return in canned cycles 



M0 program stop 



M1 optional program stop 



M2 program end 



M3 Spindle on Clockwise 



M4 Spindle on Counter Clockwise 



M5 Spindle Off 



M6 tool change 



M7 Mist Coolant On 



M8 Flood Coolant On 



M9 Coolant Off 





It is not my intention to explain in detail the above codes, but hopefully I can give you enough information to get you over the initial stages of manually editing the g-code (.dnc) files that Deskcnc uses in its machining process. There is plenty of detailed information available on the Internet or elsewhere, and the best way for you to learn is by experimenting in altering your existing code or producing new. 



A common way of producing g-codes within Deskcnc is by inputting a dxf or other drawing file. The resulting codes may need editing, in particular if you have appended a number of files, so it is essential that you have at least a basic understanding of g-codes. 



Each line of code is to be considered as a block. This block contains at least one letter followed by a numeric field which refers to the value to be assigned to that letter or function. Comments can be added and are enclosed in brackets. You can relatively easily write correctly formatted g-codes, or edit existing g- codes with a standard ASCII text editor, such as windows notepad. 





Spaces or tabs are ignored, but their use increases readability. Blank lines are also ignored. The code is case insensitive, upper or lower case characters are translated the same. If you append a number of files, you will find that the machining stops when it hits the first M2, so you will probably want to delete these from the files, (leave the last one, however) and possible the preceding and following G0 x0 y0 z0 blocks or whatever. 





Line numbers begin with an N. Within deskcnc this line number is not referred to or otherwise used, but it helps you to trace errors or edit the code, or track the machining process (Note that the line highlighted in the small edit window at the bottom of the machine screen is not the line being machined at the moment.) 





Many codes are modal, that means they are active until they are changed, even outside of their block. For example the line of code g01 Z-5.00 will set the z axis to -5.00. Subsequent moves such as g01 x5 y25.44 will move the cutter from where it was to x5, y25.44 at a depth of 5.00. (It is usual to set the top surface of the workpiece as Z0, thus any cutting into the work will be given by negative Z values.) 





The feed rate is also modal, and like other commands it applies to its current block and subsequent ones. Thus G01 x5.0 f150 will move the cutter at a speed of 150 to a new position at x5.0 subsequent g01 moves will be at the same speed, until another 'f' value is entered. Feed rate does not apply to G00 moves, of course. 





For circular moves, G2 and G3, as well as the X,Y end of arc coordinates there will either be an I and J value, or an R value. The example below demonstrates this use. I, J is the distance from the start of the arc to the centre, or R is the radius. 



N10 G00 z2.00 



N20 G00 x20 y20 



N30 G01 z-5 f200 



N40 G02 x30 y10 I0 J-10 f300 



N50 G00 z2.00 



This will move the cutter above the work surface, then go to x20, y20 at rapid speed, then feed down at a rate of 200, cut a clockwise arc of radius 10 ( centred on x20,y10) to a position x30,y10 at a feed rate of 300 then raise the cutter to clear the work piece again. The line N40 could also be written as N40 G02 x30 y10 r10 f300. 





M6 will normally stop the machine to allow a tool change. You can write your own macro code to move the tool to the appropriate position, (see the software help documentation). The results of M commands for coolant are brought out to terminals on the controller board, and you can use relays or whatever to switch coolant on or off, or use these commands to control other functions. 





The modal drilling canned cycle is entered in the form 



G81 x10 y10 z-15 r-10 f75 



X20 y20 



X30 y30 



G80 



G00 z2 





This will drill three holes, at x10,y10 x20,y20 x30,y30 to a depth of 15. The r value is the start depth of drilling, so the above code would apply to a surface which had already been milled out to a depth of more than 10 (assuming surface was at z0.) The feed rate (75) will only apply to the drill macro, and the machine will revert to the previously feed rate setting after the holes have been drilled 





G83 is the chip breaking version, it will withdraw the drill to clear swarf, and is useful for deep holes. The code looks like 



G83 x10 y10 z-25 r1 q4 f75 



This is similar to code G81, except it will withdraw the cutter every 4 units of drilling, i.e. It will go to x10,y10,z1 then go to z-3, withdraw, go to z-6, withdraw, go to z-10, withdraw, and so on. This is often referred to as 'pecking', for obvious birdlike reasons. 





Remember to cancel the canned cycles with code G80. 





It is suggested that you experiment with the codes that you are likely to use, so that you gain a full understanding of how your machine behaves. It is simple to write fragments of code, or alter existing code with the editor, in the machine mode, and immediately test the effect by running the code. The results can be seen on screen, provided the controller board is powered up, you need waste no material in testing. 

阿莫论坛20周年了!感谢大家的支持与爱护!!

一只鸟敢站在脆弱的枝条上歇脚,它依仗的不是枝条不会断,而是自己有翅膀,会飞。

出330入0汤圆

发表于 2009-1-24 15:47:51 | 显示全部楼层
备用

出0入0汤圆

发表于 2009-1-12 16:00:48 | 显示全部楼层
点击此处下载 ourdev_583664.doc(文件大小:76K) (原文件名:G指令表.doc) 

出0入0汤圆

发表于 2009-1-12 11:54:39 | 显示全部楼层
G0快速定位 



 G1期线性插值 



 G2期圆(顺时针只有XY平面) 



 G3的通知(逆时针XY平面只有) 



 G4的停留 



 G10设置坐标系统 



G17 XY平面选择 



G 20英寸的制度选择 



G 21毫米系统的选择 



 G40取消刀具直径补偿 



 G41开始刀具直径补偿左 



 G42开始刀具直径补偿的权利 



 G43刀具长度抵消(加) 



 G49取消刀具长度偏移 



 G53运动的机床坐标系统 



 G54使用预设的工作坐标系1 



 G55使用预设的工作坐标系2 



 G56使用预设的工作坐标系3 



 G57使用预设的工作坐标系4 



 G80取消运动模式(包括任何罐头周期) 



 G81钻井周期罐头 



 G83芯片打破钻井周期罐头 



 G85乏味,没有详谈,饲料的罐头周期 



 G86镗,主轴停止,快速出罐头周期 



 G87回到无聊罐头周期 



 G88镗,主轴停止,手动了罐头周期 



 G90绝对距离模式 



 G91增量距离模式 



 G92偏移坐标系 



 G92.2取消抵消坐标系统 



 G93逆时间饲料模式 



 G94饲料每分钟模式 



 G98最初一级返回罐头周期 



 G99的R -点返回罐头周期 



 M0程序停止 



 货币供应量M1可选程序停止 



 平方米程序结束 



 M3的主轴顺时针 



 M4货币供应主轴反顺时针 



 M5型主轴关闭 



 M6换刀 



 M7型喷雾冷却论 



 M8公路防汛冷却论 



 M9冷却关 





 我不打算详细解释上述代码,但我希望我可以给你足够的信息来获取你的最初阶段,手动编辑的G -代码( 。 DNC系统)档案Deskcnc使用在其加工过程。有大量的详细资料,可在因特网上或其它地方,最好的方法,可以让你学习是尝试在改变您现有的代码或生产新。 



 一种常见方式生产国守则内Deskcnc是输入DXF文件或其它绘图文件。由此产生的代码可能需要修改,特别是如果你有附加了一些文件,因此重要的是,你至少有一个基本的了解的G -代码。 



 每一行的代码是被看作是一个块。此块包含至少一个字母随后数值字段指的是价值分配给该信或功能。评论可说是括号中。您可以相对容易写格式正确克码,或修改现有的代码与标准ASCII文本编辑器,如Windows记事本。 





 空格或制表符将被忽略,但它们的使用增加可读性。空白行也不容忽视。代码是区分大小写,大写或小写字符翻译相同的。如果您添加了一些文件,你会发现,当加工站它的第一支安打平方米,所以你可能要删除这些的文件, (最后一个离开,但是)和可能的之前和之后G0 x0 y0 z0块或者别的什么东西。 





 行号开始的联合国在deskcnc这个电话号码没有提到或以其它方式使用,但它可以帮助你追踪错误或修改的代码,或跟踪加工过程(请注意,行中所强调的小编辑窗口底部的机器屏幕没有被加工线的时刻。 ) 





 许多代码模式,这意味着他们是积极的,直到他们的改变,甚至外面的区块。例如,代码行g01的Z - 5.00将Z轴为-5.00 。更强举措,如将g01 X5的y25.44移动刀从那里是X5的, y25.44深度为5.00 。 (通常设置顶部表面的工件作为Z0 ,从而任何切割的工作将给予负Z值。 ) 





 进给速度也模态,并像其它命令,它适用于当前块和其后。因此G01 x5.0 f150将刀具时速150到一个新的阵地,随后g01举动x5.0将在同样的速度,直到另一个'氟值是进入。饲料率并不适用于G00举动,当然。 





 循环移动, G2和G3 ,以及X和Y坐标弧年底将可能成为一个I和J值,或是一个R值。下面的例子说明了这一点使用。一, J是距离从一开始的弧的中心,或R是半径。 



 N10 G00 z2.00 



 N20 G00 x20 y20 



 N30 G01得5 f200 



 N40 G02 X30系列y10可达的J - 10 f300 



 N50 G00 z2.00 



 这将推动上述刀具的工作表面上,然后转到x20 , y20在较快的速度,那么饲料的下降率为200 ,减少顺时针圆弧半径10 (集中于x20 , y10 )的立场X30系列, y10在饲料率300然后提高刀具以清除工件一次。行N40也可以写成N40 G02 X30系列y10 R10赛车f300 。 





 M6 ,通常会停止机器,让一个工具的变化。您可以编写自己的宏代码的工具,移动到适当的位置, (见软件帮助文件) 。结果的M命令冷却带来了终端的控制器电路板,你可以使用继电器或任何切换冷却或关闭,或使用这些命令,控制其它职能。 





 模态钻井周期进入罐头的形式 



 G81 x10 y10得15的R - 10 F75相机 



 X20 y20 



 X30系列y30 



 G80 



 G00 z2 





 这将演练三洞,在x10 , y10 x20 , y20 X30系列, y30深度为15 。 R值是开始钻探深度 , 因此上述代码将适用于表面已经碾碎了深度超过10 (假设表面上z0 。 )进给速度( 75 )将只适用于宏观调控的深入,以及机器将恢复到以前进给速度设定后,孔已钻 





 G83是断屑版本,它将撤回演习以清除切屑,而且是有益的深洞。代码看起来像 



 G83 x10 y10得25受体1季度F75相机 



 这是类似的代码G81 ,但它将撤回刀每4台钻机,即它将去x10 , y10 , z1然后去到Z - 3 ,撤销,请至Z - 6 ,撤销,请至Z - 10 ,撤销,等等。这是通常被称为'啄'很明显,鸟类的原因。 





 请记住取消罐头周期与代码G80 。 





 建议您尝试的守则,你很可能会使用,让您充分认识如何您的机器的行为。这是简单的写片段的代码,或更改现有代码编辑器,在机器模式,并立即生效的测试运行代码。结果可以看到屏幕上,提供了控制器供电局了,你需要的材料中没有废物测试。 

出0入0汤圆

发表于 2009-1-12 11:52:01 | 显示全部楼层
看的头都大了,有谁翻译一下?
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-5-14 19:22

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表