grblHAL core  20251016
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 4 // 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 // Control signals settings (Group_ControlSignals)
937 
938 #ifndef __DOXYGEN__ // For now do not include in documentation
939 
945 #define SIGNALS_RESET_BIT (1<<0)
946 #define SIGNALS_FEEDHOLD_BIT (1<<1)
947 #define SIGNALS_CYCLESTART_BIT (1<<2)
948 #define SIGNALS_SAFETYDOOR_BIT (1<<3)
949 #define SIGNALS_BLOCKDELETE_BIT (1<<4)
950 #define SIGNALS_STOPDISABLE_BIT (1<<5)
951 #define SIGNALS_ESTOP_BIT (1<<6)
952 #define SIGNALS_PROBE_CONNECTED_BIT (1<<7)
953 #define SIGNALS_MOTOR_FAULT_BIT (1<<8)
954 #define SIGNALS_MOTOR_WARNING_BIT (1<<9)
955 #define SIGNALS_LIMITS_OVERRIDE_BIT (1<<10)
956 #define SIGNALS_SINGLE_BLOCK_BIT (1<<11)
957 #define SIGNALS_TLS_OVERTRAVEL_BIT (1<<12)
958 #define SIGNALS_PROBE_OVERTRAVEL (1<<13)
959 #define SIGNALS_PROBE_TRIGGERED_BIT (1<<14)
960 #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)
962 
963 #endif
964 
971 #if !defined DEFAULT_CONTROL_SIGNALS_INVERT_MASK || defined __DOXYGEN__
972 #define DEFAULT_CONTROL_SIGNALS_INVERT_MASK 0 // Set to SIGNALS_BITMASK or -1 to invert all signals
973 #endif
975 
990 #if !defined DEFAULT_DISABLE_CONTROL_PINS_PULL_UP_MASK || defined __DOXYGEN__
991 #define DEFAULT_DISABLE_CONTROL_PINS_PULL_UP_MASK 0 // Set to SIGNALS_BITMASK or -1 to invert all signals
992 #endif
994 
995 // Limits settings (Group_Limits)
996 
1005 #if !defined DEFAULT_LIMIT_SIGNALS_INVERT_MASK || defined __DOXYGEN__
1006 #define DEFAULT_LIMIT_SIGNALS_INVERT_MASK 0 // Set to -1 or AXES_BITMASK to invert for all axes
1007 #endif
1009 
1017 #if !defined DEFAULT_LIMIT_SIGNALS_PULLUP_DISABLE_MASK || defined __DOXYGEN__
1018 #define DEFAULT_LIMIT_SIGNALS_PULLUP_DISABLE_MASK 0 // Set to -1 or AXES_BITMASK to disable pullup for all axes
1019 #endif
1021 
1025 #if !defined DEFAULT_SOFT_LIMIT_ENABLE || defined __DOXYGEN__
1026 #define DEFAULT_SOFT_LIMIT_ENABLE Off
1027 #endif
1029 
1033 
1040 #if !defined DEFAULT_HARD_LIMIT_ENABLE || defined __DOXYGEN__
1041 #define DEFAULT_HARD_LIMIT_ENABLE Off
1042 #endif
1043 #if !defined DEFAULT_CHECK_LIMITS_AT_INIT || defined __DOXYGEN__
1044 #define DEFAULT_CHECK_LIMITS_AT_INIT Off
1045 #endif
1046 #if !defined DEFAULT_HARD_LIMITS_DISABLE_FOR_ROTARY || defined __DOXYGEN__
1047 #define DEFAULT_HARD_LIMITS_DISABLE_FOR_ROTARY Off
1048 #endif
1049 
1062 
1065 #if !defined DEFAULT_DUAL_AXIS_HOMING_FAIL_AXIS_LENGTH_PERCENT || defined __DOXYGEN__
1066 #define DEFAULT_DUAL_AXIS_HOMING_FAIL_AXIS_LENGTH_PERCENT 5.0f // Float (percent)
1067 #endif
1069 
1073 #if !defined DEFAULT_DUAL_AXIS_HOMING_FAIL_DISTANCE_MIN || defined __DOXYGEN__
1074 #define DEFAULT_DUAL_AXIS_HOMING_FAIL_DISTANCE_MIN 2.5f // Float (mm)
1075 #endif
1077 
1082 #if !defined DEFAULT_DUAL_AXIS_HOMING_FAIL_DISTANCE_MAX || defined __DOXYGEN__
1083 #define DEFAULT_DUAL_AXIS_HOMING_FAIL_DISTANCE_MAX 25.0f // Float (mm)
1084 #endif
1086 
1087 // Coolant settings (Group_Coolant)
1088 
1094 #if !defined DEFAULT_INVERT_COOLANT_FLOOD_PIN || defined __DOXYGEN__
1095 #define DEFAULT_INVERT_COOLANT_FLOOD_PIN Off
1096 #endif
1097 #if !defined DEFAULT_INVERT_COOLANT_MIST_PIN || defined __DOXYGEN__
1098 #define DEFAULT_INVERT_COOLANT_MIST_PIN Off // NOTE: not supported by all drivers.
1099 #endif
1101 
1105 #if !defined DEFAULT_COOLANT_ON_DELAY || defined __DOXYGEN__
1106 #define DEFAULT_COOLANT_ON_DELAY 0 // milliseconds: 0 or 500 - 20000
1107 #endif
1109 
1110 // Spindle settings (Group_Spindle)
1111 
1115 #if !defined DEFAULT_SPINDLE_ENABLE_OFF_WITH_ZERO_SPEED || defined __DOXYGEN__
1116 #define DEFAULT_SPINDLE_ENABLE_OFF_WITH_ZERO_SPEED Off
1117 #endif
1118 #if !defined DEFAULT_PWM_SPINDLE_DISABLE_LASER_MODE || defined __DOXYGEN__
1119 #define DEFAULT_PWM_SPINDLE_DISABLE_LASER_MODE Off
1120 #endif
1122 
1127 #if !defined DEFAULT_INVERT_SPINDLE_ENABLE_PIN || defined __DOXYGEN__
1128 #define DEFAULT_INVERT_SPINDLE_ENABLE_PIN Off
1129 #endif
1130 #if !defined DEFAULT_INVERT_SPINDLE_CCW_PIN || defined __DOXYGEN__
1131 #define DEFAULT_INVERT_SPINDLE_CCW_PIN Off // NOTE: not supported by all drivers.
1132 #endif
1133 #if !defined DEFAULT_INVERT_SPINDLE_PWM_PIN || defined __DOXYGEN__
1134 #define DEFAULT_INVERT_SPINDLE_PWM_PIN Off // NOTE: not supported by all drivers.
1135 #endif
1137 
1141 #if !defined DEFAULT_SPINDLE_RPM_MAX || defined __DOXYGEN__
1142 #define DEFAULT_SPINDLE_RPM_MAX 1000.0f // rpm
1143 #endif
1145 
1149 #if !defined DEFAULT_SPINDLE_RPM_MIN || defined __DOXYGEN__
1150 #define DEFAULT_SPINDLE_RPM_MIN 0.0f // rpm
1151 #endif
1153 
1157 #if !defined DEFAULT_SPINDLE_PWM_FREQ || defined __DOXYGEN__
1158 #define DEFAULT_SPINDLE_PWM_FREQ 5000 // Hz
1159 #endif
1161 
1165 #if !defined DEFAULT_SPINDLE_PWM_OFF_VALUE || defined __DOXYGEN__
1166 #define DEFAULT_SPINDLE_PWM_OFF_VALUE 0.0f // Percent
1167 #endif
1169 
1182 #if !defined DEFAULT_SPINDLE_PWM_MIN_VALUE || defined __DOXYGEN__
1183 #define DEFAULT_SPINDLE_PWM_MIN_VALUE 0.0f // Must be greater than zero. Integer (+-255).
1184 #endif
1186 
1190 #if !defined DEFAULT_SPINDLE_PWM_MAX_VALUE || defined __DOXYGEN__
1191 #define DEFAULT_SPINDLE_PWM_MAX_VALUE 100.0f // Percent
1192 #endif
1194 
1203 #if !defined DEFAULT_SPINDLE_PPR || defined __DOXYGEN__
1204 #define DEFAULT_SPINDLE_PPR 0 // Pulses per revolution.
1205 #endif
1207 
1211 #if !defined DEFAULT_SPINDLE_AT_SPEED_TOLERANCE || defined __DOXYGEN__
1212 #define DEFAULT_SPINDLE_AT_SPEED_TOLERANCE 0.0f // Percent - 0 means not checked
1213 #endif
1215 
1219 #if !defined DEFAULT_SPINDLE_ON_DELAY || defined __DOXYGEN__
1220 #define DEFAULT_SPINDLE_ON_DELAY 0 // milliseconds: 0 or 500 - 20000
1221 #endif
1223 
1227 #if !defined DEFAULT_SPINDLE || defined __DOXYGEN__
1228 #define DEFAULT_SPINDLE SPINDLE_PWM0 // Spindle number from spindle_control.h
1229 #endif
1231 
1235 #if !defined DEFAULT_SPINDLE_OFF_DELAY || defined __DOXYGEN__
1236 #define DEFAULT_SPINDLE_OFF_DELAY 0 // milliseconds: 0 or 500 - 20000
1237 #endif
1239 
1240 // Closed loop spindle settings (Group_Spindle_ClosedLoop)
1241 
1242 // $9 - Setting_SpindlePWMOptions
1243 // bit 0
1244 // always defaults to on
1245 // bit 1
1246 
1247 // Closed loop spindle settings (Group_Spindle_ClosedLoop)
1248 
1249 #ifndef DEFAULT_SPINDLE_P_GAIN
1250 #define DEFAULT_SPINDLE_P_GAIN 1.0f
1251 #endif
1252 #ifndef DEFAULT_SPINDLE_I_GAIN
1253 #define DEFAULT_SPINDLE_I_GAIN 0.01f
1254 #endif
1255 #ifndef DEFAULT_SPINDLE_D_GAIN
1256 #define DEFAULT_SPINDLE_D_GAIN 0.0f
1257 #endif
1258 #ifndef DEFAULT_SPINDLE_I_MAX
1259 #define DEFAULT_SPINDLE_I_MAX 10.0f
1260 #endif
1261 
1262 #if ENABLE_SPINDLE_LINEARIZATION || defined __DOXYGEN__
1263 
1268 #if !defined DEFAULT_RPM_POINT01 || defined __DOXYGEN__
1269 #define DEFAULT_RPM_POINT01 NAN // DEFAULT_SPINDLE_RPM_MIN // Replace NAN with DEFAULT_SPINDLE_RPM_MIN to enable.
1270 #endif
1271 #if !defined DEFAULT_RPM_LINE_A1 || defined __DOXYGEN__
1272 #define DEFAULT_RPM_LINE_A1 3.197101e-03f
1273 #endif
1274 #if !defined DEFAULT_RPM_LINE_B1 || defined __DOXYGEN__
1275 #define DEFAULT_RPM_LINE_B1 -3.526076e-1f
1276 #endif
1278 
1283 #if !defined DEFAULT_RPM_POINT12 || defined __DOXYGEN__
1284 #define DEFAULT_RPM_POINT12 NAN // Change NAN to a float constant to enable.
1285 #endif
1286 #if !defined DEFAULT_RPM_LINE_A2 || defined __DOXYGEN__
1287 #define DEFAULT_RPM_LINE_A2 1.722950e-2f
1288 #endif
1289 #if !defined DEFAULT_RPM_LINE_B2 || defined __DOXYGEN__
1290 #define DEFAULT_RPM_LINE_B2 1.0f,
1291 #endif
1293 
1298 #if !defined DEFAULT_RPM_POINT23 || defined __DOXYGEN__
1299 #define DEFAULT_RPM_POINT23 NAN // Change NAN to a float constant to enable.
1300 #endif
1301 #if !defined DEFAULT_RPM_LINE_A3 || defined __DOXYGEN__
1302 #define DEFAULT_RPM_LINE_A3 5.901518e-02f
1303 #endif
1304 #if !defined DEFAULT_RPM_LINE_B3 || defined __DOXYGEN__
1305 #define DEFAULT_RPM_LINE_B3 4.881851e+02f
1306 #endif
1308 
1313 #if !defined DEFAULT_RPM_POINT34 || defined __DOXYGEN__
1314 #define DEFAULT_RPM_POINT34 NAN // Change NAN to a float constant to enable.
1315 #endif
1316 #if !defined DEFAULT_RPM_LINE_A4 || defined __DOXYGEN__
1317 #define DEFAULT_RPM_LINE_A4 1.203413e-01f
1318 #endif
1319 #if !defined DEFAULT_RPM_LINE_B4 || defined __DOXYGEN__
1320 #define DEFAULT_RPM_LINE_B4 1.151360e+03f
1321 #endif
1323 
1324 #endif // ENABLE_SPINDLE_LINEARIZATION
1325 
1326 // Settings for second PWM spindle
1327 
1332 #if !defined DEFAULT_INVERT_SPINDLE1_ENABLE_PIN || defined __DOXYGEN__
1333 #define DEFAULT_INVERT_SPINDLE1_ENABLE_PIN Off
1334 #endif
1335 #if !defined DEFAULT_INVERT_SPINDLE1_CCW_PIN || defined __DOXYGEN__
1336 #define DEFAULT_INVERT_SPINDLE1_CCW_PIN Off // NOTE: not supported by all drivers.
1337 #endif
1338 #if !defined DEFAULT_INVERT_SPINDLE1_PWM_PIN || defined __DOXYGEN__
1339 #define DEFAULT_INVERT_SPINDLE1_PWM_PIN Off // NOTE: not supported by all drivers.
1340 #endif
1342 
1346 #if !defined DEFAULT_SPINDLE1_RPM_MAX || defined __DOXYGEN__
1347 #define DEFAULT_SPINDLE1_RPM_MAX 1000.0f // rpm
1348 #endif
1350 
1354 #if !defined DEFAULT_SPINDLE1_RPM_MIN || defined __DOXYGEN__
1355 #define DEFAULT_SPINDLE1_RPM_MIN 0.0f // rpm
1356 #endif
1358 
1362 #if !defined DEFAULT_SPINDLE1_PWM_FREQ || defined __DOXYGEN__
1363 #define DEFAULT_SPINDLE1_PWM_FREQ 5000 // Hz
1364 #endif
1366 
1370 #if !defined DEFAULT_SPINDLE1_PWM_OFF_VALUE || defined __DOXYGEN__
1371 #define DEFAULT_SPINDLE1_PWM_OFF_VALUE 0.0f // Percent
1372 #endif
1374 
1387 #if !defined DEFAULT_SPINDLE1_PWM_MIN_VALUE || defined __DOXYGEN__
1388 #define DEFAULT_SPINDLE1_PWM_MIN_VALUE 0.0f // Must be greater than zero. Integer (+-255).
1389 #endif
1391 
1395 #if !defined DEFAULT_SPINDLE1_PWM_MAX_VALUE || defined __DOXYGEN__
1396 #define DEFAULT_SPINDLE1_PWM_MAX_VALUE 100.0f // Percent
1397 #endif
1399 
1400 
1401 // Tool change settings (Group_Toolchange)
1402 
1407 #if !defined DEFAULT_TOOLCHANGE_MODE || defined __DOXYGEN__
1408 #define DEFAULT_TOOLCHANGE_MODE 0
1409 #endif
1411 
1415 #if !defined DEFAULT_TOOLCHANGE_PROBING_DISTANCE || defined __DOXYGEN__
1416 #define DEFAULT_TOOLCHANGE_PROBING_DISTANCE 30 // max probing distance in mm for mode 3
1417 #endif
1419 
1423 #if !defined DEFAULT_TOOLCHANGE_FEED_RATE || defined __DOXYGEN__
1424 #define DEFAULT_TOOLCHANGE_FEED_RATE 25.0f // mm/min
1425 #endif
1427 
1432 #if !defined DEFAULT_TOOLCHANGE_SEEK_RATE || defined __DOXYGEN__
1433 #define DEFAULT_TOOLCHANGE_SEEK_RATE 200.0f // mm/min
1434 #endif
1436 
1440 #if !defined DEFAULT_TOOLCHANGE_PULLOFF_RATE || defined __DOXYGEN__
1441 #define DEFAULT_TOOLCHANGE_PULLOFF_RATE 200.0f // mm/min
1442 #endif
1444 
1448 #if !defined DEFAULT_TOOLCHANGE_NO_RESTORE_POSITION || defined __DOXYGEN__
1449 #define DEFAULT_TOOLCHANGE_NO_RESTORE_POSITION Off
1450 #endif
1451 #if !defined DEFAULT_TOOLCHANGE_AT_G30 || defined __DOXYGEN__
1452 #define DEFAULT_TOOLCHANGE_AT_G30 Off
1453 #endif
1454 #if !defined DEFAULT_TOOLCHANGE_FAST_PROBE_PULLOFF || defined __DOXYGEN__
1455 #define DEFAULT_TOOLCHANGE_FAST_PROBE_PULLOFF Off
1456 #endif
1458 
1462 #if !defined DEFAULT_PERSIST_TOOL || defined __DOXYGEN__
1463 #define DEFAULT_PERSIST_TOOL Off
1464 #endif
1466 
1467 // Homing settings (Group_Homing)
1468 
1475 #if !defined DEFAULT_HOMING_ENABLE || defined __DOXYGEN__
1476 #define DEFAULT_HOMING_ENABLE Off // Default disabled. Set to \ref On or 1 to enable.
1477 #endif
1478 
1486 #if !defined DEFAULT_HOMING_SINGLE_AXIS_COMMANDS || defined __DOXYGEN__
1487 #define DEFAULT_HOMING_SINGLE_AXIS_COMMANDS Off // Default disabled. Set to \ref On or 1 to enable.
1488 #endif
1489 
1497 #if !defined DEFAULT_HOMING_INIT_LOCK || defined __DOXYGEN__
1498 #define DEFAULT_HOMING_INIT_LOCK Off // Default disabled. Set to \ref On or 1 to enable.
1499 #endif
1500 
1508 #if !defined DEFAULT_HOMING_FORCE_SET_ORIGIN || defined __DOXYGEN__
1509 #define DEFAULT_HOMING_FORCE_SET_ORIGIN Off // Default disabled. Set to \ref On or 1 to enable.
1510 #endif
1511 
1522 #if !defined DEFAULT_LIMITS_TWO_SWITCHES_ON_AXES || defined __DOXYGEN__
1523 #define DEFAULT_LIMITS_TWO_SWITCHES_ON_AXES Off // Default disabled. Set to \ref On or 1 to enable.
1524 #endif
1526 
1533 #if !defined DEFAULT_HOMING_ALLOW_MANUAL || defined __DOXYGEN__
1534 #define DEFAULT_HOMING_ALLOW_MANUAL Off // Default disabled. Set to \ref On or 1 to enable.
1535 #endif
1536 
1543 #if !defined DEFAULT_HOMING_OVERRIDE_LOCKS || defined __DOXYGEN__
1544 #define DEFAULT_HOMING_OVERRIDE_LOCKS Off // Default disabled. Set to \ref On or 1 to enable.
1545 #endif
1546 
1552 #if !defined DEFAULT_HOMING_USE_LIMIT_SWITCHES || defined __DOXYGEN__
1553 #define DEFAULT_HOMING_USE_LIMIT_SWITCHES Off // Default disabled. Set to \ref On or 1 to enable.
1554 #endif
1556 
1562 #if !defined DEFAULT_RUN_STARTUP_SCRIPTS_ONLY_ON_HOMED || defined __DOXYGEN__
1563 #define DEFAULT_RUN_STARTUP_SCRIPTS_ONLY_ON_HOMED Off // Default disabled. Set to \ref On or 1 to enable.
1564 #endif
1566 
1572 #if !defined DEFAULT_HOMING_DIR_MASK || defined __DOXYGEN__
1573 #define DEFAULT_HOMING_DIR_MASK 0
1574 #endif
1576 
1580 #if !defined DEFAULT_HOMING_FEED_RATE || defined __DOXYGEN__
1581 #define DEFAULT_HOMING_FEED_RATE 25.0f // mm/min
1582 #endif
1584 
1588 #if !defined DEFAULT_HOMING_SEEK_RATE || defined __DOXYGEN__
1589 #define DEFAULT_HOMING_SEEK_RATE 500.0f // mm/min
1590 #endif
1592 
1596 #if !defined DEFAULT_HOMING_DEBOUNCE_DELAY || defined __DOXYGEN__
1597 #define DEFAULT_HOMING_DEBOUNCE_DELAY 250 // msec (0-65k)
1598 #endif
1600 
1604 #if !defined DEFAULT_HOMING_PULLOFF || defined __DOXYGEN__
1605 #define DEFAULT_HOMING_PULLOFF 1.0f // mm
1606 #endif
1608 
1615 #if !defined DEFAULT_N_HOMING_LOCATE_CYCLE || defined __DOXYGEN__
1616 #define DEFAULT_N_HOMING_LOCATE_CYCLE 1 // Integer (1-127)
1617 #endif
1619 
1641 #if !defined DEFAULT_HOMING_CYCLE_0 || defined __DOXYGEN__
1642 #define DEFAULT_HOMING_CYCLE_0 (Z_AXIS_BIT) // REQUIRED: First move Z to clear workspace.
1643 #endif
1645 
1649 #if !defined DEFAULT_HOMING_CYCLE_1 || defined __DOXYGEN__
1650 #if COREXY
1651 #define DEFAULT_HOMING_CYCLE_1 (X_AXIS_BIT) // OPTIONAL: Then move X.
1652 #else
1653 #define DEFAULT_HOMING_CYCLE_1 (X_AXIS_BIT|Y_AXIS_BIT) // OPTIONAL: Then move X,Y at the same time.
1654 #endif
1655 #endif
1657 
1661 #if !defined DEFAULT_HOMING_CYCLE_2 || defined __DOXYGEN__
1662 #if COREXY
1663 #define DEFAULT_HOMING_CYCLE_2 (Y_AXIS_BIT) // OPTIONAL: Then move Y.
1664 #else
1665 #define DEFAULT_HOMING_CYCLE_2 0 // OPTIONAL: Uncomment and add axes mask to enable
1666 #endif
1667 #endif
1669 
1673 #if (defined A_AXIS && !defined DEFAULT_HOMING_CYCLE_3) || defined __DOXYGEN__
1674 #define DEFAULT_HOMING_CYCLE_3 0 // OPTIONAL: Uncomment and add axes mask to enable
1675 #endif
1677 
1682 #if (defined B_AXIS && !defined DEFAULT_HOMING_CYCLE_4) || defined __DOXYGEN__
1683 #define DEFAULT_HOMING_CYCLE_4 0 // OPTIONAL: Uncomment and add axes mask to enable
1684 #endif
1686 
1690 #if (defined C_AXIS && !defined DEFAULT_HOMING_CYCLE_5) || defined __DOXYGEN__
1691 #define DEFAULT_HOMING_CYCLE_5 0 // OPTIONAL: Uncomment and add axes mask to enable
1692 #endif
1694 
1703 #if !defined DEFAULT_HOME_SIGNALS_INVERT_MASK || defined __DOXYGEN__
1704 #define DEFAULT_HOME_SIGNALS_INVERT_MASK 0 // Set to -1 or AXES_BITMASK to invert for all axes
1705 #endif
1707 
1708 
1709 // Probing settings (Group_Probing)
1710 
1714 #if !defined DEFAULT_PROBE_SIGNAL_INVERT || defined __DOXYGEN__
1715 #define DEFAULT_PROBE_SIGNAL_INVERT Off
1716 #endif
1717 #if !defined DEFAULT_TOOLSETTER_SIGNAL_INVERT || defined __DOXYGEN__
1718 #define DEFAULT_TOOLSETTER_SIGNAL_INVERT Off
1719 #endif
1721 
1725 #if !defined DEFAULT_PROBE_SIGNAL_DISABLE_PULLUP || defined __DOXYGEN__
1726 #define DEFAULT_PROBE_SIGNAL_DISABLE_PULLUP Off
1727 #endif
1728 #if !defined DEFAULT_TOOLSETTER_SIGNAL_DISABLE_PULLUP || defined __DOXYGEN__
1729 #define DEFAULT_TOOLSETTER_SIGNAL_DISABLE_PULLUP Off
1730 #endif
1732 
1741 #if !defined DEFAULT_ALLOW_FEED_OVERRIDE_DURING_PROBE_CYCLES || defined __DOXYGEN__
1742 #define DEFAULT_ALLOW_FEED_OVERRIDE_DURING_PROBE_CYCLES Off
1743 #endif
1744 #if !defined DEFAULT_SOFT_LIMIT_PROBE_CYCLES || defined __DOXYGEN__
1745 #define DEFAULT_SOFT_LIMIT_PROBE_CYCLES Off
1746 #endif
1748 
1749 // Safety door/parking settings (Group_SafetyDoor)
1750 
1751 #ifdef DEFAULT_HOMING_ENABLE
1752 
1770 #if !defined DEFAULT_PARKING_ENABLE || defined __DOXYGEN__
1771 #define DEFAULT_PARKING_ENABLE Off // bit 0
1772 // Enables a special set of M-code commands that enables and disables the parking motion.
1773 // These are controlled by `M56`, `M56 P1`, or `M56 Px` to enable and `M56 P0` to disable.
1774 // The command is modal and will be set after a planner sync. Since it is g-code, it is
1775 // executed in sync with g-code commands. It is not a real-time command.
1776 // NOTE: PARKING_ENABLE is required. By default, M56 is active upon initialization. Use
1777 // DEACTIVATE_PARKING_UPON_INIT to set M56 P0 as the power-up default.
1778 #endif
1779 #if !defined DEFAULT_DEACTIVATE_PARKING_UPON_INIT || defined __DOXYGEN__
1780 #define DEFAULT_DEACTIVATE_PARKING_UPON_INIT Off // bit 1
1781 #endif
1782 #if !defined DEFAULT_ENABLE_PARKING_OVERRIDE_CONTROL || defined __DOXYGEN__
1783 #define DEFAULT_ENABLE_PARKING_OVERRIDE_CONTROL Off // bit 2
1784 #endif
1786 
1791 #if !defined DEFAULT_PARKING_AXIS || defined __DOXYGEN__
1792 #define DEFAULT_PARKING_AXIS Z_AXIS //
1793 #endif
1795 
1799 #if !defined DEFAULT_PARKING_PULLOUT_INCREMENT || defined __DOXYGEN__
1800 #define DEFAULT_PARKING_PULLOUT_INCREMENT 5.0f //
1801 #endif
1803 
1808 #if !defined DEFAULT_PARKING_PULLOUT_RATE || defined __DOXYGEN__
1809 #define DEFAULT_PARKING_PULLOUT_RATE 100.0f // mm/min.
1810 #endif
1812 
1817 #if !defined DEFAULT_PARKING_TARGET || defined __DOXYGEN__
1818 #define DEFAULT_PARKING_TARGET -5.0f // mm
1819 #endif
1821 
1826 #if !defined DEFAULT_PARKING_RATE || defined __DOXYGEN__
1827 #define DEFAULT_PARKING_RATE 500.0f // mm/min
1828 #endif
1830 
1834 
1839 #if !defined DEFAULT_DOOR_IGNORE_WHEN_IDLE || defined __DOXYGEN__
1840 #define DEFAULT_DOOR_IGNORE_WHEN_IDLE Off
1841 #endif
1846 #if !defined DEFAULT_DOOR_KEEP_COOLANT_ON || defined __DOXYGEN__
1847 #define DEFAULT_DOOR_KEEP_COOLANT_ON Off
1848 #endif
1850 
1856 #if !defined DEFAULT_SAFETY_DOOR_SPINDLE_DELAY || defined __DOXYGEN__
1857 #define DEFAULT_SAFETY_DOOR_SPINDLE_DELAY 4.0f // Float (seconds)
1858 #endif
1860 
1867 #if !defined DEFAULT_SAFETY_DOOR_COOLANT_DELAY || defined __DOXYGEN__
1868 #define DEFAULT_SAFETY_DOOR_COOLANT_DELAY 1.0f // Float (seconds)
1869 #endif
1871 
1872 #endif // DEFAULT_HOMING_ENABLE
1873 
1874 // Jogging settings (Group_Jogging)
1875 
1883 #if !defined DEFAULT_JOG_LIMIT_ENABLE || defined __DOXYGEN__
1884 #define DEFAULT_JOG_LIMIT_ENABLE Off
1885 #endif
1887 
1888 // Stepper settings (Group_Stepper)
1889 
1902 #if !defined DEFAULT_STEP_PULSE_MICROSECONDS || defined __DOXYGEN__
1903 #define DEFAULT_STEP_PULSE_MICROSECONDS 5.0f
1904 #endif
1906 
1915 #if !defined DEFAULT_STEPPER_IDLE_LOCK_TIME || defined __DOXYGEN__
1916 #define DEFAULT_STEPPER_IDLE_LOCK_TIME 25 // milliseconds
1917 #endif
1919 
1925 #if !defined DEFAULT_STEP_SIGNALS_INVERT_MASK || defined __DOXYGEN__
1926 #define DEFAULT_STEP_SIGNALS_INVERT_MASK 0
1927 #endif
1929 
1935 #if !defined DEFAULT_DIR_SIGNALS_INVERT_MASK || defined __DOXYGEN__
1936 #define DEFAULT_DIR_SIGNALS_INVERT_MASK 0
1937 #endif
1939 
1952 #if !defined DEFAULT_ENABLE_SIGNALS_INVERT_MASK || defined __DOXYGEN__
1953 #define DEFAULT_ENABLE_SIGNALS_INVERT_MASK AXES_BITMASK
1954 #endif
1956 
1962 #if !defined DEFAULT_GANGED_DIRECTION_INVERT_MASK || defined __DOXYGEN__
1963 #define DEFAULT_GANGED_DIRECTION_INVERT_MASK 0
1964 #endif
1966 
1970 #if !defined DEFAULT_STEP_PULSE_DELAY || defined __DOXYGEN__
1971 #define DEFAULT_STEP_PULSE_DELAY 0.0f
1972 #endif
1974 
1981 #if !defined DEFAULT_STEPPER_DEENERGIZE_MASK || defined __DOXYGEN__
1982 #define DEFAULT_STEPPER_DEENERGIZE_MASK 0
1983 #endif
1985 
1992 #if !defined DEFAULT_AXIS_ROTATIONAL_MASK || defined __DOXYGEN__
1993 #define DEFAULT_AXIS_ROTATIONAL_MASK 0
1994 #endif
1996 
2001 #if !defined DEFAULT_STEPPER_ENABLE_DELAY || defined __DOXYGEN__
2002 #define DEFAULT_STEPPER_ENABLE_DELAY 0
2003 #endif
2005 
2011 #if !defined DEFAULT_MOTOR_WARNING_SIGNALS_ENABLE || defined __DOXYGEN__
2012 #define DEFAULT_MOTOR_WARNING_SIGNALS_ENABLE 0
2013 #endif
2015 
2021 #if !defined DEFAULT_MOTOR_WARNING_SIGNALS_INVERT || defined __DOXYGEN__
2022 #define DEFAULT_MOTOR_WARNING_SIGNALS_INVERT 0
2023 #endif
2025 
2031 #if !defined DEFAULT_MOTOR_FAULT_SIGNALS_ENABLE || defined __DOXYGEN__
2032 #define DEFAULT_MOTOR_FAULT_SIGNALS_ENABLE 0
2033 #endif
2035 
2041 #if !defined DEFAULT_MOTOR_FAULT_SIGNALS_INVERT || defined __DOXYGEN__
2042 #define DEFAULT_MOTOR_FAULT_SIGNALS_INVERT 0
2043 #endif
2045 
2050 #if !defined DEFAULT_AUTOREPORT_INTERVAL || defined __DOXYGEN__
2051 #define DEFAULT_AUTOREPORT_INTERVAL 0
2052 #endif
2054 
2059 #if !defined DEFAULT_TIMEZONE_OFFSET || defined __DOXYGEN__
2060 #define DEFAULT_TIMEZONE_OFFSET 0.0f
2061 #endif
2063 
2069 #if !defined DEFAULT_NO_UNLOCK_AFTER_ESTOP || defined __DOXYGEN__
2070 #define DEFAULT_NO_UNLOCK_AFTER_ESTOP Off
2071 #endif
2073 
2078 #if !defined DEFAULT_RGB_STRIP0_LENGTH || defined __DOXYGEN__
2079 #define DEFAULT_RGB_STRIP0_LENGTH 0
2080 #endif
2082 
2087 #if !defined DEFAULT_RGB_STRIP1_LENGTH || defined __DOXYGEN__
2088 #define DEFAULT_RGB_STRIP1_LENGTH 0
2089 #endif
2091 
2099 #if !defined DEFAULT_AXIS_ROTARY_WRAP_MASK || defined __DOXYGEN__
2100 #define DEFAULT_AXIS_ROTARY_WRAP_MASK 0
2101 #endif
2103 
2108 #if !defined DEFAULT_MODBUS_STREAM_BAUD || defined __DOXYGEN__
2109 #define DEFAULT_MODBUS_STREAM_BAUD 3 // 0 = 2400, 1 = 4800, 2 = 9600, 3 = 19200, 4 = 38400, 5 = 115200
2110 #endif
2112 
2117 #if !defined DEFAULT_MODBUS_STREAM_PARITY || defined __DOXYGEN__
2118 #define DEFAULT_MODBUS_STREAM_PARITY 0 // 0 = None, 1 = Even, 2 = Odd
2119 #endif
2121 
2122 // Axis settings (Group_XAxis - Group_VAxis)
2123 
2128 #if !defined DEFAULT_X_STEPS_PER_MM || defined __DOXYGEN__
2129 #define DEFAULT_X_STEPS_PER_MM 250.0f
2130 #endif
2131 #if !defined DEFAULT_Y_STEPS_PER_MM || defined __DOXYGEN__
2132 #define DEFAULT_Y_STEPS_PER_MM 250.0f
2133 #endif
2134 #if !defined DEFAULT_Z_STEPS_PER_MM || defined __DOXYGEN__
2135 #define DEFAULT_Z_STEPS_PER_MM 250.0f
2136 #endif
2137 #if (defined A_AXIS && !defined DEFAULT_A_STEPS_PER_MM) || defined __DOXYGEN__
2138 #define DEFAULT_A_STEPS_PER_MM 250.0f
2139 #endif
2140 #if (defined B_AXIS && !defined DEFAULT_B_STEPS_PER_MM) || defined __DOXYGEN__
2141 #define DEFAULT_B_STEPS_PER_MM 250.0f
2142 #endif
2143 #if (defined C_AXIS && !defined DEFAULT_C_STEPS_PER_MM) || defined __DOXYGEN__
2144 #define DEFAULT_C_STEPS_PER_MM 250.0f
2145 #endif
2146 #if (defined U_AXIS && !defined DEFAULT_U_STEPS_PER_MM) || defined __DOXYGEN__
2147 #define DEFAULT_U_STEPS_PER_MM 250.0f
2148 #endif
2149 #if (defined V_AXIS && !defined DEFAULT_V_STEPS_PER_MM) || defined __DOXYGEN__
2150 #define DEFAULT_V_STEPS_PER_MM 250.0f
2151 #endif
2153 
2158 #if !defined DEFAULT_X_MAX_RATE || defined __DOXYGEN__
2159 #define DEFAULT_X_MAX_RATE 500.0f // mm/min
2160 #endif
2161 #if !defined DEFAULT_Y_MAX_RATE || defined __DOXYGEN__
2162 #define DEFAULT_Y_MAX_RATE 500.0f // mm/min
2163 #endif
2164 #if !defined DEFAULT_Z_MAX_RATE || defined __DOXYGEN__
2165 #define DEFAULT_Z_MAX_RATE 500.0f // mm/min
2166 #endif
2167 #if (defined A_AXIS && !defined DEFAULT_A_MAX_RATE) || defined __DOXYGEN__
2168 #define DEFAULT_A_MAX_RATE 500.0f // mm/min
2169 #endif
2170 #if (defined B_AXIS && !defined DEFAULT_B_MAX_RATE) || defined __DOXYGEN__
2171 #define DEFAULT_B_MAX_RATE 500.0f // mm/min
2172 #endif
2173 #if (defined C_AXIS && !defined DEFAULT_C_MAX_RATE) || defined __DOXYGEN__
2174 #define DEFAULT_C_MAX_RATE 500.0f // mm/min
2175 #endif
2176 #if (defined U_AXIS && !defined DEFAULT_U_MAX_RATE) || defined __DOXYGEN__
2177 #define DEFAULT_U_MAX_RATE 500.0f // mm/min
2178 #endif
2179 #if (defined V_AXIS && !defined DEFAULT_V_MAX_RATE) || defined __DOXYGEN__
2180 #define DEFAULT_V_MAX_RATE 500.0f // mm/min
2181 #endif
2183 
2187 #if !defined DEFAULT_X_ACCELERATION || defined __DOXYGEN__
2188 #define DEFAULT_X_ACCELERATION 10.0f // mm/sec^2
2189 #endif
2190 #if !defined DEFAULT_Y_ACCELERATION || defined __DOXYGEN__
2191 #define DEFAULT_Y_ACCELERATION 10.0f // mm/sec^2
2192 #endif
2193 #if !defined DEFAULT_Z_ACCELERATION || defined __DOXYGEN__
2194 #define DEFAULT_Z_ACCELERATION 10.0f // mm/sec^2
2195 #endif
2196 #if (defined A_AXIS && !defined DEFAULT_A_ACCELERATION) || defined __DOXYGEN__
2197 #define DEFAULT_A_ACCELERATION 10.0f // mm/sec^2
2198 #endif
2199 #if (defined B_AXIS && !defined DEFAULT_B_ACCELERATION) || defined __DOXYGEN__
2200 #define DEFAULT_B_ACCELERATION 10.0f // mm/sec^2
2201 #endif
2202 #if (defined C_AXIS && !defined DEFAULT_C_ACCELERATION) || defined __DOXYGEN__
2203 #define DEFAULT_C_ACCELERATION 10.0f // mm/sec^2
2204 #endif
2205 #if (defined U_AXIS && !defined DEFAULT_U_ACCELERATION) || defined __DOXYGEN__
2206 #define DEFAULT_U_ACCELERATION 10.0f // mm/sec^2
2207 #endif
2208 #if (defined V_AXIS && !defined DEFAULT_V_ACCELERATION) || defined __DOXYGEN__
2209 #define DEFAULT_V_ACCELERATION 10.0f // mm/sec^2
2210 #endif
2212 
2216 #if !defined DEFAULT_X_JERK|| defined __DOXYGEN__
2217 #define DEFAULT_X_JERK 100.0f // mm/sec^3
2218 #endif
2219 #if !defined DEFAULT_Y_JERK|| defined __DOXYGEN__
2220 #define DEFAULT_Y_JERK 100.0f // mm/sec^3
2221 #endif
2222 #if !defined DEFAULT_Z_JERK || defined __DOXYGEN__
2223 #define DEFAULT_Z_JERK 100.0f // mm/sec^3
2224 #endif
2225 #if (defined A_AXIS && !defined DEFAULT_A_JERK) || defined __DOXYGEN__
2226 #define DEFAULT_A_JERK 100.0f // mm/sec^3
2227 #endif
2228 #if (defined B_AXIS && !defined DEFAULT_B_JERK) || defined __DOXYGEN__
2229 #define DEFAULT_B_JERK 100.0f // mm/sec^3
2230 #endif
2231 #if (defined C_AXIS && !defined DEFAULT_C_JERK) || defined __DOXYGEN__
2232 #define DEFAULT_C_JERK 100.0f // mm/sec^3
2233 #endif
2234 #if (defined U_AXIS && !defined DEFAULT_U_JERK) || defined __DOXYGEN__
2235 #define DEFAULT_U_JERK 100.0f // mm/sec^3
2236 #endif
2237 #if (defined V_AXIS && !defined DEFAULT_V_JERK) || defined __DOXYGEN__
2238 #define DEFAULT_V_JERK 100.0f // mm/sec^3
2239 #endif
2241 
2246 #if !defined DEFAULT_X_MAX_TRAVEL || defined __DOXYGEN__
2247 #define DEFAULT_X_MAX_TRAVEL 200.0f // mm
2248 #endif
2249 #if !defined DEFAULT_Y_MAX_TRAVEL || defined __DOXYGEN__
2250 #define DEFAULT_Y_MAX_TRAVEL 200.0f // mm
2251 #endif
2252 #if !defined DEFAULT_Z_MAX_TRAVEL || defined __DOXYGEN__
2253 #define DEFAULT_Z_MAX_TRAVEL 200.0f // mm
2254 #endif
2255 #if (defined A_AXIS && !defined DEFAULT_A_MAX_TRAVEL) || defined __DOXYGEN__
2256 #define DEFAULT_A_MAX_TRAVEL 200.0f // mm
2257 #endif
2258 #if (defined B_AXIS && !defined DEFAULT_B_MAX_TRAVEL) || defined __DOXYGEN__
2259 #define DEFAULT_B_MAX_TRAVEL 200.0f // mm
2260 #endif
2261 #if (defined C_AXIS && !defined DEFAULT_C_MAX_TRAVEL) || defined __DOXYGEN__
2262 #define DEFAULT_C_MAX_TRAVEL 200.0f // mm
2263 #endif
2264 #if (defined U_AXIS && !defined DEFAULT_U_MAX_TRAVEL) || defined __DOXYGEN__
2265 #define DEFAULT_U_MAX_TRAVEL 200.0f // mm
2266 #endif
2267 #if (defined V_AXIS && !defined DEFAULT_V_MAX_TRAVEL) || defined __DOXYGEN__
2268 #define DEFAULT_V_MAX_TRAVEL 200.0f // mm
2269 #endif
2271 
2276 #if !defined DEFAULT_X_CURRENT || defined __DOXYGEN__
2277 #define DEFAULT_X_CURRENT 500.0f // mA RMS
2278 #endif
2279 #if !defined DEFAULT_Y_CURRENT || defined __DOXYGEN__
2280 #define DEFAULT_Y_CURRENT 500.0f // mA RMS
2281 #endif
2282 #if !defined DEFAULT_Z_CURRENT || defined __DOXYGEN__
2283 #define DEFAULT_Z_CURRENT 500.0f // mA RMS
2284 #endif
2285 #if (defined A_AXIS && !defined DEFAULT_A_CURRENT) || defined __DOXYGEN__
2286 #define DEFAULT_A_CURRENT 500.0f // mA RMS
2287 #endif
2288 #if (defined B_AXIS && !defined DEFAULT_B_CURRENT) || defined __DOXYGEN__
2289 #define DEFAULT_B_CURRENT 500.0f // mA RMS
2290 #endif
2291 #if (defined C_AXIS && !defined DEFAULT_C_CURRENT) || defined __DOXYGEN__
2292 #define DEFAULT_C_CURRENT 500.0f // mA RMS
2293 #endif
2294 #if (defined U_AXIS && !defined DEFAULT_U_CURRENT) || defined __DOXYGEN__
2295 #define DEFAULT_U_CURRENT 500.0f // mA RMS
2296 #endif
2297 #if (defined V_AXIS && !defined DEFAULT_V_CURRENT) || defined __DOXYGEN__
2298 #define DEFAULT_V_CURRENT 500.0f // mA RMS
2299 #endif
2301 
2302 // Sanity checks
2303 
2304 // N_TOOLS may have been defined on the compiler command line.
2305 #if !defined(N_TOOLS)
2306 #define N_TOOLS 0
2307 #elif N_TOOLS > 32
2308 #undef N_TOOLS
2309 #define N_TOOLS 32
2310 #endif
2311 
2312 #if N_SYS_SPINDLE > N_SPINDLE
2313 #undef N_SYS_SPINDLE
2314 #define N_SYS_SPINDLE N_SPINDLE
2315 #endif
2316 
2317 #if N_SYS_SPINDLE < 1
2318 #undef N_SYS_SPINDLE
2319 #define N_SYS_SPINDLE 1
2320 #endif
2321 
2322 #if N_SYS_SPINDLE > 8
2323 #undef N_SYS_SPINDLE
2324 #define N_SYS_SPINDLE 8
2325 #endif
2326 
2327 #if NGC_EXPRESSIONS_ENABLE && !NGC_PARAMETERS_ENABLE
2328 #undef NGC_PARAMETERS_ENABLE
2329 #define NGC_PARAMETERS_ENABLE On
2330 #endif
2331 
2332 #if (REPORT_WCO_REFRESH_BUSY_COUNT < REPORT_WCO_REFRESH_IDLE_COUNT)
2333  #error "WCO busy refresh is less than idle refresh."
2334 #endif
2335 #if (REPORT_OVERRIDE_REFRESH_BUSY_COUNT < REPORT_OVERRIDE_REFRESH_IDLE_COUNT)
2336  #error "Override busy refresh is less than idle refresh."
2337 #endif
2338 #if (REPORT_WCO_REFRESH_IDLE_COUNT < 2)
2339  #error "WCO refresh must be greater than one."
2340 #endif
2341 #if (REPORT_OVERRIDE_REFRESH_IDLE_COUNT < 1)
2342  #error "Override refresh must be greater than zero."
2343 #endif
2344 
2345 #if DEFAULT_LASER_MODE && DEFAULT_LATHE_MODE
2346 #error "Cannot enable laser and lathe mode at the same time!"
2347 #endif
2348 
2349 #if LATHE_UVW_OPTION && (N_AXIS > 6 || AXIS_REMAP_ABC2UVW)
2350 #warning "Cannot enable lathe UVW option when N_AXIS > 6 or ABC words are remapped!"
2351 #undef LATHE_UVW_OPTION
2352 #define LATHE_UVW_OPTION Off
2353 #endif
2354 
2355 #if DEFAULT_CONTROL_SIGNALS_INVERT_MASK < 0
2356 #undef DEFAULT_CONTROL_SIGNALS_INVERT_MASK
2357 #define DEFAULT_CONTROL_SIGNALS_INVERT_MASK SIGNALS_BITMASK
2358 #endif
2359 
2360 #if DEFAULT_LIMIT_SIGNALS_INVERT_MASK < 0
2361 #undef DEFAULT_LIMIT_SIGNALS_INVERT_MASK
2362 #define DEFAULT_LIMIT_SIGNALS_INVERT_MASK AXES_BITMASK
2363 #endif
2364 
2365 #if DEFAULT_LIMIT_SIGNALS_PULLUP_DISABLE_MASK < 0
2366 #undef DEFAULT_LIMIT_SIGNALS_PULLUP_DISABLE_MASK
2367 #define DEFAULT_LIMIT_SIGNALS_PULLUP_DISABLE_MASK AXES_BITMASK
2368 #endif
2369 
2370 #if DEFAULT_STEP_SIGNALS_INVERT_MASK < 0
2371 #undef DEFAULT_STEP_SIGNALS_INVERT_MASK
2372 #define DEFAULT_STEP_SIGNALS_INVERT_MASK AXES_BITMASK
2373 #endif
2374 
2375 #if DEFAULT_ENABLE_SIGNALS_INVERT_MASK < 0
2376 #undef DEFAULT_ENABLE_SIGNALS_INVERT_MASK
2377 #define DEFAULT_ENABLE_SIGNALS_INVERT_MASK AXES_BITMASK
2378 #endif
2379 
2380 #if DEFAULT_SPINDLE_ON_DELAY
2381 #if DEFAULT_SPINDLE_ON_DELAY < 500
2382 #undef DEFAULT_SPINDLE_ON_DELAY
2383 #define DEFAULT_SPINDLE_ON_DELAY 500
2384 #elif DEFAULT_SPINDLE_ON_DELAY > 20000
2385 #undef DEFAULT_SPINDLE_ON_DELAY
2386 #define DEFAULT_SPINDLE_ON_DELAY 20000
2387 #endif
2388 #endif
2389 
2390 #if DEFAULT_COOLANT_ON_DELAY
2391 #if DEFAULT_COOLANT_ON_DELAY < 500
2392 #undef DEFAULT_COOLANT_ON_DELAY
2393 #define DEFAULT_COOLANT_ON_DELAY 500
2394 #elif DEFAULT_COOLANT_ON_DELAY > 20000
2395 #undef DEFAULT_COOLANT_ON_DELAY
2396 #define DEFAULT_COOLANT_ON_DELAY 20000
2397 #endif
2398 #endif
2399 
2400 #if DEFAULT_PARKING_ENABLE > 0
2401  #if DEFAULT_HOMING_FORCE_SET_ORIGIN > 0
2402  #error "DEFAULT_HOMING_FORCE_SET_ORIGIN is not supported with DEFAULT_PARKING_ENABLE at this time."
2403  #endif
2404 #endif
2405 
2406 #if DEFAULT_ENABLE_PARKING_OVERRIDE_CONTROL > 0
2407  #if DEFAULT_PARKING_ENABLE < 1
2408  #error "DEFAULT_ENABLE_PARKING_OVERRIDE_CONTROL must be enabled with DEFAULT_PARKING_ENABLE."
2409  #endif
2410 #endif
2411 
2466 #endif // _GRBL_CONFIG_H_