grblHAL core  20250922
config.h
Go to the documentation of this file.
1 /*
2  config.h - compile time configuration and default setting values
3 
4  Part of grblHAL
5 
6  Copyright (c) 2020-2025 Terje Io
7 
8  grblHAL is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  grblHAL is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with grblHAL. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
32 #ifndef _GRBL_CONFIG_H_
33 #define _GRBL_CONFIG_H_
34 
35 // Compile time only default configuration
36 
41 #ifndef N_AXIS
42 #define N_AXIS 3 // Number of axes
43 #endif
44 
50 #if (!defined AXIS_REMAP_ABC2UVW && (N_AXIS > 3 && N_AXIS < 7)) || defined __DOXYGEN__
51 #define AXIS_REMAP_ABC2UVW Off
52 #endif
53 
57 #if !defined N_SPINDLE || defined __DOXYGEN__
58 #define N_SPINDLE 1
59 #endif
60 
64 #if !defined N_SYS_SPINDLE || defined __DOXYGEN__
65 #define N_SYS_SPINDLE 1
66 #endif
67 
71 #if !defined BUILD_INFO || defined __DOXYGEN__
72 #define BUILD_INFO ""
73 #endif
74 
89 #if !defined COMPATIBILITY_LEVEL || defined __DOXYGEN__
90 #define COMPATIBILITY_LEVEL 0
91 #endif
92 
101 #if !defined ENABLE_SPINDLE_LINEARIZATION || defined __DOXYGEN__
102 #define ENABLE_SPINDLE_LINEARIZATION 0 // Set to 1 to enable spindle RPM linearization. Requires compatible driver if enabled.
103 #endif
104 
108 #if !defined SPINDLE_NPWM_PIECES || defined __DOXYGEN__
109 #define SPINDLE_NPWM_PIECES 4 // Number of pieces for spindle RPM linearization, max 4.
110 #endif
111 
112 #include "nuts_bolts.h"
113 
114 //#define KINEMATICS_API // Uncomment to add HAL entry points for custom kinematics
115 
120 #if !defined MASLOW_ROUTER || defined __DOXYGEN__
121 // Enable Maslow router kinematics.
122 // Experimental - testing required and homing needs to be worked out.
123 #define MASLOW_ROUTER Off
124 #endif
125 
130 #if !defined WALL_PLOTTER || defined __DOXYGEN__
131 #define WALL_PLOTTER Off
132 #endif
133 
138 #if !defined DELTA_ROBOT || defined __DOXYGEN__
139 #define DELTA_ROBOT Off
140 #endif
141 
142 // Reduce minimum feedrate for delta robots
143 #if DELTA_ROBOT && !defined MINIMUM_FEED_RATE
144 #define MINIMUM_FEED_RATE 0.1f // (radians/min)
145 #endif
146 
151 #if !defined POLAR_ROBOT || defined __DOXYGEN__
152 #define POLAR_ROBOT Off
153 #endif
154 
155 
165 #if !defined COREXY || defined __DOXYGEN__
166 #define COREXY Off
167 #endif
168 
176 #if !defined CHECK_MODE_DELAY || defined __DOXYGEN__
177 #define CHECK_MODE_DELAY 0 // ms
178 #endif
179 
185 #if !defined DEBOUNCE_DELAY || defined __DOXYGEN__
186 #define DEBOUNCE_DELAY 40 // ms
187 #endif
188 
189 #define MAX_TOOL_NUMBER 2147483647 // Limited by max signed 32-bit value - 1
190 
191 // ---------------------------------------------------------------------------------------
192 // ADVANCED CONFIGURATION OPTIONS:
193 
194 // EXPERIMENTAL OPTIONS
195 
196 #define ENABLE_PATH_BLENDING Off // Do NOT enable unless working on adding this feature!
197 
198 #if !defined ENABLE_ACCELERATION_PROFILES || defined __DOXYGEN__
199 #define ENABLE_ACCELERATION_PROFILES Off // Enable to allow G-Code changeable acceleration profiles.
200 #endif
201 
202 #if !defined ENABLE_JERK_ACCELERATION || defined __DOXYGEN__
203 #define ENABLE_JERK_ACCELERATION Off // Enable to use 3rd order acceleration calculations. May need more processing power, a FPU will help.
204 #endif
205 
206 // -
207 
208 // Enables code for debugging purposes. Not for general use and always in constant flux.
209 //#define DEBUG // Uncomment to enable. Default disabled.
210 //#define DEBUGOUT 0 // Uncomment to claim serial port with given instance number and add HAL entry point for debug output.
211 
224 #if !defined REPORT_OVERRIDE_REFRESH_BUSY_COUNT || defined __DOXYGEN__
225 #define REPORT_OVERRIDE_REFRESH_BUSY_COUNT 20 // (1-255)
226 #endif
227 #if !defined REPORT_OVERRIDE_REFRESH_IDLE_COUNT || defined __DOXYGEN__
228 #define REPORT_OVERRIDE_REFRESH_IDLE_COUNT 10 // (1-255) Must be less than or equal to the busy count
229 #endif
230 #if !defined REPORT_WCO_REFRESH_BUSY_COUNT || defined __DOXYGEN__
231 #define REPORT_WCO_REFRESH_BUSY_COUNT 30 // (2-255)
232 #endif
233 #if !defined REPORT_WCO_REFRESH_IDLE_COUNT || defined __DOXYGEN__
234 #define REPORT_WCO_REFRESH_IDLE_COUNT 10 // (2-255) Must be less than or equal to the busy count
235 #endif
237 
248 #if !defined ACCELERATION_TICKS_PER_SECOND || defined __DOXYGEN__
249 #define ACCELERATION_TICKS_PER_SECOND 100
250 #endif
251 
252 // Sets the maximum step rate allowed to be written as a grblHAL setting. This option enables an error
253 // check in the settings module to prevent settings values that will exceed this limitation. The maximum
254 // step rate is strictly limited by the CPU speed and will change if something other than an AVR running
255 // at 16MHz is used.
256 // NOTE: For now disabled, will enable if flash space permits.
257 //#define MAX_STEP_RATE_HZ 30000 // Hz
258 
269 #if !defined REPORT_ECHO_LINE_RECEIVED || defined __DOXYGEN__
270 #define REPORT_ECHO_LINE_RECEIVED Off // Default disabled. Set to \ref On or 1 to enable.
271 #endif
272 
279 #if !defined TOOL_LENGTH_OFFSET_AXIS || defined __DOXYGEN__
280 #define TOOL_LENGTH_OFFSET_AXIS -1 // Default is all axes.
281 #endif
282 
292 #if !defined MINIMUM_JUNCTION_SPEED || defined __DOXYGEN__
293 #define MINIMUM_JUNCTION_SPEED 0.0f // (mm/min)
294 #endif
295 
303 #if !defined MINIMUM_FEED_RATE || defined __DOXYGEN__
304 #define MINIMUM_FEED_RATE 1.0f // (mm/min)
305 #endif
306 
314 #if !defined N_ARC_CORRECTION || defined __DOXYGEN__
315 #define N_ARC_CORRECTION 12 // Integer (1-255)
316 #endif
317 
329 #if !defined ARC_ANGULAR_TRAVEL_EPSILON || defined __DOXYGEN__
330 #define ARC_ANGULAR_TRAVEL_EPSILON 5E-7f // Float (radians)
331 #endif
332 
337 #if !defined BEZIER_MIN_STEP || defined __DOXYGEN__
338 #define BEZIER_MIN_STEP 0.002f
339 #endif
340 #if !defined BEZIER_MAX_STEP || defined __DOXYGEN__
341 #define BEZIER_MAX_STEP 0.1f
342 #endif
343 #if !defined BEZIER_SIGMA || defined __DOXYGEN__
344 #define BEZIER_SIGMA 0.1f
345 #endif
347 
348 
356 #if !defined DWELL_TIME_STEP || defined __DOXYGEN__
357 #define DWELL_TIME_STEP 50 // Integer (1-255) (milliseconds)
358 #endif
359 
369 #if !defined SEGMENT_BUFFER_SIZE || defined __DOXYGEN__
370 #define SEGMENT_BUFFER_SIZE 10 // Uncomment to override default in stepper.h.
371 #endif
372 
378 #if !defined SET_CHECK_MODE_PROBE_TO_START || defined __DOXYGEN__
379 #define SET_CHECK_MODE_PROBE_TO_START Off // Default disabled. Set to \ref On or 1 to enable.
380 #endif
381 
393 #if !defined HARD_LIMIT_FORCE_STATE_CHECK || defined __DOXYGEN__
394 #define HARD_LIMIT_FORCE_STATE_CHECK Off // Default disabled. Set to \ref On or 1 to enable.
395 #endif
396 
408 #if !defined HOMING_AXIS_SEARCH_SCALAR || defined __DOXYGEN__
409 #define HOMING_AXIS_SEARCH_SCALAR 1.5f // Must be > 1 to ensure limit switch will be engaged.
410 #endif
411 #if !defined HOMING_AXIS_LOCATE_SCALAR || defined __DOXYGEN__
412 #define HOMING_AXIS_LOCATE_SCALAR 10.0f// Must be > 1 to ensure limit switch is cleared.
413 #endif
415 
423 #if !defined ENABLE_RESTORE_NVS_WIPE_ALL || defined __DOXYGEN__
424 #define ENABLE_RESTORE_NVS_WIPE_ALL On
425 #endif
426 #if !defined ENABLE_RESTORE_NVS_DEFAULT_SETTINGS || defined __DOXYGEN__
427 #define ENABLE_RESTORE_NVS_DEFAULT_SETTINGS On
428 #endif
429 #if !defined ENABLE_RESTORE_NVS_CLEAR_PARAMETERS || defined __DOXYGEN__
430 #define ENABLE_RESTORE_NVS_CLEAR_PARAMETERS On
431 #endif
432 #if !defined ENABLE_RESTORE_NVS_DRIVER_PARAMETERS || defined __DOXYGEN__
433 #define ENABLE_RESTORE_NVS_DRIVER_PARAMETERS On
434 #endif
436 
447 #if !defined SETTINGS_RESTORE_DEFAULTS || defined __DOXYGEN__
448 #define SETTINGS_RESTORE_DEFAULTS On
449 #endif
450 #if !defined SETTINGS_RESTORE_PARAMETERS || defined __DOXYGEN__
451 #define SETTINGS_RESTORE_PARAMETERS On
452 #endif
453 #if !defined SETTINGS_RESTORE_STARTUP_LINES || defined __DOXYGEN__
454 #define SETTINGS_RESTORE_STARTUP_LINES On
455 #endif
456 #if !defined SETTINGS_RESTORE_BUILD_INFO || defined __DOXYGEN__
457 #define SETTINGS_RESTORE_BUILD_INFO On
458 #endif
459 #if !defined SETTINGS_RESTORE_DRIVER_PARAMETERS || defined __DOXYGEN__
460 #define SETTINGS_RESTORE_DRIVER_PARAMETERS On
461 #endif
470 #if !defined DISABLE_BUILD_INFO_WRITE_COMMAND || defined __DOXYGEN__
471 #define DISABLE_BUILD_INFO_WRITE_COMMAND Off
472 #endif
474 
488 #if !defined SLEEP_DURATION || defined __DOXYGEN__
489 #define SLEEP_DURATION 5.0f // Number of minutes before sleep mode is entered.
490 #endif
491 
497 #if !defined NVSDATA_BUFFER_ENABLE || defined __DOXYGEN__
498 #define NVSDATA_BUFFER_ENABLE On // Default on, set to \ref off or 0 to disable.
499 #endif
500 
510 #if !defined TOOLSETTER_RADIUS || defined __DOXYGEN__
511 #define TOOLSETTER_RADIUS 5.0f
512 #endif
513 
514 #if !defined ENABLE_BACKLASH_COMPENSATION || defined __DOXYGEN__
515 #define ENABLE_BACKLASH_COMPENSATION Off
516 #endif
517 
518 #if COMPATIBILITY_LEVEL == 0 || defined __DOXYGEN__
523 #if !defined N_TOOLS || defined __DOXYGEN__
524 #define N_TOOLS 0
525 #endif
526 #endif
527 
534 #if !defined SPINDLE_SYNC_ENABLE || defined __DOXYGEN__
535 #define SPINDLE_SYNC_ENABLE Off
536 #endif
537 
544 #if !defined NGC_EXPRESSIONS_ENABLE || defined __DOXYGEN__
545 #define NGC_EXPRESSIONS_ENABLE Off
546 #endif
547 
552 #if !defined NGC_PARAMETERS_ENABLE || defined __DOXYGEN__
553 #define NGC_PARAMETERS_ENABLE On
554 #endif
555 
560 #if (NGC_EXPRESSIONS_ENABLE && !defined NGC_N_ASSIGN_PARAMETERS_PER_BLOCK) || defined __DOXYGEN__
561 #define NGC_N_ASSIGN_PARAMETERS_PER_BLOCK 10
562 #endif
563 
568 #if !defined LATHE_UVW_OPTION || defined __DOXYGEN__
569 #define LATHE_UVW_OPTION Off
570 #endif
571 
572 // Max number of entries in log for PID data reporting, to be used for tuning
573 //#define PID_LOG 1000 // Default disabled. Uncomment to enable.
574 
575 // End compile time only default configuration
576 
577 // ---------------------------------------------------------------------------------------
578 // SETTINGS DEFAULT VALUE OVERRIDES:
579 
580 // General settings (Group_General)
581 
591 
596 #if !defined DEFAULT_REPORT_MACHINE_POSITION || defined __DOXYGEN__
597 #define DEFAULT_REPORT_MACHINE_POSITION On // Default on. Set to \ref Off or 0 to disable.
598 #endif
599 
605 #if !defined DEFAULT_REPORT_BUFFER_STATE || defined __DOXYGEN__
606 #define DEFAULT_REPORT_BUFFER_STATE On // Default on. Set to \ref Off or 0 to disable.
607 #endif
608 
616 #if !defined DEFAULT_REPORT_LINE_NUMBERS || defined __DOXYGEN__
617 #define DEFAULT_REPORT_LINE_NUMBERS On // Default on. Set to \ref Off or 0 to disable.
618 #endif
619 
626 #if !defined DEFAULT_REPORT_CURRENT_FEED_SPEED || defined __DOXYGEN__
627 #define DEFAULT_REPORT_CURRENT_FEED_SPEED On // Default on. Set to \ref Off or 0 to disable.
628 #endif
629 
636 #if !defined DEFAULT_REPORT_PIN_STATE || defined __DOXYGEN__
637 #define DEFAULT_REPORT_PIN_STATE On // Default on. Set to \ref Off or 0 to disable.
638 #endif
639 
646 #if !defined DEFAULT_REPORT_WORK_COORD_OFFSET || defined __DOXYGEN__
647 #define DEFAULT_REPORT_WORK_COORD_OFFSET On // Default on. Set to \ref Off or 0 to disable.
648 #endif
649 
656 #if !defined DEFAULT_REPORT_OVERRIDES || defined __DOXYGEN__
657 #define DEFAULT_REPORT_OVERRIDES On // Default on. Set to \ref Off or 0 to disable.
658 #endif
659 
667 #if !defined DEFAULT_REPORT_PROBE_COORDINATES || defined __DOXYGEN__
668 #define DEFAULT_REPORT_PROBE_COORDINATES On // Default on. Set to \ref Off or 0 to disable.
669 #endif
670 
681 #if !defined DEFAULT_REPORT_SYNC_ON_WCO_CHANGE || defined __DOXYGEN__
682 #define DEFAULT_REPORT_SYNC_ON_WCO_CHANGE On
683 #endif
684 
692 #if !defined DEFAULT_REPORT_PARSER_STATE || defined __DOXYGEN__
693 #define DEFAULT_REPORT_PARSER_STATE Off // Default off. Set to \ref On or 1 to enable.
694 #endif
695 
706 #if !defined DEFAULT_REPORT_ALARM_SUBSTATE || defined __DOXYGEN__
707 #define DEFAULT_REPORT_ALARM_SUBSTATE Off // Default off. Set to \ref On or 1 to enable.
708 #endif
709 
719 #if !defined DEFAULT_REPORT_RUN_SUBSTATE || defined __DOXYGEN__
720 #define DEFAULT_REPORT_RUN_SUBSTATE Off // Default off. Set to \ref On or 1 to enable.
721 #endif
722 
729 #if !defined DEFAULT_REPORT_WHEN_HOMING || defined __DOXYGEN__
730 #define DEFAULT_REPORT_WHEN_HOMING Off // Default off. Set to \ref On or 1 to enable.
731 #endif
732 
738 #if !defined DEFAULT_REPORT_DISTANCE_TO_GO || defined __DOXYGEN__
739 #define DEFAULT_REPORT_DISTANCE_TO_GO On // Default on. Set to \ref Off or 0 to disable.
740 #endif
741 
743 
748 #if !defined DEFAULT_JUNCTION_DEVIATION || defined __DOXYGEN__
749 #define DEFAULT_JUNCTION_DEVIATION 0.01f // mm
750 #endif
752 
757 #if !defined DEFAULT_ARC_TOLERANCE || defined __DOXYGEN__
758 #define DEFAULT_ARC_TOLERANCE 0.002f // mm
759 #endif
761 
767 #if !defined DEFAULT_REPORT_INCHES || defined __DOXYGEN__
768 #define DEFAULT_REPORT_INCHES Off
769 #endif
771 
777 #if !defined DEFAULT_G73_RETRACT || defined __DOXYGEN__
778 #define DEFAULT_G73_RETRACT 0.1f // mm
779 #endif
781 
786 #if !defined DEFAULT_LASER_MODE || defined __DOXYGEN__
787 #define DEFAULT_LASER_MODE Off
788 #endif
789 #if !defined DEFAULT_LATHE_MODE || defined __DOXYGEN__
790 #define DEFAULT_LATHE_MODE Off
791 #endif
793 
803 #if !defined DEFAULT_LEGACY_RTCOMMANDS || defined __DOXYGEN__
804 #define DEFAULT_LEGACY_RTCOMMANDS On
805 #endif
807 
811 #if !defined DEFAULT_RESET_OVERRIDES || defined __DOXYGEN__
812 #define DEFAULT_RESET_OVERRIDES Off
813 #endif
815 
819 #if !defined DEFAULT_SLEEP_ENABLE || defined __DOXYGEN__
820 #define DEFAULT_SLEEP_ENABLE Off
821 #endif
823 
831 #if !defined DEFAULT_DISABLE_LASER_DURING_HOLD || defined __DOXYGEN__
832 #define DEFAULT_DISABLE_LASER_DURING_HOLD On
833 #endif
835 
841 #if !defined DEFAULT_RESTORE_AFTER_FEED_HOLD || defined __DOXYGEN__
842 #define DEFAULT_RESTORE_AFTER_FEED_HOLD On
843 #endif
845 
855 #if !defined DEFAULT_FORCE_INITIALIZATION_ALARM || defined __DOXYGEN__
856 #define DEFAULT_FORCE_INITIALIZATION_ALARM Off
857 #endif
859 
866 #if !defined DEFAULT_DISABLE_G92_PERSISTENCE || defined __DOXYGEN__
867 #if COMPATIBILITY_LEVEL <= 1
868 #define DEFAULT_DISABLE_G92_PERSISTENCE Off
869 #else
870 #define DEFAULT_DISABLE_G92_PERSISTENCE On
871 #endif
872 #endif
874 
883 #if !defined DEFAULT_PLANNER_BUFFER_BLOCKS || defined __DOXYGEN__
884 #define DEFAULT_PLANNER_BUFFER_BLOCKS 100
885 #endif
887 
897 #if !defined DEFAULT_HOMING_KEEP_STATUS_ON_RESET || defined __DOXYGEN__
898 #define DEFAULT_HOMING_KEEP_STATUS_ON_RESET Off // Default disabled. Set to \ref On or 1 to enable.
899 #endif
901 
908 #if !defined DEFAULT_KEEP_OFFSETS_ON_RESET || defined __DOXYGEN__
909 #define DEFAULT_KEEP_OFFSETS_ON_RESET Off
910 #endif
912 
919 #if !defined DEFAULT_KEEP_RAPIDS_OVR_ON_RESET || defined __DOXYGEN__
920 #define DEFAULT_KEEP_RAPIDS_OVR_ON_RESET Off
921 #endif
923 
930 #if !defined DEFAULT_KEEP_FEED_OVR_ON_RESET || defined __DOXYGEN__
931 #define DEFAULT_KEEP_FEED_OVR_ON_RESET Off
932 #endif
934 
935 
936 
937 // Control signals settings (Group_ControlSignals)
938 
939 #ifndef __DOXYGEN__ // For now do not include in documentation
940 
946 #define SIGNALS_RESET_BIT (1<<0)
947 #define SIGNALS_FEEDHOLD_BIT (1<<1)
948 #define SIGNALS_CYCLESTART_BIT (1<<2)
949 #define SIGNALS_SAFETYDOOR_BIT (1<<3)
950 #define SIGNALS_BLOCKDELETE_BIT (1<<4)
951 #define SIGNALS_STOPDISABLE_BIT (1<<5)
952 #define SIGNALS_ESTOP_BIT (1<<6)
953 #define SIGNALS_PROBE_CONNECTED_BIT (1<<7)
954 #define SIGNALS_MOTOR_FAULT_BIT (1<<8)
955 #define SIGNALS_BITMASK (SIGNALS_RESET_BIT|SIGNALS_FEEDHOLD_BIT|SIGNALS_CYCLESTART_BIT|SIGNALS_SAFETYDOOR_BIT|SIGNALS_BLOCKDELETE_BIT|SIGNALS_STOPDISABLE_BIT|SIGNALS_ESTOP_BIT|SIGNALS_PROBE_CONNECTED_BIT|SIGNALS_MOTOR_FAULT_BIT)
957 
958 #endif
959 
966 #if !defined DEFAULT_CONTROL_SIGNALS_INVERT_MASK || defined __DOXYGEN__
967 #define DEFAULT_CONTROL_SIGNALS_INVERT_MASK 0 // Set to SIGNALS_BITMASK or -1 to invert all signals
968 #endif
970 
985 #if !defined DEFAULT_DISABLE_CONTROL_PINS_PULL_UP_MASK || defined __DOXYGEN__
986 #define DEFAULT_DISABLE_CONTROL_PINS_PULL_UP_MASK 0 // Set to SIGNALS_BITMASK or -1 to invert all signals
987 #endif
989 
990 // Limits settings (Group_Limits)
991 
1000 #if !defined DEFAULT_LIMIT_SIGNALS_INVERT_MASK || defined __DOXYGEN__
1001 #define DEFAULT_LIMIT_SIGNALS_INVERT_MASK 0 // Set to -1 or AXES_BITMASK to invert for all axes
1002 #endif
1004 
1012 #if !defined DEFAULT_LIMIT_SIGNALS_PULLUP_DISABLE_MASK || defined __DOXYGEN__
1013 #define DEFAULT_LIMIT_SIGNALS_PULLUP_DISABLE_MASK 0 // Set to -1 or AXES_BITMASK to disable pullup for all axes
1014 #endif
1016 
1020 #if !defined DEFAULT_SOFT_LIMIT_ENABLE || defined __DOXYGEN__
1021 #define DEFAULT_SOFT_LIMIT_ENABLE Off
1022 #endif
1024 
1028 
1035 #if !defined DEFAULT_HARD_LIMIT_ENABLE || defined __DOXYGEN__
1036 #define DEFAULT_HARD_LIMIT_ENABLE Off
1037 #endif
1038 #if !defined DEFAULT_CHECK_LIMITS_AT_INIT || defined __DOXYGEN__
1039 #define DEFAULT_CHECK_LIMITS_AT_INIT Off
1040 #endif
1041 #if !defined DEFAULT_HARD_LIMITS_DISABLE_FOR_ROTARY || defined __DOXYGEN__
1042 #define DEFAULT_HARD_LIMITS_DISABLE_FOR_ROTARY Off
1043 #endif
1044 
1057 
1060 #if !defined DEFAULT_DUAL_AXIS_HOMING_FAIL_AXIS_LENGTH_PERCENT || defined __DOXYGEN__
1061 #define DEFAULT_DUAL_AXIS_HOMING_FAIL_AXIS_LENGTH_PERCENT 5.0f // Float (percent)
1062 #endif
1064 
1068 #if !defined DEFAULT_DUAL_AXIS_HOMING_FAIL_DISTANCE_MIN || defined __DOXYGEN__
1069 #define DEFAULT_DUAL_AXIS_HOMING_FAIL_DISTANCE_MIN 2.5f // Float (mm)
1070 #endif
1072 
1077 #if !defined DEFAULT_DUAL_AXIS_HOMING_FAIL_DISTANCE_MAX || defined __DOXYGEN__
1078 #define DEFAULT_DUAL_AXIS_HOMING_FAIL_DISTANCE_MAX 25.0f // Float (mm)
1079 #endif
1081 
1082 // Coolant settings (Group_Coolant)
1083 
1089 #if !defined DEFAULT_INVERT_COOLANT_FLOOD_PIN || defined __DOXYGEN__
1090 #define DEFAULT_INVERT_COOLANT_FLOOD_PIN Off
1091 #endif
1092 #if !defined DEFAULT_INVERT_COOLANT_MIST_PIN || defined __DOXYGEN__
1093 #define DEFAULT_INVERT_COOLANT_MIST_PIN Off // NOTE: not supported by all drivers.
1094 #endif
1096 
1100 #if !defined DEFAULT_COOLANT_ON_DELAY || defined __DOXYGEN__
1101 #define DEFAULT_COOLANT_ON_DELAY 0 // milliseconds: 0 or 500 - 20000
1102 #endif
1104 
1105 // Spindle settings (Group_Spindle)
1106 
1110 #if !defined DEFAULT_SPINDLE_ENABLE_OFF_WITH_ZERO_SPEED || defined __DOXYGEN__
1111 #define DEFAULT_SPINDLE_ENABLE_OFF_WITH_ZERO_SPEED Off
1112 #endif
1113 #if !defined DEFAULT_PWM_SPINDLE_DISABLE_LASER_MODE || defined __DOXYGEN__
1114 #define DEFAULT_PWM_SPINDLE_DISABLE_LASER_MODE Off
1115 #endif
1117 
1122 #if !defined DEFAULT_INVERT_SPINDLE_ENABLE_PIN || defined __DOXYGEN__
1123 #define DEFAULT_INVERT_SPINDLE_ENABLE_PIN Off
1124 #endif
1125 #if !defined DEFAULT_INVERT_SPINDLE_CCW_PIN || defined __DOXYGEN__
1126 #define DEFAULT_INVERT_SPINDLE_CCW_PIN Off // NOTE: not supported by all drivers.
1127 #endif
1128 #if !defined DEFAULT_INVERT_SPINDLE_PWM_PIN || defined __DOXYGEN__
1129 #define DEFAULT_INVERT_SPINDLE_PWM_PIN Off // NOTE: not supported by all drivers.
1130 #endif
1132 
1136 #if !defined DEFAULT_SPINDLE_RPM_MAX || defined __DOXYGEN__
1137 #define DEFAULT_SPINDLE_RPM_MAX 1000.0f // rpm
1138 #endif
1140 
1144 #if !defined DEFAULT_SPINDLE_RPM_MIN || defined __DOXYGEN__
1145 #define DEFAULT_SPINDLE_RPM_MIN 0.0f // rpm
1146 #endif
1148 
1152 #if !defined DEFAULT_SPINDLE_PWM_FREQ || defined __DOXYGEN__
1153 #define DEFAULT_SPINDLE_PWM_FREQ 5000 // Hz
1154 #endif
1156 
1160 #if !defined DEFAULT_SPINDLE_PWM_OFF_VALUE || defined __DOXYGEN__
1161 #define DEFAULT_SPINDLE_PWM_OFF_VALUE 0.0f // Percent
1162 #endif
1164 
1177 #if !defined DEFAULT_SPINDLE_PWM_MIN_VALUE || defined __DOXYGEN__
1178 #define DEFAULT_SPINDLE_PWM_MIN_VALUE 0.0f // Must be greater than zero. Integer (+-255).
1179 #endif
1181 
1185 #if !defined DEFAULT_SPINDLE_PWM_MAX_VALUE || defined __DOXYGEN__
1186 #define DEFAULT_SPINDLE_PWM_MAX_VALUE 100.0f // Percent
1187 #endif
1189 
1198 #if !defined DEFAULT_SPINDLE_PPR || defined __DOXYGEN__
1199 #define DEFAULT_SPINDLE_PPR 0 // Pulses per revolution.
1200 #endif
1202 
1206 #if !defined DEFAULT_SPINDLE_AT_SPEED_TOLERANCE || defined __DOXYGEN__
1207 #define DEFAULT_SPINDLE_AT_SPEED_TOLERANCE 0.0f // Percent - 0 means not checked
1208 #endif
1210 
1214 #if !defined DEFAULT_SPINDLE_ON_DELAY || defined __DOXYGEN__
1215 #define DEFAULT_SPINDLE_ON_DELAY 0 // milliseconds: 0 or 500 - 20000
1216 #endif
1218 
1222 #if !defined DEFAULT_SPINDLE || defined __DOXYGEN__
1223 #define DEFAULT_SPINDLE SPINDLE_PWM0 // Spindle number from spindle_control.h
1224 #endif
1226 
1230 #if !defined DEFAULT_SPINDLE_OFF_DELAY || defined __DOXYGEN__
1231 #define DEFAULT_SPINDLE_OFF_DELAY 0 // milliseconds: 0 or 500 - 20000
1232 #endif
1234 
1235 // Closed loop spindle settings (Group_Spindle_ClosedLoop)
1236 
1237 // $9 - Setting_SpindlePWMOptions
1238 // bit 0
1239 // always defaults to on
1240 // bit 1
1241 
1242 // Closed loop spindle settings (Group_Spindle_ClosedLoop)
1243 
1244 #ifndef DEFAULT_SPINDLE_P_GAIN
1245 #define DEFAULT_SPINDLE_P_GAIN 1.0f
1246 #endif
1247 #ifndef DEFAULT_SPINDLE_I_GAIN
1248 #define DEFAULT_SPINDLE_I_GAIN 0.01f
1249 #endif
1250 #ifndef DEFAULT_SPINDLE_D_GAIN
1251 #define DEFAULT_SPINDLE_D_GAIN 0.0f
1252 #endif
1253 #ifndef DEFAULT_SPINDLE_I_MAX
1254 #define DEFAULT_SPINDLE_I_MAX 10.0f
1255 #endif
1256 
1257 #if ENABLE_SPINDLE_LINEARIZATION || defined __DOXYGEN__
1258 
1263 #if !defined DEFAULT_RPM_POINT01 || defined __DOXYGEN__
1264 #define DEFAULT_RPM_POINT01 NAN // DEFAULT_SPINDLE_RPM_MIN // Replace NAN with DEFAULT_SPINDLE_RPM_MIN to enable.
1265 #endif
1266 #if !defined DEFAULT_RPM_LINE_A1 || defined __DOXYGEN__
1267 #define DEFAULT_RPM_LINE_A1 3.197101e-03f
1268 #endif
1269 #if !defined DEFAULT_RPM_LINE_B1 || defined __DOXYGEN__
1270 #define DEFAULT_RPM_LINE_B1 -3.526076e-1f
1271 #endif
1273 
1278 #if !defined DEFAULT_RPM_POINT12 || defined __DOXYGEN__
1279 #define DEFAULT_RPM_POINT12 NAN // Change NAN to a float constant to enable.
1280 #endif
1281 #if !defined DEFAULT_RPM_LINE_A2 || defined __DOXYGEN__
1282 #define DEFAULT_RPM_LINE_A2 1.722950e-2f
1283 #endif
1284 #if !defined DEFAULT_RPM_LINE_B2 || defined __DOXYGEN__
1285 #define DEFAULT_RPM_LINE_B2 1.0f,
1286 #endif
1288 
1293 #if !defined DEFAULT_RPM_POINT23 || defined __DOXYGEN__
1294 #define DEFAULT_RPM_POINT23 NAN // Change NAN to a float constant to enable.
1295 #endif
1296 #if !defined DEFAULT_RPM_LINE_A3 || defined __DOXYGEN__
1297 #define DEFAULT_RPM_LINE_A3 5.901518e-02f
1298 #endif
1299 #if !defined DEFAULT_RPM_LINE_B3 || defined __DOXYGEN__
1300 #define DEFAULT_RPM_LINE_B3 4.881851e+02f
1301 #endif
1303 
1308 #if !defined DEFAULT_RPM_POINT34 || defined __DOXYGEN__
1309 #define DEFAULT_RPM_POINT34 NAN // Change NAN to a float constant to enable.
1310 #endif
1311 #if !defined DEFAULT_RPM_LINE_A4 || defined __DOXYGEN__
1312 #define DEFAULT_RPM_LINE_A4 1.203413e-01f
1313 #endif
1314 #if !defined DEFAULT_RPM_LINE_B4 || defined __DOXYGEN__
1315 #define DEFAULT_RPM_LINE_B4 1.151360e+03f
1316 #endif
1318 
1319 #endif // ENABLE_SPINDLE_LINEARIZATION
1320 
1321 // Settings for second PWM spindle
1322 
1327 #if !defined DEFAULT_INVERT_SPINDLE1_ENABLE_PIN || defined __DOXYGEN__
1328 #define DEFAULT_INVERT_SPINDLE1_ENABLE_PIN Off
1329 #endif
1330 #if !defined DEFAULT_INVERT_SPINDLE1_CCW_PIN || defined __DOXYGEN__
1331 #define DEFAULT_INVERT_SPINDLE1_CCW_PIN Off // NOTE: not supported by all drivers.
1332 #endif
1333 #if !defined DEFAULT_INVERT_SPINDLE1_PWM_PIN || defined __DOXYGEN__
1334 #define DEFAULT_INVERT_SPINDLE1_PWM_PIN Off // NOTE: not supported by all drivers.
1335 #endif
1337 
1341 #if !defined DEFAULT_SPINDLE1_RPM_MAX || defined __DOXYGEN__
1342 #define DEFAULT_SPINDLE1_RPM_MAX 1000.0f // rpm
1343 #endif
1345 
1349 #if !defined DEFAULT_SPINDLE1_RPM_MIN || defined __DOXYGEN__
1350 #define DEFAULT_SPINDLE1_RPM_MIN 0.0f // rpm
1351 #endif
1353 
1357 #if !defined DEFAULT_SPINDLE1_PWM_FREQ || defined __DOXYGEN__
1358 #define DEFAULT_SPINDLE1_PWM_FREQ 5000 // Hz
1359 #endif
1361 
1365 #if !defined DEFAULT_SPINDLE1_PWM_OFF_VALUE || defined __DOXYGEN__
1366 #define DEFAULT_SPINDLE1_PWM_OFF_VALUE 0.0f // Percent
1367 #endif
1369 
1382 #if !defined DEFAULT_SPINDLE1_PWM_MIN_VALUE || defined __DOXYGEN__
1383 #define DEFAULT_SPINDLE1_PWM_MIN_VALUE 0.0f // Must be greater than zero. Integer (+-255).
1384 #endif
1386 
1390 #if !defined DEFAULT_SPINDLE1_PWM_MAX_VALUE || defined __DOXYGEN__
1391 #define DEFAULT_SPINDLE1_PWM_MAX_VALUE 100.0f // Percent
1392 #endif
1394 
1395 
1396 // Tool change settings (Group_Toolchange)
1397 
1402 #if !defined DEFAULT_TOOLCHANGE_MODE || defined __DOXYGEN__
1403 #define DEFAULT_TOOLCHANGE_MODE 0
1404 #endif
1406 
1410 #if !defined DEFAULT_TOOLCHANGE_PROBING_DISTANCE || defined __DOXYGEN__
1411 #define DEFAULT_TOOLCHANGE_PROBING_DISTANCE 30 // max probing distance in mm for mode 3
1412 #endif
1414 
1418 #if !defined DEFAULT_TOOLCHANGE_FEED_RATE || defined __DOXYGEN__
1419 #define DEFAULT_TOOLCHANGE_FEED_RATE 25.0f // mm/min
1420 #endif
1422 
1427 #if !defined DEFAULT_TOOLCHANGE_SEEK_RATE || defined __DOXYGEN__
1428 #define DEFAULT_TOOLCHANGE_SEEK_RATE 200.0f // mm/min
1429 #endif
1431 
1435 #if !defined DEFAULT_TOOLCHANGE_PULLOFF_RATE || defined __DOXYGEN__
1436 #define DEFAULT_TOOLCHANGE_PULLOFF_RATE 200.0f // mm/min
1437 #endif
1439 
1443 #if !defined DEFAULT_TOOLCHANGE_NO_RESTORE_POSITION || defined __DOXYGEN__
1444 #define DEFAULT_TOOLCHANGE_NO_RESTORE_POSITION Off
1445 #endif
1446 #if !defined DEFAULT_TOOLCHANGE_AT_G30 || defined __DOXYGEN__
1447 #define DEFAULT_TOOLCHANGE_AT_G30 Off
1448 #endif
1449 #if !defined DEFAULT_TOOLCHANGE_FAST_PROBE_PULLOFF || defined __DOXYGEN__
1450 #define DEFAULT_TOOLCHANGE_FAST_PROBE_PULLOFF Off
1451 #endif
1453 
1457 #if !defined DEFAULT_PERSIST_TOOL || defined __DOXYGEN__
1458 #define DEFAULT_PERSIST_TOOL Off
1459 #endif
1461 
1462 // Homing settings (Group_Homing)
1463 
1470 #if !defined DEFAULT_HOMING_ENABLE || defined __DOXYGEN__
1471 #define DEFAULT_HOMING_ENABLE Off // Default disabled. Set to \ref On or 1 to enable.
1472 #endif
1473 
1481 #if !defined DEFAULT_HOMING_SINGLE_AXIS_COMMANDS || defined __DOXYGEN__
1482 #define DEFAULT_HOMING_SINGLE_AXIS_COMMANDS Off // Default disabled. Set to \ref On or 1 to enable.
1483 #endif
1484 
1492 #if !defined DEFAULT_HOMING_INIT_LOCK || defined __DOXYGEN__
1493 #define DEFAULT_HOMING_INIT_LOCK Off // Default disabled. Set to \ref On or 1 to enable.
1494 #endif
1495 
1503 #if !defined DEFAULT_HOMING_FORCE_SET_ORIGIN || defined __DOXYGEN__
1504 #define DEFAULT_HOMING_FORCE_SET_ORIGIN Off // Default disabled. Set to \ref On or 1 to enable.
1505 #endif
1506 
1517 #if !defined DEFAULT_LIMITS_TWO_SWITCHES_ON_AXES || defined __DOXYGEN__
1518 #define DEFAULT_LIMITS_TWO_SWITCHES_ON_AXES Off // Default disabled. Set to \ref On or 1 to enable.
1519 #endif
1521 
1528 #if !defined DEFAULT_HOMING_ALLOW_MANUAL || defined __DOXYGEN__
1529 #define DEFAULT_HOMING_ALLOW_MANUAL Off // Default disabled. Set to \ref On or 1 to enable.
1530 #endif
1531 
1538 #if !defined DEFAULT_HOMING_OVERRIDE_LOCKS || defined __DOXYGEN__
1539 #define DEFAULT_HOMING_OVERRIDE_LOCKS Off // Default disabled. Set to \ref On or 1 to enable.
1540 #endif
1541 
1547 #if !defined DEFAULT_HOMING_USE_LIMIT_SWITCHES || defined __DOXYGEN__
1548 #define DEFAULT_HOMING_USE_LIMIT_SWITCHES Off // Default disabled. Set to \ref On or 1 to enable.
1549 #endif
1551 
1557 #if !defined DEFAULT_RUN_STARTUP_SCRIPTS_ONLY_ON_HOMED || defined __DOXYGEN__
1558 #define DEFAULT_RUN_STARTUP_SCRIPTS_ONLY_ON_HOMED Off // Default disabled. Set to \ref On or 1 to enable.
1559 #endif
1561 
1567 #if !defined DEFAULT_HOMING_DIR_MASK || defined __DOXYGEN__
1568 #define DEFAULT_HOMING_DIR_MASK 0
1569 #endif
1571 
1575 #if !defined DEFAULT_HOMING_FEED_RATE || defined __DOXYGEN__
1576 #define DEFAULT_HOMING_FEED_RATE 25.0f // mm/min
1577 #endif
1579 
1583 #if !defined DEFAULT_HOMING_SEEK_RATE || defined __DOXYGEN__
1584 #define DEFAULT_HOMING_SEEK_RATE 500.0f // mm/min
1585 #endif
1587 
1591 #if !defined DEFAULT_HOMING_DEBOUNCE_DELAY || defined __DOXYGEN__
1592 #define DEFAULT_HOMING_DEBOUNCE_DELAY 250 // msec (0-65k)
1593 #endif
1595 
1599 #if !defined DEFAULT_HOMING_PULLOFF || defined __DOXYGEN__
1600 #define DEFAULT_HOMING_PULLOFF 1.0f // mm
1601 #endif
1603 
1610 #if !defined DEFAULT_N_HOMING_LOCATE_CYCLE || defined __DOXYGEN__
1611 #define DEFAULT_N_HOMING_LOCATE_CYCLE 1 // Integer (1-127)
1612 #endif
1614 
1636 #if !defined DEFAULT_HOMING_CYCLE_0 || defined __DOXYGEN__
1637 #define DEFAULT_HOMING_CYCLE_0 (Z_AXIS_BIT) // REQUIRED: First move Z to clear workspace.
1638 #endif
1640 
1644 #if !defined DEFAULT_HOMING_CYCLE_1 || defined __DOXYGEN__
1645 #if COREXY
1646 #define DEFAULT_HOMING_CYCLE_1 (X_AXIS_BIT) // OPTIONAL: Then move X.
1647 #else
1648 #define DEFAULT_HOMING_CYCLE_1 (X_AXIS_BIT|Y_AXIS_BIT) // OPTIONAL: Then move X,Y at the same time.
1649 #endif
1650 #endif
1652 
1656 #if !defined DEFAULT_HOMING_CYCLE_2 || defined __DOXYGEN__
1657 #if COREXY
1658 #define DEFAULT_HOMING_CYCLE_2 (Y_AXIS_BIT) // OPTIONAL: Then move Y.
1659 #else
1660 #define DEFAULT_HOMING_CYCLE_2 0 // OPTIONAL: Uncomment and add axes mask to enable
1661 #endif
1662 #endif
1664 
1668 #if (defined A_AXIS && !defined DEFAULT_HOMING_CYCLE_3) || defined __DOXYGEN__
1669 #define DEFAULT_HOMING_CYCLE_3 0 // OPTIONAL: Uncomment and add axes mask to enable
1670 #endif
1672 
1677 #if (defined B_AXIS && !defined DEFAULT_HOMING_CYCLE_4) || defined __DOXYGEN__
1678 #define DEFAULT_HOMING_CYCLE_4 0 // OPTIONAL: Uncomment and add axes mask to enable
1679 #endif
1681 
1685 #if (defined C_AXIS && !defined DEFAULT_HOMING_CYCLE_5) || defined __DOXYGEN__
1686 #define DEFAULT_HOMING_CYCLE_5 0 // OPTIONAL: Uncomment and add axes mask to enable
1687 #endif
1689 
1698 #if !defined DEFAULT_HOME_SIGNALS_INVERT_MASK || defined __DOXYGEN__
1699 #define DEFAULT_HOME_SIGNALS_INVERT_MASK 0 // Set to -1 or AXES_BITMASK to invert for all axes
1700 #endif
1702 
1703 
1704 // Probing settings (Group_Probing)
1705 
1709 #if !defined DEFAULT_PROBE_SIGNAL_INVERT || defined __DOXYGEN__
1710 #define DEFAULT_PROBE_SIGNAL_INVERT Off
1711 #endif
1712 #if !defined DEFAULT_TOOLSETTER_SIGNAL_INVERT || defined __DOXYGEN__
1713 #define DEFAULT_TOOLSETTER_SIGNAL_INVERT Off
1714 #endif
1716 
1720 #if !defined DEFAULT_PROBE_SIGNAL_DISABLE_PULLUP || defined __DOXYGEN__
1721 #define DEFAULT_PROBE_SIGNAL_DISABLE_PULLUP Off
1722 #endif
1723 #if !defined DEFAULT_TOOLSETTER_SIGNAL_DISABLE_PULLUP || defined __DOXYGEN__
1724 #define DEFAULT_TOOLSETTER_SIGNAL_DISABLE_PULLUP Off
1725 #endif
1727 
1736 #if !defined DEFAULT_ALLOW_FEED_OVERRIDE_DURING_PROBE_CYCLES || defined __DOXYGEN__
1737 #define DEFAULT_ALLOW_FEED_OVERRIDE_DURING_PROBE_CYCLES Off
1738 #endif
1739 #if !defined DEFAULT_SOFT_LIMIT_PROBE_CYCLES || defined __DOXYGEN__
1740 #define DEFAULT_SOFT_LIMIT_PROBE_CYCLES Off
1741 #endif
1743 
1744 // Safety door/parking settings (Group_SafetyDoor)
1745 
1746 #ifdef DEFAULT_HOMING_ENABLE
1747 
1765 #if !defined DEFAULT_PARKING_ENABLE || defined __DOXYGEN__
1766 #define DEFAULT_PARKING_ENABLE Off // bit 0
1767 // Enables a special set of M-code commands that enables and disables the parking motion.
1768 // These are controlled by `M56`, `M56 P1`, or `M56 Px` to enable and `M56 P0` to disable.
1769 // The command is modal and will be set after a planner sync. Since it is g-code, it is
1770 // executed in sync with g-code commands. It is not a real-time command.
1771 // NOTE: PARKING_ENABLE is required. By default, M56 is active upon initialization. Use
1772 // DEACTIVATE_PARKING_UPON_INIT to set M56 P0 as the power-up default.
1773 #endif
1774 #if !defined DEFAULT_DEACTIVATE_PARKING_UPON_INIT || defined __DOXYGEN__
1775 #define DEFAULT_DEACTIVATE_PARKING_UPON_INIT Off // bit 1
1776 #endif
1777 #if !defined DEFAULT_ENABLE_PARKING_OVERRIDE_CONTROL || defined __DOXYGEN__
1778 #define DEFAULT_ENABLE_PARKING_OVERRIDE_CONTROL Off // bit 2
1779 #endif
1781 
1786 #if !defined DEFAULT_PARKING_AXIS || defined __DOXYGEN__
1787 #define DEFAULT_PARKING_AXIS Z_AXIS //
1788 #endif
1790 
1794 #if !defined DEFAULT_PARKING_PULLOUT_INCREMENT || defined __DOXYGEN__
1795 #define DEFAULT_PARKING_PULLOUT_INCREMENT 5.0f //
1796 #endif
1798 
1803 #if !defined DEFAULT_PARKING_PULLOUT_RATE || defined __DOXYGEN__
1804 #define DEFAULT_PARKING_PULLOUT_RATE 100.0f // mm/min.
1805 #endif
1807 
1812 #if !defined DEFAULT_PARKING_TARGET || defined __DOXYGEN__
1813 #define DEFAULT_PARKING_TARGET -5.0f // mm
1814 #endif
1816 
1821 #if !defined DEFAULT_PARKING_RATE || defined __DOXYGEN__
1822 #define DEFAULT_PARKING_RATE 500.0f // mm/min
1823 #endif
1825 
1829 
1834 #if !defined DEFAULT_DOOR_IGNORE_WHEN_IDLE || defined __DOXYGEN__
1835 #define DEFAULT_DOOR_IGNORE_WHEN_IDLE Off
1836 #endif
1841 #if !defined DEFAULT_DOOR_KEEP_COOLANT_ON || defined __DOXYGEN__
1842 #define DEFAULT_DOOR_KEEP_COOLANT_ON Off
1843 #endif
1845 
1851 #if !defined DEFAULT_SAFETY_DOOR_SPINDLE_DELAY || defined __DOXYGEN__
1852 #define DEFAULT_SAFETY_DOOR_SPINDLE_DELAY 4.0f // Float (seconds)
1853 #endif
1855 
1862 #if !defined DEFAULT_SAFETY_DOOR_COOLANT_DELAY || defined __DOXYGEN__
1863 #define DEFAULT_SAFETY_DOOR_COOLANT_DELAY 1.0f // Float (seconds)
1864 #endif
1866 
1867 #endif // DEFAULT_HOMING_ENABLE
1868 
1869 // Jogging settings (Group_Jogging)
1870 
1878 #if !defined DEFAULT_JOG_LIMIT_ENABLE || defined __DOXYGEN__
1879 #define DEFAULT_JOG_LIMIT_ENABLE Off
1880 #endif
1882 
1883 // Stepper settings (Group_Stepper)
1884 
1897 #if !defined DEFAULT_STEP_PULSE_MICROSECONDS || defined __DOXYGEN__
1898 #define DEFAULT_STEP_PULSE_MICROSECONDS 5.0f
1899 #endif
1901 
1910 #if !defined DEFAULT_STEPPER_IDLE_LOCK_TIME || defined __DOXYGEN__
1911 #define DEFAULT_STEPPER_IDLE_LOCK_TIME 25 // milliseconds
1912 #endif
1914 
1920 #if !defined DEFAULT_STEP_SIGNALS_INVERT_MASK || defined __DOXYGEN__
1921 #define DEFAULT_STEP_SIGNALS_INVERT_MASK 0
1922 #endif
1924 
1930 #if !defined DEFAULT_DIR_SIGNALS_INVERT_MASK || defined __DOXYGEN__
1931 #define DEFAULT_DIR_SIGNALS_INVERT_MASK 0
1932 #endif
1934 
1947 #if !defined DEFAULT_ENABLE_SIGNALS_INVERT_MASK || defined __DOXYGEN__
1948 #define DEFAULT_ENABLE_SIGNALS_INVERT_MASK AXES_BITMASK
1949 #endif
1951 
1957 #if !defined DEFAULT_GANGED_DIRECTION_INVERT_MASK || defined __DOXYGEN__
1958 #define DEFAULT_GANGED_DIRECTION_INVERT_MASK 0
1959 #endif
1961 
1965 #if !defined DEFAULT_STEP_PULSE_DELAY || defined __DOXYGEN__
1966 #define DEFAULT_STEP_PULSE_DELAY 0.0f
1967 #endif
1969 
1976 #if !defined DEFAULT_STEPPER_DEENERGIZE_MASK || defined __DOXYGEN__
1977 #define DEFAULT_STEPPER_DEENERGIZE_MASK 0
1978 #endif
1980 
1987 #if !defined DEFAULT_AXIS_ROTATIONAL_MASK || defined __DOXYGEN__
1988 #define DEFAULT_AXIS_ROTATIONAL_MASK 0
1989 #endif
1991 
1996 #if !defined DEFAULT_STEPPER_ENABLE_DELAY || defined __DOXYGEN__
1997 #define DEFAULT_STEPPER_ENABLE_DELAY 0
1998 #endif
2000 
2006 #if !defined DEFAULT_MOTOR_WARNING_SIGNALS_ENABLE || defined __DOXYGEN__
2007 #define DEFAULT_MOTOR_WARNING_SIGNALS_ENABLE 0
2008 #endif
2010 
2016 #if !defined DEFAULT_MOTOR_WARNING_SIGNALS_INVERT || defined __DOXYGEN__
2017 #define DEFAULT_MOTOR_WARNING_SIGNALS_INVERT 0
2018 #endif
2020 
2026 #if !defined DEFAULT_MOTOR_FAULT_SIGNALS_ENABLE || defined __DOXYGEN__
2027 #define DEFAULT_MOTOR_FAULT_SIGNALS_ENABLE 0
2028 #endif
2030 
2036 #if !defined DEFAULT_MOTOR_FAULT_SIGNALS_INVERT || defined __DOXYGEN__
2037 #define DEFAULT_MOTOR_FAULT_SIGNALS_INVERT 0
2038 #endif
2040 
2045 #if !defined DEFAULT_AUTOREPORT_INTERVAL || defined __DOXYGEN__
2046 #define DEFAULT_AUTOREPORT_INTERVAL 0
2047 #endif
2049 
2054 #if !defined DEFAULT_TIMEZONE_OFFSET || defined __DOXYGEN__
2055 #define DEFAULT_TIMEZONE_OFFSET 0.0f
2056 #endif
2058 
2064 #if !defined DEFAULT_NO_UNLOCK_AFTER_ESTOP || defined __DOXYGEN__
2065 #define DEFAULT_NO_UNLOCK_AFTER_ESTOP Off
2066 #endif
2068 
2073 #if !defined DEFAULT_RGB_STRIP0_LENGTH || defined __DOXYGEN__
2074 #define DEFAULT_RGB_STRIP0_LENGTH 0
2075 #endif
2077 
2082 #if !defined DEFAULT_RGB_STRIP1_LENGTH || defined __DOXYGEN__
2083 #define DEFAULT_RGB_STRIP1_LENGTH 0
2084 #endif
2086 
2094 #if !defined DEFAULT_AXIS_ROTARY_WRAP_MASK || defined __DOXYGEN__
2095 #define DEFAULT_AXIS_ROTARY_WRAP_MASK 0
2096 #endif
2098 
2103 #if !defined DEFAULT_MODBUS_STREAM_BAUD || defined __DOXYGEN__
2104 #define DEFAULT_MODBUS_STREAM_BAUD 3 // 0 = 2400, 1 = 4800, 2 = 9600, 3 = 19200, 4 = 38400, 5 = 115200
2105 #endif
2107 
2112 #if !defined DEFAULT_MODBUS_STREAM_PARITY || defined __DOXYGEN__
2113 #define DEFAULT_MODBUS_STREAM_PARITY 0 // 0 = None, 1 = Even, 2 = Odd
2114 #endif
2116 
2117 // Axis settings (Group_XAxis - Group_VAxis)
2118 
2123 #if !defined DEFAULT_X_STEPS_PER_MM || defined __DOXYGEN__
2124 #define DEFAULT_X_STEPS_PER_MM 250.0f
2125 #endif
2126 #if !defined DEFAULT_Y_STEPS_PER_MM || defined __DOXYGEN__
2127 #define DEFAULT_Y_STEPS_PER_MM 250.0f
2128 #endif
2129 #if !defined DEFAULT_Z_STEPS_PER_MM || defined __DOXYGEN__
2130 #define DEFAULT_Z_STEPS_PER_MM 250.0f
2131 #endif
2132 #if (defined A_AXIS && !defined DEFAULT_A_STEPS_PER_MM) || defined __DOXYGEN__
2133 #define DEFAULT_A_STEPS_PER_MM 250.0f
2134 #endif
2135 #if (defined B_AXIS && !defined DEFAULT_B_STEPS_PER_MM) || defined __DOXYGEN__
2136 #define DEFAULT_B_STEPS_PER_MM 250.0f
2137 #endif
2138 #if (defined C_AXIS && !defined DEFAULT_C_STEPS_PER_MM) || defined __DOXYGEN__
2139 #define DEFAULT_C_STEPS_PER_MM 250.0f
2140 #endif
2141 #if (defined U_AXIS && !defined DEFAULT_U_STEPS_PER_MM) || defined __DOXYGEN__
2142 #define DEFAULT_U_STEPS_PER_MM 250.0f
2143 #endif
2144 #if (defined V_AXIS && !defined DEFAULT_V_STEPS_PER_MM) || defined __DOXYGEN__
2145 #define DEFAULT_V_STEPS_PER_MM 250.0f
2146 #endif
2148 
2153 #if !defined DEFAULT_X_MAX_RATE || defined __DOXYGEN__
2154 #define DEFAULT_X_MAX_RATE 500.0f // mm/min
2155 #endif
2156 #if !defined DEFAULT_Y_MAX_RATE || defined __DOXYGEN__
2157 #define DEFAULT_Y_MAX_RATE 500.0f // mm/min
2158 #endif
2159 #if !defined DEFAULT_Z_MAX_RATE || defined __DOXYGEN__
2160 #define DEFAULT_Z_MAX_RATE 500.0f // mm/min
2161 #endif
2162 #if (defined A_AXIS && !defined DEFAULT_A_MAX_RATE) || defined __DOXYGEN__
2163 #define DEFAULT_A_MAX_RATE 500.0f // mm/min
2164 #endif
2165 #if (defined B_AXIS && !defined DEFAULT_B_MAX_RATE) || defined __DOXYGEN__
2166 #define DEFAULT_B_MAX_RATE 500.0f // mm/min
2167 #endif
2168 #if (defined C_AXIS && !defined DEFAULT_C_MAX_RATE) || defined __DOXYGEN__
2169 #define DEFAULT_C_MAX_RATE 500.0f // mm/min
2170 #endif
2171 #if (defined U_AXIS && !defined DEFAULT_U_MAX_RATE) || defined __DOXYGEN__
2172 #define DEFAULT_U_MAX_RATE 500.0f // mm/min
2173 #endif
2174 #if (defined V_AXIS && !defined DEFAULT_V_MAX_RATE) || defined __DOXYGEN__
2175 #define DEFAULT_V_MAX_RATE 500.0f // mm/min
2176 #endif
2178 
2182 #if !defined DEFAULT_X_ACCELERATION || defined __DOXYGEN__
2183 #define DEFAULT_X_ACCELERATION 10.0f // mm/sec^2
2184 #endif
2185 #if !defined DEFAULT_Y_ACCELERATION || defined __DOXYGEN__
2186 #define DEFAULT_Y_ACCELERATION 10.0f // mm/sec^2
2187 #endif
2188 #if !defined DEFAULT_Z_ACCELERATION || defined __DOXYGEN__
2189 #define DEFAULT_Z_ACCELERATION 10.0f // mm/sec^2
2190 #endif
2191 #if (defined A_AXIS && !defined DEFAULT_A_ACCELERATION) || defined __DOXYGEN__
2192 #define DEFAULT_A_ACCELERATION 10.0f // mm/sec^2
2193 #endif
2194 #if (defined B_AXIS && !defined DEFAULT_B_ACCELERATION) || defined __DOXYGEN__
2195 #define DEFAULT_B_ACCELERATION 10.0f // mm/sec^2
2196 #endif
2197 #if (defined C_AXIS && !defined DEFAULT_C_ACCELERATION) || defined __DOXYGEN__
2198 #define DEFAULT_C_ACCELERATION 10.0f // mm/sec^2
2199 #endif
2200 #if (defined U_AXIS && !defined DEFAULT_U_ACCELERATION) || defined __DOXYGEN__
2201 #define DEFAULT_U_ACCELERATION 10.0f // mm/sec^2
2202 #endif
2203 #if (defined V_AXIS && !defined DEFAULT_V_ACCELERATION) || defined __DOXYGEN__
2204 #define DEFAULT_V_ACCELERATION 10.0f // mm/sec^2
2205 #endif
2207 
2211 #if !defined DEFAULT_X_JERK|| defined __DOXYGEN__
2212 #define DEFAULT_X_JERK 100.0f // mm/sec^3
2213 #endif
2214 #if !defined DEFAULT_Y_JERK|| defined __DOXYGEN__
2215 #define DEFAULT_Y_JERK 100.0f // mm/sec^3
2216 #endif
2217 #if !defined DEFAULT_Z_JERK || defined __DOXYGEN__
2218 #define DEFAULT_Z_JERK 100.0f // mm/sec^3
2219 #endif
2220 #if (defined A_AXIS && !defined DEFAULT_A_JERK) || defined __DOXYGEN__
2221 #define DEFAULT_A_JERK 100.0f // mm/sec^3
2222 #endif
2223 #if (defined B_AXIS && !defined DEFAULT_B_JERK) || defined __DOXYGEN__
2224 #define DEFAULT_B_JERK 100.0f // mm/sec^3
2225 #endif
2226 #if (defined C_AXIS && !defined DEFAULT_C_JERK) || defined __DOXYGEN__
2227 #define DEFAULT_C_JERK 100.0f // mm/sec^3
2228 #endif
2229 #if (defined U_AXIS && !defined DEFAULT_U_JERK) || defined __DOXYGEN__
2230 #define DEFAULT_U_JERK 100.0f // mm/sec^3
2231 #endif
2232 #if (defined V_AXIS && !defined DEFAULT_V_JERK) || defined __DOXYGEN__
2233 #define DEFAULT_V_JERK 100.0f // mm/sec^3
2234 #endif
2236 
2241 #if !defined DEFAULT_X_MAX_TRAVEL || defined __DOXYGEN__
2242 #define DEFAULT_X_MAX_TRAVEL 200.0f // mm
2243 #endif
2244 #if !defined DEFAULT_Y_MAX_TRAVEL || defined __DOXYGEN__
2245 #define DEFAULT_Y_MAX_TRAVEL 200.0f // mm
2246 #endif
2247 #if !defined DEFAULT_Z_MAX_TRAVEL || defined __DOXYGEN__
2248 #define DEFAULT_Z_MAX_TRAVEL 200.0f // mm
2249 #endif
2250 #if (defined A_AXIS && !defined DEFAULT_A_MAX_TRAVEL) || defined __DOXYGEN__
2251 #define DEFAULT_A_MAX_TRAVEL 200.0f // mm
2252 #endif
2253 #if (defined B_AXIS && !defined DEFAULT_B_MAX_TRAVEL) || defined __DOXYGEN__
2254 #define DEFAULT_B_MAX_TRAVEL 200.0f // mm
2255 #endif
2256 #if (defined C_AXIS && !defined DEFAULT_C_MAX_TRAVEL) || defined __DOXYGEN__
2257 #define DEFAULT_C_MAX_TRAVEL 200.0f // mm
2258 #endif
2259 #if (defined U_AXIS && !defined DEFAULT_U_MAX_TRAVEL) || defined __DOXYGEN__
2260 #define DEFAULT_U_MAX_TRAVEL 200.0f // mm
2261 #endif
2262 #if (defined V_AXIS && !defined DEFAULT_V_MAX_TRAVEL) || defined __DOXYGEN__
2263 #define DEFAULT_V_MAX_TRAVEL 200.0f // mm
2264 #endif
2266 
2271 #if !defined DEFAULT_X_CURRENT || defined __DOXYGEN__
2272 #define DEFAULT_X_CURRENT 500.0f // mA RMS
2273 #endif
2274 #if !defined DEFAULT_Y_CURRENT || defined __DOXYGEN__
2275 #define DEFAULT_Y_CURRENT 500.0f // mA RMS
2276 #endif
2277 #if !defined DEFAULT_Z_CURRENT || defined __DOXYGEN__
2278 #define DEFAULT_Z_CURRENT 500.0f // mA RMS
2279 #endif
2280 #if (defined A_AXIS && !defined DEFAULT_A_CURRENT) || defined __DOXYGEN__
2281 #define DEFAULT_A_CURRENT 500.0f // mA RMS
2282 #endif
2283 #if (defined B_AXIS && !defined DEFAULT_B_CURRENT) || defined __DOXYGEN__
2284 #define DEFAULT_B_CURRENT 500.0f // mA RMS
2285 #endif
2286 #if (defined C_AXIS && !defined DEFAULT_C_CURRENT) || defined __DOXYGEN__
2287 #define DEFAULT_C_CURRENT 500.0f // mA RMS
2288 #endif
2289 #if (defined U_AXIS && !defined DEFAULT_U_CURRENT) || defined __DOXYGEN__
2290 #define DEFAULT_U_CURRENT 500.0f // mA RMS
2291 #endif
2292 #if (defined V_AXIS && !defined DEFAULT_V_CURRENT) || defined __DOXYGEN__
2293 #define DEFAULT_V_CURRENT 500.0f // mA RMS
2294 #endif
2296 
2297 // Sanity checks
2298 
2299 // N_TOOLS may have been defined on the compiler command line.
2300 #if !defined(N_TOOLS)
2301 #define N_TOOLS 0
2302 #elif N_TOOLS > 32
2303 #undef N_TOOLS
2304 #define N_TOOLS 32
2305 #endif
2306 
2307 #if N_SYS_SPINDLE > N_SPINDLE
2308 #undef N_SYS_SPINDLE
2309 #define N_SYS_SPINDLE N_SPINDLE
2310 #endif
2311 
2312 #if N_SYS_SPINDLE < 1
2313 #undef N_SYS_SPINDLE
2314 #define N_SYS_SPINDLE 1
2315 #endif
2316 
2317 #if N_SYS_SPINDLE > 8
2318 #undef N_SYS_SPINDLE
2319 #define N_SYS_SPINDLE 8
2320 #endif
2321 
2322 #if NGC_EXPRESSIONS_ENABLE && !NGC_PARAMETERS_ENABLE
2323 #undef NGC_PARAMETERS_ENABLE
2324 #define NGC_PARAMETERS_ENABLE On
2325 #endif
2326 
2327 #if (REPORT_WCO_REFRESH_BUSY_COUNT < REPORT_WCO_REFRESH_IDLE_COUNT)
2328  #error "WCO busy refresh is less than idle refresh."
2329 #endif
2330 #if (REPORT_OVERRIDE_REFRESH_BUSY_COUNT < REPORT_OVERRIDE_REFRESH_IDLE_COUNT)
2331  #error "Override busy refresh is less than idle refresh."
2332 #endif
2333 #if (REPORT_WCO_REFRESH_IDLE_COUNT < 2)
2334  #error "WCO refresh must be greater than one."
2335 #endif
2336 #if (REPORT_OVERRIDE_REFRESH_IDLE_COUNT < 1)
2337  #error "Override refresh must be greater than zero."
2338 #endif
2339 
2340 #if DEFAULT_LASER_MODE && DEFAULT_LATHE_MODE
2341 #error "Cannot enable laser and lathe mode at the same time!"
2342 #endif
2343 
2344 #if LATHE_UVW_OPTION && (N_AXIS > 6 || AXIS_REMAP_ABC2UVW)
2345 #warning "Cannot enable lathe UVW option when N_AXIS > 6 or ABC words are remapped!"
2346 #undef LATHE_UVW_OPTION
2347 #define LATHE_UVW_OPTION Off
2348 #endif
2349 
2350 #if DEFAULT_CONTROL_SIGNALS_INVERT_MASK < 0
2351 #undef DEFAULT_CONTROL_SIGNALS_INVERT_MASK
2352 #define DEFAULT_CONTROL_SIGNALS_INVERT_MASK SIGNALS_BITMASK
2353 #endif
2354 
2355 #if DEFAULT_LIMIT_SIGNALS_INVERT_MASK < 0
2356 #undef DEFAULT_LIMIT_SIGNALS_INVERT_MASK
2357 #define DEFAULT_LIMIT_SIGNALS_INVERT_MASK AXES_BITMASK
2358 #endif
2359 
2360 #if DEFAULT_LIMIT_SIGNALS_PULLUP_DISABLE_MASK < 0
2361 #undef DEFAULT_LIMIT_SIGNALS_PULLUP_DISABLE_MASK
2362 #define DEFAULT_LIMIT_SIGNALS_PULLUP_DISABLE_MASK AXES_BITMASK
2363 #endif
2364 
2365 #if DEFAULT_STEP_SIGNALS_INVERT_MASK < 0
2366 #undef DEFAULT_STEP_SIGNALS_INVERT_MASK
2367 #define DEFAULT_STEP_SIGNALS_INVERT_MASK AXES_BITMASK
2368 #endif
2369 
2370 #if DEFAULT_ENABLE_SIGNALS_INVERT_MASK < 0
2371 #undef DEFAULT_ENABLE_SIGNALS_INVERT_MASK
2372 #define DEFAULT_ENABLE_SIGNALS_INVERT_MASK AXES_BITMASK
2373 #endif
2374 
2375 #if DEFAULT_SPINDLE_ON_DELAY
2376 #if DEFAULT_SPINDLE_ON_DELAY < 500
2377 #undef DEFAULT_SPINDLE_ON_DELAY
2378 #define DEFAULT_SPINDLE_ON_DELAY 500
2379 #elif DEFAULT_SPINDLE_ON_DELAY > 20000
2380 #undef DEFAULT_SPINDLE_ON_DELAY
2381 #define DEFAULT_SPINDLE_ON_DELAY 20000
2382 #endif
2383 #endif
2384 
2385 #if DEFAULT_COOLANT_ON_DELAY
2386 #if DEFAULT_COOLANT_ON_DELAY < 500
2387 #undef DEFAULT_COOLANT_ON_DELAY
2388 #define DEFAULT_COOLANT_ON_DELAY 500
2389 #elif DEFAULT_COOLANT_ON_DELAY > 20000
2390 #undef DEFAULT_COOLANT_ON_DELAY
2391 #define DEFAULT_COOLANT_ON_DELAY 20000
2392 #endif
2393 #endif
2394 
2395 #if DEFAULT_PARKING_ENABLE > 0
2396  #if DEFAULT_HOMING_FORCE_SET_ORIGIN > 0
2397  #error "DEFAULT_HOMING_FORCE_SET_ORIGIN is not supported with DEFAULT_PARKING_ENABLE at this time."
2398  #endif
2399 #endif
2400 
2401 #if DEFAULT_ENABLE_PARKING_OVERRIDE_CONTROL > 0
2402  #if DEFAULT_PARKING_ENABLE < 1
2403  #error "DEFAULT_ENABLE_PARKING_OVERRIDE_CONTROL must be enabled with DEFAULT_PARKING_ENABLE."
2404  #endif
2405 #endif
2406 
2461 #endif // _GRBL_CONFIG_H_