grblHAL core  20250806
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 
734 
739 #if !defined DEFAULT_JUNCTION_DEVIATION || defined __DOXYGEN__
740 #define DEFAULT_JUNCTION_DEVIATION 0.01f // mm
741 #endif
743 
748 #if !defined DEFAULT_ARC_TOLERANCE || defined __DOXYGEN__
749 #define DEFAULT_ARC_TOLERANCE 0.002f // mm
750 #endif
752 
758 #if !defined DEFAULT_REPORT_INCHES || defined __DOXYGEN__
759 #define DEFAULT_REPORT_INCHES Off
760 #endif
762 
768 #if !defined DEFAULT_G73_RETRACT || defined __DOXYGEN__
769 #define DEFAULT_G73_RETRACT 0.1f // mm
770 #endif
772 
777 #if !defined DEFAULT_LASER_MODE || defined __DOXYGEN__
778 #define DEFAULT_LASER_MODE Off
779 #endif
780 #if !defined DEFAULT_LATHE_MODE || defined __DOXYGEN__
781 #define DEFAULT_LATHE_MODE Off
782 #endif
784 
794 #if !defined DEFAULT_LEGACY_RTCOMMANDS || defined __DOXYGEN__
795 #define DEFAULT_LEGACY_RTCOMMANDS On
796 #endif
798 
802 #if !defined DEFAULT_RESET_OVERRIDES || defined __DOXYGEN__
803 #define DEFAULT_RESET_OVERRIDES Off
804 #endif
806 
810 #if !defined DEFAULT_SLEEP_ENABLE || defined __DOXYGEN__
811 #define DEFAULT_SLEEP_ENABLE Off
812 #endif
814 
822 #if !defined DEFAULT_DISABLE_LASER_DURING_HOLD || defined __DOXYGEN__
823 #define DEFAULT_DISABLE_LASER_DURING_HOLD On
824 #endif
826 
832 #if !defined DEFAULT_RESTORE_AFTER_FEED_HOLD || defined __DOXYGEN__
833 #define DEFAULT_RESTORE_AFTER_FEED_HOLD On
834 #endif
836 
846 #if !defined DEFAULT_FORCE_INITIALIZATION_ALARM || defined __DOXYGEN__
847 #define DEFAULT_FORCE_INITIALIZATION_ALARM Off
848 #endif
850 
857 #if !defined DEFAULT_DISABLE_G92_PERSISTENCE || defined __DOXYGEN__
858 #if COMPATIBILITY_LEVEL <= 1
859 #define DEFAULT_DISABLE_G92_PERSISTENCE Off
860 #else
861 #define DEFAULT_DISABLE_G92_PERSISTENCE On
862 #endif
863 #endif
865 
874 #if !defined DEFAULT_PLANNER_BUFFER_BLOCKS || defined __DOXYGEN__
875 #define DEFAULT_PLANNER_BUFFER_BLOCKS 100
876 #endif
878 
888 #if !defined DEFAULT_HOMING_KEEP_STATUS_ON_RESET || defined __DOXYGEN__
889 #define DEFAULT_HOMING_KEEP_STATUS_ON_RESET Off // Default disabled. Set to \ref On or 1 to enable.
890 #endif
892 
899 #if !defined DEFAULT_KEEP_OFFSETS_ON_RESET || defined __DOXYGEN__
900 #define DEFAULT_KEEP_OFFSETS_ON_RESET Off
901 #endif
903 
904 // Control signals settings (Group_ControlSignals)
905 
906 #ifndef __DOXYGEN__ // For now do not include in documentation
907 
913 #define SIGNALS_RESET_BIT (1<<0)
914 #define SIGNALS_FEEDHOLD_BIT (1<<1)
915 #define SIGNALS_CYCLESTART_BIT (1<<2)
916 #define SIGNALS_SAFETYDOOR_BIT (1<<3)
917 #define SIGNALS_BLOCKDELETE_BIT (1<<4)
918 #define SIGNALS_STOPDISABLE_BIT (1<<5)
919 #define SIGNALS_ESTOP_BIT (1<<6)
920 #define SIGNALS_PROBE_CONNECTED_BIT (1<<7)
921 #define SIGNALS_MOTOR_FAULT_BIT (1<<8)
922 #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)
924 
925 #endif
926 
933 #if !defined DEFAULT_CONTROL_SIGNALS_INVERT_MASK || defined __DOXYGEN__
934 #define DEFAULT_CONTROL_SIGNALS_INVERT_MASK 0 // Set to SIGNALS_BITMASK or -1 to invert all signals
935 #endif
937 
952 #if !defined DEFAULT_DISABLE_CONTROL_PINS_PULL_UP_MASK || defined __DOXYGEN__
953 #define DEFAULT_DISABLE_CONTROL_PINS_PULL_UP_MASK 0 // Set to SIGNALS_BITMASK or -1 to invert all signals
954 #endif
956 
957 // Limits settings (Group_Limits)
958 
967 #if !defined DEFAULT_LIMIT_SIGNALS_INVERT_MASK || defined __DOXYGEN__
968 #define DEFAULT_LIMIT_SIGNALS_INVERT_MASK 0 // Set to -1 or AXES_BITMASK to invert for all axes
969 #endif
971 
979 #if !defined DEFAULT_LIMIT_SIGNALS_PULLUP_DISABLE_MASK || defined __DOXYGEN__
980 #define DEFAULT_LIMIT_SIGNALS_PULLUP_DISABLE_MASK 0 // Set to -1 or AXES_BITMASK to disable pullup for all axes
981 #endif
983 
987 #if !defined DEFAULT_SOFT_LIMIT_ENABLE || defined __DOXYGEN__
988 #define DEFAULT_SOFT_LIMIT_ENABLE Off
989 #endif
991 
995 
1002 #if !defined DEFAULT_HARD_LIMIT_ENABLE || defined __DOXYGEN__
1003 #define DEFAULT_HARD_LIMIT_ENABLE Off
1004 #endif
1005 #if !defined DEFAULT_CHECK_LIMITS_AT_INIT || defined __DOXYGEN__
1006 #define DEFAULT_CHECK_LIMITS_AT_INIT Off
1007 #endif
1008 #if !defined DEFAULT_HARD_LIMITS_DISABLE_FOR_ROTARY || defined __DOXYGEN__
1009 #define DEFAULT_HARD_LIMITS_DISABLE_FOR_ROTARY Off
1010 #endif
1011 
1024 
1027 #if !defined DEFAULT_DUAL_AXIS_HOMING_FAIL_AXIS_LENGTH_PERCENT || defined __DOXYGEN__
1028 #define DEFAULT_DUAL_AXIS_HOMING_FAIL_AXIS_LENGTH_PERCENT 5.0f // Float (percent)
1029 #endif
1031 
1035 #if !defined DEFAULT_DUAL_AXIS_HOMING_FAIL_DISTANCE_MIN || defined __DOXYGEN__
1036 #define DEFAULT_DUAL_AXIS_HOMING_FAIL_DISTANCE_MIN 2.5f // Float (mm)
1037 #endif
1039 
1044 #if !defined DEFAULT_DUAL_AXIS_HOMING_FAIL_DISTANCE_MAX || defined __DOXYGEN__
1045 #define DEFAULT_DUAL_AXIS_HOMING_FAIL_DISTANCE_MAX 25.0f // Float (mm)
1046 #endif
1048 
1049 // Coolant settings (Group_Coolant)
1050 
1056 #if !defined DEFAULT_INVERT_COOLANT_FLOOD_PIN || defined __DOXYGEN__
1057 #define DEFAULT_INVERT_COOLANT_FLOOD_PIN Off
1058 #endif
1059 #if !defined DEFAULT_INVERT_COOLANT_MIST_PIN || defined __DOXYGEN__
1060 #define DEFAULT_INVERT_COOLANT_MIST_PIN Off // NOTE: not supported by all drivers.
1061 #endif
1063 
1067 #if !defined DEFAULT_COOLANT_ON_DELAY || defined __DOXYGEN__
1068 #define DEFAULT_COOLANT_ON_DELAY 0 // milliseconds: 0 or 500 - 20000
1069 #endif
1071 
1072 // Spindle settings (Group_Spindle)
1073 
1077 #if !defined DEFAULT_SPINDLE_ENABLE_OFF_WITH_ZERO_SPEED || defined __DOXYGEN__
1078 #define DEFAULT_SPINDLE_ENABLE_OFF_WITH_ZERO_SPEED Off
1079 #endif
1080 #if !defined DEFAULT_PWM_SPINDLE_DISABLE_LASER_MODE || defined __DOXYGEN__
1081 #define DEFAULT_PWM_SPINDLE_DISABLE_LASER_MODE Off
1082 #endif
1084 
1089 #if !defined DEFAULT_INVERT_SPINDLE_ENABLE_PIN || defined __DOXYGEN__
1090 #define DEFAULT_INVERT_SPINDLE_ENABLE_PIN Off
1091 #endif
1092 #if !defined DEFAULT_INVERT_SPINDLE_CCW_PIN || defined __DOXYGEN__
1093 #define DEFAULT_INVERT_SPINDLE_CCW_PIN Off // NOTE: not supported by all drivers.
1094 #endif
1095 #if !defined DEFAULT_INVERT_SPINDLE_PWM_PIN || defined __DOXYGEN__
1096 #define DEFAULT_INVERT_SPINDLE_PWM_PIN Off // NOTE: not supported by all drivers.
1097 #endif
1099 
1103 #if !defined DEFAULT_SPINDLE_RPM_MAX || defined __DOXYGEN__
1104 #define DEFAULT_SPINDLE_RPM_MAX 1000.0f // rpm
1105 #endif
1107 
1111 #if !defined DEFAULT_SPINDLE_RPM_MIN || defined __DOXYGEN__
1112 #define DEFAULT_SPINDLE_RPM_MIN 0.0f // rpm
1113 #endif
1115 
1119 #if !defined DEFAULT_SPINDLE_PWM_FREQ || defined __DOXYGEN__
1120 #define DEFAULT_SPINDLE_PWM_FREQ 5000 // Hz
1121 #endif
1123 
1127 #if !defined DEFAULT_SPINDLE_PWM_OFF_VALUE || defined __DOXYGEN__
1128 #define DEFAULT_SPINDLE_PWM_OFF_VALUE 0.0f // Percent
1129 #endif
1131 
1144 #if !defined DEFAULT_SPINDLE_PWM_MIN_VALUE || defined __DOXYGEN__
1145 #define DEFAULT_SPINDLE_PWM_MIN_VALUE 0.0f // Must be greater than zero. Integer (+-255).
1146 #endif
1148 
1152 #if !defined DEFAULT_SPINDLE_PWM_MAX_VALUE || defined __DOXYGEN__
1153 #define DEFAULT_SPINDLE_PWM_MAX_VALUE 100.0f // Percent
1154 #endif
1156 
1165 #if !defined DEFAULT_SPINDLE_PPR || defined __DOXYGEN__
1166 #define DEFAULT_SPINDLE_PPR 0 // Pulses per revolution.
1167 #endif
1169 
1173 #if !defined DEFAULT_SPINDLE_AT_SPEED_TOLERANCE || defined __DOXYGEN__
1174 #define DEFAULT_SPINDLE_AT_SPEED_TOLERANCE 0.0f // Percent - 0 means not checked
1175 #endif
1177 
1181 #if !defined DEFAULT_SPINDLE_ON_DELAY || defined __DOXYGEN__
1182 #define DEFAULT_SPINDLE_ON_DELAY 0 // milliseconds: 0 or 500 - 20000
1183 #endif
1185 
1189 #if !defined DEFAULT_SPINDLE || defined __DOXYGEN__
1190 #define DEFAULT_SPINDLE SPINDLE_PWM0 // Spindle number from spindle_control.h
1191 #endif
1193 
1197 #if !defined DEFAULT_SPINDLE_OFF_DELAY || defined __DOXYGEN__
1198 #define DEFAULT_SPINDLE_OFF_DELAY 0 // milliseconds: 0 or 500 - 20000
1199 #endif
1201 
1202 // Closed loop spindle settings (Group_Spindle_ClosedLoop)
1203 
1204 // $9 - Setting_SpindlePWMOptions
1205 // bit 0
1206 // always defaults to on
1207 // bit 1
1208 
1209 // Closed loop spindle settings (Group_Spindle_ClosedLoop)
1210 
1211 #ifndef DEFAULT_SPINDLE_P_GAIN
1212 #define DEFAULT_SPINDLE_P_GAIN 1.0f
1213 #endif
1214 #ifndef DEFAULT_SPINDLE_I_GAIN
1215 #define DEFAULT_SPINDLE_I_GAIN 0.01f
1216 #endif
1217 #ifndef DEFAULT_SPINDLE_D_GAIN
1218 #define DEFAULT_SPINDLE_D_GAIN 0.0f
1219 #endif
1220 #ifndef DEFAULT_SPINDLE_I_MAX
1221 #define DEFAULT_SPINDLE_I_MAX 10.0f
1222 #endif
1223 
1224 #if ENABLE_SPINDLE_LINEARIZATION || defined __DOXYGEN__
1225 
1230 #if !defined DEFAULT_RPM_POINT01 || defined __DOXYGEN__
1231 #define DEFAULT_RPM_POINT01 NAN // DEFAULT_SPINDLE_RPM_MIN // Replace NAN with DEFAULT_SPINDLE_RPM_MIN to enable.
1232 #endif
1233 #if !defined DEFAULT_RPM_LINE_A1 || defined __DOXYGEN__
1234 #define DEFAULT_RPM_LINE_A1 3.197101e-03f
1235 #endif
1236 #if !defined DEFAULT_RPM_LINE_B1 || defined __DOXYGEN__
1237 #define DEFAULT_RPM_LINE_B1 -3.526076e-1f
1238 #endif
1240 
1245 #if !defined DEFAULT_RPM_POINT12 || defined __DOXYGEN__
1246 #define DEFAULT_RPM_POINT12 NAN // Change NAN to a float constant to enable.
1247 #endif
1248 #if !defined DEFAULT_RPM_LINE_A2 || defined __DOXYGEN__
1249 #define DEFAULT_RPM_LINE_A2 1.722950e-2f
1250 #endif
1251 #if !defined DEFAULT_RPM_LINE_B2 || defined __DOXYGEN__
1252 #define DEFAULT_RPM_LINE_B2 1.0f,
1253 #endif
1255 
1260 #if !defined DEFAULT_RPM_POINT23 || defined __DOXYGEN__
1261 #define DEFAULT_RPM_POINT23 NAN // Change NAN to a float constant to enable.
1262 #endif
1263 #if !defined DEFAULT_RPM_LINE_A3 || defined __DOXYGEN__
1264 #define DEFAULT_RPM_LINE_A3 5.901518e-02f
1265 #endif
1266 #if !defined DEFAULT_RPM_LINE_B3 || defined __DOXYGEN__
1267 #define DEFAULT_RPM_LINE_B3 4.881851e+02f
1268 #endif
1270 
1275 #if !defined DEFAULT_RPM_POINT34 || defined __DOXYGEN__
1276 #define DEFAULT_RPM_POINT34 NAN // Change NAN to a float constant to enable.
1277 #endif
1278 #if !defined DEFAULT_RPM_LINE_A4 || defined __DOXYGEN__
1279 #define DEFAULT_RPM_LINE_A4 1.203413e-01f
1280 #endif
1281 #if !defined DEFAULT_RPM_LINE_B4 || defined __DOXYGEN__
1282 #define DEFAULT_RPM_LINE_B4 1.151360e+03f
1283 #endif
1285 
1286 #endif // ENABLE_SPINDLE_LINEARIZATION
1287 
1288 // Settings for second PWM spindle
1289 
1294 #if !defined DEFAULT_INVERT_SPINDLE1_ENABLE_PIN || defined __DOXYGEN__
1295 #define DEFAULT_INVERT_SPINDLE1_ENABLE_PIN Off
1296 #endif
1297 #if !defined DEFAULT_INVERT_SPINDLE1_CCW_PIN || defined __DOXYGEN__
1298 #define DEFAULT_INVERT_SPINDLE1_CCW_PIN Off // NOTE: not supported by all drivers.
1299 #endif
1300 #if !defined DEFAULT_INVERT_SPINDLE1_PWM_PIN || defined __DOXYGEN__
1301 #define DEFAULT_INVERT_SPINDLE1_PWM_PIN Off // NOTE: not supported by all drivers.
1302 #endif
1304 
1308 #if !defined DEFAULT_SPINDLE1_RPM_MAX || defined __DOXYGEN__
1309 #define DEFAULT_SPINDLE1_RPM_MAX 1000.0f // rpm
1310 #endif
1312 
1316 #if !defined DEFAULT_SPINDLE1_RPM_MIN || defined __DOXYGEN__
1317 #define DEFAULT_SPINDLE1_RPM_MIN 0.0f // rpm
1318 #endif
1320 
1324 #if !defined DEFAULT_SPINDLE1_PWM_FREQ || defined __DOXYGEN__
1325 #define DEFAULT_SPINDLE1_PWM_FREQ 5000 // Hz
1326 #endif
1328 
1332 #if !defined DEFAULT_SPINDLE1_PWM_OFF_VALUE || defined __DOXYGEN__
1333 #define DEFAULT_SPINDLE1_PWM_OFF_VALUE 0.0f // Percent
1334 #endif
1336 
1349 #if !defined DEFAULT_SPINDLE1_PWM_MIN_VALUE || defined __DOXYGEN__
1350 #define DEFAULT_SPINDLE1_PWM_MIN_VALUE 0.0f // Must be greater than zero. Integer (+-255).
1351 #endif
1353 
1357 #if !defined DEFAULT_SPINDLE1_PWM_MAX_VALUE || defined __DOXYGEN__
1358 #define DEFAULT_SPINDLE1_PWM_MAX_VALUE 100.0f // Percent
1359 #endif
1361 
1362 
1363 // Tool change settings (Group_Toolchange)
1364 
1369 #if !defined DEFAULT_TOOLCHANGE_MODE || defined __DOXYGEN__
1370 #define DEFAULT_TOOLCHANGE_MODE 0
1371 #endif
1373 
1377 #if !defined DEFAULT_TOOLCHANGE_PROBING_DISTANCE || defined __DOXYGEN__
1378 #define DEFAULT_TOOLCHANGE_PROBING_DISTANCE 30 // max probing distance in mm for mode 3
1379 #endif
1381 
1385 #if !defined DEFAULT_TOOLCHANGE_FEED_RATE || defined __DOXYGEN__
1386 #define DEFAULT_TOOLCHANGE_FEED_RATE 25.0f // mm/min
1387 #endif
1389 
1394 #if !defined DEFAULT_TOOLCHANGE_SEEK_RATE || defined __DOXYGEN__
1395 #define DEFAULT_TOOLCHANGE_SEEK_RATE 200.0f // mm/min
1396 #endif
1398 
1402 #if !defined DEFAULT_TOOLCHANGE_PULLOFF_RATE || defined __DOXYGEN__
1403 #define DEFAULT_TOOLCHANGE_PULLOFF_RATE 200.0f // mm/min
1404 #endif
1406 
1410 #if !defined DEFAULT_TOOLCHANGE_NO_RESTORE_POSITION || defined __DOXYGEN__
1411 #define DEFAULT_TOOLCHANGE_NO_RESTORE_POSITION Off
1412 #endif
1413 #if !defined DEFAULT_TOOLCHANGE_AT_G30 || defined __DOXYGEN__
1414 #define DEFAULT_TOOLCHANGE_AT_G30 Off
1415 #endif
1416 #if !defined DEFAULT_TOOLCHANGE_FAST_PROBE_PULLOFF || defined __DOXYGEN__
1417 #define DEFAULT_TOOLCHANGE_FAST_PROBE_PULLOFF Off
1418 #endif
1420 
1424 #if !defined DEFAULT_PERSIST_TOOL || defined __DOXYGEN__
1425 #define DEFAULT_PERSIST_TOOL Off
1426 #endif
1428 
1429 // Homing settings (Group_Homing)
1430 
1437 #if !defined DEFAULT_HOMING_ENABLE || defined __DOXYGEN__
1438 #define DEFAULT_HOMING_ENABLE Off // Default disabled. Set to \ref On or 1 to enable.
1439 #endif
1440 
1448 #if !defined DEFAULT_HOMING_SINGLE_AXIS_COMMANDS || defined __DOXYGEN__
1449 #define DEFAULT_HOMING_SINGLE_AXIS_COMMANDS Off // Default disabled. Set to \ref On or 1 to enable.
1450 #endif
1451 
1459 #if !defined DEFAULT_HOMING_INIT_LOCK || defined __DOXYGEN__
1460 #define DEFAULT_HOMING_INIT_LOCK Off // Default disabled. Set to \ref On or 1 to enable.
1461 #endif
1462 
1470 #if !defined DEFAULT_HOMING_FORCE_SET_ORIGIN || defined __DOXYGEN__
1471 #define DEFAULT_HOMING_FORCE_SET_ORIGIN Off // Default disabled. Set to \ref On or 1 to enable.
1472 #endif
1473 
1484 #if !defined DEFAULT_LIMITS_TWO_SWITCHES_ON_AXES || defined __DOXYGEN__
1485 #define DEFAULT_LIMITS_TWO_SWITCHES_ON_AXES Off // Default disabled. Set to \ref On or 1 to enable.
1486 #endif
1488 
1495 #if !defined DEFAULT_HOMING_ALLOW_MANUAL || defined __DOXYGEN__
1496 #define DEFAULT_HOMING_ALLOW_MANUAL Off // Default disabled. Set to \ref On or 1 to enable.
1497 #endif
1498 
1505 #if !defined DEFAULT_HOMING_OVERRIDE_LOCKS || defined __DOXYGEN__
1506 #define DEFAULT_HOMING_OVERRIDE_LOCKS Off // Default disabled. Set to \ref On or 1 to enable.
1507 #endif
1508 
1514 #if !defined DEFAULT_HOMING_USE_LIMIT_SWITCHES || defined __DOXYGEN__
1515 #define DEFAULT_HOMING_USE_LIMIT_SWITCHES Off // Default disabled. Set to \ref On or 1 to enable.
1516 #endif
1518 
1524 #if !defined DEFAULT_RUN_STARTUP_SCRIPTS_ONLY_ON_HOMED || defined __DOXYGEN__
1525 #define DEFAULT_RUN_STARTUP_SCRIPTS_ONLY_ON_HOMED Off // Default disabled. Set to \ref On or 1 to enable.
1526 #endif
1528 
1534 #if !defined DEFAULT_HOMING_DIR_MASK || defined __DOXYGEN__
1535 #define DEFAULT_HOMING_DIR_MASK 0
1536 #endif
1538 
1542 #if !defined DEFAULT_HOMING_FEED_RATE || defined __DOXYGEN__
1543 #define DEFAULT_HOMING_FEED_RATE 25.0f // mm/min
1544 #endif
1546 
1550 #if !defined DEFAULT_HOMING_SEEK_RATE || defined __DOXYGEN__
1551 #define DEFAULT_HOMING_SEEK_RATE 500.0f // mm/min
1552 #endif
1554 
1558 #if !defined DEFAULT_HOMING_DEBOUNCE_DELAY || defined __DOXYGEN__
1559 #define DEFAULT_HOMING_DEBOUNCE_DELAY 250 // msec (0-65k)
1560 #endif
1562 
1566 #if !defined DEFAULT_HOMING_PULLOFF || defined __DOXYGEN__
1567 #define DEFAULT_HOMING_PULLOFF 1.0f // mm
1568 #endif
1570 
1577 #if !defined DEFAULT_N_HOMING_LOCATE_CYCLE || defined __DOXYGEN__
1578 #define DEFAULT_N_HOMING_LOCATE_CYCLE 1 // Integer (1-127)
1579 #endif
1581 
1603 #if !defined DEFAULT_HOMING_CYCLE_0 || defined __DOXYGEN__
1604 #define DEFAULT_HOMING_CYCLE_0 (Z_AXIS_BIT) // REQUIRED: First move Z to clear workspace.
1605 #endif
1607 
1611 #if !defined DEFAULT_HOMING_CYCLE_1 || defined __DOXYGEN__
1612 #if COREXY
1613 #define DEFAULT_HOMING_CYCLE_1 (X_AXIS_BIT) // OPTIONAL: Then move X.
1614 #else
1615 #define DEFAULT_HOMING_CYCLE_1 (X_AXIS_BIT|Y_AXIS_BIT) // OPTIONAL: Then move X,Y at the same time.
1616 #endif
1617 #endif
1619 
1623 #if !defined DEFAULT_HOMING_CYCLE_2 || defined __DOXYGEN__
1624 #if COREXY
1625 #define DEFAULT_HOMING_CYCLE_2 (Y_AXIS_BIT) // OPTIONAL: Then move Y.
1626 #else
1627 #define DEFAULT_HOMING_CYCLE_2 0 // OPTIONAL: Uncomment and add axes mask to enable
1628 #endif
1629 #endif
1631 
1635 #if (defined A_AXIS && !defined DEFAULT_HOMING_CYCLE_3) || defined __DOXYGEN__
1636 #define DEFAULT_HOMING_CYCLE_3 0 // OPTIONAL: Uncomment and add axes mask to enable
1637 #endif
1639 
1644 #if (defined B_AXIS && !defined DEFAULT_HOMING_CYCLE_4) || defined __DOXYGEN__
1645 #define DEFAULT_HOMING_CYCLE_4 0 // OPTIONAL: Uncomment and add axes mask to enable
1646 #endif
1648 
1652 #if (defined C_AXIS && !defined DEFAULT_HOMING_CYCLE_5) || defined __DOXYGEN__
1653 #define DEFAULT_HOMING_CYCLE_5 0 // OPTIONAL: Uncomment and add axes mask to enable
1654 #endif
1656 
1665 #if !defined DEFAULT_HOME_SIGNALS_INVERT_MASK || defined __DOXYGEN__
1666 #define DEFAULT_HOME_SIGNALS_INVERT_MASK 0 // Set to -1 or AXES_BITMASK to invert for all axes
1667 #endif
1669 
1670 
1671 // Probing settings (Group_Probing)
1672 
1676 #if !defined DEFAULT_PROBE_SIGNAL_INVERT || defined __DOXYGEN__
1677 #define DEFAULT_PROBE_SIGNAL_INVERT Off
1678 #endif
1679 #if !defined DEFAULT_TOOLSETTER_SIGNAL_INVERT || defined __DOXYGEN__
1680 #define DEFAULT_TOOLSETTER_SIGNAL_INVERT Off
1681 #endif
1683 
1687 #if !defined DEFAULT_PROBE_SIGNAL_DISABLE_PULLUP || defined __DOXYGEN__
1688 #define DEFAULT_PROBE_SIGNAL_DISABLE_PULLUP Off
1689 #endif
1690 #if !defined DEFAULT_TOOLSETTER_SIGNAL_DISABLE_PULLUP || defined __DOXYGEN__
1691 #define DEFAULT_TOOLSETTER_SIGNAL_DISABLE_PULLUP Off
1692 #endif
1694 
1703 #if !defined DEFAULT_ALLOW_FEED_OVERRIDE_DURING_PROBE_CYCLES || defined __DOXYGEN__
1704 #define DEFAULT_ALLOW_FEED_OVERRIDE_DURING_PROBE_CYCLES Off
1705 #endif
1706 #if !defined DEFAULT_SOFT_LIMIT_PROBE_CYCLES || defined __DOXYGEN__
1707 #define DEFAULT_SOFT_LIMIT_PROBE_CYCLES Off
1708 #endif
1710 
1711 // Safety door/parking settings (Group_SafetyDoor)
1712 
1713 #ifdef DEFAULT_HOMING_ENABLE
1714 
1732 #if !defined DEFAULT_PARKING_ENABLE || defined __DOXYGEN__
1733 #define DEFAULT_PARKING_ENABLE Off // bit 0
1734 // Enables a special set of M-code commands that enables and disables the parking motion.
1735 // These are controlled by `M56`, `M56 P1`, or `M56 Px` to enable and `M56 P0` to disable.
1736 // The command is modal and will be set after a planner sync. Since it is g-code, it is
1737 // executed in sync with g-code commands. It is not a real-time command.
1738 // NOTE: PARKING_ENABLE is required. By default, M56 is active upon initialization. Use
1739 // DEACTIVATE_PARKING_UPON_INIT to set M56 P0 as the power-up default.
1740 #endif
1741 #if !defined DEFAULT_DEACTIVATE_PARKING_UPON_INIT || defined __DOXYGEN__
1742 #define DEFAULT_DEACTIVATE_PARKING_UPON_INIT Off // bit 1
1743 #endif
1744 #if !defined DEFAULT_ENABLE_PARKING_OVERRIDE_CONTROL || defined __DOXYGEN__
1745 #define DEFAULT_ENABLE_PARKING_OVERRIDE_CONTROL Off // bit 2
1746 #endif
1748 
1753 #if !defined DEFAULT_PARKING_AXIS || defined __DOXYGEN__
1754 #define DEFAULT_PARKING_AXIS Z_AXIS //
1755 #endif
1757 
1761 #if !defined DEFAULT_PARKING_PULLOUT_INCREMENT || defined __DOXYGEN__
1762 #define DEFAULT_PARKING_PULLOUT_INCREMENT 5.0f //
1763 #endif
1765 
1770 #if !defined DEFAULT_PARKING_PULLOUT_RATE || defined __DOXYGEN__
1771 #define DEFAULT_PARKING_PULLOUT_RATE 100.0f // mm/min.
1772 #endif
1774 
1779 #if !defined DEFAULT_PARKING_TARGET || defined __DOXYGEN__
1780 #define DEFAULT_PARKING_TARGET -5.0f // mm
1781 #endif
1783 
1788 #if !defined DEFAULT_PARKING_RATE || defined __DOXYGEN__
1789 #define DEFAULT_PARKING_RATE 500.0f // mm/min
1790 #endif
1792 
1796 
1801 #if !defined DEFAULT_DOOR_IGNORE_WHEN_IDLE || defined __DOXYGEN__
1802 #define DEFAULT_DOOR_IGNORE_WHEN_IDLE Off
1803 #endif
1808 #if !defined DEFAULT_DOOR_KEEP_COOLANT_ON || defined __DOXYGEN__
1809 #define DEFAULT_DOOR_KEEP_COOLANT_ON Off
1810 #endif
1812 
1818 #if !defined DEFAULT_SAFETY_DOOR_SPINDLE_DELAY || defined __DOXYGEN__
1819 #define DEFAULT_SAFETY_DOOR_SPINDLE_DELAY 4.0f // Float (seconds)
1820 #endif
1822 
1829 #if !defined DEFAULT_SAFETY_DOOR_COOLANT_DELAY || defined __DOXYGEN__
1830 #define DEFAULT_SAFETY_DOOR_COOLANT_DELAY 1.0f // Float (seconds)
1831 #endif
1833 
1834 #endif // DEFAULT_HOMING_ENABLE
1835 
1836 // Jogging settings (Group_Jogging)
1837 
1845 #if !defined DEFAULT_JOG_LIMIT_ENABLE || defined __DOXYGEN__
1846 #define DEFAULT_JOG_LIMIT_ENABLE Off
1847 #endif
1849 
1850 // Stepper settings (Group_Stepper)
1851 
1864 #if !defined DEFAULT_STEP_PULSE_MICROSECONDS || defined __DOXYGEN__
1865 #define DEFAULT_STEP_PULSE_MICROSECONDS 5.0f
1866 #endif
1868 
1877 #if !defined DEFAULT_STEPPER_IDLE_LOCK_TIME || defined __DOXYGEN__
1878 #define DEFAULT_STEPPER_IDLE_LOCK_TIME 25 // milliseconds
1879 #endif
1881 
1887 #if !defined DEFAULT_STEP_SIGNALS_INVERT_MASK || defined __DOXYGEN__
1888 #define DEFAULT_STEP_SIGNALS_INVERT_MASK 0
1889 #endif
1891 
1897 #if !defined DEFAULT_DIR_SIGNALS_INVERT_MASK || defined __DOXYGEN__
1898 #define DEFAULT_DIR_SIGNALS_INVERT_MASK 0
1899 #endif
1901 
1914 #if !defined DEFAULT_ENABLE_SIGNALS_INVERT_MASK || defined __DOXYGEN__
1915 #define DEFAULT_ENABLE_SIGNALS_INVERT_MASK AXES_BITMASK
1916 #endif
1918 
1924 #if !defined DEFAULT_GANGED_DIRECTION_INVERT_MASK || defined __DOXYGEN__
1925 #define DEFAULT_GANGED_DIRECTION_INVERT_MASK 0
1926 #endif
1928 
1932 #if !defined DEFAULT_STEP_PULSE_DELAY || defined __DOXYGEN__
1933 #define DEFAULT_STEP_PULSE_DELAY 0.0f
1934 #endif
1936 
1943 #if !defined DEFAULT_STEPPER_DEENERGIZE_MASK || defined __DOXYGEN__
1944 #define DEFAULT_STEPPER_DEENERGIZE_MASK 0
1945 #endif
1947 
1954 #if !defined DEFAULT_AXIS_ROTATIONAL_MASK || defined __DOXYGEN__
1955 #define DEFAULT_AXIS_ROTATIONAL_MASK 0
1956 #endif
1958 
1963 #if !defined DEFAULT_STEPPER_ENABLE_DELAY || defined __DOXYGEN__
1964 #define DEFAULT_STEPPER_ENABLE_DELAY 0
1965 #endif
1967 
1973 #if !defined DEFAULT_MOTOR_WARNING_SIGNALS_ENABLE || defined __DOXYGEN__
1974 #define DEFAULT_MOTOR_WARNING_SIGNALS_ENABLE 0
1975 #endif
1977 
1983 #if !defined DEFAULT_MOTOR_WARNING_SIGNALS_INVERT || defined __DOXYGEN__
1984 #define DEFAULT_MOTOR_WARNING_SIGNALS_INVERT 0
1985 #endif
1987 
1993 #if !defined DEFAULT_MOTOR_FAULT_SIGNALS_ENABLE || defined __DOXYGEN__
1994 #define DEFAULT_MOTOR_FAULT_SIGNALS_ENABLE 0
1995 #endif
1997 
2003 #if !defined DEFAULT_MOTOR_FAULT_SIGNALS_INVERT || defined __DOXYGEN__
2004 #define DEFAULT_MOTOR_FAULT_SIGNALS_INVERT 0
2005 #endif
2007 
2012 #if !defined DEFAULT_AUTOREPORT_INTERVAL || defined __DOXYGEN__
2013 #define DEFAULT_AUTOREPORT_INTERVAL 0
2014 #endif
2016 
2021 #if !defined DEFAULT_TIMEZONE_OFFSET || defined __DOXYGEN__
2022 #define DEFAULT_TIMEZONE_OFFSET 0.0f
2023 #endif
2025 
2031 #if !defined DEFAULT_NO_UNLOCK_AFTER_ESTOP || defined __DOXYGEN__
2032 #define DEFAULT_NO_UNLOCK_AFTER_ESTOP Off
2033 #endif
2035 
2040 #if !defined DEFAULT_RGB_STRIP0_LENGTH || defined __DOXYGEN__
2041 #define DEFAULT_RGB_STRIP0_LENGTH 0
2042 #endif
2044 
2049 #if !defined DEFAULT_RGB_STRIP1_LENGTH || defined __DOXYGEN__
2050 #define DEFAULT_RGB_STRIP1_LENGTH 0
2051 #endif
2053 
2061 #if !defined DEFAULT_AXIS_ROTARY_WRAP_MASK || defined __DOXYGEN__
2062 #define DEFAULT_AXIS_ROTARY_WRAP_MASK 0
2063 #endif
2065 
2070 #if !defined DEFAULT_MODBUS_STREAM_BAUD || defined __DOXYGEN__
2071 #define DEFAULT_MODBUS_STREAM_BAUD 3 // 0 = 2400, 1 = 4800, 2 = 9600, 3 = 19200, 4 = 38400, 5 = 115200
2072 #endif
2074 
2079 #if !defined DEFAULT_MODBUS_STREAM_PARITY || defined __DOXYGEN__
2080 #define DEFAULT_MODBUS_STREAM_PARITY 0 // 0 = None, 1 = Even, 2 = Odd
2081 #endif
2083 
2084 // Axis settings (Group_XAxis - Group_VAxis)
2085 
2090 #if !defined DEFAULT_X_STEPS_PER_MM || defined __DOXYGEN__
2091 #define DEFAULT_X_STEPS_PER_MM 250.0f
2092 #endif
2093 #if !defined DEFAULT_Y_STEPS_PER_MM || defined __DOXYGEN__
2094 #define DEFAULT_Y_STEPS_PER_MM 250.0f
2095 #endif
2096 #if !defined DEFAULT_Z_STEPS_PER_MM || defined __DOXYGEN__
2097 #define DEFAULT_Z_STEPS_PER_MM 250.0f
2098 #endif
2099 #if (defined A_AXIS && !defined DEFAULT_A_STEPS_PER_MM) || defined __DOXYGEN__
2100 #define DEFAULT_A_STEPS_PER_MM 250.0f
2101 #endif
2102 #if (defined B_AXIS && !defined DEFAULT_B_STEPS_PER_MM) || defined __DOXYGEN__
2103 #define DEFAULT_B_STEPS_PER_MM 250.0f
2104 #endif
2105 #if (defined C_AXIS && !defined DEFAULT_C_STEPS_PER_MM) || defined __DOXYGEN__
2106 #define DEFAULT_C_STEPS_PER_MM 250.0f
2107 #endif
2108 #if (defined U_AXIS && !defined DEFAULT_U_STEPS_PER_MM) || defined __DOXYGEN__
2109 #define DEFAULT_U_STEPS_PER_MM 250.0f
2110 #endif
2111 #if (defined V_AXIS && !defined DEFAULT_V_STEPS_PER_MM) || defined __DOXYGEN__
2112 #define DEFAULT_V_STEPS_PER_MM 250.0f
2113 #endif
2115 
2120 #if !defined DEFAULT_X_MAX_RATE || defined __DOXYGEN__
2121 #define DEFAULT_X_MAX_RATE 500.0f // mm/min
2122 #endif
2123 #if !defined DEFAULT_Y_MAX_RATE || defined __DOXYGEN__
2124 #define DEFAULT_Y_MAX_RATE 500.0f // mm/min
2125 #endif
2126 #if !defined DEFAULT_Z_MAX_RATE || defined __DOXYGEN__
2127 #define DEFAULT_Z_MAX_RATE 500.0f // mm/min
2128 #endif
2129 #if (defined A_AXIS && !defined DEFAULT_A_MAX_RATE) || defined __DOXYGEN__
2130 #define DEFAULT_A_MAX_RATE 500.0f // mm/min
2131 #endif
2132 #if (defined B_AXIS && !defined DEFAULT_B_MAX_RATE) || defined __DOXYGEN__
2133 #define DEFAULT_B_MAX_RATE 500.0f // mm/min
2134 #endif
2135 #if (defined C_AXIS && !defined DEFAULT_C_MAX_RATE) || defined __DOXYGEN__
2136 #define DEFAULT_C_MAX_RATE 500.0f // mm/min
2137 #endif
2138 #if (defined U_AXIS && !defined DEFAULT_U_MAX_RATE) || defined __DOXYGEN__
2139 #define DEFAULT_U_MAX_RATE 500.0f // mm/min
2140 #endif
2141 #if (defined V_AXIS && !defined DEFAULT_V_MAX_RATE) || defined __DOXYGEN__
2142 #define DEFAULT_V_MAX_RATE 500.0f // mm/min
2143 #endif
2145 
2149 #if !defined DEFAULT_X_ACCELERATION || defined __DOXYGEN__
2150 #define DEFAULT_X_ACCELERATION 10.0f // mm/sec^2
2151 #endif
2152 #if !defined DEFAULT_Y_ACCELERATION || defined __DOXYGEN__
2153 #define DEFAULT_Y_ACCELERATION 10.0f // mm/sec^2
2154 #endif
2155 #if !defined DEFAULT_Z_ACCELERATION || defined __DOXYGEN__
2156 #define DEFAULT_Z_ACCELERATION 10.0f // mm/sec^2
2157 #endif
2158 #if (defined A_AXIS && !defined DEFAULT_A_ACCELERATION) || defined __DOXYGEN__
2159 #define DEFAULT_A_ACCELERATION 10.0f // mm/sec^2
2160 #endif
2161 #if (defined B_AXIS && !defined DEFAULT_B_ACCELERATION) || defined __DOXYGEN__
2162 #define DEFAULT_B_ACCELERATION 10.0f // mm/sec^2
2163 #endif
2164 #if (defined C_AXIS && !defined DEFAULT_C_ACCELERATION) || defined __DOXYGEN__
2165 #define DEFAULT_C_ACCELERATION 10.0f // mm/sec^2
2166 #endif
2167 #if (defined U_AXIS && !defined DEFAULT_U_ACCELERATION) || defined __DOXYGEN__
2168 #define DEFAULT_U_ACCELERATION 10.0f // mm/sec^2
2169 #endif
2170 #if (defined V_AXIS && !defined DEFAULT_V_ACCELERATION) || defined __DOXYGEN__
2171 #define DEFAULT_V_ACCELERATION 10.0f // mm/sec^2
2172 #endif
2174 
2178 #if !defined DEFAULT_X_JERK|| defined __DOXYGEN__
2179 #define DEFAULT_X_JERK 100.0f // mm/sec^3
2180 #endif
2181 #if !defined DEFAULT_Y_JERK|| defined __DOXYGEN__
2182 #define DEFAULT_Y_JERK 100.0f // mm/sec^3
2183 #endif
2184 #if !defined DEFAULT_Z_JERK || defined __DOXYGEN__
2185 #define DEFAULT_Z_JERK 100.0f // mm/sec^3
2186 #endif
2187 #if (defined A_AXIS && !defined DEFAULT_A_JERK) || defined __DOXYGEN__
2188 #define DEFAULT_A_JERK 100.0f // mm/sec^3
2189 #endif
2190 #if (defined B_AXIS && !defined DEFAULT_B_JERK) || defined __DOXYGEN__
2191 #define DEFAULT_B_JERK 100.0f // mm/sec^3
2192 #endif
2193 #if (defined C_AXIS && !defined DEFAULT_C_JERK) || defined __DOXYGEN__
2194 #define DEFAULT_C_JERK 100.0f // mm/sec^3
2195 #endif
2196 #if (defined U_AXIS && !defined DEFAULT_U_JERK) || defined __DOXYGEN__
2197 #define DEFAULT_U_JERK 100.0f // mm/sec^3
2198 #endif
2199 #if (defined V_AXIS && !defined DEFAULT_V_JERK) || defined __DOXYGEN__
2200 #define DEFAULT_V_JERK 100.0f // mm/sec^3
2201 #endif
2203 
2208 #if !defined DEFAULT_X_MAX_TRAVEL || defined __DOXYGEN__
2209 #define DEFAULT_X_MAX_TRAVEL 200.0f // mm
2210 #endif
2211 #if !defined DEFAULT_Y_MAX_TRAVEL || defined __DOXYGEN__
2212 #define DEFAULT_Y_MAX_TRAVEL 200.0f // mm
2213 #endif
2214 #if !defined DEFAULT_Z_MAX_TRAVEL || defined __DOXYGEN__
2215 #define DEFAULT_Z_MAX_TRAVEL 200.0f // mm
2216 #endif
2217 #if (defined A_AXIS && !defined DEFAULT_A_MAX_TRAVEL) || defined __DOXYGEN__
2218 #define DEFAULT_A_MAX_TRAVEL 200.0f // mm
2219 #endif
2220 #if (defined B_AXIS && !defined DEFAULT_B_MAX_TRAVEL) || defined __DOXYGEN__
2221 #define DEFAULT_B_MAX_TRAVEL 200.0f // mm
2222 #endif
2223 #if (defined C_AXIS && !defined DEFAULT_C_MAX_TRAVEL) || defined __DOXYGEN__
2224 #define DEFAULT_C_MAX_TRAVEL 200.0f // mm
2225 #endif
2226 #if (defined U_AXIS && !defined DEFAULT_U_MAX_TRAVEL) || defined __DOXYGEN__
2227 #define DEFAULT_U_MAX_TRAVEL 200.0f // mm
2228 #endif
2229 #if (defined V_AXIS && !defined DEFAULT_V_MAX_TRAVEL) || defined __DOXYGEN__
2230 #define DEFAULT_V_MAX_TRAVEL 200.0f // mm
2231 #endif
2233 
2238 #if !defined DEFAULT_X_CURRENT || defined __DOXYGEN__
2239 #define DEFAULT_X_CURRENT 500.0f // mA RMS
2240 #endif
2241 #if !defined DEFAULT_Y_CURRENT || defined __DOXYGEN__
2242 #define DEFAULT_Y_CURRENT 500.0f // mA RMS
2243 #endif
2244 #if !defined DEFAULT_Z_CURRENT || defined __DOXYGEN__
2245 #define DEFAULT_Z_CURRENT 500.0f // mA RMS
2246 #endif
2247 #if (defined A_AXIS && !defined DEFAULT_A_CURRENT) || defined __DOXYGEN__
2248 #define DEFAULT_A_CURRENT 500.0f // mA RMS
2249 #endif
2250 #if (defined B_AXIS && !defined DEFAULT_B_CURRENT) || defined __DOXYGEN__
2251 #define DEFAULT_B_CURRENT 500.0f // mA RMS
2252 #endif
2253 #if (defined C_AXIS && !defined DEFAULT_C_CURRENT) || defined __DOXYGEN__
2254 #define DEFAULT_C_CURRENT 500.0f // mA RMS
2255 #endif
2256 #if (defined U_AXIS && !defined DEFAULT_U_CURRENT) || defined __DOXYGEN__
2257 #define DEFAULT_U_CURRENT 500.0f // mA RMS
2258 #endif
2259 #if (defined V_AXIS && !defined DEFAULT_V_CURRENT) || defined __DOXYGEN__
2260 #define DEFAULT_V_CURRENT 500.0f // mA RMS
2261 #endif
2263 
2264 // Sanity checks
2265 
2266 // N_TOOLS may have been defined on the compiler command line.
2267 #if !defined(N_TOOLS)
2268 #define N_TOOLS 0
2269 #elif N_TOOLS > 32
2270 #undef N_TOOLS
2271 #define N_TOOLS 32
2272 #endif
2273 
2274 #if N_SYS_SPINDLE > N_SPINDLE
2275 #undef N_SYS_SPINDLE
2276 #define N_SYS_SPINDLE N_SPINDLE
2277 #endif
2278 
2279 #if N_SYS_SPINDLE < 1
2280 #undef N_SYS_SPINDLE
2281 #define N_SYS_SPINDLE 1
2282 #endif
2283 
2284 #if N_SYS_SPINDLE > 8
2285 #undef N_SYS_SPINDLE
2286 #define N_SYS_SPINDLE 8
2287 #endif
2288 
2289 #if NGC_EXPRESSIONS_ENABLE && !NGC_PARAMETERS_ENABLE
2290 #undef NGC_PARAMETERS_ENABLE
2291 #define NGC_PARAMETERS_ENABLE On
2292 #endif
2293 
2294 #if (REPORT_WCO_REFRESH_BUSY_COUNT < REPORT_WCO_REFRESH_IDLE_COUNT)
2295  #error "WCO busy refresh is less than idle refresh."
2296 #endif
2297 #if (REPORT_OVERRIDE_REFRESH_BUSY_COUNT < REPORT_OVERRIDE_REFRESH_IDLE_COUNT)
2298  #error "Override busy refresh is less than idle refresh."
2299 #endif
2300 #if (REPORT_WCO_REFRESH_IDLE_COUNT < 2)
2301  #error "WCO refresh must be greater than one."
2302 #endif
2303 #if (REPORT_OVERRIDE_REFRESH_IDLE_COUNT < 1)
2304  #error "Override refresh must be greater than zero."
2305 #endif
2306 
2307 #if DEFAULT_LASER_MODE && DEFAULT_LATHE_MODE
2308 #error "Cannot enable laser and lathe mode at the same time!"
2309 #endif
2310 
2311 #if LATHE_UVW_OPTION && (N_AXIS > 6 || AXIS_REMAP_ABC2UVW)
2312 #warning "Cannot enable lathe UVW option when N_AXIS > 6 or ABC words are remapped!"
2313 #undef LATHE_UVW_OPTION
2314 #define LATHE_UVW_OPTION Off
2315 #endif
2316 
2317 #if DEFAULT_CONTROL_SIGNALS_INVERT_MASK < 0
2318 #undef DEFAULT_CONTROL_SIGNALS_INVERT_MASK
2319 #define DEFAULT_CONTROL_SIGNALS_INVERT_MASK SIGNALS_BITMASK
2320 #endif
2321 
2322 #if DEFAULT_LIMIT_SIGNALS_INVERT_MASK < 0
2323 #undef DEFAULT_LIMIT_SIGNALS_INVERT_MASK
2324 #define DEFAULT_LIMIT_SIGNALS_INVERT_MASK AXES_BITMASK
2325 #endif
2326 
2327 #if DEFAULT_LIMIT_SIGNALS_PULLUP_DISABLE_MASK < 0
2328 #undef DEFAULT_LIMIT_SIGNALS_PULLUP_DISABLE_MASK
2329 #define DEFAULT_LIMIT_SIGNALS_PULLUP_DISABLE_MASK AXES_BITMASK
2330 #endif
2331 
2332 #if DEFAULT_STEP_SIGNALS_INVERT_MASK < 0
2333 #undef DEFAULT_STEP_SIGNALS_INVERT_MASK
2334 #define DEFAULT_STEP_SIGNALS_INVERT_MASK AXES_BITMASK
2335 #endif
2336 
2337 #if DEFAULT_ENABLE_SIGNALS_INVERT_MASK < 0
2338 #undef DEFAULT_ENABLE_SIGNALS_INVERT_MASK
2339 #define DEFAULT_ENABLE_SIGNALS_INVERT_MASK AXES_BITMASK
2340 #endif
2341 
2342 #if DEFAULT_SPINDLE_ON_DELAY
2343 #if DEFAULT_SPINDLE_ON_DELAY < 500
2344 #undef DEFAULT_SPINDLE_ON_DELAY
2345 #define DEFAULT_SPINDLE_ON_DELAY 500
2346 #elif DEFAULT_SPINDLE_ON_DELAY > 20000
2347 #undef DEFAULT_SPINDLE_ON_DELAY
2348 #define DEFAULT_SPINDLE_ON_DELAY 20000
2349 #endif
2350 #endif
2351 
2352 #if DEFAULT_COOLANT_ON_DELAY
2353 #if DEFAULT_COOLANT_ON_DELAY < 500
2354 #undef DEFAULT_COOLANT_ON_DELAY
2355 #define DEFAULT_COOLANT_ON_DELAY 500
2356 #elif DEFAULT_COOLANT_ON_DELAY > 20000
2357 #undef DEFAULT_COOLANT_ON_DELAY
2358 #define DEFAULT_COOLANT_ON_DELAY 20000
2359 #endif
2360 #endif
2361 
2362 #if DEFAULT_PARKING_ENABLE > 0
2363  #if DEFAULT_HOMING_FORCE_SET_ORIGIN > 0
2364  #error "DEFAULT_HOMING_FORCE_SET_ORIGIN is not supported with DEFAULT_PARKING_ENABLE at this time."
2365  #endif
2366 #endif
2367 
2368 #if DEFAULT_ENABLE_PARKING_OVERRIDE_CONTROL > 0
2369  #if DEFAULT_PARKING_ENABLE < 1
2370  #error "DEFAULT_ENABLE_PARKING_OVERRIDE_CONTROL must be enabled with DEFAULT_PARKING_ENABLE."
2371  #endif
2372 #endif
2373 
2428 #endif // _GRBL_CONFIG_H_