Skip to content

First Run Grbl Settings

Terje Io edited this page Feb 13, 2023 · 3 revisions

First Run Grbl Settings

When a grblHAL controller is ready to test, a few changes to the grblHAL Settings may be needed.

Input Controls

Standard grblHAL inputs are EStop or Reset, Cycle Start and Feed Hold. The Safety Door input is optional and often not enabled. These are typically controlled by switches. In order to encourage good anti-EMI practice, they default to Normally Closed (NC) inputs. This means that grblHAL sees an unconnected pin as "on" and performs the input pin's intended action. With EStop or Reset open or not connected, for example, grblHAL will enter an Alarm state. This prevents grblHAL from accepting all but a few commands.

To resolve this and allow grblHAL to not start in the Alarm state, there are three options.

  • Install NC switches on the inputs.
  • Jumper the input pins to ground (0v).
  • Invert the input pins in the $14 grblHAL Setting, a standard grblHAL bitfield.
    The available input pins and assigned bit number/bit values can be listed with the $$=14 command, an example:
$$=14
$14: Invert control pins as bitfield:
    1 - Feed hold (2)
    2 - Cycle start (4)
    6 - EStop (64)
...

To invert inputs add the values in brackets for those inputs you want inverted and use the sum as the $14 value. Inverting all inputs for this example is done by entering $14=70 (2+4+64), typically in a terminal application talking directly to grblHAL. If the Safety Door input is enabled add 8 to the value.
If the EStop input is not available but Reset is then all inputs can typically be inverted by $14=7, or $14=15 if the Safety Door input is enabled.

To check the current input status send ? to the controller from the terminal, this will respond with a status message. In this the |Pn: element contains the input status. In normal operation one wants this element to be empty (no inputs detected as active), if any are each active input is listed with a single letter reference.
An example:

?
<Idle|MPos:16.224,15.128,0.000|Bf:35,1023|FS:0,0|Pn:PH>

|Pn:PH shows that the probe input (P) and the feed hold (H) inputs are active.

Limit Switches

While these are unlikely to interfere with first tests, they too are NC inputs to encourage good anti-EMI practice. There are similar options to the above shown input controls. The bit fields in the $5 grblHAL Setting are assigned as

  • X Limit - Bit 0 (+1)
  • Y Limit - Bit 1 (+2)
  • Z Limit - Bit 2 (+4)
  • and so on

To invert Limit Pins on a 5 Axis machines, one enters $5=31 (1+2+4+8+16) in a terminal application talking directly to grblHAL

Stepper Driver Enables

Depending on the how the stepper driver pins are set up and what the stepper driver expects, you may need to invert the step enable pins via the $4 Grbl Setting. A common problem stemming from this is the stepper motors do not run when commanded. If the target hardware has a single enable for all stepper drivers, $4=1 inverts all of them. If the target hardware has individual step enables for each stepper driver, you will need to use bit field assignments in $4.

  • Axis X - Bit 0 (+1)
  • Axis Y - Bit 1 (+2)
  • Axis Z - Bit 2 (+4)
  • and so on

To invert all Step Enable pins in a 5 Axis machine, one enters $4=31 (1+2+4+8+16) in a terminal application talking directly to grblHAL.