This file contains compile-time and run-time configurations for grblHAL's internal system. For the most part, users will not need to directly modify these, but they are here for specific needs, i.e. performance tuning or adjusting to non-typical machines.
IMPORTANT: Symbol/macro names starting with DEFAULT_
contains default values for run-time configurable settings that can be changed with $=<setting id>
commands. Any changes to these requires a full re-compiling of the source code to propagate them. A reset of non-volatile storage with $RST=*
after reflashing is also required.
More...
#include "nuts_bolts.h"
Go to the source code of this file.
Macros | |
#define | N_AXIS 3 |
Defines number of axes supported - minimum 3, maximum 8. If more than 3 axes are configured a compliant driver and board map file is needed. More... | |
#define | AXIS_REMAP_ABC2UVW Off |
Remap ABC axis letters to UVW NOTE: Experimental, if more than 3 and less than 7 axes are configured the ABC axis letters can be remapped to UWV . More... | |
#define | N_SPINDLE 1 |
Defines number of spindles supported - minimum 1, maximum 32. More... | |
#define | N_SYS_SPINDLE 1 |
Defines number of simultaneously active spindles supported - minimum 1 (none), maximum 8. More... | |
#define | BUILD_INFO "" |
Defines string to be output as part of the $I or $I+ command response. More... | |
#define | COMPATIBILITY_LEVEL 0 |
Define compatibility level with the legacy Grbl 1.1 protocol. More... | |
#define | ENABLE_SPINDLE_LINEARIZATION 0 |
This feature alters the spindle PWM/speed to a nonlinear output with a simple piecewise linear curve. More... | |
#define | SPINDLE_NPWM_PIECES 4 |
Number of pieces used for spindle RPM linearization, enabled by setting ENABLE_SPINDLE_LINEARIZATION to 1. More... | |
#define | MASLOW_ROUTER Off |
Enable Maslow router kinematics. Experimental - testing required and homing needs to be worked out. More... | |
#define | WALL_PLOTTER Off |
Enable wall plotter kinematics. Experimental - testing required and homing needs to be worked out. More... | |
#define | DELTA_ROBOT Off |
Enable delta kinematics. Experimental - testing required and homing needs to be worked out. More... | |
#define | POLAR_ROBOT Off |
Enable polar kinematics. Experimental - testing required and homing needs to be worked out. More... | |
#define | COREXY Off |
Enable CoreXY kinematics. Use ONLY with CoreXY machines. IMPORTANT: If homing is enabled, you must reconfigure the homing cycle #defines above to #define DEFAULT_HOMING_CYCLE_1 X_AXIS_BIT and #define DEFAULT_HOMING_CYCLE_2 Y_AXIS_BIT NOTE: This configuration option alters the motion of the X and Y axes to principle of operation defined at corexy.com. Motors are assumed to positioned and wired exactly as described, if not, motions may move in strange directions. grblHAL requires the CoreXY A and B motors have the same steps per mm internally. More... | |
#define | CHECK_MODE_DELAY 0 |
Add a short delay for each block processed in Check Mode to avoid overwhelming the sender with fast reply messages. This is likely to happen when streaming is done via a protocol where the speed is not limited to 115200 baud. An example is native USB streaming. More... | |
#define | DEBOUNCE_DELAY 40 |
When > 0 adds a short delay when an input changes state to avoid switch bounce or EMI triggering the related interrupt falsely or too many times. More... | |
#define | ENABLE_PATH_BLENDING Off |
#define | DEBUGOUT -1 |
#define | ACCELERATION_TICKS_PER_SECOND 100 |
The temporal resolution of the acceleration management subsystem. A higher number gives smoother acceleration, particularly noticeable on machines that run at very high feedrates, but may negatively impact performance. The correct value for this parameter is machine dependent, so it's advised to set this only as high as needed. Approximate successful values can widely range from 50 to 200 or more. NOTE: Changing this value also changes the execution time of a segment in the step segment buffer. When increasing this value, this stores less overall time in the segment buffer and vice versa. Make certain the step segment buffer is increased/decreased to account for these changes. More... | |
#define | REPORT_ECHO_LINE_RECEIVED Off |
With this enabled, grblHAL sends back an echo of the line it has received, which has been pre-parsed (spaces removed, capitalized letters, no comments) and is to be immediately executed by grblHAL. Echoes will not be sent upon a line buffer overflow, but should for all normal lines sent to grblHAL. For example, if a user sends the line 'g1 x1.032 y2.45 (test comment)', grblHAL will echo back in the form '[echo: G1X1.032Y2.45]'. NOTE: Only use this for debugging purposes!! When echoing, this takes up valuable resources and can effect performance. If absolutely needed for normal operation, the serial write buffer should be greatly increased to help minimize transmission waiting within the serial write protocol. More... | |
#define | TOOL_LENGTH_OFFSET_AXIS -1 |
Sets which axis the tool length offset is applied. Assumes the spindle is always parallel with the selected axis with the tool oriented toward the negative direction. In other words, a positive tool length offset value is subtracted from the current location. More... | |
#define | MINIMUM_JUNCTION_SPEED 0.0f |
Minimum planner junction speed. Sets the default minimum junction speed the planner plans to at every buffer block junction, except for starting from rest and end of the buffer, which are always zero. This value controls how fast the machine moves through junctions with no regard for acceleration limits or angle between neighboring block line move directions. This is useful for machines that can't tolerate the tool dwelling for a split second, i.e. 3d printers or laser cutters. If used, this value should not be much greater than zero or to the minimum value necessary for the machine to work. More... | |
#define | MINIMUM_FEED_RATE 1.0f |
Sets the minimum feed rate the planner will allow. Any value below it will be set to this minimum value. This also ensures that a planned motion always completes and accounts for any floating-point round-off errors. Although not recommended, a lower value than 1.0 mm/min will likely work in smaller machines, perhaps to 0.1mm/min, but your success may vary based on multiple factors. More... | |
#define | N_ARC_CORRECTION 12 |
Number of arc generation iterations by small angle approximation before exact arc trajectory correction with expensive sin() and cos() calculations. This parameter maybe decreased if there are issues with the accuracy of the arc generations, or increased if arc execution is getting bogged down by too many trig calculations. More... | |
#define | ARC_ANGULAR_TRAVEL_EPSILON 5E-7f |
The arc G2/3 g-code standard is problematic by definition. Radius-based arcs have horrible numerical errors when arc at semi-circles(pi) or full-circles(2*pi). Offset-based arcs are much more accurate but still have a problem when arcs are full-circles (2*pi). This define accounts for the floating point issues when offset-based arcs are commanded as full circles, but get interpreted as extremely small arcs with around machine epsilon (1.2e-7rad) due to numerical round-off and precision issues. This define value sets the machine epsilon cutoff to determine if the arc is a full-circle or not. NOTE: Be very careful when adjusting this value. It should always be greater than 1.2e-7 but not too much greater than this. The default setting should capture most, if not all, full arc error situations. More... | |
#define | DWELL_TIME_STEP 50 |
Time delay increments performed during a dwell. The default value is set at 50ms, which provides a maximum time delay of roughly 55 minutes, more than enough for most any application. Increasing this delay will increase the maximum dwell time linearly, but also reduces the responsiveness of run-time command executions, like status reports, since these are performed between each dwell time step. More... | |
#define | SEGMENT_BUFFER_SIZE 10 |
Governs the size of the intermediary step segment buffer between the step execution algorithm and the planner blocks. Each segment is set of steps executed at a constant velocity over a fixed time defined by ACCELERATION_TICKS_PER_SECOND. They are computed such that the planner block velocity profile is traced exactly. The size of this buffer governs how much step execution lead time there is for other grblHAL processes have to compute and do their thing before having to come back and refill this buffer, currently at ~50msec of step moves. More... | |
#define | SET_CHECK_MODE_PROBE_TO_START Off |
Configures the position after a probing cycle during grblHAL's check mode. Disabled sets the position to the probe target, when enabled sets the position to the start position. More... | |
#define | HARD_LIMIT_FORCE_STATE_CHECK Off |
Force grblHAL to check the state of the hard limit switches when the processor detects a pin change inside the hard limit ISR routine. By default, grblHAL will trigger the hard limits alarm upon any pin change, since bouncing switches can cause a state check like this to misread the pin. When hard limits are triggered, they should be 100% reliable, which is the reason that this option is disabled by default. Only if your system/electronics can guarantee that the switches don't bounce, we recommend enabling this option. This will help prevent triggering a hard limit when the machine disengages from the switch. NOTE: This option has no effect if SOFTWARE_DEBOUNCE is enabled. More... | |
#define | SLEEP_DURATION 5.0f |
Configures grblHAL's sleep mode feature. If the spindle or coolant are powered and grblHAL is not actively moving or receiving any commands, a sleep timer will start. If any data or commands are received, the sleep timer will reset and restart until the above condition are not satisfied. If the sleep timer elaspes, grblHAL will immediately execute the sleep mode by shutting down the spindle and coolant and entering a safe sleep state. If parking is enabled, grblHAL will park the machine as well. While in sleep mode, only a hard/soft reset will exit it and the job will be unrecoverable. Sleep mode is enabled by setting DEFAULT_SLEEP_ENABLE to On or 1, overridable by the $62 setting. NOTE: Sleep mode is a safety feature, primarily to address communication disconnect problems. To keep grblHAL from sleeping, employ a stream of '?' status report commands as a connection "heartbeat". More... | |
#define | NVSDATA_BUFFER_ENABLE On |
Disable non-volatile storage (NVS) emulation/buffering in RAM (allocated from heap memory). The NVS buffer can be used for MCUs with no non-volatile storage or for delaying writing to non-volatile storage until the controller is in IDLE state. More... | |
#define | TOOLSETTER_RADIUS 5.0f |
The grbl.on_probe_toolsetter event handler is called by the default tool change algorithm when probing at G59.3. In addition it will be called on a "normal" probe sequence if the XY position is within the radius of the G59.3 position defined below. Change if the default value of 5mm is not suitable or set it to 0.0f to disable. NOTE: A grbl.on_probe_toolsetter event handler is not installed by the core, it has to be provided by a driver or a plugin. More... | |
#define | ENABLE_BACKLASH_COMPENSATION Off |
#define | N_TOOLS 0 |
Number of tools in tool table, edit to enable (max. 32 allowed) More... | |
#define | NGC_EXPRESSIONS_ENABLE Off |
Set to On or 1 to enable experimental support for expressions. More... | |
#define | NGC_PARAMETERS_ENABLE On |
Set to On or 1 to enable experimental support for parameters. More... | |
#define | NGC_N_ASSIGN_PARAMETERS_PER_BLOCK 10 |
Maximum number of parameters allowed in a block. More... | |
#define | LATHE_UVW_OPTION Off |
Allow use of UVW axis words for non-modal relative lathe motion. More... | |
#define | DEFAULT_HOMING_ALLOW_MANUAL Off |
If enabled this allows using the homing $-commands to set the home position to the current axis position. More... | |
#define | DEFAULT_HOMING_OVERRIDE_LOCKS Off |
If homing init lock is enabled this sets grblHAL into an alarm state upon power up or a soft reset. To allow a soft reset to override the lock uncomment the line below. More... | |
#define | DEFAULT_HOMING_KEEP_STATUS_ON_RESET Off |
Enable this setting to keep homed status over a soft reset - if position was not lost due to a reset during motion. More... | |
#define | DEFAULT_HOMING_USE_LIMIT_SWITCHES Off |
Enable this setting to force using limit switches for homing. More... | |
Status report frequency | |
Some status report data isn't necessary for realtime, only intermittently, because the values don't change often. The following macros configures how many times a status report needs to be called before the associated data is refreshed and included in the status report. However, if one of these value changes, grblHAL will automatically include this data in the next status report, regardless of what the count is at the time. This helps reduce the communication overhead involved with high frequency reporting and aggressive streaming. There is also a busy and an idle refresh count, which sets up grblHAL to send refreshes more often when its not doing anything important. With a good GUI, this data doesn't need to be refreshed very often, on the order of a several seconds. | |
#define | REPORT_OVERRIDE_REFRESH_BUSY_COUNT 20 |
#define | REPORT_OVERRIDE_REFRESH_IDLE_COUNT 10 |
#define | REPORT_WCO_REFRESH_BUSY_COUNT 30 |
#define | REPORT_WCO_REFRESH_IDLE_COUNT 10 |
Default constants for G5 Cubic splines | |
#define | BEZIER_MIN_STEP 0.002f |
#define | BEZIER_MAX_STEP 0.1f |
#define | BEZIER_SIGMA 0.1f |
Homing cycle search and locate scalars | |
Adjusts homing cycle search and locate scalars. These are the multipliers used by grblHAL's homing cycle to ensure the limit switches are engaged and cleared through each phase of the cycle. The search phase uses the axes max-travel setting times the | |
#define | HOMING_AXIS_SEARCH_SCALAR 1.5f |
#define | HOMING_AXIS_LOCATE_SCALAR 10.0f |
Non-volatile storage restore commands | |
Enable the | |
#define | ENABLE_RESTORE_NVS_WIPE_ALL On |
$RST=* Default enabled. Set to Off or 0 to disable. More... | |
#define | ENABLE_RESTORE_NVS_DEFAULT_SETTINGS On |
$RST=$ Default enabled. Set to Off or 0 to disable. More... | |
#define | ENABLE_RESTORE_NVS_CLEAR_PARAMETERS On |
$RST=# Default enabled. Set to Off or 0 to disable. More... | |
#define | ENABLE_RESTORE_NVS_DRIVER_PARAMETERS On |
$RST=& Default enabled. Set to Off or 0 to disable. For drivers that implements non-generic settings. More... | |
Non-volatile storage restore options | |
Defines the non-volatile data restored upon a settings version change and | |
#define | SETTINGS_RESTORE_DEFAULTS On |
Default enabled. Set to Off or 0 to disable. More... | |
#define | SETTINGS_RESTORE_PARAMETERS On |
Default enabled. Set to Off or 0 to disable. More... | |
#define | SETTINGS_RESTORE_STARTUP_LINES On |
Default enabled. Set to Off or 0 to disable. More... | |
#define | SETTINGS_RESTORE_BUILD_INFO On |
Default enabled. Set to Off or 0 to disable. More... | |
#define | SETTINGS_RESTORE_DRIVER_PARAMETERS On |
Default enabled. Set to Off or 0 to disable. More... | |
#define | DISABLE_BUILD_INFO_WRITE_COMMAND Off |
Disable the $I=(string) build info write command. If disabled, any existing build info data must be placed into non-volatile storage via external means with a valid checksum value. This macro option is useful to prevent this data from being over-written by a user, when used to store OEM product data. NOTE: If disabled and to ensure grblHAL can never alter the build info line, you'll also need to set the SETTINGS_RESTORE_BUILD_INFO symbol to Off or 0. More... | |
$10 - Setting_StatusReportMask | |
The status report change for grblHAL v1.1 and after also removed the ability to disable/enable most data fields from the report. This caused issues for GUI developers, who've had to manage several scenarios and configurations. The increased efficiency of the new reporting style allows for all data fields to be sent without potential performance issues. | |
#define | DEFAULT_REPORT_MACHINE_POSITION On |
If set to Off or 0 position is reported with all offsets added. More... | |
#define | DEFAULT_REPORT_BUFFER_STATE On |
If set to Off or 0 the |Bf: buffer state element is not included in the real time report. More... | |
#define | DEFAULT_REPORT_LINE_NUMBERS On |
If set to Off or 0 the |Ln: line number element is not included in the real time report. NOTE: Line numbers are only reported if present in the gcode. More... | |
#define | DEFAULT_REPORT_CURRENT_FEED_SPEED On |
If set to Off or 0 the |FS: current feed & speed element is not included in the real time report. More... | |
#define | DEFAULT_REPORT_PIN_STATE On |
If set to Off or 0 the |Pn: input pins state element is not included in the real time report. More... | |
#define | DEFAULT_REPORT_WORK_COORD_OFFSET On |
If set to Off or 0 the |WCO: work coordinate offset element is not included in the real time report. More... | |
#define | DEFAULT_REPORT_OVERRIDES On |
If set to Off or 0 the |Pn: input pins state element is not included in the real time report. More... | |
#define | DEFAULT_REPORT_PROBE_COORDINATES On |
Upon a successful probe cycle, this option provides immediately feedback of the probe coordinates through an automatically generated message. If disabled, users can still access the last probe coordinates through grblHAL $# print parameters command. More... | |
#define | DEFAULT_REPORT_SYNC_ON_WCO_CHANGE On |
In Grbl v0.9 and prior, there is an old outstanding bug where the WPos: work position reported may not correlate to what is executing, because WPos: is based on the g-code parser state, which can be several motions behind. This option forces the planner buffer to empty, sync, and stop motion whenever there is a command that alters the work coordinate offsets G10,G43.1,G92,G54-59.3 . This is the simplest way to ensure WPos: is always correct. Fortunately, it's exceedingly rare that any of these commands are used need continuous motions through them. More... | |
#define | DEFAULT_REPORT_PARSER_STATE Off |
When enabled adds automatic report of the parser state following a status report request if the state was changed since the last report. The output is the same as provided by the $G command. More... | |
#define | DEFAULT_REPORT_ALARM_SUBSTATE Off |
Many controllers cannot be hard reset on startup due to using native USB or network protocols for communication. If the grblHAL for some reason is in ALARM state there is normally no way to determine the cause of the alarm. Enabling this setting adds the alarm code (see alarm_code_t) as a substate, separated by a colon, to the Alarm state in the real time report. NOTE: Enabling this option may break senders. More... | |
#define | DEFAULT_REPORT_RUN_SUBSTATE Off |
Enabling this setting may add a code, separated by a colon, to the Run state in the real time report. The following codes are defined: More... | |
#define | DEFAULT_REPORT_WHEN_HOMING Off |
Enabling this setting enables status reporting while homing. NOTE: Enabling this option may break senders. More... | |
$11 - Setting_JunctionDeviation | |
#define | DEFAULT_JUNCTION_DEVIATION 0.01f |
$12 - Setting_ArcTolerance | |
#define | DEFAULT_ARC_TOLERANCE 0.002f |
$13 - Setting_ReportInches | |
If set to On or 1 reported positions, offsets etc will be converted to inches with 4 digits of precision. | |
#define | DEFAULT_REPORT_INCHES Off |
$28 - Setting_G73Retract | |
The retract motion distance used for chip breaking by the | |
#define | DEFAULT_G73_RETRACT 0.1f |
$32 - Setting_Mode | |
NOTE: only one mode can be enabled. | |
#define | DEFAULT_LASER_MODE Off |
#define | DEFAULT_LATHE_MODE Off |
$39 - Setting_EnableLegacyRTCommands | |
Using printable ASCII characters for realtime commands can cause issues with files containing such characters in comments or settings. If the GCode sender support the use of the top-bit set alternatives for these then they may be disabled. | |
#define | DEFAULT_LEGACY_RTCOMMANDS On |
$60 - Setting_RestoreOverrides | |
#define | DEFAULT_RESET_OVERRIDES Off |
$62 - Setting_SleepEnable | |
#define | DEFAULT_SLEEP_ENABLE Off |
$63 - Setting_HoldActions | |
This option will automatically disable the laser during a feed hold by invoking a spindle stop override immediately after coming to a stop. However, this also means that the laser still may be re-enabled by disabling the spindle stop override, if needed. This is purely a safety feature to ensure the laser doesn't inadvertently remain powered while at a stop and cause a fire. | |
#define | DEFAULT_DISABLE_LASER_DURING_HOLD On |
This option is for what should happen on resume from feed hold. | |
Default action is to restore spindle and coolant status (if overridden), this contradicts the behaviour of industrial controllers but is in line with earlier versions of Grbl. | |
#define | DEFAULT_RESTORE_AFTER_FEED_HOLD On |
$64 - Setting_ForceInitAlarm | |
When grblHAL powers-cycles or is hard reset with the MCU reset button, grblHAL boots up with no ALARM by default. This is to make it as simple as possible for new users to start using grblHAL. When homing is enabled and a user has installed limit switches, grblHAL will boot up in an ALARM state to indicate grblHAL doesn't know its position and to force the user to home before proceeding. This option forces grblHAL to always initialize into an ALARM state regardless of homing or not. This option is more for OEMs and LinuxCNC users that would like this power-cycle behavior. | |
#define | DEFAULT_FORCE_INITIALIZATION_ALARM Off |
$384 - Setting_DisableG92Persistence | |
G92 offsets is by default stored to non-volatile storage (NVS) on changes and restored on startup if COMPATIBILITY_LEVEL is <= 1. If COMPATIBILITY_LEVEL is <= 1 then setting $384 can be used to change this at run-time. To allow store/restore of the G92 offset when COMPATIBILITY_LEVEL > 1 uncomment the line below and reset settings with $RST=*. | |
#define | DEFAULT_DISABLE_G92_PERSISTENCE Off |
$398 - Setting_PlannerBlocks | |
The number of linear motions in the planner buffer to be planned at any give time. The vast majority of RAM that grblHAL uses is based on this buffer size. Only increase if there is extra available RAM, like when compiling for MCU with ample amounts of RAM. Or decrease if the MCU begins to crash due to the lack of available RAM or if the CPU is having trouble keeping up with planning new incoming motions as they are executed. | |
#define | DEFAULT_PLANNER_BUFFER_BLOCKS 100 |
$14 - Setting_ControlInvertMask | |
Inverts logic of the control input signals based on a signalmask. This essentially means you are using normally-open (NO) switches on the specified pins, rather than the default normally-closed (NC) switches. | |
#define | DEFAULT_CONTROL_SIGNALS_INVERT_MASK 0 |
$17 - Setting_ControlPullUpDisableMask | |
By default, grblHAL sets all input pins to normal-low operation with their internal pull-up resistors enabled. This simplifies the wiring for users by requiring only a normally closed (NC) switch connected to ground. It is not recommended to use normally-open (NO) switches as this increases the risk of electrical noise spuriously triggering the inputs. If normally-open (NO) switches are used the logic of the input signals should be be inverted with the invert settings below. The following options disable the internal pull-up resistors, and switches must be now connect to Vcc instead of ground. | |
#define | DEFAULT_DISABLE_CONTROL_PINS_PULL_UP_MASK 0 |
$5 - Setting_LimitPinsInvertMask | |
By default, grblHAL sets all input pins to normal-low operation with their internal pull-up resistors enabled. This simplifies the wiring for users by requiring only a normally closed (NC) switch connected to ground. It is not recommended to use normally-open (NO) switches as this increases the risk of electrical noise or cable breaks spuriously triggering the inputs. If normally-open (NO) switches are used the logic of the input signals should be be inverted with the axismask below. | |
#define | DEFAULT_LIMIT_SIGNALS_INVERT_MASK 0 |
$18 - Setting_LimitPullUpDisableMask | |
The following options disable the internal pull-up resistors by axismask, and switches must be now connect to Vcc instead of ground. | |
#define | DEFAULT_LIMIT_SIGNALS_PULLUP_DISABLE_MASK 0 |
$20 - Setting_SoftLimitsEnable | |
#define | DEFAULT_SOFT_LIMIT_ENABLE Off |
$21 - Setting_HardLimitsEnable | |
#define | DEFAULT_HARD_LIMIT_ENABLE Off |
At power-up or a reset, grblHAL will check the limit switch states to ensure they are not active before initialization. If it detects a problem and the hard limits setting is enabled, grblHAL will simply message the user to check the limits and enter an alarm state, rather than idle. grblHAL will not throw an alarm message. More... | |
#define | DEFAULT_CHECK_LIMITS_AT_INIT Off |
#define | DEFAULT_HARD_LIMITS_DISABLE_FOR_ROTARY Off |
$347 - Setting_DualAxisLengthFailPercent | |
#define | DEFAULT_DUAL_AXIS_HOMING_FAIL_AXIS_LENGTH_PERCENT 5.0f |
$348 - Setting_DualAxisLengthFailMin | |
#define | DEFAULT_DUAL_AXIS_HOMING_FAIL_DISTANCE_MIN 2.5f |
#define | DEFAULT_DUAL_AXIS_HOMING_FAIL_DISTANCE_MAX 25.0f |
$15 - Setting_CoolantInvertMask | |
Inverts the selected coolant signals from active high to active low. Useful for some pre-built electronic boards. | |
#define | DEFAULT_INVERT_COOLANT_FLOOD_PIN Off |
#define | DEFAULT_INVERT_COOLANT_MIST_PIN Off |
$9 - Setting_SpindlePWMOptions | |
#define | DEFAULT_SPINDLE_ENABLE_OFF_WITH_ZERO_SPEED Off |
$16 - Setting_SpindleInvertMask | |
Inverts the selected spindle output signals from active high to active low. Useful for some pre-built electronic boards. | |
#define | DEFAULT_INVERT_SPINDLE_ENABLE_PIN Off |
#define | DEFAULT_INVERT_SPINDLE_CCW_PIN Off |
#define | DEFAULT_INVERT_SPINDLE_PWM_PIN Off |
$30 - Setting_RpmMax | |
#define | DEFAULT_SPINDLE_RPM_MAX 1000.0f |
$31 - Setting_RpmMin | |
#define | DEFAULT_SPINDLE_RPM_MIN 0.0f |
$33 - Setting_PWMFreq | |
#define | DEFAULT_SPINDLE_PWM_FREQ 5000 |
$34 - Setting_PWMOffValue | |
#define | DEFAULT_SPINDLE_PWM_OFF_VALUE 0.0f |
$35 - Setting_PWMMinValue | |
Used by variable spindle output only. This forces the PWM output to a minimum duty cycle when enabled. The PWM pin will still read 0V when the spindle is disabled. Most users will not need this option, but it may be useful in certain scenarios. This minimum PWM settings coincides with the spindle rpm minimum setting, like rpm max to max PWM. This is handy if you need a larger voltage difference between 0V disabled and the voltage set by the minimum PWM for minimum rpm. This difference is 0.02V per PWM value. So, when minimum PWM is at 1, only 0.02 volts separate enabled and disabled. At PWM 5, this would be 0.1V. Keep in mind that you will begin to lose PWM resolution with increased minimum PWM values, since you have less and less range over the total 255 PWM levels to signal different spindle speeds. | |
#define | DEFAULT_SPINDLE_PWM_MIN_VALUE 0.0f |
$36 - Setting_PWMMaxValue | |
#define | DEFAULT_SPINDLE_PWM_MAX_VALUE 100.0f |
$38 - Setting_SpindlePPR | |
When the HAL driver supports spindle sync then this option sets the number of pulses per revolution for the spindle encoder. Depending on the driver this may lead to the "spindle at speed" detection being enabled. When this is enabled grblHAL will wait for the spindle to reach the programmed speed before continue processing. NOTE: Currently there is no timeout for this wait. Default value is 0, meaning spindle sync is disabled | |
#define | DEFAULT_SPINDLE_PPR 0 |
$340 - Setting_SpindleAtSpeedTolerance | |
#define | DEFAULT_SPINDLE_AT_SPEED_TOLERANCE 0.0f |
$395 - Setting_SpindleType | |
#define | DEFAULT_SPINDLE SPINDLE_PWM0 |
$66 - Setting_LinearSpindlePiece1 | |
Defines the parameters for the first entry in the spindle RPM linearization table. | |
#define | DEFAULT_RPM_POINT01 NAN |
#define | DEFAULT_RPM_LINE_A1 3.197101e-03f |
#define | DEFAULT_RPM_LINE_B1 -3.526076e-1f |
$67 - Setting_LinearSpindlePiece2 | |
Defines the parameters for the second entry in the spindle RPM linearization table. | |
#define | DEFAULT_RPM_POINT12 NAN |
#define | DEFAULT_RPM_LINE_A2 1.722950e-2f |
#define | DEFAULT_RPM_LINE_B2 1.0f, |
$68 - Setting_LinearSpindlePiece3 | |
Defines the parameters for the third entry in the spindle RPM linearization table. | |
#define | DEFAULT_RPM_POINT23 NAN |
#define | DEFAULT_RPM_LINE_A3 5.901518e-02f |
#define | DEFAULT_RPM_LINE_B3 4.881851e+02f |
$69 - Setting_LinearSpindlePiece4 | |
Defines the parameters for the fourth entry in the spindle RPM linearization table. | |
#define | DEFAULT_RPM_POINT34 NAN |
#define | DEFAULT_RPM_LINE_A4 1.203413e-01f |
#define | DEFAULT_RPM_LINE_B4 1.151360e+03f |
$341 - Setting_ToolChangeMode | |
0 = Normal mode, 1 = Manual change, 2 = Manual change @ G59.3, 3 = Manual change and probe sensor @ G59.3 - sets TLO | |
#define | DEFAULT_TOOLCHANGE_MODE 0 |
$342 - Setting_ToolChangeProbingDistance | |
#define | DEFAULT_TOOLCHANGE_PROBING_DISTANCE 30 |
$343 - Setting_ToolChangeFeedRate | |
#define | DEFAULT_TOOLCHANGE_FEED_RATE 25.0f |
$344 - Setting_ToolChangeSeekRate | |
#define | DEFAULT_TOOLCHANGE_SEEK_RATE 200.0f |
$345 - Setting_ToolChangePulloffRate | |
#define | DEFAULT_TOOLCHANGE_PULLOFF_RATE 200.0f |
$346 - Setting_ToolChangeRestorePosition | |
#define | DEFAULT_TOOLCHANGE_NO_RESTORE_POSITION Off |
$22 - Setting_HomingEnable | |
Enable homing. Requires homing cycles to be defined by DEFAULT_HOMING_CYCLE_0 - DEFAULT_HOMING_CYCLE_2 +. | |
#define | DEFAULT_HOMING_ENABLE Off |
#define | DEFAULT_HOMING_SINGLE_AXIS_COMMANDS Off |
Enables single axis homing commands. $HX , $HY , $HZ etc. for homing the respective axes.The full homing cycle is still invoked by the $H command. This is disabled by default. If you have a two-axis machine, DON'T USE THIS. Instead, just alter the homing cycle for two-axes. More... | |
#define | DEFAULT_HOMING_INIT_LOCK Off |
If homing is enabled, homing init lock sets grblHAL into an alarm state upon power up or a soft reset. This forces the user to perform the homing cycle before doing anything else. This is mainly a safety feature to remind the user to home, since position is unknown to grblHAL. More... | |
#define | DEFAULT_HOMING_FORCE_SET_ORIGIN Off |
After homing, grblHAL will set by default the entire machine space into negative space, as is typical for professional CNC machines, regardless of where the limit switches are located. Set this define to On or 1 to force grblHAL to always set the machine origin at the homed location despite switch orientation. More... | |
#define | DEFAULT_LIMITS_TWO_SWITCHES_ON_AXES Off |
If your machine has two limits switches wired in parallel to one axis, you will need to enable this feature. Since the two switches are sharing a single pin, there is no way for grblHAL to tell which one is enabled. This option only effects homing, where if a limit is engaged, grblHAL will alarm out and force the user to manually disengage the limit switch. Otherwise, if you have one limit switch for each axis, don't enable this option. By keeping it disabled, you can perform a homing cycle while on the limit switch and not have to move the machine off of it. More... | |
$23 - Setting_HomingDirMask | |
axismask controlling the direction of movement during homing. Unset bits in the mask results in movement in positive direction. | |
#define | DEFAULT_HOMING_DIR_MASK 0 |
$24 - Setting_HomingFeedRate | |
#define | DEFAULT_HOMING_FEED_RATE 25.0f |
$25 - Setting_HomingSeekRate | |
#define | DEFAULT_HOMING_SEEK_RATE 500.0f |
$26 - Setting_HomingDebounceDelay | |
#define | DEFAULT_HOMING_DEBOUNCE_DELAY 250 |
$27 - Setting_HomingPulloff | |
#define | DEFAULT_HOMING_PULLOFF 1.0f |
$43 - Setting_HomingLocateCycles | |
Number of homing cycles performed after when the machine initially jogs to limit switches. This help in preventing overshoot and should improve repeatability. This value should be one or greater. | |
#define | DEFAULT_N_HOMING_LOCATE_CYCLE 1 |
$44 - Setting_HomingCycle_1 | |
#define | DEFAULT_HOMING_CYCLE_0 (Z_AXIS_BIT) |
$45 - Setting_HomingCycle_2 | |
#define | DEFAULT_HOMING_CYCLE_1 (X_AXIS_BIT|Y_AXIS_BIT) |
$46 - Setting_HomingCycle_3 | |
#define | DEFAULT_HOMING_CYCLE_2 0 |
$47 - Setting_HomingCycle_4 | |
#define | DEFAULT_HOMING_CYCLE_3 0 |
$48 - Setting_HomingCycle_5 | |
#define | DEFAULT_HOMING_CYCLE_4 0 |
$49 - Setting_HomingCycle_6 | |
#define | DEFAULT_HOMING_CYCLE_5 0 |
$671 - Setting_HomePinsInvertMask | |
By default, grblHAL sets all input pins to normal-low operation with their internal pull-up resistors enabled. This simplifies the wiring for users by requiring only a normally closed (NC) switch connected to ground. It is not recommended to use normally-open (NO) switches as this increases the risk of electrical noise or cable breaks spuriously triggering the inputs. If normally-open (NO) switches are used the logic of the input signals should be be inverted with the axismask below. | |
#define | DEFAULT_HOME_SIGNALS_INVERT_MASK 0 |
$6 - Setting_InvertProbePin | |
#define | DEFAULT_PROBE_SIGNAL_INVERT Off |
$19 - Setting_ProbePullUpDisable | |
#define | DEFAULT_PROBE_SIGNAL_DISABLE_PULLUP Off |
$65 - Setting_ProbingFeedOverride | |
By default, grblHAL disables feed rate overrides for all G38.x probe cycle commands. Although this may be different than some pro-class machine control, it's arguable that it should be this way. Most probe sensors produce different levels of error that is dependent on rate of speed. By keeping probing cycles to their programmed feed rates, the probe sensor should be a lot more repeatable. If needed, you can disable this behavior by uncommenting the define below. | |
#define | DEFAULT_ALLOW_FEED_OVERRIDE_DURING_PROBE_CYCLES Off |
$41 - Setting_ParkingEnable | |
Enables and configures parking motion methods upon a safety door state. Primarily for OEMs that desire this feature for their integrated machines. At the moment, grblHAL assumes that the parking motion only involves one axis, although the parking implementation was written to be easily refactored for any number of motions on different axes by altering the parking source code. At this time, grblHAL only supports parking one axis (typically the Z-axis) that moves in the positive direction upon retracting and negative direction upon restoring position. The motion executes with a slow pull-out retraction motion, power-down, and a fast park. Restoring to the resume position follows these set motions in reverse: fast restore to pull-out position, power-up with a time-out, and plunge back to the original position at the slower pull-out rate. NOTE: Still a work-in-progress. Machine coordinates must be in all negative space and does not work with DEFAULT_HOMING_FORCE_SET_ORIGIN enabled. Parking motion also moves only in positive direction. // Default disabled. Uncomment to enable. | |
#define | DEFAULT_PARKING_ENABLE Off |
#define | DEFAULT_DEACTIVATE_PARKING_UPON_INIT Off |
#define | DEFAULT_ENABLE_PARKING_OVERRIDE_CONTROL Off |
$42 - Setting_ParkingAxis | |
Define which axis that performs the parking motion | |
#define | DEFAULT_PARKING_AXIS Z_AXIS |
$56 - Setting_ParkingPulloutIncrement | |
#define | DEFAULT_PARKING_PULLOUT_INCREMENT 5.0f |
$57 - Setting_ParkingPulloutRate | |
Spindle pull-out and plunge distance in mm. Incremental distance. Must be positive value or equal to zero. | |
#define | DEFAULT_PARKING_PULLOUT_RATE 100.0f |
$58 - Setting_ParkingTarget | |
Parking axis target. In mm, as machine coordinate [-max_travel, 0]. | |
#define | DEFAULT_PARKING_TARGET -5.0f |
$59 - Setting_ParkingFastRate | |
Parking fast rate after pull-out in mm/min. | |
#define | DEFAULT_PARKING_RATE 500.0f |
$61 - Setting_DoorOptions | |
#define | DEFAULT_DOOR_IGNORE_WHEN_IDLE Off |
If set to On or 1 ignore the door open signal command when in IDLE state. This can be useful for jogging laser cutters/engravers when the lid is open. More... | |
#define | DEFAULT_DOOR_KEEP_COOLANT_ON Off |
If set to On or 1 keep the coolant on when door is opened. More... | |
392 - Setting_DoorSpindleOnDelay | |
After the safety door switch has been toggled and restored, this setting sets the power-up delay between restoring the spindle and resuming the cycle. | |
#define | DEFAULT_SAFETY_DOOR_SPINDLE_DELAY 4.0f |
393 - Setting_DoorCoolantOnDelay | |
After the safety door switch has been toggled and restored, this setting sets the power-up delay between restoring the coolant and resuming the cycle. | |
#define | DEFAULT_SAFETY_DOOR_COOLANT_DELAY 1.0f |
$40 - Setting_JogSoftLimited | |
Soft limit jog commands to stay within machine limits. Unlike the general soft limits that raises an alarm for motions that exceeds machine limits this setting, when enabled, keeps them with the limits. | |
#define | DEFAULT_JOG_LIMIT_ENABLE Off |
$0 - Setting_PulseMicroseconds | |
Stepper pulse length in microseconds. | |
#define | DEFAULT_STEP_PULSE_MICROSECONDS 10.0f |
$1 - Setting_StepperIdleLockTime | |
Delay in milliseconds before steppers are disabled when idle, range 0-65535. Which axes are disabled can be defined by the DEFAULT_STEPPER_DEENERGIZE_MASK symbol. E.g. it might be desirable to unlock X and Y and keep the Z-axis enabled since the spindle may pull down the Z due to its weight. | |
#define | DEFAULT_STEPPER_IDLE_LOCK_TIME 25 |
$2 - Setting_StepInvertMask | |
axismask controlling the polarity of the step signals. The default is positive pulses. Set this value to -1 or AXES_BITMASK to invert for all steppers or specify which by mask. | |
#define | DEFAULT_STEP_SIGNALS_INVERT_MASK 0 |
$3 - Setting_DirInvertMask | |
axismask controling the polarity of the stepper direction signals. The default is positive voltage for motions in negative direction. Set this value to -1 or AXES_BITMASK to invert for all steppers or specify which by mask. | |
#define | DEFAULT_DIR_SIGNALS_INVERT_MASK 0 |
$4 - Setting_InvertStepperEnable | |
axismask for inverting the polarity of the stepper enable signal(s). Set this value to -1 or AXES_BITMASK to invert for all steppers or specify which by mask. | |
#define | DEFAULT_ENABLE_SIGNALS_INVERT_MASK AXES_BITMASK |
$8 - Setting_GangedDirInvertMask | |
axismask for inverting the polarity of the stepper direction signal(s) for the second motor for ganged/auto squared axes. | |
#define | DEFAULT_GANGED_DIRECTION_INVERT_MASK 0 |
$29 - Setting_PulseDelayMicroseconds | |
#define | DEFAULT_STEP_PULSE_DELAY 0.0f |
$37 - Setting_StepperDeenergizeMask | |
axismask to be OR'ed with stepper disable signal(s). Axes configured will not be disabled. | |
#define | DEFAULT_STEPPER_DEENERGIZE_MASK 0 |
$376 - Settings_Axis_Rotational | |
Designate ABC axes as rotational by axismask. This will disable scaling (to mm) in inches mode. Set steps/mm for the axes to the value that represent the desired movement per unit. For the controller the distance is unitless and and can be in degrees, radians, rotations, ... | |
#define | DEFAULT_AXIS_ROTATIONAL_MASK 0 |
$481 - Setting_AutoReportInterval | |
Auto status report interval, allowed range is 100 - 1000. Set to 0 to disable. | |
#define | DEFAULT_AUTOREPORT_INTERVAL 0 |
$482 - Setting_TimeZoneOffset | |
Timezone offset from UTC in hours, allowed range is -12.0 - 12.0. | |
#define | DEFAULT_TIMEZONE_OFFSET 0.0f |
$536 - Setting_RGB_StripLengt0 | |
Number of LEDs in NeoPixel/WS2812 strip 1. | |
#define | DEFAULT_RGB_STRIP0_LENGTH 0 |
$537 - Setting_RGB_StripLengt1 | |
Number of LEDs in NeoPixel/WS2812 strip 2. | |
#define | DEFAULT_RGB_STRIP1_LENGTH 0 |
$538 - Setting_RotaryWrap | |
Enable fast return to G28 position for rotary axes by axismask. Use: G91G28<axisletter>0 G90 | |
#define | DEFAULT_AXIS_ROTARY_WRAP_MASK 0 |
$10x - Setting_AxisStepsPerMM | |
#define | DEFAULT_X_STEPS_PER_MM 250.0f |
#define | DEFAULT_Y_STEPS_PER_MM 250.0f |
#define | DEFAULT_Z_STEPS_PER_MM 250.0f |
#define | DEFAULT_A_STEPS_PER_MM 250.0f |
#define | DEFAULT_B_STEPS_PER_MM 250.0f |
#define | DEFAULT_C_STEPS_PER_MM 250.0f |
#define | DEFAULT_U_STEPS_PER_MM 250.0f |
#define | DEFAULT_V_STEPS_PER_MM 250.0f |
$11x - Setting_AxisMaxRate | |
#define | DEFAULT_X_MAX_RATE 500.0f |
#define | DEFAULT_Y_MAX_RATE 500.0f |
#define | DEFAULT_Z_MAX_RATE 500.0f |
#define | DEFAULT_A_MAX_RATE 500.0f |
#define | DEFAULT_B_MAX_RATE 500.0f |
#define | DEFAULT_C_MAX_RATE 500.0f |
#define | DEFAULT_U_MAX_RATE 500.0f |
#define | DEFAULT_V_MAX_RATE 500.0f |
12x - Setting_AxisAcceleration | |
#define | DEFAULT_X_ACCELERATION 10.0f |
#define | DEFAULT_Y_ACCELERATION 10.0f |
#define | DEFAULT_Z_ACCELERATION 10.0f |
#define | DEFAULT_A_ACCELERATION 10.0f |
#define | DEFAULT_B_ACCELERATION 10.0f |
#define | DEFAULT_C_ACCELERATION 10.0f |
#define | DEFAULT_U_ACCELERATION 10.0f |
#define | DEFAULT_V_ACCELERATION 10.0f |
13x - Setting_AxisMaxTravel | |
NOTE: Must be a positive values. | |
#define | DEFAULT_X_MAX_TRAVEL 200.0f |
#define | DEFAULT_Y_MAX_TRAVEL 200.0f |
#define | DEFAULT_Z_MAX_TRAVEL 200.0f |
#define | DEFAULT_A_MAX_TRAVEL 200.0f |
#define | DEFAULT_B_MAX_TRAVEL 200.0f |
#define | DEFAULT_C_MAX_TRAVEL 200.0f |
#define | DEFAULT_U_MAX_TRAVEL 200.0f |
#define | DEFAULT_V_MAX_TRAVEL 200.0f |
14x - Setting_AxisStepperCurrent | |
#define | DEFAULT_X_CURRENT 500.0f |
#define | DEFAULT_Y_CURRENT 500.0f |
#define | DEFAULT_Z_CURRENT 500.0f |
#define | DEFAULT_A_CURRENT 500.0f |
#define | DEFAULT_B_CURRENT 500.0f |
#define | DEFAULT_C_CURRENT 500.0f |
#define | DEFAULT_U_CURRENT 500.0f |
#define | DEFAULT_V_CURRENT 500.0f |
This file contains compile-time and run-time configurations for grblHAL's internal system. For the most part, users will not need to directly modify these, but they are here for specific needs, i.e. performance tuning or adjusting to non-typical machines.
IMPORTANT: Symbol/macro names starting with DEFAULT_
contains default values for run-time configurable settings that can be changed with $=<setting id>
commands. Any changes to these requires a full re-compiling of the source code to propagate them. A reset of non-volatile storage with $RST=*
after reflashing is also required.
#define ACCELERATION_TICKS_PER_SECOND 100 |
The temporal resolution of the acceleration management subsystem. A higher number gives smoother acceleration, particularly noticeable on machines that run at very high feedrates, but may negatively impact performance. The correct value for this parameter is machine dependent, so it's advised to set this only as high as needed. Approximate successful values can widely range from 50 to 200 or more.
NOTE: Changing this value also changes the execution time of a segment in the step segment buffer. When increasing this value, this stores less overall time in the segment buffer and vice versa. Make certain the step segment buffer is increased/decreased to account for these changes.
#define ARC_ANGULAR_TRAVEL_EPSILON 5E-7f |
The arc G2/3 g-code standard is problematic by definition. Radius-based arcs have horrible numerical errors when arc at semi-circles(pi) or full-circles(2*pi). Offset-based arcs are much more accurate but still have a problem when arcs are full-circles (2*pi). This define accounts for the floating point issues when offset-based arcs are commanded as full circles, but get interpreted as extremely small arcs with around machine epsilon (1.2e-7rad) due to numerical round-off and precision issues. This define value sets the machine epsilon cutoff to determine if the arc is a full-circle or not.
NOTE: Be very careful when adjusting this value. It should always be greater than 1.2e-7 but not too much greater than this. The default setting should capture most, if not all, full arc error situations.
#define AXIS_REMAP_ABC2UVW Off |
Remap ABC
axis letters to UVW
NOTE: Experimental, if more than 3 and less than 7 axes are configured the ABC
axis letters can be remapped to UWV
.
#define BEZIER_MAX_STEP 0.1f |
#define BEZIER_MIN_STEP 0.002f |
#define BEZIER_SIGMA 0.1f |
#define BUILD_INFO "" |
Defines string to be output as part of the $I
or $I+
command response.
#define CHECK_MODE_DELAY 0 |
Add a short delay for each block processed in Check Mode to avoid overwhelming the sender with fast reply messages. This is likely to happen when streaming is done via a protocol where the speed is not limited to 115200 baud. An example is native USB streaming.
#define COMPATIBILITY_LEVEL 0 |
Define compatibility level with the legacy Grbl 1.1 protocol.
Additional G- and M-codes are not disabled except when level is set to >= 10. This does not apply to G- and M-codes dependent on driver and/or configuration settings disabled by setting level > 1.
Set to 0
for reporting itself as "GrblHAL" with protocol extensions enabled.
Set to 1
to disable some extensions, and for reporting itself as "Grbl".
Set to 2
to disable new settings as well, use #define symbols/macros for setting default values.
These can be found in in this file and in defaults.h.
Set to 10
to also disable new coordinate system offsets (G59.1 - G59.3) and some $#
report extensions.
NOTE: if switching to a level > 1 please reset non-volatile storage with $RST=*
after reflashing!
#define COREXY Off |
Enable CoreXY kinematics. Use ONLY with CoreXY machines.
IMPORTANT: If homing is enabled, you must reconfigure the homing cycle #defines above to #define DEFAULT_HOMING_CYCLE_1 X_AXIS_BIT
and #define DEFAULT_HOMING_CYCLE_2 Y_AXIS_BIT
NOTE: This configuration option alters the motion of the X and Y axes to principle of operation defined at corexy.com. Motors are assumed to positioned and wired exactly as described, if not, motions may move in strange directions. grblHAL requires the CoreXY A and B motors have the same steps per mm internally.
#define DEBOUNCE_DELAY 40 |
When > 0 adds a short delay when an input changes state to avoid switch bounce or EMI triggering the related interrupt falsely or too many times.
#define DEBUGOUT -1 |
#define DEFAULT_A_ACCELERATION 10.0f |
#define DEFAULT_A_CURRENT 500.0f |
#define DEFAULT_A_MAX_RATE 500.0f |
#define DEFAULT_A_MAX_TRAVEL 200.0f |
#define DEFAULT_A_STEPS_PER_MM 250.0f |
#define DEFAULT_ALLOW_FEED_OVERRIDE_DURING_PROBE_CYCLES Off |
#define DEFAULT_ARC_TOLERANCE 0.002f |
#define DEFAULT_AUTOREPORT_INTERVAL 0 |
#define DEFAULT_AXIS_ROTARY_WRAP_MASK 0 |
#define DEFAULT_AXIS_ROTATIONAL_MASK 0 |
#define DEFAULT_B_ACCELERATION 10.0f |
#define DEFAULT_B_CURRENT 500.0f |
#define DEFAULT_B_MAX_RATE 500.0f |
#define DEFAULT_B_MAX_TRAVEL 200.0f |
#define DEFAULT_B_STEPS_PER_MM 250.0f |
#define DEFAULT_C_ACCELERATION 10.0f |
#define DEFAULT_C_CURRENT 500.0f |
#define DEFAULT_C_MAX_RATE 500.0f |
#define DEFAULT_C_MAX_TRAVEL 200.0f |
#define DEFAULT_C_STEPS_PER_MM 250.0f |
#define DEFAULT_CHECK_LIMITS_AT_INIT Off |
#define DEFAULT_CONTROL_SIGNALS_INVERT_MASK 0 |
#define DEFAULT_DEACTIVATE_PARKING_UPON_INIT Off |
#define DEFAULT_DIR_SIGNALS_INVERT_MASK 0 |
#define DEFAULT_DISABLE_CONTROL_PINS_PULL_UP_MASK 0 |
#define DEFAULT_DISABLE_G92_PERSISTENCE Off |
#define DEFAULT_DISABLE_LASER_DURING_HOLD On |
#define DEFAULT_DOOR_IGNORE_WHEN_IDLE Off |
If set to On or 1 ignore the door open signal command when in IDLE state. This can be useful for jogging laser cutters/engravers when the lid is open.
#define DEFAULT_DUAL_AXIS_HOMING_FAIL_AXIS_LENGTH_PERCENT 5.0f |
#define DEFAULT_DUAL_AXIS_HOMING_FAIL_DISTANCE_MAX 25.0f |
#define DEFAULT_DUAL_AXIS_HOMING_FAIL_DISTANCE_MIN 2.5f |
#define DEFAULT_ENABLE_PARKING_OVERRIDE_CONTROL Off |
#define DEFAULT_ENABLE_SIGNALS_INVERT_MASK AXES_BITMASK |
#define DEFAULT_FORCE_INITIALIZATION_ALARM Off |
#define DEFAULT_G73_RETRACT 0.1f |
#define DEFAULT_GANGED_DIRECTION_INVERT_MASK 0 |
#define DEFAULT_HARD_LIMIT_ENABLE Off |
At power-up or a reset, grblHAL will check the limit switch states to ensure they are not active before initialization. If it detects a problem and the hard limits setting is enabled, grblHAL will simply message the user to check the limits and enter an alarm state, rather than idle. grblHAL will not throw an alarm message.
#define DEFAULT_HARD_LIMITS_DISABLE_FOR_ROTARY Off |
#define DEFAULT_HOME_SIGNALS_INVERT_MASK 0 |
#define DEFAULT_HOMING_ALLOW_MANUAL Off |
If enabled this allows using the homing $-commands to set the home position to the current axis position.
/def DEFAULT_HOMING_ALLOW_MANUAL
#define DEFAULT_HOMING_CYCLE_0 (Z_AXIS_BIT) |
#define DEFAULT_HOMING_CYCLE_1 (X_AXIS_BIT|Y_AXIS_BIT) |
#define DEFAULT_HOMING_CYCLE_2 0 |
#define DEFAULT_HOMING_CYCLE_3 0 |
#define DEFAULT_HOMING_CYCLE_4 0 |
#define DEFAULT_HOMING_CYCLE_5 0 |
#define DEFAULT_HOMING_DEBOUNCE_DELAY 250 |
#define DEFAULT_HOMING_DIR_MASK 0 |
#define DEFAULT_HOMING_ENABLE Off |
#define DEFAULT_HOMING_FEED_RATE 25.0f |
#define DEFAULT_HOMING_FORCE_SET_ORIGIN Off |
After homing, grblHAL will set by default the entire machine space into negative space, as is typical for professional CNC machines, regardless of where the limit switches are located. Set this define to On or 1 to force grblHAL to always set the machine origin at the homed location despite switch orientation.
/def DEFAULT_HOMING_FORCE_SET_ORIGIN
#define DEFAULT_HOMING_INIT_LOCK Off |
If homing is enabled, homing init lock sets grblHAL into an alarm state upon power up or a soft reset. This forces the user to perform the homing cycle before doing anything else. This is mainly a safety feature to remind the user to home, since position is unknown to grblHAL.
/def DEFAULT_HOMING_INIT_LOCK
#define DEFAULT_HOMING_KEEP_STATUS_ON_RESET Off |
Enable this setting to keep homed status over a soft reset - if position was not lost due to a reset during motion.
/def DEFAULT_HOMING_KEEP_STATUS_ON_RESET
#define DEFAULT_HOMING_OVERRIDE_LOCKS Off |
If homing init lock is enabled this sets grblHAL into an alarm state upon power up or a soft reset. To allow a soft reset to override the lock uncomment the line below.
/def DEFAULT_HOMING_OVERRIDE_LOCKS
#define DEFAULT_HOMING_PULLOFF 1.0f |
#define DEFAULT_HOMING_SEEK_RATE 500.0f |
#define DEFAULT_HOMING_SINGLE_AXIS_COMMANDS Off |
Enables single axis homing commands. $HX
, $HY
, $HZ
etc. for homing the respective axes.The full homing cycle is still invoked by the $H
command. This is disabled by default. If you have a two-axis machine, DON'T USE THIS. Instead, just alter the homing cycle for two-axes.
/def DEFAULT_HOMING_SINGLE_AXIS_COMMANDS
#define DEFAULT_HOMING_USE_LIMIT_SWITCHES Off |
Enable this setting to force using limit switches for homing.
/def DEFAULT_HOMING_USE_LIMIT_SWITCHES
#define DEFAULT_INVERT_COOLANT_FLOOD_PIN Off |
#define DEFAULT_INVERT_COOLANT_MIST_PIN Off |
#define DEFAULT_INVERT_SPINDLE_CCW_PIN Off |
#define DEFAULT_INVERT_SPINDLE_ENABLE_PIN Off |
#define DEFAULT_INVERT_SPINDLE_PWM_PIN Off |
#define DEFAULT_JOG_LIMIT_ENABLE Off |
#define DEFAULT_JUNCTION_DEVIATION 0.01f |
#define DEFAULT_LASER_MODE Off |
#define DEFAULT_LATHE_MODE Off |
#define DEFAULT_LEGACY_RTCOMMANDS On |
#define DEFAULT_LIMIT_SIGNALS_INVERT_MASK 0 |
#define DEFAULT_LIMIT_SIGNALS_PULLUP_DISABLE_MASK 0 |
#define DEFAULT_LIMITS_TWO_SWITCHES_ON_AXES Off |
If your machine has two limits switches wired in parallel to one axis, you will need to enable this feature. Since the two switches are sharing a single pin, there is no way for grblHAL to tell which one is enabled. This option only effects homing, where if a limit is engaged, grblHAL will alarm out and force the user to manually disengage the limit switch. Otherwise, if you have one limit switch for each axis, don't enable this option. By keeping it disabled, you can perform a homing cycle while on the limit switch and not have to move the machine off of it.
#define DEFAULT_N_HOMING_LOCATE_CYCLE 1 |
#define DEFAULT_PARKING_AXIS Z_AXIS |
#define DEFAULT_PARKING_ENABLE Off |
#define DEFAULT_PARKING_PULLOUT_INCREMENT 5.0f |
#define DEFAULT_PARKING_PULLOUT_RATE 100.0f |
#define DEFAULT_PARKING_RATE 500.0f |
#define DEFAULT_PARKING_TARGET -5.0f |
#define DEFAULT_PLANNER_BUFFER_BLOCKS 100 |
#define DEFAULT_PROBE_SIGNAL_DISABLE_PULLUP Off |
#define DEFAULT_PROBE_SIGNAL_INVERT Off |
#define DEFAULT_REPORT_ALARM_SUBSTATE Off |
Many controllers cannot be hard reset on startup due to using native USB or network protocols for communication. If the grblHAL for some reason is in ALARM
state there is normally no way to determine the cause of the alarm. Enabling this setting adds the alarm code (see alarm_code_t) as a substate, separated by a colon, to the Alarm state in the real time report.
NOTE: Enabling this option may break senders.
#define DEFAULT_REPORT_BUFFER_STATE On |
If set to Off or 0 the |Bf:
buffer state element is not included in the real time report.
#define DEFAULT_REPORT_CURRENT_FEED_SPEED On |
If set to Off or 0 the |FS:
current feed & speed element is not included in the real time report.
#define DEFAULT_REPORT_INCHES Off |
#define DEFAULT_REPORT_LINE_NUMBERS On |
If set to Off or 0 the |Ln:
line number element is not included in the real time report.
NOTE: Line numbers are only reported if present in the gcode.
#define DEFAULT_REPORT_MACHINE_POSITION On |
If set to Off or 0 position is reported with all offsets added.
#define DEFAULT_REPORT_OVERRIDES On |
If set to Off or 0 the |Pn:
input pins state element is not included in the real time report.
#define DEFAULT_REPORT_PARSER_STATE Off |
When enabled adds automatic report of the parser state following a status report request if the state was changed since the last report. The output is the same as provided by the $G
command.
#define DEFAULT_REPORT_PIN_STATE On |
If set to Off or 0 the |Pn:
input pins state element is not included in the real time report.
#define DEFAULT_REPORT_PROBE_COORDINATES On |
Upon a successful probe cycle, this option provides immediately feedback of the probe coordinates through an automatically generated message. If disabled, users can still access the last probe coordinates through grblHAL $#
print parameters command.
#define DEFAULT_REPORT_RUN_SUBSTATE Off |
Enabling this setting may add a code, separated by a colon, to the Run state in the real time report. The following codes are defined:
1
- a feed hold is pending, waiting for spindle synchronized motion to complete.2
- the motion is a probe. #define DEFAULT_REPORT_SYNC_ON_WCO_CHANGE On |
In Grbl v0.9 and prior, there is an old outstanding bug where the WPos:
work position reported may not correlate to what is executing, because WPos:
is based on the g-code parser state, which can be several motions behind. This option forces the planner buffer to empty, sync, and stop motion whenever there is a command that alters the work coordinate offsets G10,G43.1,G92,G54-59.3
. This is the simplest way to ensure WPos:
is always correct. Fortunately, it's exceedingly rare that any of these commands are used need continuous motions through them.
ok
#define DEFAULT_REPORT_WHEN_HOMING Off |
Enabling this setting enables status reporting while homing.
NOTE: Enabling this option may break senders.
#define DEFAULT_REPORT_WORK_COORD_OFFSET On |
If set to Off or 0 the |WCO:
work coordinate offset element is not included in the real time report.
#define DEFAULT_RESET_OVERRIDES Off |
#define DEFAULT_RESTORE_AFTER_FEED_HOLD On |
#define DEFAULT_RGB_STRIP0_LENGTH 0 |
#define DEFAULT_RGB_STRIP1_LENGTH 0 |
#define DEFAULT_RPM_LINE_A1 3.197101e-03f |
#define DEFAULT_RPM_LINE_A2 1.722950e-2f |
#define DEFAULT_RPM_LINE_A3 5.901518e-02f |
#define DEFAULT_RPM_LINE_A4 1.203413e-01f |
#define DEFAULT_RPM_LINE_B1 -3.526076e-1f |
#define DEFAULT_RPM_LINE_B2 1.0f, |
#define DEFAULT_RPM_LINE_B3 4.881851e+02f |
#define DEFAULT_RPM_LINE_B4 1.151360e+03f |
#define DEFAULT_RPM_POINT01 NAN |
#define DEFAULT_RPM_POINT12 NAN |
#define DEFAULT_RPM_POINT23 NAN |
#define DEFAULT_RPM_POINT34 NAN |
#define DEFAULT_SAFETY_DOOR_COOLANT_DELAY 1.0f |
#define DEFAULT_SAFETY_DOOR_SPINDLE_DELAY 4.0f |
#define DEFAULT_SLEEP_ENABLE Off |
#define DEFAULT_SOFT_LIMIT_ENABLE Off |
#define DEFAULT_SPINDLE SPINDLE_PWM0 |
#define DEFAULT_SPINDLE_AT_SPEED_TOLERANCE 0.0f |
#define DEFAULT_SPINDLE_ENABLE_OFF_WITH_ZERO_SPEED Off |
#define DEFAULT_SPINDLE_PPR 0 |
#define DEFAULT_SPINDLE_PWM_FREQ 5000 |
#define DEFAULT_SPINDLE_PWM_MAX_VALUE 100.0f |
#define DEFAULT_SPINDLE_PWM_MIN_VALUE 0.0f |
#define DEFAULT_SPINDLE_PWM_OFF_VALUE 0.0f |
#define DEFAULT_SPINDLE_RPM_MAX 1000.0f |
#define DEFAULT_SPINDLE_RPM_MIN 0.0f |
#define DEFAULT_STEP_PULSE_DELAY 0.0f |
#define DEFAULT_STEP_PULSE_MICROSECONDS 10.0f |
#define DEFAULT_STEP_SIGNALS_INVERT_MASK 0 |
#define DEFAULT_STEPPER_DEENERGIZE_MASK 0 |
#define DEFAULT_STEPPER_IDLE_LOCK_TIME 25 |
#define DEFAULT_TIMEZONE_OFFSET 0.0f |
#define DEFAULT_TOOLCHANGE_FEED_RATE 25.0f |
#define DEFAULT_TOOLCHANGE_MODE 0 |
#define DEFAULT_TOOLCHANGE_NO_RESTORE_POSITION Off |
#define DEFAULT_TOOLCHANGE_PROBING_DISTANCE 30 |
#define DEFAULT_TOOLCHANGE_PULLOFF_RATE 200.0f |
#define DEFAULT_TOOLCHANGE_SEEK_RATE 200.0f |
#define DEFAULT_U_ACCELERATION 10.0f |
#define DEFAULT_U_CURRENT 500.0f |
#define DEFAULT_U_MAX_RATE 500.0f |
#define DEFAULT_U_MAX_TRAVEL 200.0f |
#define DEFAULT_U_STEPS_PER_MM 250.0f |
#define DEFAULT_V_ACCELERATION 10.0f |
#define DEFAULT_V_CURRENT 500.0f |
#define DEFAULT_V_MAX_RATE 500.0f |
#define DEFAULT_V_MAX_TRAVEL 200.0f |
#define DEFAULT_V_STEPS_PER_MM 250.0f |
#define DEFAULT_X_ACCELERATION 10.0f |
#define DEFAULT_X_CURRENT 500.0f |
#define DEFAULT_X_MAX_RATE 500.0f |
#define DEFAULT_X_MAX_TRAVEL 200.0f |
#define DEFAULT_X_STEPS_PER_MM 250.0f |
#define DEFAULT_Y_ACCELERATION 10.0f |
#define DEFAULT_Y_CURRENT 500.0f |
#define DEFAULT_Y_MAX_RATE 500.0f |
#define DEFAULT_Y_MAX_TRAVEL 200.0f |
#define DEFAULT_Y_STEPS_PER_MM 250.0f |
#define DEFAULT_Z_ACCELERATION 10.0f |
#define DEFAULT_Z_CURRENT 500.0f |
#define DEFAULT_Z_MAX_RATE 500.0f |
#define DEFAULT_Z_MAX_TRAVEL 200.0f |
#define DEFAULT_Z_STEPS_PER_MM 250.0f |
#define DELTA_ROBOT Off |
Enable delta kinematics. Experimental - testing required and homing needs to be worked out.
#define DISABLE_BUILD_INFO_WRITE_COMMAND Off |
Disable the $I=(string)
build info write command. If disabled, any existing build info data must be placed into non-volatile storage via external means with a valid checksum value. This macro option is useful to prevent this data from being over-written by a user, when used to store OEM product data.
NOTE: If disabled and to ensure grblHAL can never alter the build info line, you'll also need to set the SETTINGS_RESTORE_BUILD_INFO symbol to Off or 0.
$I=
Default enabled. Uncomment to disable.
#define DWELL_TIME_STEP 50 |
Time delay increments performed during a dwell. The default value is set at 50ms, which provides a maximum time delay of roughly 55 minutes, more than enough for most any application. Increasing this delay will increase the maximum dwell time linearly, but also reduces the responsiveness of run-time command executions, like status reports, since these are performed between each dwell time step.
#define ENABLE_BACKLASH_COMPENSATION Off |
#define ENABLE_PATH_BLENDING Off |
#define ENABLE_RESTORE_NVS_DRIVER_PARAMETERS On |
$RST=&
Default enabled. Set to Off or 0 to disable. For drivers that implements non-generic settings.
#define ENABLE_SPINDLE_LINEARIZATION 0 |
This feature alters the spindle PWM/speed to a nonlinear output with a simple piecewise linear curve.
Useful for spindles that don't produce the right RPM from Grbl's standard spindle PWM linear model. Requires a solution by the 'fit_nonlinear_spindle.py' script in the /doc/script folder of the repo. See file comments on how to gather spindle data and run the script to generate a solution.
#define HARD_LIMIT_FORCE_STATE_CHECK Off |
Force grblHAL to check the state of the hard limit switches when the processor detects a pin change inside the hard limit ISR routine. By default, grblHAL will trigger the hard limits alarm upon any pin change, since bouncing switches can cause a state check like this to misread the pin. When hard limits are triggered, they should be 100% reliable, which is the reason that this option is disabled by default. Only if your system/electronics can guarantee that the switches don't bounce, we recommend enabling this option. This will help prevent triggering a hard limit when the machine disengages from the switch.
NOTE: This option has no effect if SOFTWARE_DEBOUNCE is enabled.
#define HOMING_AXIS_LOCATE_SCALAR 10.0f |
#define HOMING_AXIS_SEARCH_SCALAR 1.5f |
#define LATHE_UVW_OPTION Off |
Allow use of UVW axis words for non-modal relative lathe motion.
#define MASLOW_ROUTER Off |
Enable Maslow router kinematics. Experimental - testing required and homing needs to be worked out.
#define MINIMUM_FEED_RATE 1.0f |
Sets the minimum feed rate the planner will allow. Any value below it will be set to this minimum value. This also ensures that a planned motion always completes and accounts for any floating-point round-off errors. Although not recommended, a lower value than 1.0 mm/min will likely work in smaller machines, perhaps to 0.1mm/min, but your success may vary based on multiple factors.
#define MINIMUM_JUNCTION_SPEED 0.0f |
Minimum planner junction speed. Sets the default minimum junction speed the planner plans to at every buffer block junction, except for starting from rest and end of the buffer, which are always zero. This value controls how fast the machine moves through junctions with no regard for acceleration limits or angle between neighboring block line move directions. This is useful for machines that can't tolerate the tool dwelling for a split second, i.e. 3d printers or laser cutters. If used, this value should not be much greater than zero or to the minimum value necessary for the machine to work.
#define N_ARC_CORRECTION 12 |
Number of arc generation iterations by small angle approximation before exact arc trajectory correction with expensive sin() and cos() calculations. This parameter maybe decreased if there are issues with the accuracy of the arc generations, or increased if arc execution is getting bogged down by too many trig calculations.
#define N_AXIS 3 |
Defines number of axes supported - minimum 3, maximum 8. If more than 3 axes are configured a compliant driver and board map file is needed.
#define N_SPINDLE 1 |
Defines number of spindles supported - minimum 1, maximum 32.
#define N_SYS_SPINDLE 1 |
Defines number of simultaneously active spindles supported - minimum 1 (none), maximum 8.
#define N_TOOLS 0 |
Number of tools in tool table, edit to enable (max. 32 allowed)
#define NGC_EXPRESSIONS_ENABLE Off |
Set to On or 1 to enable experimental support for expressions.
Some LinuxCNC extensions are supported, conditionals and subroutines are not.
#define NGC_N_ASSIGN_PARAMETERS_PER_BLOCK 10 |
Maximum number of parameters allowed in a block.
#define NVSDATA_BUFFER_ENABLE On |
Disable non-volatile storage (NVS) emulation/buffering in RAM (allocated from heap memory). The NVS buffer can be used for MCUs with no non-volatile storage or for delaying writing to non-volatile storage until the controller is in IDLE state.
#define POLAR_ROBOT Off |
Enable polar kinematics. Experimental - testing required and homing needs to be worked out.
#define REPORT_ECHO_LINE_RECEIVED Off |
With this enabled, grblHAL sends back an echo of the line it has received, which has been pre-parsed (spaces removed, capitalized letters, no comments) and is to be immediately executed by grblHAL. Echoes will not be sent upon a line buffer overflow, but should for all normal lines sent to grblHAL. For example, if a user sends the line 'g1 x1.032 y2.45 (test comment)', grblHAL will echo back in the form '[echo: G1X1.032Y2.45]'. NOTE: Only use this for debugging purposes!! When echoing, this takes up valuable resources and can effect performance. If absolutely needed for normal operation, the serial write buffer should be greatly increased to help minimize transmission waiting within the serial write protocol.
#define REPORT_OVERRIDE_REFRESH_BUSY_COUNT 20 |
#define REPORT_OVERRIDE_REFRESH_IDLE_COUNT 10 |
#define REPORT_WCO_REFRESH_BUSY_COUNT 30 |
#define REPORT_WCO_REFRESH_IDLE_COUNT 10 |
#define SEGMENT_BUFFER_SIZE 10 |
Governs the size of the intermediary step segment buffer between the step execution algorithm and the planner blocks. Each segment is set of steps executed at a constant velocity over a fixed time defined by ACCELERATION_TICKS_PER_SECOND. They are computed such that the planner block velocity profile is traced exactly. The size of this buffer governs how much step execution lead time there is for other grblHAL processes have to compute and do their thing before having to come back and refill this buffer, currently at ~50msec of step moves.
#define SET_CHECK_MODE_PROBE_TO_START Off |
Configures the position after a probing cycle during grblHAL's check mode. Disabled sets the position to the probe target, when enabled sets the position to the start position.
#define SLEEP_DURATION 5.0f |
Configures grblHAL's sleep mode feature. If the spindle or coolant are powered and grblHAL is not actively moving or receiving any commands, a sleep timer will start. If any data or commands are received, the sleep timer will reset and restart until the above condition are not satisfied. If the sleep timer elaspes, grblHAL will immediately execute the sleep mode by shutting down the spindle and coolant and entering a safe sleep state. If parking is enabled, grblHAL will park the machine as well. While in sleep mode, only a hard/soft reset will exit it and the job will be unrecoverable. Sleep mode is enabled by setting DEFAULT_SLEEP_ENABLE to On or 1, overridable by the $62
setting.
NOTE: Sleep mode is a safety feature, primarily to address communication disconnect problems. To keep grblHAL from sleeping, employ a stream of '?' status report commands as a connection "heartbeat".
#define SPINDLE_NPWM_PIECES 4 |
Number of pieces used for spindle RPM linearization, enabled by setting ENABLE_SPINDLE_LINEARIZATION to 1.
#define TOOL_LENGTH_OFFSET_AXIS -1 |
Sets which axis the tool length offset is applied. Assumes the spindle is always parallel with the selected axis with the tool oriented toward the negative direction. In other words, a positive tool length offset value is subtracted from the current location.
#define TOOLSETTER_RADIUS 5.0f |
The grbl.on_probe_toolsetter event handler is called by the default tool change algorithm when probing at G59.3. In addition it will be called on a "normal" probe sequence if the XY position is within the radius of the G59.3 position defined below. Change if the default value of 5mm is not suitable or set it to 0.0f to disable.
NOTE: A grbl.on_probe_toolsetter event handler is not installed by the core, it has to be provided by a driver or a plugin.
#define WALL_PLOTTER Off |
Enable wall plotter kinematics. Experimental - testing required and homing needs to be worked out.