GRBL v1.1版本命令说明

这次翻译了一下Grbl的命令wiki说明,内容比较多,如果有什么错误的地方,请在下方留言,欢迎相互交流学习

Grbl v1.1 command

Source websit: https://github.com/gnea/grbl/wiki/Grbl-v1.1-Commands

 

       Pleasehelp us keep this page maintained! If you spot a problem, feel free to updateit or notify us.

       请帮助我们保持这个页面,如果您发现问题,请随时更新或通知我们。

 

       Grblv1.1 Commands

       In general, Grbl assumes allcharacters and streaming data sent to it is g-code and will parse and try toexecute it as soon as it can. However, Grbl also has two separate systemcommand types that are outside of the normal g-code streaming. One systemcommand type is streamed to Grbl like g-code, but starts with a $ character totell Grbl it's not g-code. The other is composed of a special set of charactersthat will immediately command Grbl to do a task in real-time. It's not part ofthe g-code stream. Grbl's system commands do things like control machine state,report saved parameters or what Grbl is doing, save or print machine settings,run a homing cycle, or make the machine move faster or slower than programmed.This document describes these "internal" system Grbl commands, whatthey do, how they work, and how to use them.

       通常来说,Grbl会认为所有的字符和发送给它的数据都是G-code,只要是就会分析和解析它,Grbl也有两个独立的系统命令类型是正常的指令流外。有一类动态的系统命令很像发送给Grbl的G代码,但是从一个$字符告诉Grbl这个不是G-code,另一个是由一个特殊的静态字符集,是一种立即的命令来来让Grbl完成实时任务。这不是G代码流的一部分。Grbl系统命令可以做一些事情,比如,查询系统状态,报告保存的参数或给Grbl执行,保存或打印设置,返回原点开始,或使机器移动的比默认的更快或更慢。本文档描述了这些“内部”的系统方法的命令,他们做什么,他们如何工作,以及如何使用它们。

 

       Getting Started

       开始部分

First, connectto Grbl using the serial terminal of your choice.

首先使用串口设备连接Grbl

Set the baudrate to 115200as 8-N-1 (8-bits, no parity, and 1-stop bit.)

设置波特率为115200和8位,没有校验位,1个停止位

Once connectedyou should get the Grbl-prompt, which looks like this:

一旦连接上之后Grbl提示你以下信息

Grbl 1.1e ['$' for help]

Type $ and pressenter to have Grbl print a help message. You should not see any local echo ofthe $ and enter. Grbl should respond with:

输入$并按下,Grbl会打印出帮助信息给你,Grbl不会给你回复$,Grbl会回答你其他的信息,如下所示

