1. 程式人生 > >GRBL v1.1版本命令說明

GRBL v1.1版本命令說明

這次翻譯了一下Grbl的命令wiki說明,內容比較多,如果有什麼錯誤的地方,請在下方留言,歡迎相互交流學習奮鬥

Grbl v1.1 command

       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.1Configurationfor 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 Pxor G10 L20 Pxcommand defined by the NIST gcode standard andthe EMC2 (linuxcnc.org) standard. G28/G30 pre-defined positions can be changedvia the G28.1and the G30.1commands, 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. TLOdenotes tool length offset (for the defaultz-axis), and PRBdenotes the coordinates of the last probingcycle, where the suffix :1denotes if the last probe was successful and :0as 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存在時顯示。