Committer:
Sergunb
Date:
Mon Sep 04 12:03:42 2017 +0000
Revision:
0:f1834a63f7c1
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Sergunb 0:f1834a63f7c1 1 # Grbl Interface Basics
Sergunb 0:f1834a63f7c1 2
Sergunb 0:f1834a63f7c1 3 The interface for Grbl is fairly simple and straightforward. With Grbl v1.1, steps have been taken to try to make it even easier for new users to get started, and for GUI developers to write their own custom interfaces to Grbl.
Sergunb 0:f1834a63f7c1 4
Sergunb 0:f1834a63f7c1 5 Grbl communicates through the serial interface on the Arduino. You just need to connect your Arduino to your computer with a USB cable. Use any standard serial terminal program to connect to Grbl, such as: the Arduino IDE serial monitor, Coolterm, puTTY, etc. Or use one of the many great Grbl GUIs out there in the Internet wild.
Sergunb 0:f1834a63f7c1 6
Sergunb 0:f1834a63f7c1 7 The primary way to talk to Grbl is performed by sending it a string of characters, followed by a carriage return. Grbl will then process the string, set it up for execution, and then reply back with a **response message**, also terminated by a return, to tell you how it went. These command strings include sending Grbl: a G-code block to execute, commands to configure Grbl's system settings, to view how Grbl is doing, etc.
Sergunb 0:f1834a63f7c1 8
Sergunb 0:f1834a63f7c1 9 To stream a g-code program to Grbl, the basic interface is to send Grbl a line of g-code, then wait for the proper **response message** starting with an `ok` or `error`. This signals Grbl has completed the parsing and executing the command. At times, Grbl may not respond immediately. This happens when Grbl is busy doing something else or waiting to place a commanded motion into the look-ahead planner buffer. Other times, usually at the start of a program, Grbl may quickly respond to several lines, but nothing happens. This occurs when Grbl places a series of commanded motions directly in the planner queue and will try to fill it up completely before starting.
Sergunb 0:f1834a63f7c1 10
Sergunb 0:f1834a63f7c1 11 Along with **response messages**, Grbl has **push messages** to provide more feedback on what Grbl is doing and are also strings terminated by a return. These messages may be "pushed" from Grbl to the user in response to a query or to let the user know something important just happened. These can come at any time, but usually from something like a settings print out when asked to. **Push messages** are easily identified because they don't start with an `ok` or `error` like **response messages** do. They are typically placed in `[]` brackets, `<>` chevrons, start with a `$`, or a specific string of text. These are all defined and described later in this document.
Sergunb 0:f1834a63f7c1 12
Sergunb 0:f1834a63f7c1 13 Finally, Grbl has **real-time commands** that are invoked by a set of special characters that may be sent at any time and are not part of the basic streaming send-response interface. These cause Grbl to immediately execute the command and typically don't generate a response. These include pausing the current motion, speed up/down everything, toggle the spindle during a job, reset Grbl, or query Grbl for a real-time status report. See the `Commands` document to see what they are and how they work.
Sergunb 0:f1834a63f7c1 14
Sergunb 0:f1834a63f7c1 15 -------
Sergunb 0:f1834a63f7c1 16
Sergunb 0:f1834a63f7c1 17 # Writing an Interface for Grbl
Sergunb 0:f1834a63f7c1 18
Sergunb 0:f1834a63f7c1 19 The general interface for Grbl has been described above, but what's missing is how to run an entire G-code program on Grbl, when it doesn't seem to have an upload feature. This is where this section fits in. Early on, users fiercely requested for flash drive, external RAM, LCD support, joysticks, or network support so they can upload a g-code program and run it directly on Grbl. The general answer to that is, good ideas, but Grbl doesn't need them. Grbl already has nearly all of the tools and features to reliably communicate with a graphical user interface (GUI) or a seperate host interface that provides all those extra bells and whistles. Grbl's base philosophy is to minimize what Grbl should be doing, because, in the end, Grbl needs to be concentrating on producing clean, reliable motion. That's it.
Sergunb 0:f1834a63f7c1 20
Sergunb 0:f1834a63f7c1 21
Sergunb 0:f1834a63f7c1 22 ## Streaming a G-Code Program to Grbl
Sergunb 0:f1834a63f7c1 23
Sergunb 0:f1834a63f7c1 24 Here we will describe two different streaming methods for Grbl GUIs. One of the main problems with streaming to Grbl is the USB port itself. Arduinos and most all micro controllers use a USB-to-serial converter chip that, at times, behaves strangely and not typically how you'd expect, like USB packet buffering and delays that can wreak havoc to a streaming protocol. Another problem is how to deal with some of the latency and oddities of the PCs themselves, because none of them are truly real-time and always create micro-delays when executing other tasks. Regardless, we've come up with ways to ensure the G-code stream is reliable and simple.
Sergunb 0:f1834a63f7c1 25
Sergunb 0:f1834a63f7c1 26 The following streaming protocols require tracking the **response messages** to determine when to send the next g-code line. All **push messages** are not counted toward the streaming protocol and should be handled separately. All real-time command characters can be sent at any time and are never placed in Grbl's RX serial buffer. They are intercepted as they come in and simply sets flags for Grbl to execute them.
Sergunb 0:f1834a63f7c1 27
Sergunb 0:f1834a63f7c1 28 #### Streaming Protocol: Simple Send-Response _[Recommended]_
Sergunb 0:f1834a63f7c1 29 The send-response streaming protocol is the most fool-proof and simplest method to stream a G-code program to Grbl. The host PC interface simply sends a line of G-code to Grbl and waits for an `ok` or `error:` **response message** before sending the next line of G-code. So, no matter if Grbl needs to wait for room in the look-ahead planner buffer to finish parsing and executing the last line of G-code or if the the host computer is busy doing something, this guarantees both to the host PC and Grbl, the programmed G-code has been sent and received properly. An example of this protocol is published in our `simple_stream.py` script in our repository.
Sergunb 0:f1834a63f7c1 30
Sergunb 0:f1834a63f7c1 31 However, it's also the slowest of three outlined streaming protocols. Grbl essentially has two buffers between the execution of steps and the host PC interface. One of them is the serial receive buffer. This briefly stores up to 127 characters of data received from the host PC until Grbl has time to fetch and parse the line of G-code. The other buffer is the look-ahead planner buffer. This buffer stores up to 16 line motions that are acceleration-planned and optimized for step execution. Since the send-response protocol receives a line of G-code while the host PC waits for a response, Grbl's serial receive buffer is usually empty and under-utilized. If Grbl is actively running and executing steps, Grbl will immediately begin to execute and empty the look-ahead planner buffer, while it sends the response to the host PC, waits for the next line from the host PC, upon receiving it, parse and plan it, and add it to the end of the look-ahead buffer.
Sergunb 0:f1834a63f7c1 32
Sergunb 0:f1834a63f7c1 33 Although this communication lag may take only a fraction of a second, there is a cumulative effect, because there is a lag with every G-code block sent to Grbl. In certain scenarios, like a G-code program containing lots of sequential, very short, line segments with high feed rates, the cumulative lag can be large enough to empty and starve the look-ahead planner buffer within this time. This could lead to start-stop motion when the streaming can't keep up with G-code program execution. Also, since Grbl can only plan and optimize what's in the look-ahead planner buffer, the performance through these types of motions will never be full-speed, because look-ahead buffer will always be partially full when using this streaming method. If your expected application doesn't contain a lot of these short line segments with high feed rates, this streaming protocol should be more than adequate for a vast majority of applications, is very robust, and is a quick way to get started.
Sergunb 0:f1834a63f7c1 34
Sergunb 0:f1834a63f7c1 35 #### Streaming Protocol: Character-Counting _[**Recommended with Reservation**]_
Sergunb 0:f1834a63f7c1 36
Sergunb 0:f1834a63f7c1 37 To get the best of both worlds, the simplicity and reliability of the send-response method and assurance of maximum performance with software flow control, we came up with a simple character-counting protocol for streaming a G-code program to Grbl. It works like the send-response method, where the host PC sends a line of G-code for Grbl to execute and waits for a `response message`, but, rather than needing special XON/XOFF characters for flow control, this protocol simply uses Grbl's responses as a way to reliably track how much room there is in Grbl's serial receive buffer. An example of this protocol is outlined in the `stream.py` streaming script in our repo. This protocol is particular useful for very fast machines like laser cutters.
Sergunb 0:f1834a63f7c1 38
Sergunb 0:f1834a63f7c1 39 The main difference between this protocol and the others is the host PC needs to maintain a standing count of how many characters it has sent to Grbl and then subtract the number of characters corresponding to the line executed with each Grbl response. Suppose there is a short G-code program that has 5 lines with 25, 40, 31, 58, and 20 characters (counting the line feed and carriage return characters too). We know Grbl has a 128 character serial receive buffer, and the host PC can send up to 128 characters without overflowing the buffer. If we let the host PC send as many complete lines as we can without over flowing Grbl's serial receive buffer, the first three lines of 25, 40, and 31 characters can be sent for a total of 96 characters. When Grbl sends a **response message**, we know the first line has been processed and is no longer in the serial read buffer. As it stands, the serial read buffer now has the 40 and 31 character lines in it for a total of 71 characters. The host PC needs to then determine if it's safe to send the next line without overflowing the buffer. With the next line at 58 characters and the serial buffer at 71 for a total of 129 characters, the host PC will need to wait until more room has cleared from the serial buffer. When the next Grbl **response message** comes in, the second line has been processed and only the third 31 character line remains in the serial buffer. At this point, it's safe to send the remaining last two 58 and 20 character lines of the g-code program for a total of 110.
Sergunb 0:f1834a63f7c1 40
Sergunb 0:f1834a63f7c1 41 While seemingly complicated, this character-counting streaming protocol is extremely effective in practice. It always ensures Grbl's serial read buffer is filled, while never overflowing it. It maximizes Grbl's performance by keeping the look-ahead planner buffer full by better utilizing the bi-directional data flow of the serial port, and it's fairly simple to implement as our `stream.py` script illustrates. We have stress-tested this character-counting protocol to extremes and it has not yet failed. Seemingly, only the speed of the serial connection is the limit.
Sergunb 0:f1834a63f7c1 42
Sergunb 0:f1834a63f7c1 43 _RESERVATION:_
Sergunb 0:f1834a63f7c1 44
Sergunb 0:f1834a63f7c1 45 - _If a g-code line is parsed and generates an error **response message**, a GUI should stop the stream immediately. However, since the character-counting method stuffs Grbl's RX buffer, Grbl will continue reading from the RX buffer and parse and execute the commands inside it. A GUI won't be able to control this. The interim solution is to check all of the g-code via the $C check mode, so all errors are vetted prior to streaming. This will get resolved in later versions of Grbl._
Sergunb 0:f1834a63f7c1 46
Sergunb 0:f1834a63f7c1 47
Sergunb 0:f1834a63f7c1 48 ## Interacting with Grbl's Systems
Sergunb 0:f1834a63f7c1 49
Sergunb 0:f1834a63f7c1 50 Along with streaming a G-code program, there a few more things to consider when writing a GUI for Grbl, such as how to use status reporting, real-time control commands, dealing with EEPROM, and general message handling.
Sergunb 0:f1834a63f7c1 51
Sergunb 0:f1834a63f7c1 52 #### Status Reporting
Sergunb 0:f1834a63f7c1 53 When a `?` character is sent to Grbl (no additional line feed or carriage return character required), it will immediately respond with something like `<Idle|MPos:0.000,0.000,0.000|FS:0.0,0>` to report its state and current position. The `?` is always picked-off and removed from the serial receive buffer whenever Grbl detects one. So, these can be sent at any time. Also, to make it a little easier for GUIs to pick up on status reports, they are always encased by `<>` chevrons.
Sergunb 0:f1834a63f7c1 54
Sergunb 0:f1834a63f7c1 55 Developers can use this data to provide an on-screen position digital-read-out (DRO) for the user and/or to show the user a 3D position in a virtual workspace. We recommend querying Grbl for a `?` real-time status report at no more than 5Hz. 10Hz may be possible, but at some point, there are diminishing returns and you are taxing Grbl's CPU more by asking it to generate and send a lot of position data.
Sergunb 0:f1834a63f7c1 56
Sergunb 0:f1834a63f7c1 57 Grbl's status report is fairly simply in organization. It always starts with a word describing the machine state like `IDLE` (descriptions of these are available elsewhere in the Wiki). The following data values are usually in the order listed below and separated by `|` pipe characters, but may not be in the exact order or printed at all. For a complete description of status report formatting, read the _Real-time Status Reports_ section below.
Sergunb 0:f1834a63f7c1 58
Sergunb 0:f1834a63f7c1 59 #### Real-Time Control Commands
Sergunb 0:f1834a63f7c1 60 The real-time control commands, `~` cycle start/resume, `!` feed hold, `^X` soft-reset, and all of the override commands, all immediately signal Grbl to change its running state. Just like `?` status reports, these control characters are picked-off and removed from the serial buffer when they are detected and do not require an additional line-feed or carriage-return character to operate.
Sergunb 0:f1834a63f7c1 61
Sergunb 0:f1834a63f7c1 62 One important note are the override command characters. These are defined in the extended-ASCII character space and are generally not type-able on a keyboard. A GUI must be able to send these 8-bit values to support overrides.
Sergunb 0:f1834a63f7c1 63
Sergunb 0:f1834a63f7c1 64 #### EEPROM Issues
Sergunb 0:f1834a63f7c1 65 EEPROM access on the Arduino AVR CPUs turns off all of the interrupts while the CPU _writes_ to EEPROM. This poses a problem for certain features in Grbl, particularly if a user is streaming and running a g-code program, since it can pause the main step generator interrupt from executing on time. Most of the EEPROM access is restricted by Grbl when it's in certain states, but there are some things that developers need to know.
Sergunb 0:f1834a63f7c1 66
Sergunb 0:f1834a63f7c1 67 * Settings should not be streamed with the character-counting streaming protocols. Only the simple send-response protocol works. This is because during the EEPROM write, the AVR CPU also shuts-down the serial RX interrupt, which means data can get corrupted or lost. This is safe with the send-response protocol, because it's not sending data after commanding Grbl to save data.
Sergunb 0:f1834a63f7c1 68
Sergunb 0:f1834a63f7c1 69 For reference:
Sergunb 0:f1834a63f7c1 70 * Grbl's EEPROM write commands: `G10 L2`, `G10 L20`, `G28.1`, `G30.1`, `$x=`, `$I=`, `$Nx=`, `$RST=`
Sergunb 0:f1834a63f7c1 71 * Grbl's EEPROM read commands: `G54-G59`, `G28`, `G30`, `$$`, `$I`, `$N`, `$#`
Sergunb 0:f1834a63f7c1 72
Sergunb 0:f1834a63f7c1 73 #### G-code Error Handling
Sergunb 0:f1834a63f7c1 74
Sergunb 0:f1834a63f7c1 75 Grbl's g-code parser is fully standards-compilant with complete error-checking. When a G-code parser detects an error in a G-code block/line, the parser will dump everything in the block from memory and report an `error:` back to the user or GUI. This dump is absolutely the right thing to do, because a g-code line with an error can be interpreted in multiple ways. However, this dump can be problematic, because the bad G-code block may have contained some valuable positioning commands or feed rate settings that the following g-code depends on.
Sergunb 0:f1834a63f7c1 76
Sergunb 0:f1834a63f7c1 77 It's highly recommended to do what all professional CNC controllers do when they detect an error in the G-code program, _**halt**_. Don't do anything further until the user has modified the G-code and fixed the error in their program. Otherwise, bad things could happen.
Sergunb 0:f1834a63f7c1 78
Sergunb 0:f1834a63f7c1 79 As a service to GUIs, Grbl has a "check G-code" mode, enabled by the `$C` system command. GUIs can stream a G-code program to Grbl, where it will parse it, error-check it, and report `ok`'s and `errors:`'s without powering on anything or moving. So GUIs can pre-check the programs before streaming them for real. To disable the "check G-code" mode, send another `$C` system command and Grbl will automatically soft-reset to flush and re-initialize the G-code parser and the rest of the system. This perhaps should be run in the background when a user first loads a program, before a user sets up his machine. This flushing and re-initialization clears `G92`'s by G-code standard, which some users still incorrectly use to set their part zero.
Sergunb 0:f1834a63f7c1 80
Sergunb 0:f1834a63f7c1 81 #### Jogging
Sergunb 0:f1834a63f7c1 82
Sergunb 0:f1834a63f7c1 83 As of Grbl v1.1, a new jogging feature is available that accepts incremental, absolute, or absolute override motions, along with a jog cancel real-time command that will automatically feed hold and purge the planner buffer. The most important aspect of the new jogging motion is that it is completely independent from the g-code parser, so GUIs no longer have to ensure the g-code modal states are set back correctly after jogging is complete. See the jogging document for more details on how it works and how you can use it with an analog joystick or rotary dial.
Sergunb 0:f1834a63f7c1 84
Sergunb 0:f1834a63f7c1 85 #### Synchronization
Sergunb 0:f1834a63f7c1 86
Sergunb 0:f1834a63f7c1 87 For situations when a GUI needs to run a special set of commands for tool changes, auto-leveling, etc, there often needs to be a way to know when Grbl has completed a task and the planner buffer is empty. The absolute simplest way to do this is to insert a `G4 P0.01` dwell command, where P is in seconds and must be greater than 0.0. This acts as a quick force-synchronization and ensures the planner buffer is completely empty before the GUI sends the next task to execute.
Sergunb 0:f1834a63f7c1 88
Sergunb 0:f1834a63f7c1 89 -----
Sergunb 0:f1834a63f7c1 90 # Message Summary
Sergunb 0:f1834a63f7c1 91
Sergunb 0:f1834a63f7c1 92 In v1.1, Grbl's interface protocol has been tweaked in the attempt to make GUI development cleaner, clearer, and hopefully easier. All messages are designed to be deterministic without needing to know the context of the message. Each can be inferred to a much greater degree than before just by the message type, which are all listed below.
Sergunb 0:f1834a63f7c1 93
Sergunb 0:f1834a63f7c1 94 - **Response Messages:** Normal send command and execution response acknowledgement. Used for streaming.
Sergunb 0:f1834a63f7c1 95
Sergunb 0:f1834a63f7c1 96 - `ok` : Indicates the command line received was parsed and executed (or set to be executed).
Sergunb 0:f1834a63f7c1 97 - `error:x` : Indicated the command line received contained an error, with an error code `x`, and was purged. See error code section below for definitions.
Sergunb 0:f1834a63f7c1 98
Sergunb 0:f1834a63f7c1 99 - **Push Messages:**
Sergunb 0:f1834a63f7c1 100
Sergunb 0:f1834a63f7c1 101 - `< >` : Enclosed chevrons contains status report data.
Sergunb 0:f1834a63f7c1 102 - `Grbl X.Xx ['$' for help]` : Welcome message indicates initialization.
Sergunb 0:f1834a63f7c1 103 - `ALARM:x` : Indicates an alarm has been thrown. Grbl is now in an alarm state.
Sergunb 0:f1834a63f7c1 104 - `$x=val` and `$Nx=line` indicate a settings printout from a `$` and `$N` user query, respectively.
Sergunb 0:f1834a63f7c1 105 - `[MSG:]` : Indicates a non-queried feedback message.
Sergunb 0:f1834a63f7c1 106 - `[GC:]` : Indicates a queried `$G` g-code state message.
Sergunb 0:f1834a63f7c1 107 - `[HLP:]` : Indicates the help message.
Sergunb 0:f1834a63f7c1 108 - `[G54:]`, `[G55:]`, `[G56:]`, `[G57:]`, `[G58:]`, `[G59:]`, `[G28:]`, `[G30:]`, `[G92:]`, `[TLO:]`, and `[PRB:]` messages indicate the parameter data printout from a `$#` user query.
Sergunb 0:f1834a63f7c1 109 - `[VER:]` : Indicates build info and string from a `$I` user query.
Sergunb 0:f1834a63f7c1 110 - `[echo:]` : Indicates an automated line echo from a pre-parsed string prior to g-code parsing. Enabled by config.h option.
Sergunb 0:f1834a63f7c1 111 - `>G54G20:ok` : The open chevron indicates startup line execution. The `:ok` suffix shows it executed correctly without adding an unmatched `ok` response on a new line.
Sergunb 0:f1834a63f7c1 112
Sergunb 0:f1834a63f7c1 113 In addition, all `$x=val` settings, `error:`, and `ALARM:` messages no longer contain human-readable strings, but rather codes that are defined in other documents. The `$` help message is also reduced to just showing the available commands. Doing this saves incredible amounts of flash space. Otherwise, the new overrides features would not have fit.
Sergunb 0:f1834a63f7c1 114
Sergunb 0:f1834a63f7c1 115 Other minor changes and bug fixes that may effect GUI parsing include:
Sergunb 0:f1834a63f7c1 116
Sergunb 0:f1834a63f7c1 117 - Floating point values printed with zero precision do not show a decimal, or look like an integer. This includes spindle speed RPM and feed rate in mm mode.
Sergunb 0:f1834a63f7c1 118 - `$G` reports fixed a long time bug with program modal state. It always showed `M0` program pause when running. Now during a normal program run, no program modal state is given until an `M0`, `M2`, or `M30` is active and then the appropriate state will be shown.
Sergunb 0:f1834a63f7c1 119
Sergunb 0:f1834a63f7c1 120 On a final note, this interface tweak came about out of necessity, as more data is being sent back from Grbl and it is capable of doing many more things. It's not intended to be altered again in the near future, if at all. This is likely the only and last major change to this. If you have any comments or suggestions before Grbl v1.1 goes to master, please do immediately so we can all vet the new alteration before its installed.
Sergunb 0:f1834a63f7c1 121
Sergunb 0:f1834a63f7c1 122
Sergunb 0:f1834a63f7c1 123
Sergunb 0:f1834a63f7c1 124
Sergunb 0:f1834a63f7c1 125
Sergunb 0:f1834a63f7c1 126 ---------
Sergunb 0:f1834a63f7c1 127
Sergunb 0:f1834a63f7c1 128 # Grbl Response Messages
Sergunb 0:f1834a63f7c1 129
Sergunb 0:f1834a63f7c1 130 Every G-code block sent to Grbl and Grbl `$` system command that is terminated with a return will be parsed and processed by Grbl. Grbl will then respond either if it recognized the command with an `ok` line or if there was a problem with an `error` line.
Sergunb 0:f1834a63f7c1 131
Sergunb 0:f1834a63f7c1 132 * **`ok`**: All is good! Everything in the last line was understood by Grbl and was successfully processed and executed.
Sergunb 0:f1834a63f7c1 133
Sergunb 0:f1834a63f7c1 134 - If an empty line with only a return is sent to Grbl, it considers it a valid line and will return an `ok` too, except it didn't do anything.
Sergunb 0:f1834a63f7c1 135
Sergunb 0:f1834a63f7c1 136
Sergunb 0:f1834a63f7c1 137 * **`error:X`**: Something went wrong! Grbl did not recognize the command and did not execute anything inside that message. The `X` is given as a numeric error code to tell you exactly what happened. The table below decribes every one of them.
Sergunb 0:f1834a63f7c1 138
Sergunb 0:f1834a63f7c1 139 | ID | Error Code Description |
Sergunb 0:f1834a63f7c1 140 |:-------------:|----|
Sergunb 0:f1834a63f7c1 141 | **`1`** | G-code words consist of a letter and a value. Letter was not found. |
Sergunb 0:f1834a63f7c1 142 | **`2`** | Numeric value format is not valid or missing an expected value. |
Sergunb 0:f1834a63f7c1 143 | **`3`** | Grbl '$' system command was not recognized or supported. |
Sergunb 0:f1834a63f7c1 144 | **`4`** | Negative value received for an expected positive value. |
Sergunb 0:f1834a63f7c1 145 | **`5`** | Homing cycle is not enabled via settings. |
Sergunb 0:f1834a63f7c1 146 | **`6`** | Minimum step pulse time must be greater than 3usec |
Sergunb 0:f1834a63f7c1 147 | **`7`** | EEPROM read failed. Reset and restored to default values. |
Sergunb 0:f1834a63f7c1 148 | **`8`** | Grbl '$' command cannot be used unless Grbl is IDLE. Ensures smooth operation during a job. |
Sergunb 0:f1834a63f7c1 149 | **`9`** | G-code locked out during alarm or jog state |
Sergunb 0:f1834a63f7c1 150 | **`10`** | Soft limits cannot be enabled without homing also enabled. |
Sergunb 0:f1834a63f7c1 151 | **`11`** | Max characters per line exceeded. Line was not processed and executed. |
Sergunb 0:f1834a63f7c1 152 | **`12`** | (Compile Option) Grbl '$' setting value exceeds the maximum step rate supported. |
Sergunb 0:f1834a63f7c1 153 | **`13`** | Safety door detected as opened and door state initiated. |
Sergunb 0:f1834a63f7c1 154 | **`14`** | (Grbl-Mega Only) Build info or startup line exceeded EEPROM line length limit. |
Sergunb 0:f1834a63f7c1 155 | **`15`** | Jog target exceeds machine travel. Command ignored. |
Sergunb 0:f1834a63f7c1 156 | **`16`** | Jog command with no '=' or contains prohibited g-code. |
Sergunb 0:f1834a63f7c1 157 | **`17`** | Laser mode disabled. Requires PWM output. |
Sergunb 0:f1834a63f7c1 158 | **`20`** | Unsupported or invalid g-code command found in block. |
Sergunb 0:f1834a63f7c1 159 | **`21`** | More than one g-code command from same modal group found in block.|
Sergunb 0:f1834a63f7c1 160 | **`22`** | Feed rate has not yet been set or is undefined. |
Sergunb 0:f1834a63f7c1 161 | **`23`** | G-code command in block requires an integer value. |
Sergunb 0:f1834a63f7c1 162 | **`24`** | Two G-code commands that both require the use of the `XYZ` axis words were detected in the block.|
Sergunb 0:f1834a63f7c1 163 | **`25`** | A G-code word was repeated in the block.|
Sergunb 0:f1834a63f7c1 164 | **`26`** | A G-code command implicitly or explicitly requires `XYZ` axis words in the block, but none were detected.|
Sergunb 0:f1834a63f7c1 165 | **`27`**| `N` line number value is not within the valid range of `1` - `9,999,999`. |
Sergunb 0:f1834a63f7c1 166 | **`28`** | A G-code command was sent, but is missing some required `P` or `L` value words in the line. |
Sergunb 0:f1834a63f7c1 167 | **`29`** | Grbl supports six work coordinate systems `G54-G59`. `G59.1`, `G59.2`, and `G59.3` are not supported.|
Sergunb 0:f1834a63f7c1 168 | **`30`**| The `G53` G-code command requires either a `G0` seek or `G1` feed motion mode to be active. A different motion was active.|
Sergunb 0:f1834a63f7c1 169 | **`31`** | There are unused axis words in the block and `G80` motion mode cancel is active.|
Sergunb 0:f1834a63f7c1 170 | **`32`** | A `G2` or `G3` arc was commanded but there are no `XYZ` axis words in the selected plane to trace the arc.|
Sergunb 0:f1834a63f7c1 171 | **`33`** | The motion command has an invalid target. `G2`, `G3`, and `G38.2` generates this error, if the arc is impossible to generate or if the probe target is the current position.|
Sergunb 0:f1834a63f7c1 172 | **`34`** | A `G2` or `G3` arc, traced with the radius definition, had a mathematical error when computing the arc geometry. Try either breaking up the arc into semi-circles or quadrants, or redefine them with the arc offset definition.|
Sergunb 0:f1834a63f7c1 173 | **`35`** | A `G2` or `G3` arc, traced with the offset definition, is missing the `IJK` offset word in the selected plane to trace the arc.|
Sergunb 0:f1834a63f7c1 174 | **`36`** | There are unused, leftover G-code words that aren't used by any command in the block.|
Sergunb 0:f1834a63f7c1 175 | **`37`** | The `G43.1` dynamic tool length offset command cannot apply an offset to an axis other than its configured axis. The Grbl default axis is the Z-axis.|
Sergunb 0:f1834a63f7c1 176 | **`38`** | Tool number greater than max supported value.|
Sergunb 0:f1834a63f7c1 177
Sergunb 0:f1834a63f7c1 178
Sergunb 0:f1834a63f7c1 179 ----------------------
Sergunb 0:f1834a63f7c1 180
Sergunb 0:f1834a63f7c1 181 # Grbl Push Messages
Sergunb 0:f1834a63f7c1 182
Sergunb 0:f1834a63f7c1 183 Along with the response message to indicate successfully executing a line command sent to Grbl, Grbl provides additional push messages for important feedback of its current state or if something went horribly wrong. These messages are "pushed" from Grbl and may appear at anytime. They are usually in response to a user query or some system event that Grbl needs to tell you about immediately. These push messages are organized into six general classes:
Sergunb 0:f1834a63f7c1 184
Sergunb 0:f1834a63f7c1 185 - **_Welcome message_** - A unique message to indicate Grbl has initialized.
Sergunb 0:f1834a63f7c1 186
Sergunb 0:f1834a63f7c1 187 - **_ALARM messages_** - Means an emergency mode has been enacted and shut down normal use.
Sergunb 0:f1834a63f7c1 188
Sergunb 0:f1834a63f7c1 189 - **_'$' settings messages_** - Contains the type and data value for a Grbl setting.
Sergunb 0:f1834a63f7c1 190
Sergunb 0:f1834a63f7c1 191 - **_Feedback messages_** - Contains general feedback and can provide useful data.
Sergunb 0:f1834a63f7c1 192
Sergunb 0:f1834a63f7c1 193 - **_Startup line execution_** - Indicates a startup line as executed with the line itself and how it went.
Sergunb 0:f1834a63f7c1 194
Sergunb 0:f1834a63f7c1 195 - **_Real-time status reports_** - Contains current run data like state, position, and speed.
Sergunb 0:f1834a63f7c1 196
Sergunb 0:f1834a63f7c1 197
Sergunb 0:f1834a63f7c1 198 ------
Sergunb 0:f1834a63f7c1 199
Sergunb 0:f1834a63f7c1 200 #### Welcome Message
Sergunb 0:f1834a63f7c1 201
Sergunb 0:f1834a63f7c1 202 **`Grbl X.Xx ['$' for help]`**
Sergunb 0:f1834a63f7c1 203
Sergunb 0:f1834a63f7c1 204 The start up message always prints upon startup and after a reset. Whenever you see this message, this also means that Grbl has completed re-initializing all its systems, so everything starts out the same every time you use Grbl.
Sergunb 0:f1834a63f7c1 205
Sergunb 0:f1834a63f7c1 206 * `X.Xx` indicates the major version number, followed by a minor version letter. The major version number indicates the general release, while the letter simply indicates a feature update or addition from the preceding minor version letter.
Sergunb 0:f1834a63f7c1 207 * Bug fix revisions are tracked by the build info version number, printed when an `$I` command is sent. These revisions don't update the version number and are given by date revised in year, month, and day, like so `20161014`.
Sergunb 0:f1834a63f7c1 208
Sergunb 0:f1834a63f7c1 209 -----
Sergunb 0:f1834a63f7c1 210
Sergunb 0:f1834a63f7c1 211 #### Alarm Message
Sergunb 0:f1834a63f7c1 212
Sergunb 0:f1834a63f7c1 213 Alarm is an emergency state. Something has gone terribly wrong when these occur. Typically, they are caused by limit error when the machine has moved or wants to move outside the machine travel and crash into the ends. They also report problems if Grbl is lost and can't guarantee positioning or a probe command has failed. Once in alarm-mode, Grbl will lock out all g-code functionality and accept only a small set of commands. It may even stop everything and force you to acknowledge the problem until you issue Grbl a reset. While in alarm-mode, the user can override the alarm manually with a specific command, which then re-enables g-code so you can move the machine again. This ensures the user knows about the problem and has taken steps to fix or account for it.
Sergunb 0:f1834a63f7c1 214
Sergunb 0:f1834a63f7c1 215 Similar to error messages, all alarm messages are sent as **`ALARM:X`**, where `X` is an alarm code to tell you exacly what caused the alarm. The table below describes the meaning of each alarm code.
Sergunb 0:f1834a63f7c1 216
Sergunb 0:f1834a63f7c1 217 | ID | Alarm Code Description |
Sergunb 0:f1834a63f7c1 218 |:-------------:|----|
Sergunb 0:f1834a63f7c1 219 | **`1`** | Hard limit triggered. Machine position is likely lost due to sudden and immediate halt. Re-homing is highly recommended. |
Sergunb 0:f1834a63f7c1 220 | **`2`** | G-code motion target exceeds machine travel. Machine position safely retained. Alarm may be unlocked. |
Sergunb 0:f1834a63f7c1 221 | **`3`** | Reset while in motion. Grbl cannot guarantee position. Lost steps are likely. Re-homing is highly recommended. |
Sergunb 0:f1834a63f7c1 222 | **`4`** | Probe fail. The probe is not in the expected initial state before starting probe cycle, where G38.2 and G38.3 is not triggered and G38.4 and G38.5 is triggered. |
Sergunb 0:f1834a63f7c1 223 | **`5`** | Probe fail. Probe did not contact the workpiece within the programmed travel for G38.2 and G38.4. |
Sergunb 0:f1834a63f7c1 224 | **`6`** | Homing fail. Reset during active homing cycle. |
Sergunb 0:f1834a63f7c1 225 | **`7`** | Homing fail. Safety door was opened during active homing cycle. |
Sergunb 0:f1834a63f7c1 226 | **`8`** | Homing fail. Cycle failed to clear limit switch when pulling off. Try increasing pull-off setting or check wiring. |
Sergunb 0:f1834a63f7c1 227 | **`9`** | Homing fail. Could not find limit switch within search distance. Defined as `1.5 * max_travel` on search and `5 * pulloff` on locate phases. |
Sergunb 0:f1834a63f7c1 228
Sergunb 0:f1834a63f7c1 229 -------
Sergunb 0:f1834a63f7c1 230
Sergunb 0:f1834a63f7c1 231 #### Grbl `$` Settings Message
Sergunb 0:f1834a63f7c1 232
Sergunb 0:f1834a63f7c1 233 When a push message starts with a `$`, this indicates Grbl is sending a setting and its configured value. There are only two types of settings messages: a single setting and value `$x=val` and a startup string setting `$Nx=line`. See [Configuring Grbl v1.x] document if you'd like to learn how to write these values for your machine.
Sergunb 0:f1834a63f7c1 234
Sergunb 0:f1834a63f7c1 235 - `$x=val` will only appear when the user queries to print all of Grbl's settings via the `$$` print settings command. It does so sequentially and completes with an `ok`.
Sergunb 0:f1834a63f7c1 236
Sergunb 0:f1834a63f7c1 237 - In prior versions of Grbl, the `$` settings included a short description of the setting immediately after the value. However, due to flash restrictions, most human-readable strings were removed to free up flash for the new override features in Grbl v1.1. In short, it was these strings or overrides, and overrides won. Keep in mind that once these values are set, they usually don't change, and GUIs will likely provide the assistance of translating these codes for users.
Sergunb 0:f1834a63f7c1 238
Sergunb 0:f1834a63f7c1 239 - _**NOTE for GUI developers:**_ _As with the error and alarm codes, settings codes are available in an easy to parse CSV file in the `/doc/csv` folder. These are continually updated._
Sergunb 0:f1834a63f7c1 240
Sergunb 0:f1834a63f7c1 241 - The `$$` settings print out is shown below and the following describes each setting.
Sergunb 0:f1834a63f7c1 242
Sergunb 0:f1834a63f7c1 243 ```
Sergunb 0:f1834a63f7c1 244 $0=10
Sergunb 0:f1834a63f7c1 245 $1=25
Sergunb 0:f1834a63f7c1 246 $2=0
Sergunb 0:f1834a63f7c1 247 $3=0
Sergunb 0:f1834a63f7c1 248 $4=0
Sergunb 0:f1834a63f7c1 249 $5=0
Sergunb 0:f1834a63f7c1 250 $6=0
Sergunb 0:f1834a63f7c1 251 $10=255
Sergunb 0:f1834a63f7c1 252 $11=0.010
Sergunb 0:f1834a63f7c1 253 $12=0.002
Sergunb 0:f1834a63f7c1 254 $13=0
Sergunb 0:f1834a63f7c1 255 $20=0
Sergunb 0:f1834a63f7c1 256 $21=0
Sergunb 0:f1834a63f7c1 257 $22=0
Sergunb 0:f1834a63f7c1 258 $23=0
Sergunb 0:f1834a63f7c1 259 $24=25.000
Sergunb 0:f1834a63f7c1 260 $25=500.000
Sergunb 0:f1834a63f7c1 261 $26=250
Sergunb 0:f1834a63f7c1 262 $27=1.000
Sergunb 0:f1834a63f7c1 263 $30=1000
Sergunb 0:f1834a63f7c1 264 $31=0
Sergunb 0:f1834a63f7c1 265 $32=0
Sergunb 0:f1834a63f7c1 266 $100=250.000
Sergunb 0:f1834a63f7c1 267 $101=250.000
Sergunb 0:f1834a63f7c1 268 $102=250.000
Sergunb 0:f1834a63f7c1 269 $110=500.000
Sergunb 0:f1834a63f7c1 270 $111=500.000
Sergunb 0:f1834a63f7c1 271 $112=500.000
Sergunb 0:f1834a63f7c1 272 $120=10.000
Sergunb 0:f1834a63f7c1 273 $121=10.000
Sergunb 0:f1834a63f7c1 274 $122=10.000
Sergunb 0:f1834a63f7c1 275 $130=200.000
Sergunb 0:f1834a63f7c1 276 $131=200.000
Sergunb 0:f1834a63f7c1 277 $132=200.000
Sergunb 0:f1834a63f7c1 278 ok
Sergunb 0:f1834a63f7c1 279 ```
Sergunb 0:f1834a63f7c1 280
Sergunb 0:f1834a63f7c1 281 | `$x` Code | Setting Description, Units |
Sergunb 0:f1834a63f7c1 282 |:-------------:|----|
Sergunb 0:f1834a63f7c1 283 | **`0`** | Step pulse time, microseconds |
Sergunb 0:f1834a63f7c1 284 | **`1`** | Step idle delay, milliseconds |
Sergunb 0:f1834a63f7c1 285 | **`2`** | Step pulse invert, mask |
Sergunb 0:f1834a63f7c1 286 | **`3`** | Step direction invert, mask |
Sergunb 0:f1834a63f7c1 287 | **`4`** | Invert step enable pin, boolean |
Sergunb 0:f1834a63f7c1 288 | **`5`** | Invert limit pins, boolean |
Sergunb 0:f1834a63f7c1 289 | **`6`** | Invert probe pin, boolean |
Sergunb 0:f1834a63f7c1 290 | **`10`** | Status report options, mask |
Sergunb 0:f1834a63f7c1 291 | **`11`** | Junction deviation, millimeters |
Sergunb 0:f1834a63f7c1 292 | **`12`** | Arc tolerance, millimeters |
Sergunb 0:f1834a63f7c1 293 | **`13`** | Report in inches, boolean |
Sergunb 0:f1834a63f7c1 294 | **`20`** | Soft limits enable, boolean |
Sergunb 0:f1834a63f7c1 295 | **`21`** | Hard limits enable, boolean |
Sergunb 0:f1834a63f7c1 296 | **`22`** | Homing cycle enable, boolean |
Sergunb 0:f1834a63f7c1 297 | **`23`** | Homing direction invert, mask |
Sergunb 0:f1834a63f7c1 298 | **`24`** | Homing locate feed rate, mm/min |
Sergunb 0:f1834a63f7c1 299 | **`25`** | Homing search seek rate, mm/min |
Sergunb 0:f1834a63f7c1 300 | **`26`** | Homing switch debounce delay, milliseconds |
Sergunb 0:f1834a63f7c1 301 | **`27`** | Homing switch pull-off distance, millimeters |
Sergunb 0:f1834a63f7c1 302 | **`30`** | Maximum spindle speed, RPM |
Sergunb 0:f1834a63f7c1 303 | **`31`** | Minimum spindle speed, RPM |
Sergunb 0:f1834a63f7c1 304 | **`32`** | Laser-mode enable, boolean |
Sergunb 0:f1834a63f7c1 305 | **`100`** | X-axis steps per millimeter |
Sergunb 0:f1834a63f7c1 306 | **`101`** | Y-axis steps per millimeter |
Sergunb 0:f1834a63f7c1 307 | **`102`** | Z-axis steps per millimeter |
Sergunb 0:f1834a63f7c1 308 | **`110`** | X-axis maximum rate, mm/min |
Sergunb 0:f1834a63f7c1 309 | **`111`** | Y-axis maximum rate, mm/min |
Sergunb 0:f1834a63f7c1 310 | **`112`** | Z-axis maximum rate, mm/min |
Sergunb 0:f1834a63f7c1 311 | **`120`** | X-axis acceleration, mm/sec^2 |
Sergunb 0:f1834a63f7c1 312 | **`121`** | Y-axis acceleration, mm/sec^2 |
Sergunb 0:f1834a63f7c1 313 | **`122`** | Z-axis acceleration, mm/sec^2 |
Sergunb 0:f1834a63f7c1 314 | **`130`** | X-axis maximum travel, millimeters |
Sergunb 0:f1834a63f7c1 315 | **`131`** | Y-axis maximum travel, millimeters |
Sergunb 0:f1834a63f7c1 316 | **`132`** | Z-axis maximum travel, millimeters |
Sergunb 0:f1834a63f7c1 317
Sergunb 0:f1834a63f7c1 318
Sergunb 0:f1834a63f7c1 319 - The other `$Nx=line` message is the print-out of a user-defined startup line, where `x` denotes the startup line order and ranges from `0` to `1` by default. The `line` denotes the startup line to be executed by Grbl upon reset or power-up, except during an ALARM.
Sergunb 0:f1834a63f7c1 320
Sergunb 0:f1834a63f7c1 321 - When a user queries for the startup lines via a `$N` command, the following is sent by Grbl and completed by an `ok` response. The first line sets the initial startup work coordinate system to `G54`, while the second line is empty and does not execute.
Sergunb 0:f1834a63f7c1 322 ```
Sergunb 0:f1834a63f7c1 323 $N0=G54
Sergunb 0:f1834a63f7c1 324 $N1=
Sergunb 0:f1834a63f7c1 325 ok
Sergunb 0:f1834a63f7c1 326 ```
Sergunb 0:f1834a63f7c1 327
Sergunb 0:f1834a63f7c1 328
Sergunb 0:f1834a63f7c1 329 ------
Sergunb 0:f1834a63f7c1 330
Sergunb 0:f1834a63f7c1 331 #### Feedback Messages
Sergunb 0:f1834a63f7c1 332
Sergunb 0:f1834a63f7c1 333 Feedback messages provide non-critical information on what Grbl is doing, what it needs, and/or provide some non-real-time data for the user when queried. Not too complicated. Feedback message are always enclosed in `[]` brackets, except for the startup line execution message which begins with an open chevron character `>`.
Sergunb 0:f1834a63f7c1 334
Sergunb 0:f1834a63f7c1 335 - **Non-Queried Feedback Messages:** These feedback messages that may appear at any time and is not part of a query are listed and described below. They are usually sent as an additional helpful acknowledgement of some event or command executed. These always start with a `[MSG:` to denote their type.
Sergunb 0:f1834a63f7c1 336
Sergunb 0:f1834a63f7c1 337 - `[MSG:Reset to continue]` - Critical event message. Reset is required before Grbl accepts any other commands. This prevents ongoing command streaming and risking a motion before the alarm is acknowledged. Only hard or soft limit errors send this message immediately after the ALARM:x code.
Sergunb 0:f1834a63f7c1 338
Sergunb 0:f1834a63f7c1 339 - `[MSG:‘$H’|’$X’ to unlock]`- Alarm state is active at initialization. This message serves as a reminder note on how to cancel the alarm state. All g-code commands and some ‘$’ are blocked until the alarm state is cancelled via homing `$H` or unlocking `$X`. Only appears immediately after the `Grbl` welcome message when initialized with an alarm. Startup lines are not executed at initialization if this message is present and the alarm is active.
Sergunb 0:f1834a63f7c1 340
Sergunb 0:f1834a63f7c1 341 - `[MSG:Caution: Unlocked]` - Appears as an alarm unlock `$X` acknowledgement. An 'ok' still appears immediately after to denote the `$X` was parsed and executed. This message reminds the user that Grbl is operating under an unlock state, where startup lines have still not be executed and should be cautious and mindful of what they do. Grbl may not have retained machine position due to an alarm suddenly halting the machine. A reset or re-homing Grbl is highly recommended as soon as possible, where any startup lines will be properly executed.
Sergunb 0:f1834a63f7c1 342
Sergunb 0:f1834a63f7c1 343 - `[MSG:Enabled]` - Appears as a check-mode `$C` enabled acknowledgement. An 'ok' still appears immediately after to denote the `$C` was parsed and executed.
Sergunb 0:f1834a63f7c1 344
Sergunb 0:f1834a63f7c1 345 - `[MSG:Disabled]` - Appears as a check-mode `$C` disabled acknowledgement. An 'ok' still appears immediately after to denote the `$C` was parsed and executed. Grbl is automatically reset afterwards to restore all default g-code parser states changed by the check-mode.
Sergunb 0:f1834a63f7c1 346
Sergunb 0:f1834a63f7c1 347 - `[MSG:Check Door]` - This message appears whenever the safety door detected as open. This includes immediately upon a safety door switch detects a pin change or appearing after the welcome message, if the safety door is ajar when Grbl initializes after a power-up/reset.
Sergunb 0:f1834a63f7c1 348
Sergunb 0:f1834a63f7c1 349 - If in motion and the safety door switch is triggered, Grbl will immediately send this message, start a feed hold, and place Grbl into a suspend with the DOOR state.
Sergunb 0:f1834a63f7c1 350 - If not in motion and not at startup, the same process occurs without the feed hold.
Sergunb 0:f1834a63f7c1 351 - If Grbl is in a DOOR state and already suspended, any detected door switch pin detected will generate this message, including a door close.
Sergunb 0:f1834a63f7c1 352 - If this message appears at startup, Grbl will suspended into immediately into the DOOR state. The startup lines are executed immediately after the DOOR state is exited by closing the door and sending Grbl a resume command.
Sergunb 0:f1834a63f7c1 353
Sergunb 0:f1834a63f7c1 354 - `[MSG:Check Limits]` - If Grbl detects a limit switch as triggered after a power-up/reset and hard limits are enabled, this will appear as a courtesy message immediately after the Grbl welcome message.
Sergunb 0:f1834a63f7c1 355
Sergunb 0:f1834a63f7c1 356 - `[MSG:Pgm End]` - M2/30 program end message to denote g-code modes have been restored to defaults according to the M2/30 g-code description.
Sergunb 0:f1834a63f7c1 357
Sergunb 0:f1834a63f7c1 358 - `[MSG:Restoring defaults]` - Appears as an acknowledgement message when restoring EEPROM defaults via a `$RST=` command. An 'ok' still appears immediately after to denote the `$RST=` was parsed and executed.
Sergunb 0:f1834a63f7c1 359
Sergunb 0:f1834a63f7c1 360 - `[MSG:Sleeping]` - Appears as an acknowledgement message when Grbl's sleep mode is invoked by issuing a `$SLP` command when in IDLE or ALARM states. Note that Grbl-Mega may invoke this at any time when the sleep timer option has been enabled and the timeout has been exceeded. Grbl may only be exited by a reset in the sleep state and will automatically enter an alarm state since the steppers were disabled.
Sergunb 0:f1834a63f7c1 361 - NOTE: Sleep will also invoke the parking motion, if it's enabled. However, if sleep is commanded during an ALARM, Grbl will not park and will simply de-energize everything and go to sleep.
Sergunb 0:f1834a63f7c1 362
Sergunb 0:f1834a63f7c1 363 - **Queried Feedback Messages:**
Sergunb 0:f1834a63f7c1 364
Sergunb 0:f1834a63f7c1 365 - `[GC:]` G-code Parser State Message
Sergunb 0:f1834a63f7c1 366
Sergunb 0:f1834a63f7c1 367 ```
Sergunb 0:f1834a63f7c1 368 [GC:G0 G54 G17 G21 G90 G94 M5 M9 T0 F0.0 S0]
Sergunb 0:f1834a63f7c1 369 ok
Sergunb 0:f1834a63f7c1 370 ```
Sergunb 0:f1834a63f7c1 371
Sergunb 0:f1834a63f7c1 372 - Initiated by the user via a `$G` command. Grbl replies as follows, where the `[GC:` denotes the message type and is followed by a separate `ok` to confirm the `$G` was executed.
Sergunb 0:f1834a63f7c1 373
Sergunb 0:f1834a63f7c1 374 - The shown g-code are the current modal states of Grbl's g-code parser. This may not correlate to what is executing since there are usually several motions queued in the planner buffer.
Sergunb 0:f1834a63f7c1 375
Sergunb 0:f1834a63f7c1 376 - NOTE: Program modal state has been fixed and will show `M0`, `M2`, or `M30` when they are active. During a run state, nothing will appear for program modal state.
Sergunb 0:f1834a63f7c1 377
Sergunb 0:f1834a63f7c1 378
Sergunb 0:f1834a63f7c1 379
Sergunb 0:f1834a63f7c1 380 - `[HLP:]` : Initiated by the user via a `$` print help command. The help message is shown below with a separate `ok` to confirm the `$` was executed.
Sergunb 0:f1834a63f7c1 381 ```
Sergunb 0:f1834a63f7c1 382 [HLP:$$ $# $G $I $N $x=val $Nx=line $J=line $C $X $H ~ ! ? ctrl-x]
Sergunb 0:f1834a63f7c1 383 ok
Sergunb 0:f1834a63f7c1 384 ```
Sergunb 0:f1834a63f7c1 385 - _**NOTE:** Grbl v1.1's new override real-time commands are not included in the help message. They use the extended-ASCII character set, which are not easily type-able, and require a GUI that supports them. This is for two reasons: Establish enough characters for all of the overrides with extra for later growth, and prevent accidental keystrokes or characters in a g-code file from enacting an override inadvertently._
Sergunb 0:f1834a63f7c1 386
Sergunb 0:f1834a63f7c1 387
Sergunb 0:f1834a63f7c1 388 - The `$#` print parameter data query produces a large set of data which shown below and completed by an `ok` response message.
Sergunb 0:f1834a63f7c1 389
Sergunb 0:f1834a63f7c1 390 - Each line of the printout is starts with the data type, a `:`, and followed by the data values. If there is more than one, the order is XYZ axes, separated by commas.
Sergunb 0:f1834a63f7c1 391
Sergunb 0:f1834a63f7c1 392 ```
Sergunb 0:f1834a63f7c1 393 [G54:0.000,0.000,0.000]
Sergunb 0:f1834a63f7c1 394 [G55:0.000,0.000,0.000]
Sergunb 0:f1834a63f7c1 395 [G56:0.000,0.000,0.000]
Sergunb 0:f1834a63f7c1 396 [G57:0.000,0.000,0.000]
Sergunb 0:f1834a63f7c1 397 [G58:0.000,0.000,0.000]
Sergunb 0:f1834a63f7c1 398 [G59:0.000,0.000,0.000]
Sergunb 0:f1834a63f7c1 399 [G28:0.000,0.000,0.000]
Sergunb 0:f1834a63f7c1 400 [G30:0.000,0.000,0.000]
Sergunb 0:f1834a63f7c1 401 [G92:0.000,0.000,0.000]
Sergunb 0:f1834a63f7c1 402 [TLO:0.000]
Sergunb 0:f1834a63f7c1 403 [PRB:0.000,0.000,0.000:0]
Sergunb 0:f1834a63f7c1 404 ok
Sergunb 0:f1834a63f7c1 405 ```
Sergunb 0:f1834a63f7c1 406
Sergunb 0:f1834a63f7c1 407 - The `PRB:` probe parameter message includes an additional `:` and suffix value is a boolean. It denotes whether the last probe cycle was successful or not.
Sergunb 0:f1834a63f7c1 408
Sergunb 0:f1834a63f7c1 409 - `[VER:]` and `[OPT:]`: Indicates build info data from a `$I` user query. These build info messages are followed by an `ok` to confirm the `$I` was executed, like so:
Sergunb 0:f1834a63f7c1 410
Sergunb 0:f1834a63f7c1 411 ```
Sergunb 0:f1834a63f7c1 412 [VER:v1.1f.20170131:Some string]
Sergunb 0:f1834a63f7c1 413 [OPT:VL,16,128]
Sergunb 0:f1834a63f7c1 414 ok
Sergunb 0:f1834a63f7c1 415 ```
Sergunb 0:f1834a63f7c1 416
Sergunb 0:f1834a63f7c1 417 - The first line `[VER:]` contains the build version and date.
Sergunb 0:f1834a63f7c1 418 - A string may appear after the second `:` colon. It is a stored EEPROM string a user via a `$I=line` command or OEM can place there for personal use or tracking purposes.
Sergunb 0:f1834a63f7c1 419 - The `[OPT:]` line follows immediately after and contains character codes for compile-time options that were either enabled or disabled and two values separated by commas, which indicates the total usable planner blocks and serial RX buffer bytes, respectively. The codes are defined below and a CSV file is also provided for quick parsing. This is generally only used for quickly diagnosing firmware bugs or compatibility issues.
Sergunb 0:f1834a63f7c1 420
Sergunb 0:f1834a63f7c1 421 | `OPT` Code | Setting Description, Units |
Sergunb 0:f1834a63f7c1 422 |:-------------:|----|
Sergunb 0:f1834a63f7c1 423 | **`V`** | Variable spindle enabled |
Sergunb 0:f1834a63f7c1 424 | **`N`** | Line numbers enabled |
Sergunb 0:f1834a63f7c1 425 | **`M`** | Mist coolant enabled |
Sergunb 0:f1834a63f7c1 426 | **`C`** | CoreXY enabled |
Sergunb 0:f1834a63f7c1 427 | **`P`** | Parking motion enabled |
Sergunb 0:f1834a63f7c1 428 | **`Z`** | Homing force origin enabled |
Sergunb 0:f1834a63f7c1 429 | **`H`** | Homing single axis enabled |
Sergunb 0:f1834a63f7c1 430 | **`T`** | Two limit switches on axis enabled |
Sergunb 0:f1834a63f7c1 431 | **`D`** | Spindle direction pin used as enable pin |
Sergunb 0:f1834a63f7c1 432 | **`0`** | Spindle enable off when speed is zero enabled |
Sergunb 0:f1834a63f7c1 433 | **`S`** | Software limit pin debouncing enabled |
Sergunb 0:f1834a63f7c1 434 | **`R`** | Parking override control enabled |
Sergunb 0:f1834a63f7c1 435 | **`A`** | Allow feed rate overrides in probe cycles |
Sergunb 0:f1834a63f7c1 436 | **`*`** | Restore all EEPROM disabled |
Sergunb 0:f1834a63f7c1 437 | **`$`** | Restore EEPROM `$` settings disabled |
Sergunb 0:f1834a63f7c1 438 | **`#`** | Restore EEPROM parameter data disabled |
Sergunb 0:f1834a63f7c1 439 | **`I`** | Build info write user string disabled |
Sergunb 0:f1834a63f7c1 440 | **`E`** | Force sync upon EEPROM write disabled |
Sergunb 0:f1834a63f7c1 441 | **`W`** | Force sync upon work coordinate offset change disabled |
Sergunb 0:f1834a63f7c1 442 | **`L`** | Homing initialization auto-lock disabled |
Sergunb 0:f1834a63f7c1 443
Sergunb 0:f1834a63f7c1 444 - `[echo:]` : Indicates an automated line echo from a command just prior to being parsed and executed. May be enabled only by a config.h option. Often used for debugging communication issues. A typical line echo message is shown below. A separate `ok` will eventually appear to confirm the line has been parsed and executed, but may not be immediate as with any line command containing motions.
Sergunb 0:f1834a63f7c1 445 ```
Sergunb 0:f1834a63f7c1 446 [echo:G1X0.540Y10.4F100]
Sergunb 0:f1834a63f7c1 447 ```
Sergunb 0:f1834a63f7c1 448 - NOTE: The echoed line will have been pre-parsed a bit by Grbl. No spaces or comments will appear and all letters will be capitalized.
Sergunb 0:f1834a63f7c1 449
Sergunb 0:f1834a63f7c1 450 ------
Sergunb 0:f1834a63f7c1 451
Sergunb 0:f1834a63f7c1 452 #### Startup Line Execution
Sergunb 0:f1834a63f7c1 453
Sergunb 0:f1834a63f7c1 454 - `>G54G20:ok` : The open chevron indicates a startup line has just executed. The startup line `G54G20` immediately follows the `>` character and is followed by an `:ok` response to indicate it executed successfully.
Sergunb 0:f1834a63f7c1 455
Sergunb 0:f1834a63f7c1 456 - A startup line will execute upon initialization only if a line is present and if Grbl is not in an alarm state.
Sergunb 0:f1834a63f7c1 457
Sergunb 0:f1834a63f7c1 458 - The `:ok` on the same line is intentional. It prevents this `ok` response from being counted as part of a stream, because it is not tied to a sent command, but an internally-generated one.
Sergunb 0:f1834a63f7c1 459
Sergunb 0:f1834a63f7c1 460 - There should always be an appended `:ok` because the startup line is checked for validity before it is stored in EEPROM. In the event that it's not, Grbl will print `>G54G20:error:X`, where `X` is the error code explaining why the startup line failed to execute.
Sergunb 0:f1834a63f7c1 461
Sergunb 0:f1834a63f7c1 462 - In the rare chance that there is an EEPROM read error, the startup line execution will print `>:error:7` with no startup line and a error code `7` for a read fail. Grbl will also automatically wipe and try to restore the problematic EEPROM.
Sergunb 0:f1834a63f7c1 463
Sergunb 0:f1834a63f7c1 464
Sergunb 0:f1834a63f7c1 465 ------
Sergunb 0:f1834a63f7c1 466
Sergunb 0:f1834a63f7c1 467 #### Real-time Status Reports
Sergunb 0:f1834a63f7c1 468
Sergunb 0:f1834a63f7c1 469 - Contains real-time data of Grbl’s state, position, and other data required independently of the stream.
Sergunb 0:f1834a63f7c1 470
Sergunb 0:f1834a63f7c1 471 - Categorized as a real-time message, where it is a separate message that should not be counted as part of the streaming protocol. It may appear at any given time.
Sergunb 0:f1834a63f7c1 472
Sergunb 0:f1834a63f7c1 473 - A status report is initiated by sending Grbl a '?' character.
Sergunb 0:f1834a63f7c1 474
Sergunb 0:f1834a63f7c1 475 - Like all real-time commands, the '?' character is intercepted and never enters the serial buffer. It's never a part of the stream and can be sent at any time.
Sergunb 0:f1834a63f7c1 476
Sergunb 0:f1834a63f7c1 477 - Grbl will generate and transmit a report within ~5-20 milliseconds.
Sergunb 0:f1834a63f7c1 478
Sergunb 0:f1834a63f7c1 479 - Every ’?’ command sent by a GUI is not guaranteed with a response. The following are the current scenarios when Grbl may not immediately or ignore a status report request. _NOTE: These may change in the future and will be documented here._
Sergunb 0:f1834a63f7c1 480
Sergunb 0:f1834a63f7c1 481 - If two or more '?' queries are sent before the first report is generated, the additional queries are ignored.
Sergunb 0:f1834a63f7c1 482
Sergunb 0:f1834a63f7c1 483 - A soft-reset commanded clears the last status report query.
Sergunb 0:f1834a63f7c1 484
Sergunb 0:f1834a63f7c1 485 - When Grbl throws a critical alarm from a limit violation. A soft-reset is required to resume operation.
Sergunb 0:f1834a63f7c1 486
Sergunb 0:f1834a63f7c1 487 - During a homing cycle.
Sergunb 0:f1834a63f7c1 488
Sergunb 0:f1834a63f7c1 489 - **Message Construction:**
Sergunb 0:f1834a63f7c1 490
Sergunb 0:f1834a63f7c1 491 - A message is a single line of ascii text, completed by a carriage return and line feed.
Sergunb 0:f1834a63f7c1 492
Sergunb 0:f1834a63f7c1 493 - `< >` Chevrons uniquely enclose reports to indicate message type.
Sergunb 0:f1834a63f7c1 494
Sergunb 0:f1834a63f7c1 495 - `|` Pipe delimiters separate data fields inside the report.
Sergunb 0:f1834a63f7c1 496
Sergunb 0:f1834a63f7c1 497 - The first data field is an exception to the following data field rules. See 'Machine State' description for details.
Sergunb 0:f1834a63f7c1 498
Sergunb 0:f1834a63f7c1 499 - All remaining data fields consist of a data type followed by a `:` colon delimiter and data values. `type:value(s)`
Sergunb 0:f1834a63f7c1 500
Sergunb 0:f1834a63f7c1 501 - Data values are given either as as one or more pre-defined character codes to indicate certain states/conditions or as numeric values, which are separated by a `,` comma delimiter when more than one is present. Numeric values are also in a pre-defined order and units of measure.
Sergunb 0:f1834a63f7c1 502
Sergunb 0:f1834a63f7c1 503 - The first (Machine State) and second (Current Position) data fields are always included in every report.
Sergunb 0:f1834a63f7c1 504
Sergunb 0:f1834a63f7c1 505 - Assume any following data field may or may not exist and can be in any order. The `$10` status report mask setting can alter what data is present and certain data fields can be reported intermittently (see descriptions for details.)
Sergunb 0:f1834a63f7c1 506
Sergunb 0:f1834a63f7c1 507 - The `$13` report inches settings alters the units of some data values. `$13=0` false indicates mm-mode, while `$13=1` true indicates inch-mode reporting. Keep note of this setting and which report values can be altered.
Sergunb 0:f1834a63f7c1 508
Sergunb 0:f1834a63f7c1 509 - **Data Field Descriptions:**
Sergunb 0:f1834a63f7c1 510
Sergunb 0:f1834a63f7c1 511 - **Machine State:**
Sergunb 0:f1834a63f7c1 512
Sergunb 0:f1834a63f7c1 513 - Valid states types: `Idle, Run, Hold, Jog, Alarm, Door, Check, Home, Sleep`
Sergunb 0:f1834a63f7c1 514
Sergunb 0:f1834a63f7c1 515 - Sub-states may be included via `:` a colon delimiter and numeric code.
Sergunb 0:f1834a63f7c1 516
Sergunb 0:f1834a63f7c1 517 - Current sub-states are:
Sergunb 0:f1834a63f7c1 518
Sergunb 0:f1834a63f7c1 519 - `Hold:0` Hold complete. Ready to resume.
Sergunb 0:f1834a63f7c1 520 - `Hold:1` Hold in-progress. Reset will throw an alarm.
Sergunb 0:f1834a63f7c1 521 - `Door:0` Door closed. Ready to resume.
Sergunb 0:f1834a63f7c1 522 - `Door:1` Machine stopped. Door still ajar. Can't resume until closed.
Sergunb 0:f1834a63f7c1 523 - `Door:2` Door opened. Hold (or parking retract) in-progress. Reset will throw an alarm.
Sergunb 0:f1834a63f7c1 524 - `Door:3` Door closed and resuming. Restoring from park, if applicable. Reset will throw an alarm.
Sergunb 0:f1834a63f7c1 525
Sergunb 0:f1834a63f7c1 526 - This data field is always present as the first field.
Sergunb 0:f1834a63f7c1 527
Sergunb 0:f1834a63f7c1 528 - **Current Position:**
Sergunb 0:f1834a63f7c1 529
Sergunb 0:f1834a63f7c1 530 - Depending on `$10` status report mask settings, position may be sent as either:
Sergunb 0:f1834a63f7c1 531
Sergunb 0:f1834a63f7c1 532 - `MPos:0.000,-10.000,5.000` machine position or
Sergunb 0:f1834a63f7c1 533 - `WPos:-2.500,0.000,11.000` work position
Sergunb 0:f1834a63f7c1 534
Sergunb 0:f1834a63f7c1 535 - **NOTE: Grbl v1.1 sends only one position vector because a GUI can easily compute the other position vector with the work coordinate offset `WCO:` data. See WCO description for details.**
Sergunb 0:f1834a63f7c1 536
Sergunb 0:f1834a63f7c1 537 - Three position values are given in the order of X, Y, and Z. A fourth position value may exist in later versions for the A-axis.
Sergunb 0:f1834a63f7c1 538
Sergunb 0:f1834a63f7c1 539 - `$13` report inches user setting effects these values and is given as either mm or inches.
Sergunb 0:f1834a63f7c1 540
Sergunb 0:f1834a63f7c1 541 - This data field is always present as the second field.
Sergunb 0:f1834a63f7c1 542
Sergunb 0:f1834a63f7c1 543 - **Work Coordinate Offset:**
Sergunb 0:f1834a63f7c1 544
Sergunb 0:f1834a63f7c1 545 - `WCO:0.000,1.551,5.664` is the current work coordinate offset of the g-code parser, which is the sum of the current work coordinate system, G92 offsets, and G43.1 tool length offset.
Sergunb 0:f1834a63f7c1 546
Sergunb 0:f1834a63f7c1 547 - Machine position and work position are related by this simple equation per axis: `WPos = MPos - WCO`
Sergunb 0:f1834a63f7c1 548
Sergunb 0:f1834a63f7c1 549 - **GUI Developers:** Simply track and retain the last `WCO:` vector and use the above equation to compute the other position vector for your position readouts. If Grbl's status reports show either `WPos` or `MPos`, just follow the equations below. It's as easy as that!
Sergunb 0:f1834a63f7c1 550 - If `WPos:` is given, use `MPos = WPos + WCO`.
Sergunb 0:f1834a63f7c1 551 - If `MPos:` is given, use `WPos = MPos - WCO`.
Sergunb 0:f1834a63f7c1 552
Sergunb 0:f1834a63f7c1 553 - Values are given in the order of the X,Y, and Z axes offsets. A fourth offset value may exist in later versions for the A-axis.
Sergunb 0:f1834a63f7c1 554 - `$13` report inches user setting effects these values and is given as either mm or inches.
Sergunb 0:f1834a63f7c1 555
Sergunb 0:f1834a63f7c1 556 - `WCO:` values don't change often during a job once set and only requires intermittent refreshing.
Sergunb 0:f1834a63f7c1 557
Sergunb 0:f1834a63f7c1 558 - This data field appears:
Sergunb 0:f1834a63f7c1 559
Sergunb 0:f1834a63f7c1 560 - In every 10 or 30 (configurable 1-255) status reports, depending on if Grbl is in a motion state or not.
Sergunb 0:f1834a63f7c1 561 - Immediately in the next report, if an offset value has changed.
Sergunb 0:f1834a63f7c1 562 - In the first report after a reset/power-cycle.
Sergunb 0:f1834a63f7c1 563
Sergunb 0:f1834a63f7c1 564 - This data field will not appear if:
Sergunb 0:f1834a63f7c1 565
Sergunb 0:f1834a63f7c1 566 - It is disabled in the config.h file. No `$` mask setting available.
Sergunb 0:f1834a63f7c1 567 - The refresh counter is in-between intermittent reports.
Sergunb 0:f1834a63f7c1 568
Sergunb 0:f1834a63f7c1 569 - **Buffer State:**
Sergunb 0:f1834a63f7c1 570
Sergunb 0:f1834a63f7c1 571 - `Bf:15,128`. The first value is the number of available blocks in the planner buffer and the second is number of available bytes in the serial RX buffer.
Sergunb 0:f1834a63f7c1 572
Sergunb 0:f1834a63f7c1 573 - The usage of this data is generally for debugging an interface, but is known to be used to control some GUI-specific tasks. While this is disabled by default, GUIs should expect this data field to appear, but they may ignore it, if desired.
Sergunb 0:f1834a63f7c1 574
Sergunb 0:f1834a63f7c1 575 - IMPORTANT: Do not use this buffer data to control streaming. During a stream, the reported buffer will often be out-dated and may be incorrect by the time it has been received by the GUI. Instead, please use the streaming protocols outlined. They use Grbl's responses as a direct way to accurately determine the buffer state.
Sergunb 0:f1834a63f7c1 576
Sergunb 0:f1834a63f7c1 577 - NOTE: The buffer state values changed from showing "in-use" blocks or bytes to "available". This change does not require the GUI knowing how many block/bytes Grbl has been compiled with.
Sergunb 0:f1834a63f7c1 578
Sergunb 0:f1834a63f7c1 579 - This data field appears:
Sergunb 0:f1834a63f7c1 580
Sergunb 0:f1834a63f7c1 581 - In every status report when enabled. It is disabled in the settings mask by default.
Sergunb 0:f1834a63f7c1 582
Sergunb 0:f1834a63f7c1 583 - This data field will not appear if:
Sergunb 0:f1834a63f7c1 584
Sergunb 0:f1834a63f7c1 585 - It is disabled by the `$` status report mask setting or disabled in the config.h file.
Sergunb 0:f1834a63f7c1 586
Sergunb 0:f1834a63f7c1 587 - **Line Number:**
Sergunb 0:f1834a63f7c1 588
Sergunb 0:f1834a63f7c1 589 - `Ln:99999` indicates line 99999 is currently being executed. This differs from the `$G` line `N` value since the parser is usually queued few blocks behind execution.
Sergunb 0:f1834a63f7c1 590
Sergunb 0:f1834a63f7c1 591 - Compile-time option only because of memory requirements. However, if a GUI passes indicator line numbers onto Grbl, it's very useful to determine when Grbl is executing them.
Sergunb 0:f1834a63f7c1 592
Sergunb 0:f1834a63f7c1 593 - This data field will not appear if:
Sergunb 0:f1834a63f7c1 594
Sergunb 0:f1834a63f7c1 595 - It is disabled in the config.h file. No `$` mask setting available.
Sergunb 0:f1834a63f7c1 596 - The line number reporting not enabled in config.h. Different option to reporting data field.
Sergunb 0:f1834a63f7c1 597 - No line number or `N0` is passed with the g-code block.
Sergunb 0:f1834a63f7c1 598 - Grbl is homing, jogging, parking, or performing a system task/motion.
Sergunb 0:f1834a63f7c1 599 - There is no motion in the g-code block like a `G4P1` dwell. (May be fixed in later versions.)
Sergunb 0:f1834a63f7c1 600
Sergunb 0:f1834a63f7c1 601 - **Current Feed and Speed:**
Sergunb 0:f1834a63f7c1 602
Sergunb 0:f1834a63f7c1 603 - There are two versions of this data field that Grbl may respond with.
Sergunb 0:f1834a63f7c1 604
Sergunb 0:f1834a63f7c1 605 - `F:500` contains real-time feed rate data as the value. This appears only when VARIABLE_SPINDLE is disabled in config.h, because spindle speed is not tracked in this mode.
Sergunb 0:f1834a63f7c1 606 - `FS:500,8000` contains real-time feed rate, followed by spindle speed, data as the values. Note the `FS:`, rather than `F:`, data type name indicates spindle speed data is included.
Sergunb 0:f1834a63f7c1 607
Sergunb 0:f1834a63f7c1 608 - The current feed rate value is in mm/min or inches/min, depending on the `$` report inches user setting.
Sergunb 0:f1834a63f7c1 609 - The second value is the current spindle speed in RPM
Sergunb 0:f1834a63f7c1 610
Sergunb 0:f1834a63f7c1 611 - These values will often not be the programmed feed rate or spindle speed, because several situations can alter or limit them. For example, overrides directly scale the programmed values to a different running value, while machine settings, acceleration profiles, and even the direction traveled can also limit rates to maximum values allowable.
Sergunb 0:f1834a63f7c1 612
Sergunb 0:f1834a63f7c1 613 - As a operational note, reported rate is typically 30-50 msec behind actual position reported.
Sergunb 0:f1834a63f7c1 614
Sergunb 0:f1834a63f7c1 615 - This data field will always appear, unless it was explicitly disabled in the config.h file.
Sergunb 0:f1834a63f7c1 616
Sergunb 0:f1834a63f7c1 617 - **Input Pin State:**
Sergunb 0:f1834a63f7c1 618
Sergunb 0:f1834a63f7c1 619 - `Pn:XYZPDHRS` indicates which input pins Grbl has detected as 'triggered'.
Sergunb 0:f1834a63f7c1 620
Sergunb 0:f1834a63f7c1 621 - Pin state is evaluated every time a status report is generated. All input pin inversions are appropriately applied to determine 'triggered' states.
Sergunb 0:f1834a63f7c1 622
Sergunb 0:f1834a63f7c1 623 - Each letter of `XYZPDHRS` denotes a particular 'triggered' input pin.
Sergunb 0:f1834a63f7c1 624
Sergunb 0:f1834a63f7c1 625 - `X Y Z` XYZ limit pins, respectively
Sergunb 0:f1834a63f7c1 626 - `P` the probe pin.
Sergunb 0:f1834a63f7c1 627 - `D H R S` the door, hold, soft-reset, and cycle-start pins, respectively.
Sergunb 0:f1834a63f7c1 628 - Example: `Pn:PZ` indicates the probe and z-limit pins are 'triggered'.
Sergunb 0:f1834a63f7c1 629 - Note: `A` may be added in later versions for an A-axis limit pin.
Sergunb 0:f1834a63f7c1 630
Sergunb 0:f1834a63f7c1 631 - Assume input pin letters are presented in no particular order.
Sergunb 0:f1834a63f7c1 632
Sergunb 0:f1834a63f7c1 633 - One or more 'triggered' pin letter(s) will always be present with a `Pn:` data field.
Sergunb 0:f1834a63f7c1 634
Sergunb 0:f1834a63f7c1 635 - This data field will not appear if:
Sergunb 0:f1834a63f7c1 636
Sergunb 0:f1834a63f7c1 637 - It is disabled in the config.h file. No `$` mask setting available.
Sergunb 0:f1834a63f7c1 638 - No input pins are detected as triggered.
Sergunb 0:f1834a63f7c1 639
Sergunb 0:f1834a63f7c1 640 - **Override Values:**
Sergunb 0:f1834a63f7c1 641
Sergunb 0:f1834a63f7c1 642 - `Ov:100,100,100` indicates current override values in percent of programmed values for feed, rapids, and spindle speed, respectively.
Sergunb 0:f1834a63f7c1 643
Sergunb 0:f1834a63f7c1 644 - Override maximum, minimum, and increment sizes are all configurable within config.h. Assume that a user or OEM will alter these based on customized use-cases. Recommend not hard-coding these values into a GUI, but rather just show the actual override values and generic increment buttons.
Sergunb 0:f1834a63f7c1 645
Sergunb 0:f1834a63f7c1 646 - Override values don't change often during a job once set and only requires intermittent refreshing. This data field appears:
Sergunb 0:f1834a63f7c1 647
Sergunb 0:f1834a63f7c1 648 - After 10 or 20 (configurable 1-255) status reports, depending on is in a motion state or not.
Sergunb 0:f1834a63f7c1 649 - If an override value has changed, this data field will appear immediately in the next report. However, if `WCO:` is present, this data field will be delayed one report.
Sergunb 0:f1834a63f7c1 650 - In the second report after a reset/power-cycle.
Sergunb 0:f1834a63f7c1 651
Sergunb 0:f1834a63f7c1 652 - This data field will not appear if:
Sergunb 0:f1834a63f7c1 653
Sergunb 0:f1834a63f7c1 654 - It is disabled in the config.h file. No `$` mask setting available.
Sergunb 0:f1834a63f7c1 655 - The override refresh counter is in-between intermittent reports.
Sergunb 0:f1834a63f7c1 656 - `WCO:` exists in current report during refresh. Automatically set to try again on next report.
Sergunb 0:f1834a63f7c1 657
Sergunb 0:f1834a63f7c1 658 - **Accessory State:**
Sergunb 0:f1834a63f7c1 659
Sergunb 0:f1834a63f7c1 660 - `A:SFM` indicates the current state of accessory machine components, such as the spindle and coolant.
Sergunb 0:f1834a63f7c1 661
Sergunb 0:f1834a63f7c1 662 - Due to the new toggle overrides, these machine components may not be running according to the g-code program. This data is provided to ensure the user knows exactly what Grbl is doing at any given time.
Sergunb 0:f1834a63f7c1 663
Sergunb 0:f1834a63f7c1 664 - Each letter after `A:` denotes a particular state. When it appears, the state is enabled. When it does not appear, the state is disabled.
Sergunb 0:f1834a63f7c1 665
Sergunb 0:f1834a63f7c1 666 - `S` indicates spindle is enabled in the CW direction. This does not appear with `C`.
Sergunb 0:f1834a63f7c1 667 - `C` indicates spindle is enabled in the CCW direction. This does not appear with `S`.
Sergunb 0:f1834a63f7c1 668 - `F` indicates flood coolant is enabled.
Sergunb 0:f1834a63f7c1 669 - `M` indicates mist coolant is enabled.
Sergunb 0:f1834a63f7c1 670
Sergunb 0:f1834a63f7c1 671 - Assume accessory state letters are presented in no particular order.
Sergunb 0:f1834a63f7c1 672
Sergunb 0:f1834a63f7c1 673 - This data field appears:
Sergunb 0:f1834a63f7c1 674
Sergunb 0:f1834a63f7c1 675 - When any accessory state is enabled.
Sergunb 0:f1834a63f7c1 676 - Only with the override values field in the same message. Any accessory state change will trigger the accessory state and override values fields to be shown on the next report.
Sergunb 0:f1834a63f7c1 677
Sergunb 0:f1834a63f7c1 678 - This data field will not appear if:
Sergunb 0:f1834a63f7c1 679
Sergunb 0:f1834a63f7c1 680 - No accessory state is active.
Sergunb 0:f1834a63f7c1 681 - It is disabled in the config.h file. No `$` mask setting available.
Sergunb 0:f1834a63f7c1 682 - If override refresh counter is in-between intermittent reports.
Sergunb 0:f1834a63f7c1 683 - `WCO:` exists in current report during refresh. Automatically set to try again on next report.