[HLP:$$ $# $G $I $N $x=val $Nx=line $J=line$SLP $C $X $H ~ ! ? ctrl-x]

The ‘$’-commandsare Grbl system commands used to tweak the settings, view or change Grbl'sstates and running modes, and start a homing cycle. The last four non-'$'commands are realtime control commands that can be sent at anytime, no matterwhat Grbl is doing. These either immediately change Grbl's running behavior orimmediately print a report of the important realtime data like current position(aka DRO). There are over a dozen more realtime control commands, but they arenot user type-able. See realtime command section for details.

‘$’命令是Grbl的系统命令用来调整设置,查看或修改Grbl的状态和运行模式, 最后的四个非'$'命令是实时控制命令可以在任何时候发送在,无论Grbl在做什么。这些可以立即改变Grbl的运行或者立即打印的重要的实时数据,如当前位置(又名DRO)。还有几十个控制命令,但它们不是用户类型的。有关详细信息,请参见实时命令部分。

Grbl '$'Commands

Grbl的’$’命令

The $ system commands provide additional controls forthe user, such as printing feedback on the current G-code parser modal state orrunning the homing cycle. This section explains what these commands are and howto use them.

$系统命令为用户提供额外的控件,比如打印当前G代码模块的状态反馈,或者执行原点回归运动。本节解释这些命令是什么以及如何使用它们。

 

$$and $x=val -View and write Grbl settings

$$和$x=值-查看和修改Grbl的设定

See Grbl v1.1Configuration for more details on how to view and write setting andlearn what they are.

查看Grbl v1.1 Configuration可以知道详细资料,包括如何去查看和修改设定以及老姐这些是设定是什么意思

 

$# -View gcode parameters

$#-查看g代码参数

G-codeparameters store the coordinate offset values for G54-G59 work coordinates,G28/G30 pre-defined positions, G92 coordinate offset, tool length offsets, andprobing (not officially, but we added here anyway). Most of these parametersare directly written to EEPROM anytime they are changed and are persistent.Meaning that they will remain the same, regardless of power-down, until theyare explicitly changed. The non-persistent parameters, which will are notretained when reset or power-cycled, are G92, G43.1 tool length offsets, andthe G38.2 probing data.

G代码参数存储坐标偏移值在G54-G59工作坐标中,G28/G30是预定义位置,G92设定坐标偏移,工具长度偏移,和探测(不是正式的,但是我们还是添加了这个功能)。这些参数是可以一直随时更改写入到EEPROM中,这意味着这些参数即使断电也会保持一样,除非他们被明确被修改。有一些参数是不持续的,当电源关断和复位的时候它们不会保存,G92, G43.1 是刀具长度偏移 G38.2 是探测数据

G54-G59work coordinates can be changed via the G10 L2 Px or G10 L20 Px command defined by the NIST gcode standard andthe EMC2 (linuxcnc.org) standard. G28/G30 pre-defined positions can be changedvia the G28.1 and the G30.1 commands, respectively.

G54-G59工作坐标可以通过NIST G代码标准的G10 L2 Px或者EMC2标准的G10 L20 Px命令定义改变,G28/G30预定义坐标可以分别通过G28.1G30.2命令改变

When $# is called, Grbl will respond with the storedoffsets from machine coordinates for each system as follows. TLO denotes tool length offset (for the defaultz-axis), and PRB denotes the coordinates of the last probingcycle, where the suffix :1 denotes if the last probe was successful and :0 as not successful.

当输入$#Grbl将会回复储存的机器坐标偏差值如下,TLO表示刀具长度偏差(默认作用于z周),PRB表示最后探测的坐标,后缀部分:1.表示最后探测是成功的0.表示是不成功的

[G54:4.000,0.000,0.000]

[G55:4.000,6.000,7.000]

[G56:0.000,0.000,0.000]

[G57:0.000,0.000,0.000]

[G58:0.000,0.000,0.000]

[G59:0.000,0.000,0.000]

[G28:1.000,2.000,0.000]

[G30:4.000,6.000,0.000]

[G92:0.000,0.000,0.000]

[TLO:0.000]

[PRB:0.000,0.000,0.000:0]

 

$G - Viewgcode parser state

$G – 查看g代码解释器的状态

This command prints all of the active gcodemodes in Grbl's G-code parser. When sending this command to Grbl, it will replywith a message starting with an [GC: indicator like:

这个命令会打印除Grbl的G代码解释器中所有活动的G代码模块,当你发送这个命令给Grbl的时候,他会回答以下的信息:

[GC:G0 G54 G17 G21 G90 G94 M0 M5 M9 T0 S0.0F500.0]

These active modes determine how the nextG-code block or command will be interpreted by Grbl's G-code parser. For thosenew to G-code and CNC machining, modes sets the parser into a particular stateso you don't have to constantly tell the parser how to parse it. These modesare organized into sets called "modal groups" that cannot belogically active at the same time. For example, the units modal group setswhether your G-code program is interpreted in inches or in millimeters.

这些活动模块将决定Grbl的G代码解释器将要解析的下一个G代码模块,对于那些新的G代码和CNC数控机床,可以设置解析器进入特定的状态的模式,所以你不用经常的告诉解析器如何去解析这些代码,这些模式被组织成称为“模态组”的集合,它们在同一时间不能在逻辑上活动。举个例子,单位模块组会设置你的G代码命令程序是用英寸还是毫米来执行

A short list of the modal groups, supportedby Grbl, is shown below, but more complete and detailed descriptions can befound at LinuxCNC's website. The G-code commands in bold indicate the default modes uponpowering-up Grbl or resetting it.

我们列出了部分Grbl支持的模组,更多的完整的详细的细节描述在这里linuxCNC website,这些用粗体显示的G代码命令是表示上电或者重启恢复默认

Modal Group

Member Words

Motion Mode

G0, G1, G2, G3, G38.2, G38.3, G38.4, G38.5, G80

Coordinate System Select

G54, G55, G56, G57, G58, G59

Plane Select

G17, G18, G19

Distance Mode

G90, G91

Arc IJK Distance Mode

G91.1

Feed Rate Mode

G93, G94

Units Mode

G20, G21

Cutter Radius Compensation

G40

Tool Length Offset

G43.1, G49

Program Mode

M0, M1, M2, M30

Spindle State

M3, M4, M5

Coolant State

M7, M8, M9

In addition to the G-code parser modes, Grblwill report the active T tool number, S spindle speed, and F feed rate, whichall default to 0 upon a reset. For those that are curious, these don't quitefit into nice modal groups, but are just as important for determining theparser state.

       除了G代码解析模块,Grbl会当前活动的模块,T工具数,S主轴速度,F给进速率,在复位的时候他们恢复到默认0的数值,对于那些对此感兴趣的人来说会,这种模组不是很好,但是这些对于分析解析器的状态也是很重要的

Note that this list does not include the non-modalg-code commands group and they are not listed in the $G parser report, becausethey only affect the current line they are commanded in. For completeness, hereare the non-modal commands supported by Grbl:

注意:列表中不包括非模块的g代码命令并且它们不会在$G的解析报告中列出,因为它们只影响当前行的命令,为了保证完整型,下面列出了Grbl支持的非模块吗命令

Supported Non-Modal Commands

支持的非模块命令

G4, G10 L2, G10 L20, G28, G30, G28.1, G30.1, G53, G92, G92.1

 

$I - Viewbuild info

$I – 查看版本信息

This prints feedback to the user the Grblversion and source code build date. Optionally, $I can also store a shortstring to help identify which CNC machine you are communicating with, if youhave more than machine using Grbl. To set this string, send Grbl $I=xxx, wherexxx is your customization string that is less than 80 characters. This stringwill be saved as capitalized, white space removed, and can only containalpha-numeric characters. The next time you query Grbl with a $I view buildinfo, Grbl will print this string after the version and build date.

这条打印会反馈Grbl的版本信息和源码生成的信息,或者,如果你有多台机器使用Grbl,$I也储存短的字符串去帮助识别当当前与哪台CNC机器通信。如果你有多台机器使用Grbl,可以设置这个字符串,发送$I=xxx,其中xxx就是是你发送的字符串要少于80个字符,这个字符串将会被保存为大写,空格的地方会被删除,并且只包含希腊字符,下次你输入$I查询Grbl的构建信息,Grbl会在版本和构建信息的后面打印这个字符串

NOTE: Some OEMs may block access toover-writing the build info string so they can store product information andcodes there.

注意:有些OEM可能会阻止访问构建信息字符串以此来储存产品的信息和代码

 

$N - Viewstartup blocks

$N – 访问启动块

$Nx are the startup blocks that Grbl runsevery time you power on Grbl or reset Grbl. In other words, a startup block isa line of G-code that you can have Grbl auto-magically run to set your G-codemodal defaults, or anything else you need Grbl to do everytime you start upyour machine. Grbl can store two blocks of G-code as a system default.

$N 是一个启动块,当Grbl每次上电或者复位的时候运行,换句话说,这个启动块是一条用于Grbl自动运行用于设置Grbl默认模式的G代码,或者用于设置机器启动时你需要Grbl执行的任何事情,Grbl默认系统可以储存两块G代码

So, when connected to Grbl, type $N and thenenter. Grbl should respond with something short like:

所以,当你连接到Grbl输入$并按下回车时,Grbl会回答一下的内容

$N0=

$N1=

ok

Not much to go on, but this just means thatthere is no G-code block stored in line $N0 for Grbl to run upon startup. $N1is the next line to be run.

内容虽然不多,但这些非G代码模块表示的意思是$N0是Grbl启动后首先运行的,而$N1是之后要运行的下一行

 

$Nx=line -Save startup block

$Nx=line – 保存启动块

IMPORTANT: Bevery careful when storing any motion (G0/1,G2/3,G28/30) commands in the startupblocks. These motion commands will run everytime you reset or power up Grbl, soif you have an emergency situation and have to e-stop and reset, a startupblock move can and will likely make things worse quickly. Also, do not placeany commands that save data to EEPROM, such as G10/G28.1/G30.1. This will causeGrbl to constantly re-write this data upon every startup and reset, which willeventually wear out your Arduino's EEPROM

重要:当心,当你储存任何的运动命令(G0/1,G2/3,G28/30)再启动块时,这个运动命令将会在你启动Grbl后立刻执行,所以如果你遇到了紧急情况需要停止并重新启动的时候,这个启动块的动作可能会让事情变得更糟糕,同样的,不要输入存储命令的数据把数据存储到EEPROM中,比如G10G28.1/G30.1,这回导致Grbl在开机后经常重新写如数据到其中,这最终会磨损你的Arduino的EEPROM

Typical usagefor a startup block is simply to set your preferred modal states, such as G20inches mode, always default to a different work coordinate system, or, toprovide a way for a user to run some user-written unique feature that they needfor their crazy project.

启动块典型的用法比如说是设置你的首选状态模式,比如说G20英寸模式这些,将使用与默认模式不同的坐标系,或者为用户提供一种办法来运行他们特殊项目需要的特殊功能

To set a startup block, type $N0= followed bya valid G-code block and an enter. Grbl will run the block to check if it'svalid and then reply with an ok or an error: to tell you if it's successful orsomething went wrong. If there is an error, Grbl will not save it.

开始设置启动模块,输入$N0=有效的G代码并回车,Grbl会运行这个代码块并检查这个代码是否是有效,然后回复你ok或者是error,这是在告诉你是成功了,还是有些错误,如果这是错误的,Grbl 不会保存这些

For example, say that you want to use yourfirst startup block $N0 to set your G-code parser modes like G54 workcoordinate, G20 inches mode, G17 XY-plane. You would type $N0=G20 G54 G17 withan enter and you should see an ok response. You can then check if it got storedby typing $N and you should now see a response like $N0=G20G54G17.

举个例子,当你想要用启动块设置你的G代码模块比如G54工作坐标,G20单位模式,G17XY-平面模式,你应该输入$N0=G20 G54 G17然后回车并且你应该可以看到ok的回复,输入$N可以检查这个些,你应该会看到回复$N0=G20G54G17.

Once you have a startup block stored inGrbl's EEPROM, everytime you startup or reset you will see your startup blockprinted back to you, starting with an open-chevron >, and a :ok responsefrom Grbl to indicate if it ran okay. So for the previous example, you'll see:

只要你把启动块写入一次到EEPROM里面去,每当你开启或者复位的时候,你将会看到启动块反馈打印给你,从一开始的>到:ok,如果Grbl反馈这个给你表示已经运行成功了,所以通过上面的这个例子你会看到

Grbl 1.1d ['$' for help]

>G20G54G17:ok

If you have multiple G-code startup blocks,they will print back to you in order upon every startup. And if you'd like toclear one of the startup blocks, (e.g., block 0) type $N0= without anythingfollowing the equal sign.

如果你有多个G代码启动块,它会依次打印反馈每个启动块,如果你想要清除其中一个启动块(比如 启动块0),输入$N0=,后面不要输入任何的东西

NOTE: There are two variations on whenstartup blocks with run. First, it will not run if Grbl initializes up in anALARM state or exits an ALARM state via an $X unlock for safety reasons. Alwaysaddress and cancel the ALARM and then finish by a reset, where the startupblocks will run at initialization. Second, if you have homing enabled, thestartup blocks will execute immediately after a successful homing cycle, not atstartup.

注意:注意在启动块运行之后有两点是要注意的,第一点,如果Grbl初始化进入ALARM状态或者为了安全的原因,通过输入$X解除报警状态,会持续的寻址并且取消报警,启动块则会在初始化后运行,第二点,如果你启用了原点复位功能,启动块将在原点复位完成后立刻执行,而不是在一开始

$C - Checkgcode mode

$C – 检查G代码模块

This toggles the Grbl's gcode parser to takeall incoming blocks and process them completely, as it would in normaloperation, but it does not move any of the axes, ignores dwells, and powers offthe spindle and coolant. This is intended as a way to provide the user a way tocheck how their new G-code program fares with Grbl's parser and monitor for anyerrors (and checks for soft limit violations, if enabled).

这个指令会切换Grbl的G代码模块去获取所有在传递中的模块并处理完这些,这是正常的操作,但是不会移动任何的轴,忽略停顿,并且打开主轴和冷却剂,这是作为一种与预判的方法,使用这个方法去检查新的G代码项目是如何使用的Grbl模块的并监视这些错误

When toggled off, Grbl will perform anautomatic soft-reset (^X). This is for two purposes. It simplifies the codemanagement a bit. But, it also prevents users from starting a job when theirG-code modes are not what they think they are. A system reset always gives theuser a fresh, consistent start.

当切换停止,Grbl会执行一个自动软复位,这有两个目的,这是为了代码的管理简单一点,但是,这也阻止了使用者继续开始工作,当G代码模块不是和他们想象中的那样时。系统复位会给使用者一个新的开始

 

$X - Killalarm lock

$X – 解除报警锁定

Grbl's alarm mode is a state when somethinghas gone critically wrong, such as a hard limit or an abort during a cycle, orif Grbl doesn't know its position. By default, if you have homing enabled andpower-up the Arduino, Grbl enters the alarm state, because it does not know itsposition. The alarm mode will lock all G-code commands until the '$H' homingcycle has been performed. Or if a user needs to override the alarm lock to movetheir axes off their limit switches, for example, '$X' kill alarm lock willoverride the locks and allow G-code functions to work again

Grbl 的报警模式是一个状态,当某些东西发生了严重的错误,.比如在周期中触发了硬限位并中止,或者,Grbl不知道它自己的位置。默认状态下,如果你启用了原点复位使能并且给Grbl通电,Grbl会进入报警状态,因为它不知道它自己的位置,报警模式会一直锁住所有的G代码模块知道’$H’原点复位循环被执行,或者当一个使用者需要无视报警锁定去将轴移出限位开关,可以使用’$X’解除报警锁定命令去无视这个锁定并且允许G代码功能重新工作

But, tread carefully!! This should only beused in emergency situations. The position has likely been lost, and Grbl maynot be where you think it is. So, it's advised to use G91 incremental mode tomake short moves. Then, perform a homing cycle or reset immediately afterwards.

但是,要小心,这个只能用于紧急情况,当位置丢失Grbl不知道自己在哪,此时建议使用G91增量模式去做短途移动,然后,执行原点复位循环或者立刻复位

As noted earlier, startup lines do notexecute after a $X command. Always reset when you have cleared the alarm andfixed the scenario that caused it. When Grbl resets to idle, the startup lineswill then run as normal.

如前所述,启动行不会在$X命令后执行。当你需要清除警报并修复导致警报的场景时,都要复位。当Grbl重置为空信号,启动线路将正常运行。

 

$H - Runhoming cycle

$H – 运行原点复位循环

This command is the only way to perform thehoming cycle in Grbl. Some other motion controllers designate a special G-codecommand to run a homing cycle, but this is incorrect according to the G-codestandards. Homing is a completely separate command handled by the controller.

这个命令仅仅是Grbl执行原点复位的一种方法,其他的运动控制器可能会使用其他的G代码命令来完成原点复位循环,但是在标准的G代码上这是不正确的,对于这个控制器来说原点复位是一个完全独立的操作命令

TIP: After running a homing cycle, ratherjogging manually all the time to a position in the middle of your workspacevolume. You can set a G28 or G30 pre-defined position to be your post-homingposition, closer to where you'll be machining. To set these, you'll first needto jog your machine to where you would want it to move to after homing. TypeG28.1 (or G30.1) to have Grbl store that position. So then after '$H' homing,you could just enter 'G28' (or 'G30') and it'll move there auto-magically. Ingeneral, I would just move the XY axis to the center and leave the Z-axis up.This ensures that there isn't a chance the tool in the spindle will interfereand that it doesn't catch on anything.

提示:在原点复位循环后,将手动移动至工作区体积中间的某个位置,你可以用G28和G30预定义位置去设置你的初始位置,以靠近你要加工的地方,为了设置这些, 在复位运动后,你首先需要让机器慢慢靠近,再向Grbl输入G28.1(或者G30.1)储存其位子,所以当'$H'原点复位后,输入'G28' (or 'G30')就会自动移动,通常,我们保持Z轴不动只移动XY轴去确定,这是为了确保主轴上的工具不会发生意外,并且不会抓住任何东西

$Jx=line -Run jogging motion

$Jx=指令 – 使用慢动模式

New to Grbl v1.1, this command will execute aspecial jogging motion. There are three main differences between a joggingmotion and a motion commanded by a g-code line.

在Grbl1.1中,这个命令会执行空间慢步运动,慢步运动和G代码运动之间有三个主要的不同点

  • Like normal g-code commands, several jog motions may be queued into the planner buffer, but the jogging can be easily canceled by a jog-cancel or feed-hold real-time command. Grbl will immediately hold the current jog and then automatically purge the buffers of any remaining commands.
  • 和一般的G代码命令一样,多条的慢步命令将会被排列到计划里去,但是通过慢动关闭或者实时给进命令,可以很容易的停止慢动,Grbl会立刻停在现在的点并且自动清除缓冲中剩余的命令
  • Jog commands are completely independent of the g-code parser state. It will not change any modes like G91 incremental distance mode. So, you no longer have to make sure that you change it back to G90 absolute distance mode afterwards. This helps reduce the chance of starting with the wrong g-code modes enabled.
  • 慢动命令是一个完整的独立于G代码模块,这个不会改变任何的模块比如G91增量距离模式,所以,你不用长时间的去确认你是否改变到G90绝对距离模式,这个可以帮助减少触发错误g代码模块的可能
  • If soft-limits are enabled, any jog command that exceeds a soft-limit will simply return an error. It will not throw an alarm as it would with a normal g-code command. This allows for a much more enjoyable and fluid GUI or joystick interaction.
  • 如果软限位是使能的,任何的慢动命令超出软限位将会返回错误,和一般的g代码命令一样这个不会引发报警。这样能更友好充分的和GUI或者是操纵杆互动

Executing a jog requires a specific commandstructure, as described below:

执行慢动需要特定的命令结果,描述如下

  • The first three characters must be '$J=' to indicate the jog.
  • 开头必须要有'$J='这三个字符表示是慢动
  • The jog command follows immediate after the '=' and works like a normal G1 command
  • 慢动命令在. '='后面要要接上类似与G1的命令
  • Feed rate is only interpreted in G94 units per minute. A prior G93 state is ignored during jog.
  • 给进速率表示G94单位每分钟,现有的G93状态将会被忽视
  • Required words:
  • 必要的部分
    • XYZ: One or more axis words with target value.
    • XYZ:目标值必须有一个或这多个轴
    • F - Feed rate value. NOTE: Each jog requires this value and is not treated as modal.
    • F- 给精速率,注意:每一次慢动都需要这个值
  • Optional words: Jog executes based on current G20/G21 and G90/G91 g-code parser state. If one of the following optional words is passed, that state is overridden for one command only.
  • 可选的部分,Jog执行基于g代码解析器现有的G20/G21和G90/G91的状态,如果有输入下面的选项,那么状态就会被这个命令覆盖
    • G20 or G21 - Inch and millimeter mode
    • G20或G21 – 英寸或毫米模式
    • G90 or G91 - Absolute and incremental distances
    • G90或G91 – 绝对或者相对距离
    • G53 - Move in machine coordinates
    • G53 – 机械坐标移动
  • All other g-codes, m-codes, and value words are not accepted in the jog command.
  • 所有其他的G代码,M代码和有效数值在慢动命令中是不被识别的
  • Spaces and comments are allowed in the command. These are removed by the pre-parser.
  • 命令中可以有空格和注释,这些会被解析器删除
  • Example: G21 and G90 are active modal states prior to jogging. These are sequential commands.
  • 例:G21和G90对于慢动是的活动模态。这些是顺序命令。
    • $J=X10.0 Y-1.5 will move to X=10.0mm and Y=-1.5mm in work coordinate frame (WPos).
    • $J=X10.0 Y-1.5 将在坐标系中移动到X=10.0mm和Y=-1.5mm
    • $J=G91 G20 X0.5 will move +0.5 inches (12.7mm) to X=22.7mm (WPos). Note that G91 and G20 are only applied to this jog command.
    • $J=G91 G20 X0.5 将会X=22.5mm的住址在向X轴移动0.5英寸(约等于12.7mm),注意G91和G20仅仅只适用于慢动状态
    • $J=G53 Y5.0 will move the machine to Y=5.0mm in the machine coordinate frame (MPos). If the work coordinate offset for the y-axis is 2.0mm, then Y is 3.0mm in (WPos).
    • $J=G53 Y5.0 将会把机器移动机械坐标的Y轴5.0mm的位置,如果Y轴的工作坐标偏移是2.0mm,那么Y轴实际是在3mm

Jog commands behave almost identically tonormal g-code streaming. Every jog command will return an 'ok' when the joggingmotion has been parsed and is setup for execution. If a command is not valid orexceeds a soft-limit, Grbl will return an 'error:'. Multiple jogging commandsmay be queued in sequence.

慢动命令的反应和正常的G代码流几乎一样,当慢动运动被解析的时候每个慢动都会反馈’ok’并且执行它,如果命令是无效的或者执行遇到了软限位,Grbl将会反馈‘error’,多个慢动命令会被放入列队里面

NOTE: See additional jogging documentationfor details on using this command to create a low-latency joystick or rotary dialinterface.

注意:实时的操纵杆或者旋转对接口如果要使用这个命令请参看附加的慢动文档描述。

 

$RST=$,$RST=#, and $RST=*- Restore Grbl settings and data to defaults

$RST=$,$RST=#, and $RST=*- 恢复Grbl默认的设定和数据

These commands are not listed in the mainGrbl $ help message, but are available to allow users to restore parts of orall of Grbl's EEPROM data. Note: Grbl will automatically reset after executingone of these commands to ensure the system is initialized correctly.

这个命令不在Grbl的主要帮助信息的列表中,但是这个可以允许用户恢复Grbl部分的EEPROM数据,注意:Grbl执行这个命令之后将会自动重启,确保系统是初始化正确的

  • $RST=$ : Erases and restores the $$ Grbl settings back to defaults, which is defined by the default settings file used when compiling Grbl. Often OEMs will build their Grbl firmwares with their machine-specific recommended settings. This provides users and OEMs a quick way to get back to square-one, if something went awry or if a user wants to start over.
  • $RST=$ :擦除并恢复Grbl的设置块为默认状态,默认状态就是编译Grbl后的状态,通常,OEM将使用其机器特定的推荐设置来构建Grbl固件。这为用户和原始设备制造商提供了一种快速的方法,以便在出现问题或用户想重新开始时回到原点。
  • $RST=# : Erases and zeros all G54-G59 work coordinate offsets and G28/30 positions stored in EEPROM. These are generally the values seen in the $# parameters printout. This provides an easy way to clear these without having to do it manually for each set with a G20 L2/20 or G28.1/30.1 command.
  • $RST=# : 擦除并置0所有的G54-G59工作坐标系以及储存在EEPROM中的G285/G30的位置信息,这些通常是$#参数打印输出中看到的值。这提供了一种简单的方法来清除这些,而无需使用a G20 L2/20或G28.1/30.1命令手动执行每个设置
  • $RST=* : This clears and restores all of the EEPROM data used by Grbl. This includes $$ settings, $# parameters, $N startup lines, and $I build info string. Note that this doesn't wipe the entire EEPROM, only the data areas Grbl uses. To do a complete wipe, please use the Arduino IDE's EEPROM clear example project.
  • $RST=* :这个会清除并恢复所有的EEPROM的Grbl用户数据,这个包含的$$设定信息,$#参数,$N启动行和$I编译信息字符串。请注意,这不会擦除整个EEPROM,只有Grbl使用的数据区域。要完成擦除,请使用Arduino IDE的EEPROM清除示例项目。

NOTE: Some OEMs may restrict some or all ofthese commands to prevent certain data they use from being wiped.

注意:有些OEM可能会限制部分或所有的这些命令以保护一些确定的数据被擦除掉

 

$SLP - EnableSleep Mode

$SLP – 启动睡眠模式

This command will place Grbl into ade-powered sleep state, shutting down the spindle, coolant, and stepper enablepins and block any commands. It may only be exited by a soft-reset orpower-cycle. Once re-initialized, Grbl will automatically enter an ALARM state,because it's not sure where it is due to the steppers being disabled.

这命令将会使Grbl进入低功耗的睡眠状态,关闭主轴,冷冻剂和步进电机使能引脚以及所有的指令块,要退出只能通过软件重启或者重新上电,当重新初始化的时候,Grbl会自动的进入报警状态,因为它不确定当前的位子这是由于步进电机是关闭着的

This feature is useful if you need toautomatically de-power everything at the end of a job by adding this command atthe end of your g-code program, BUT, it is highly recommended that you addcommands to first move your machine to a safe parking location prior to thissleep command. It also should be emphasized that you should have a reliable CNCmachine that will disable everything when its supposed to, like your spindle.Grbl is not responsible for any damage it may cause. It's never a good idea toleave your machine unattended. So, use this command with the utmost caution!

这个功能是很有用的,如果你需要在工作结束后的自动关闭所有东西,那么增加这个命令在G代码项目结束后,但是,强烈建议,先移动你的机器到一个安全的停车地点之前在添加睡眠命令。也应该强调的是,首先你要有可靠的CNC机器可以支持这个指令,那么它会关闭所有东西,比如你的主轴,Grbl不对其可能造成的任何损害负责。让您的机器无人看管永远不是一个好主意。因此,请谨慎使用此命令!

 

Grbl v1.1Realtime commands

Grbl v1.1 实时命令

Realtime commands are single controlcharacters that may be sent to Grbl to command and perform an action inreal-time. This means that they can be sent at anytime, anywhere, and Grbl willimmediately respond, regardless of what it is doing at the time. These commandsinclude a reset, feed hold, resume, status report query, and overrides (inv1.1).

实时命令是一个简短的控制字符,发送这些命令给Grbl时会实时的执行一个动作,这意味着任何时候,任何地点发送这些命令,不管Grb在做什么l都会立刻有回应,。这个命令包括复位,给进保持,状态恢复,状态报告以及覆写(v1.1版本)

A realtime command:

一个实时的命令

  • Will execute within tens of milliseconds.
  • 将在几十毫秒内执行。
  • Is a single character that may be sent to Grbl at any time.
  • 这是一组简单的字符串可以在任意时刻发送给Grbl
  • Does not require a line feed or carriage return after them.
  • 命令后面不要有换行或者回车
  • Is not considered a part of the streaming protocol.
  • 不被认为是流协议的一部分。
  • Are intercepted when they are received and never placed in a buffer to be parsed by Grbl.

当数据接收的时候就会被截取,不会放在缓冲区中去让Grbl解析

  • Will ignore multiple commands until it has executed the first received command.
  • 将会忽略多个命令,直到第一个接收的命令被执行
  • May be tied to an input pin and may be operated with a button or switch.
  • 可以连接到输入引脚,使用开关按钮和按键
  • Actions depends on state or what Grbl is doing. It may not do anything.
  • 具体的行为取决与Grbl在做什么,他可能什么都不做
  • Descriptions explain how they work and what to expect.
  • 说明解释了他们是如何工作的

ASCIIRealtime Command Descriptions

ASCLL 实时命令概括

Four realtime commands are type-able by userson a keyboard and shown in the $ Grbl help message. These realtime commandcharacters control some of Grbl's basic functions.

这四个实时命令是用用户键盘输入的,并且可以在Grbl中用$查看帮助文档,这些实时命令字符具有控制Grbl基本功能的特点

  • 0x18 (ctrl-x) : Soft-Reset
  • 0x18 (ctrl-x):软件重启
    • Immediately halts and safely resets Grbl without a power-cycle.
    • 不按下电源就能立刻停止并且安全的重启Grbl
    • Accepts and executes this command at any time.
    • 这个命了任何时候都能被接受并执行
    • If reset while in motion, Grbl will throw an alarm to indicate position may be lost from the motion halt.
    • 如果在运动中复位,Grbl会产生一个报警表示在运动会停止并且位置信息可能会丢失
    • If reset while in not motion, position is retained and re-homing is not required.
    • 如果不在运动中复位,位置会被保存并且不进行原点复位
    • An input pin is available to connect a button or switch.
    • 一个输入引脚能接入一个控制按键或者引脚
  • ? : Status Report Query
  • ?:状态反馈查询
    • Immediately generates and sends back runtime data with a status report.
    • 立即生成实时数据和状态报告并发送回去
    • Accepts and executes this command at any time, except during a homing cycle and when critical alarm (hard/soft limit error) is thrown.
    • 随时接受并执行这个命令,除了运行在原点复位中并且触发了严重的报警(碰到了限位开关)
  • ~ : Cycle Start / Resume
  • ~:循环开始/继续
    • Resumes a feed hold, a safety door/parking state when the door is closed, and the M0 program pause states.
    • 继续保持给进状态或者安全门状态或者停车状态,当门是关着的
    • Command is otherwise ignored.
    • 其他命令被忽略
    • If the parking compile-time option is enabled and the safety door state is ready to resume, Grbl will re-enable the spindle and coolant, move back into position, and then resume.
    • 如果停车编译时间选项已使能并且安全门状态已经准备就绪,Grbl将重新启用主轴和冷却液,移回原位,然后恢复。
    • An input pin is available to connect a button or switch.
    • 一个输入引脚可以连接一个按键或者开关
  • ! : Feed Hold
  • ! : 给精保持
    • Places Grbl into a suspend or HOLD state. If in motion, the machine will decelerate to a stop and then be suspended.
    • 让Grbl进入停车或者保持在停车状态,如果在运动中,机器会减速直至停止
    • Command executes when Grbl is in an IDLE, RUN, or JOG state. It is otherwise ignored.
    • 当Grbl处于IDIL、RUN、JOG状态会被执行,其他情况会被忽略
    • If jogging, a feed hold will cancel the jog motion and flush all remaining jog motions in the planner buffer. The state will return from JOG to IDLE or DOOR, if was detected as ajar during the active hold.
    • 如果在慢动状态下,给进保持会解除慢动运动并且将剩余的慢动运动放入到缓冲区中,如果在主动保持期间被检测为半开着,状态将从JOG返回到IDLE或DOOR。
    • By machine control definition, a feed hold does not disable the spindle or coolant. Only motion.
    • 在机器控制定义中,给精保持不会失能主轴或者冷却液,这个只限于运动中
    • An input pin is available to connect a button or switch.
    • 一个输入引脚可以连接一个按键或者开关

Extended-ASCIIRealtime Command Descriptions

扩展内容-ASCII码类型的实时命令描述

Grbl v1.1 installed more than a dozen newrealtime commands to control feed, rapid, and spindle overrides. To helpprevent users from inadvertently altering overrides with a keystroke and allowfor more commands later on, all of the new control characters have been movedto the extended ASCII character set. These are not easily type-able on akeyboard, but, depending on the OS, they may be entered using specifickeystroke and code. GUI developers will need to be able to send extended ASCIIcharacters, values 128 (0x80) to 255 (0xFF), to Grbl to take advantage of thesenew features.

Grblv1.1安装了十几个新的实时命令来控制进给,快速和主轴覆盖。为帮助防止用户无意中通过按键更改覆盖并在稍后允许更多命令,所有新控制字符都已移至扩展ASCII字符集。这些在键盘上不易输入,但根据操作系统的不同,可能会使用特定的按键和代码输入它们。GUI开发人员需要能够发送扩展ASCII字符,发送128(0x80)255(0xFF)Grbl以充分利用这些新功能。

  • 0x84 : Safety Door
  • 0x84 : 安全门
    • Although typically connected to an input pin to detect the opening of a safety door, this command allows a GUI to enact the safety door behavior with this command.
    • 虽然通常要联谊一个输入引脚去检测安全门的开关,但是这个命令可以允许GUI通过命令来制定安全门的行为
    • Immediately suspends into a DOOR state and disables the spindle and coolant. If in motion, the machine will decelerate to a stop and then be suspended.立刻停车并进入DOOR状态,失能主轴和冷却液,如果在运动中,机器会减速直至停止然后暂停
    • If executed during homing, Grbl will instead halt motion and throw a homing alarm.
    • 如果在原点复位的时候被执行,Grbl会停止运动并发出警报
    • If already in a suspend state or HOLD, the DOOR state supersedes it.
    • 如果已经处于停车状态或者HOLD状态,将会用DOOR状态取代它
    • If the parking compile-time option is enabled, Grbl will park the spindle to a specified location.
    • 如果停车编译选项是使能的,Grbl会将主轴停在指定的位置
    • Command executes when Grbl is in an IDLE, HOLD, RUN, HOMING, or JOG state. It is otherwise ignored.
    • 当Grbl在IDLE,HOLD,HOMING或者JOG状态下时,命令被执行,初次之外的将会被忽略
    • If jogging, a safety door will cancel the jog and all queued motions in the planner buffer. When the safety door is closed and resumed, Grbl will return to an IDLE state.
    • 如果在慢动中,安全门会关闭慢动状态并且将队列中的运动放入到计划缓冲区中去,当安全门关闭后再继续,Grbl会返回到IDLE状态
    • An input pin is available to connect a button or switch, if enabled with a compile-time option.
    • 如果编译时使能了这个选项,可以用输入引脚连接一个按钮和开关。
    • Some builds of Grbl v0.9 used the @ character for this command, but it was undocumented. Moved to extended-ASCII to prevent accidental commanding.
    • 编译Grbl v0.9版本的时候可以用@字符来使用这个命令,但是这个是不正式的,使用扩展的ASCII可以防止意外出现
  • 0x85 : Jog Cancel
  • 0x85 : 慢动关闭
    • Immediately cancels the current jog state by a feed hold and automatically flushing any remaining jog commands in the buffer.
    • 立刻取消掉现在的慢动状态并且自动将剩余的慢动命令放入到缓冲区
    • Command is ignored, if not in a JOG state or if jog cancel is already invoked and in-process.
    • 命令会被忽略,如果不是在慢动状态或者慢动取消已经被调用
    • Grbl will return to the IDLE state or the DOOR state, if the safety door was detected as ajar during the cancel.
    • Grbl 会返回IDLE状态或者DOOR状态,如果安全门是检测半开的状态(正在取消)
  • Feed Overrides
  • 给进覆盖
    • Immediately alters the feed override value. An active feed motion is altered within tens of milliseconds.
    • 立刻改变给进覆盖的值,将会在几十毫秒内改变一个给进运动
    • Does not alter rapid rates, which include G0, G28, and G30, or jog motions.
    • 不会改变快速覆盖的速率,包括G0/G28/G30或者慢动运动
    • Feed override value can not be 10% or greater than 200%.
    • 给进覆盖值不能小于10%或者大于200%
    • If feed override value does not change, the command is ignored.
    • 如果给进覆盖值不可更改,这个命令会被忽略
    • Feed override range and increments may be changed in config.h.
    • 给进覆盖的范围和增长量可以在config.h文件中修改
    • The commands are:
      • 0x90 : Set 100% of programmed rate.
      • 0x90 : 设定 100% 的设定速率
      • 0x91 : Increase 10%
      • 0x91 : 增加 10%
      • 0x92 : Decrease 10%
      • 0x92: 减少10%
      • 0x93 : Increase 1%
      • 0x93: 增加 1%
      • 0x94 : Decrease 1%
      • 0x94 : 减少 1%
  • Rapid Overrides
  • 快速覆盖
    • Immediately alters the rapid override value. An active rapid motion is altered within tens of milliseconds.
    • 立刻改变快速覆盖的值,将会在几十毫秒内改变一个快速运动
    • Only effects rapid motions, which include G0, G28, and G30.
    • 只影响快速运动,包括G0、G28、G30
    • If rapid override value does not change, the command is ignored.
    • 快速覆盖值不能改变,这个命令会被忽略
    • Rapid override set values may be changed in config.h.
    • 快速覆盖的设定值可以在config.h文件中修改
    • The commands are:
    • 这些命令是
      • 0x95 : Set to 100% full rapid rate.
      • 0x95 : 设置100% 的快速速率
      • 0x96 : Set to 50% of rapid rate.
      • 0x96 : 设置50% 的快速速率
      • 0x97 : Set to 25% of rapid rate.
      • 0x97 : 设置 25% 放入快速速率
  • Spindle Speed Overrides
  • 主轴速度覆盖
    • Immediately alters the spindle speed override value. An active spindle speed is altered within tens of milliseconds.
    • 立刻改主轴速度覆盖的值,将会在几十毫秒内改变主轴速度
    • Override values may be changed at any time, regardless of if the spindle is enabled or disabled.
    • 可以在任意时间改写这个值,,注意主轴是使能的还是失能的
    • Spindle override value can not be 10% or greater than 200%
    • 主轴覆盖的值不可以小于10%也不可以大于200%
    • If spindle override value does not change, the command is ignored.
    • 如果主轴覆盖值不可更改,这个命令将被忽略
    • Spindle override range and increments may be altered in config.h.
    • 主轴覆盖范围和变化量可以在config.h文件中修改
    • The commands are:
    • 这些命令是
      • 0x99 : Set 100% of programmed spindle speed
      • 0x99 :主轴速度变为设定速度的100%
      • 0x9A : Increase 10%
      • 0x9A:增加10%
      • 0x9B : Decrease 10%
      • 0x9B : 减少10%
      • 0x9C : Increase 1%
      • 0x9C:增加1%
      • 0x9D : Decrease 1%
      • 0x9C:减少1%
  • 0x9E : Toggle Spindle Stop
  • 0x9E:主轴停止按钮
    • Toggles spindle enable or disable state immediately, but only while in the HOLD state.

o   立即切换主轴使能或禁止状态,但只能在HOLD状态下使用。

    • The command is otherwise ignored, especially while in motion. This prevents accidental disabling during a job that can either destroy the part/machine or cause personal injury. Industrial machines handle the spindle stop override similarly.
    • 否则命令被忽略,特别是在运动中。这样可以防止在作业过程中发生意外失效,从而破坏零件/机器或造成人身伤害。工业机床类似地处理主轴停止覆盖。
    • When motion restarts via cycle start, the last spindle state will be restored and wait 4.0 seconds (configurable) before resuming the tool path. This ensures the user doesn't forget to turn it back on.
    • 当运动通过循环启动重新启动时,最后的主轴状态将恢复,并在恢复刀具路径之前等待4.0秒(可配置)。这确保用户不会忘记将其重新打开。
    • While disabled, spindle speed override values may still be altered and will be in effect once the spindle is re-enabled.
    • 禁用时,主轴速度倍率值可能仍然会改变,并且一旦主轴重新启用,该值将生效。
    • If a safety door is opened, the DOOR state will supersede the spindle stop override, where it will manage the spindle re-energizing itself upon closing the door and resuming. The prior spindle stop override state is cleared and reset.
    • 如果安全门打开,则DOOR状态将取代主轴停止覆盖,在关闭门并重新开始后,它将管理主轴重新启动。之前的主轴停止覆盖状态被清除并复位。
  • 0xA0 : Toggle Flood Coolant
  • 切换液态冷却剂
    • Toggles flood coolant state and output pin until the next toggle or g-code command alters it.
    • 切换淹没冷却液状态和输出引脚,直到下一个切换或g代码命令改变它为止。
    • May be commanded at any time while in IDLE, RUN, or HOLD states. It is otherwise ignored.
    • 可在空闲,运行或保持状态下随时命令。否则会被忽略。
    • This override directly changes the coolant modal state in the g-code parser. Grbl will continue to operate normally like it received and executed an M8 or M9 g-code command.
    • 该重写直接改变g代码解析器中的冷却剂模态状态。Grbl将继续正常操作像它接收并执行一个M8或M9G代码命令。
    • When $G g-code parser state is queried, the toggle override change will be reflected by an M8 enabled or disabled with an M9 or not appearing when M7 is present.
    • 当$G查询g代码分析器状态时,切换覆盖更改将通过M8启用或禁用来反映,并且存在M9或不M7存在时显示。
  • 0xA1 : Toggle Mist Coolant
  • 切换喷雾冷却剂
    • Enabled by ENABLE_M7 compile-time option. Default is disabled.
    • 可在空闲,运行或保持状态下随时命令。否则会被忽略。
    • Toggles mist coolant state and output pin until the next toggle or g-code command alters it.
    • 切换淹没冷却液状态和输出引脚,直到下一个切换或g代码命令改变它为止。
    • May be commanded at any time while in IDLE, RUN, or HOLD states. It is otherwise ignored.
    • 可在空闲,运行或保持状态下随时命令。否则会被忽略。
    • This override directly changes the coolant modal state in the g-code parser. Grbl will continue to operate normally like it received and executed an M7 or M9 g-code command.
    • 该重写直接改变g代码解析器中的冷却剂模态状态。Grbl将继续正常操作像它接收并执行一个M8或M9G代码命令。
    • When $G g-code parser state is queried, the toggle override change will be reflected by an M7 enabled or disabled with an M9 or not appearing when M8 is present.
    • 当$G查询g代码分析器状态时,切换覆盖更改将通过M8启用或禁用来反映,并且存在M9或不M7存在时显示。

 

 

你可能感兴趣的:(GRBL)