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 v1.1 Realtime commands
Sergunb 0:f1834a63f7c1 2
Sergunb 0:f1834a63f7c1 3 Realtime commands are single control characters that may be sent to Grbl to command and perform an action in real-time. This means that they can be sent at anytime, anywhere, and Grbl will immediately respond, regardless of what it is doing at the time. These commands include a reset, feed hold, resume, status report query, and overrides (in v1.1).
Sergunb 0:f1834a63f7c1 4
Sergunb 0:f1834a63f7c1 5 A realtime command:
Sergunb 0:f1834a63f7c1 6
Sergunb 0:f1834a63f7c1 7 - Will execute within tens of milliseconds.
Sergunb 0:f1834a63f7c1 8
Sergunb 0:f1834a63f7c1 9 - Is a single character that may be sent to Grbl at any time.
Sergunb 0:f1834a63f7c1 10
Sergunb 0:f1834a63f7c1 11 - Does not require a line feed or carriage return after them.
Sergunb 0:f1834a63f7c1 12
Sergunb 0:f1834a63f7c1 13 - Is not considered a part of the streaming protocol.
Sergunb 0:f1834a63f7c1 14
Sergunb 0:f1834a63f7c1 15 - Are intercepted when they are received and never placed in a buffer to be parsed by Grbl.
Sergunb 0:f1834a63f7c1 16
Sergunb 0:f1834a63f7c1 17 - Will ignore multiple commands until it has executed the first received command.
Sergunb 0:f1834a63f7c1 18
Sergunb 0:f1834a63f7c1 19 - May be tied to an input pin and may be operated with a button or switch.
Sergunb 0:f1834a63f7c1 20
Sergunb 0:f1834a63f7c1 21 - Actions depends on state or what Grbl is doing. It may not do anything.
Sergunb 0:f1834a63f7c1 22
Sergunb 0:f1834a63f7c1 23 - Descriptions explain how they work and what to expect.
Sergunb 0:f1834a63f7c1 24
Sergunb 0:f1834a63f7c1 25 #### ASCII Realtime Command Descriptions
Sergunb 0:f1834a63f7c1 26 Four realtime commands are type-able by users on a keyboard and shown in the `$` Grbl help message. These realtime command characters control some of Grbl's basic functions.
Sergunb 0:f1834a63f7c1 27
Sergunb 0:f1834a63f7c1 28 - `0x18` (ctrl-x) : Soft-Reset
Sergunb 0:f1834a63f7c1 29
Sergunb 0:f1834a63f7c1 30 - Immediately halts and safely resets Grbl without a power-cycle.
Sergunb 0:f1834a63f7c1 31 - Accepts and executes this command at any time.
Sergunb 0:f1834a63f7c1 32 - If reset while in motion, Grbl will throw an alarm to indicate position may be lost from the motion halt.
Sergunb 0:f1834a63f7c1 33 - If reset while in not motion, position is retained and re-homing is not required.
Sergunb 0:f1834a63f7c1 34 - An input pin is available to connect a button or switch.
Sergunb 0:f1834a63f7c1 35
Sergunb 0:f1834a63f7c1 36
Sergunb 0:f1834a63f7c1 37 - `?` : Status Report Query
Sergunb 0:f1834a63f7c1 38
Sergunb 0:f1834a63f7c1 39 - Immediately generates and sends back runtime data with a status report.
Sergunb 0:f1834a63f7c1 40 - Accepts and executes this command at any time, except during a homing cycle and when critical alarm (hard/soft limit error) is thrown.
Sergunb 0:f1834a63f7c1 41
Sergunb 0:f1834a63f7c1 42
Sergunb 0:f1834a63f7c1 43 - `~` : Cycle Start / Resume
Sergunb 0:f1834a63f7c1 44
Sergunb 0:f1834a63f7c1 45 - Resumes a feed hold, a safety door/parking state when the door is closed, and the M0 program pause states.
Sergunb 0:f1834a63f7c1 46 - Command is otherwise ignored.
Sergunb 0:f1834a63f7c1 47 - 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.
Sergunb 0:f1834a63f7c1 48 - An input pin is available to connect a button or switch.
Sergunb 0:f1834a63f7c1 49
Sergunb 0:f1834a63f7c1 50
Sergunb 0:f1834a63f7c1 51 - `!` : Feed Hold
Sergunb 0:f1834a63f7c1 52
Sergunb 0:f1834a63f7c1 53 - Places Grbl into a suspend or HOLD state. If in motion, the machine will decelerate to a stop and then be suspended.
Sergunb 0:f1834a63f7c1 54 - Command executes when Grbl is in an IDLE, RUN, or JOG state. It is otherwise ignored.
Sergunb 0:f1834a63f7c1 55 - 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.
Sergunb 0:f1834a63f7c1 56 - By machine control definition, a feed hold does not disable the spindle or coolant. Only motion.
Sergunb 0:f1834a63f7c1 57 - An input pin is available to connect a button or switch.
Sergunb 0:f1834a63f7c1 58
Sergunb 0:f1834a63f7c1 59
Sergunb 0:f1834a63f7c1 60 #### Extended-ASCII Realtime Command Descriptions
Sergunb 0:f1834a63f7c1 61
Sergunb 0:f1834a63f7c1 62 Grbl v1.1 installed more than a dozen new realtime commands to control feed, rapid, and spindle overrides. To help prevent users from inadvertently altering overrides with a keystroke and allow for more commands later on, all of the new control characters have been moved to the extended ASCII character set. These are not easily type-able on a keyboard, but, depending on the OS, they may be entered using specific keystroke and code. GUI developers will need to be able to send extended ASCII characters, values `128 (0x80)` to `255 (0xFF)`, to Grbl to take advantage of these new features.
Sergunb 0:f1834a63f7c1 63
Sergunb 0:f1834a63f7c1 64 - `0x84` : Safety Door
Sergunb 0:f1834a63f7c1 65
Sergunb 0:f1834a63f7c1 66 - 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.
Sergunb 0:f1834a63f7c1 67 - 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.
Sergunb 0:f1834a63f7c1 68 - If executed during homing, Grbl will instead halt motion and throw a homing alarm.
Sergunb 0:f1834a63f7c1 69 - If already in a suspend state or HOLD, the DOOR state supersedes it.
Sergunb 0:f1834a63f7c1 70 - If the parking compile-time option is enabled, Grbl will park the spindle to a specified location.
Sergunb 0:f1834a63f7c1 71 - Command executes when Grbl is in an IDLE, HOLD, RUN, HOMING, or JOG state. It is otherwise ignored.
Sergunb 0:f1834a63f7c1 72 - 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.
Sergunb 0:f1834a63f7c1 73 - An input pin is available to connect a button or switch, if enabled with a compile-time option.
Sergunb 0:f1834a63f7c1 74 - Some builds of Grbl v0.9 used the `@` character for this command, but it was undocumented. Moved to extended-ASCII to prevent accidental commanding.
Sergunb 0:f1834a63f7c1 75
Sergunb 0:f1834a63f7c1 76
Sergunb 0:f1834a63f7c1 77 - `0x85` : Jog Cancel
Sergunb 0:f1834a63f7c1 78
Sergunb 0:f1834a63f7c1 79 - Immediately cancels the current jog state by a feed hold and automatically flushing any remaining jog commands in the buffer.
Sergunb 0:f1834a63f7c1 80 - Command is ignored, if not in a JOG state or if jog cancel is already invoked and in-process.
Sergunb 0:f1834a63f7c1 81 - Grbl will return to the IDLE state or the DOOR state, if the safety door was detected as ajar during the cancel.
Sergunb 0:f1834a63f7c1 82
Sergunb 0:f1834a63f7c1 83
Sergunb 0:f1834a63f7c1 84 - Feed Overrides
Sergunb 0:f1834a63f7c1 85
Sergunb 0:f1834a63f7c1 86 - Immediately alters the feed override value. An active feed motion is altered within tens of milliseconds.
Sergunb 0:f1834a63f7c1 87 - Does not alter rapid rates, which include G0, G28, and G30, or jog motions.
Sergunb 0:f1834a63f7c1 88 - Feed override value can not be 10% or greater than 200%.
Sergunb 0:f1834a63f7c1 89 - If feed override value does not change, the command is ignored.
Sergunb 0:f1834a63f7c1 90 - Feed override range and increments may be changed in config.h.
Sergunb 0:f1834a63f7c1 91 - The commands are:
Sergunb 0:f1834a63f7c1 92 - `0x90` : Set 100% of programmed rate.
Sergunb 0:f1834a63f7c1 93 - `0x91` : Increase 10%
Sergunb 0:f1834a63f7c1 94 - `0x92` : Decrease 10%
Sergunb 0:f1834a63f7c1 95 - `0x93` : Increase 1%
Sergunb 0:f1834a63f7c1 96 - `0x94` : Decrease 1%
Sergunb 0:f1834a63f7c1 97
Sergunb 0:f1834a63f7c1 98
Sergunb 0:f1834a63f7c1 99 - Rapid Overrides
Sergunb 0:f1834a63f7c1 100
Sergunb 0:f1834a63f7c1 101 - Immediately alters the rapid override value. An active rapid motion is altered within tens of milliseconds.
Sergunb 0:f1834a63f7c1 102 - Only effects rapid motions, which include G0, G28, and G30.
Sergunb 0:f1834a63f7c1 103 - If rapid override value does not change, the command is ignored.
Sergunb 0:f1834a63f7c1 104 - Rapid override set values may be changed in config.h.
Sergunb 0:f1834a63f7c1 105 - The commands are:
Sergunb 0:f1834a63f7c1 106 - `0x95` : Set to 100% full rapid rate.
Sergunb 0:f1834a63f7c1 107 - `0x96` : Set to 50% of rapid rate.
Sergunb 0:f1834a63f7c1 108 - `0x97` : Set to 25% of rapid rate.
Sergunb 0:f1834a63f7c1 109
Sergunb 0:f1834a63f7c1 110
Sergunb 0:f1834a63f7c1 111 - Spindle Speed Overrides
Sergunb 0:f1834a63f7c1 112
Sergunb 0:f1834a63f7c1 113 - Immediately alters the spindle speed override value. An active spindle speed is altered within tens of milliseconds.
Sergunb 0:f1834a63f7c1 114 - Override values may be changed at any time, regardless of if the spindle is enabled or disabled.
Sergunb 0:f1834a63f7c1 115 - Spindle override value can not be 10% or greater than 200%
Sergunb 0:f1834a63f7c1 116 - If spindle override value does not change, the command is ignored.
Sergunb 0:f1834a63f7c1 117 - Spindle override range and increments may be altered in config.h.
Sergunb 0:f1834a63f7c1 118 - The commands are:
Sergunb 0:f1834a63f7c1 119 - `0x99` : Set 100% of programmed spindle speed
Sergunb 0:f1834a63f7c1 120 - `0x9A` : Increase 10%
Sergunb 0:f1834a63f7c1 121 - `0x9B` : Decrease 10%
Sergunb 0:f1834a63f7c1 122 - `0x9C` : Increase 1%
Sergunb 0:f1834a63f7c1 123 - `0x9D` : Decrease 1%
Sergunb 0:f1834a63f7c1 124
Sergunb 0:f1834a63f7c1 125
Sergunb 0:f1834a63f7c1 126 - `0x9E` : Toggle Spindle Stop
Sergunb 0:f1834a63f7c1 127
Sergunb 0:f1834a63f7c1 128 - Toggles spindle enable or disable state immediately, but only while in the HOLD state.
Sergunb 0:f1834a63f7c1 129 - 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.
Sergunb 0:f1834a63f7c1 130 - 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.
Sergunb 0:f1834a63f7c1 131 - While disabled, spindle speed override values may still be altered and will be in effect once the spindle is re-enabled.
Sergunb 0:f1834a63f7c1 132 - 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.
Sergunb 0:f1834a63f7c1 133
Sergunb 0:f1834a63f7c1 134
Sergunb 0:f1834a63f7c1 135 - `0xA0` : Toggle Flood Coolant
Sergunb 0:f1834a63f7c1 136
Sergunb 0:f1834a63f7c1 137 - Toggles flood coolant state and output pin until the next toggle or g-code command alters it.
Sergunb 0:f1834a63f7c1 138 - May be commanded at any time while in IDLE, RUN, or HOLD states. It is otherwise ignored.
Sergunb 0:f1834a63f7c1 139 - 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.
Sergunb 0:f1834a63f7c1 140 - 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.
Sergunb 0:f1834a63f7c1 141
Sergunb 0:f1834a63f7c1 142
Sergunb 0:f1834a63f7c1 143 - `0xA1` : Toggle Mist Coolant
Sergunb 0:f1834a63f7c1 144
Sergunb 0:f1834a63f7c1 145 - Enabled by `ENABLE_M7` compile-time option. Default is disabled.
Sergunb 0:f1834a63f7c1 146 - Toggles mist coolant state and output pin until the next toggle or g-code command alters it.
Sergunb 0:f1834a63f7c1 147 - May be commanded at any time while in IDLE, RUN, or HOLD states. It is otherwise ignored.
Sergunb 0:f1834a63f7c1 148 - 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.
Sergunb 0:f1834a63f7c1 149 - 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.