My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SanityCheck.h 8.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. /**
  2. * SanityCheck.h
  3. *
  4. * Test configuration values for errors at compile-time.
  5. */
  6. #ifndef SANITYCHECK_H
  7. #define SANITYCHECK_H
  8. /**
  9. * Dual Stepper Drivers
  10. */
  11. #if defined(Z_DUAL_STEPPER_DRIVERS) && defined(Y_DUAL_STEPPER_DRIVERS)
  12. #error You cannot have dual stepper drivers for both Y and Z.
  13. #endif
  14. /**
  15. * Progress Bar
  16. */
  17. #ifdef LCD_PROGRESS_BAR
  18. #ifndef SDSUPPORT
  19. #error LCD_PROGRESS_BAR requires SDSUPPORT.
  20. #endif
  21. #ifdef DOGLCD
  22. #error LCD_PROGRESS_BAR does not apply to graphical displays.
  23. #endif
  24. #ifdef FILAMENT_LCD_DISPLAY
  25. #error LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both.
  26. #endif
  27. #endif
  28. /**
  29. * Babystepping
  30. */
  31. #ifdef BABYSTEPPING
  32. #ifdef COREXY
  33. #error BABYSTEPPING not implemented for COREXY yet.
  34. #endif
  35. #ifdef SCARA
  36. #error BABYSTEPPING is not implemented for SCARA yet.
  37. #endif
  38. #if defined(DELTA) && defined(BABYSTEP_XY)
  39. #error BABYSTEPPING only implemented for Z axis on deltabots.
  40. #endif
  41. #endif
  42. /**
  43. * Filament Change with Extruder Runout Prevention
  44. */
  45. #if defined(FILAMENTCHANGEENABLE) && defined(EXTRUDER_RUNOUT_PREVENT)
  46. #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE.
  47. #endif
  48. /**
  49. * Options only for EXTRUDERS == 1
  50. */
  51. #if EXTRUDERS > 1
  52. #if EXTRUDERS > 4
  53. #error The maximum number of EXTRUDERS in Marlin is 4.
  54. #endif
  55. #ifdef TEMP_SENSOR_1_AS_REDUNDANT
  56. #error EXTRUDERS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT.
  57. #endif
  58. #ifdef HEATERS_PARALLEL
  59. #error EXTRUDERS must be 1 with HEATERS_PARALLEL.
  60. #endif
  61. #ifdef Y_DUAL_STEPPER_DRIVERS
  62. #error EXTRUDERS must be 1 with Y_DUAL_STEPPER_DRIVERS.
  63. #endif
  64. #ifdef Z_DUAL_STEPPER_DRIVERS
  65. #error EXTRUDERS must be 1 with Z_DUAL_STEPPER_DRIVERS.
  66. #endif
  67. #endif // EXTRUDERS > 1
  68. /**
  69. * Limited number of servos
  70. */
  71. #if NUM_SERVOS > 4
  72. #error The maximum number of SERVOS in Marlin is 4.
  73. #endif
  74. /**
  75. * Required LCD language
  76. */
  77. #if !defined(DOGLCD) && defined(ULTRA_LCD) && !defined(DISPLAY_CHARSET_HD44780_JAPAN) && !defined(DISPLAY_CHARSET_HD44780_WESTERN)
  78. #error You must enable either DISPLAY_CHARSET_HD44780_JAPAN or DISPLAY_CHARSET_HD44780_WESTERN for your LCD controller.
  79. #endif
  80. /**
  81. * Auto Bed Leveling
  82. */
  83. #ifdef ENABLE_AUTO_BED_LEVELING
  84. /**
  85. * Require a Z Min pin
  86. */
  87. #if Z_MIN_PIN == -1
  88. #ifdef Z_PROBE_REPEATABILITY_TEST
  89. #error You must have a Z_MIN endstop to enable Z_PROBE_REPEATABILITY_TEST.
  90. #else
  91. #error ENABLE_AUTO_BED_LEVELING requires a Z_MIN endstop. Z_MIN_PIN must point to a valid hardware pin.
  92. #endif
  93. #endif
  94. /**
  95. * Check if Probe_Offset * Grid Points is greater than Probing Range
  96. */
  97. #ifdef AUTO_BED_LEVELING_GRID
  98. // Make sure probing points are reachable
  99. #if LEFT_PROBE_BED_POSITION < MIN_PROBE_X
  100. #error "The given LEFT_PROBE_BED_POSITION can't be reached by the probe."
  101. #elif RIGHT_PROBE_BED_POSITION > MAX_PROBE_X
  102. #error "The given RIGHT_PROBE_BED_POSITION can't be reached by the probe."
  103. #elif FRONT_PROBE_BED_POSITION < MIN_PROBE_Y
  104. #error "The given FRONT_PROBE_BED_POSITION can't be reached by the probe."
  105. #elif BACK_PROBE_BED_POSITION > MAX_PROBE_Y
  106. #error "The given BACK_PROBE_BED_POSITION can't be reached by the probe."
  107. #endif
  108. #define PROBE_SIZE_X (X_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1))
  109. #define PROBE_SIZE_Y (Y_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1))
  110. #define PROBE_AREA_WIDTH (RIGHT_PROBE_BED_POSITION - LEFT_PROBE_BED_POSITION)
  111. #define PROBE_AREA_DEPTH (BACK_PROBE_BED_POSITION - FRONT_PROBE_BED_POSITION)
  112. #if X_PROBE_OFFSET_FROM_EXTRUDER < 0
  113. #if PROBE_SIZE_X <= -PROBE_AREA_WIDTH
  114. #define X_PROBE_ERROR
  115. #endif
  116. #elif PROBE_SIZE_X >= PROBE_AREA_WIDTH
  117. #define X_PROBE_ERROR
  118. #endif
  119. #ifdef X_PROBE_ERROR
  120. #error The X axis probing range is too small to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS
  121. #endif
  122. #if Y_PROBE_OFFSET_FROM_EXTRUDER < 0
  123. #if PROBE_SIZE_Y <= -PROBE_AREA_DEPTH
  124. #define Y_PROBE_ERROR
  125. #endif
  126. #elif PROBE_SIZE_Y >= PROBE_AREA_DEPTH
  127. #define Y_PROBE_ERROR
  128. #endif
  129. #ifdef Y_PROBE_ERROR
  130. #error The Y axis probing range is to small to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS
  131. #endif
  132. #undef PROBE_SIZE_X
  133. #undef PROBE_SIZE_Y
  134. #undef PROBE_AREA_WIDTH
  135. #undef PROBE_AREA_DEPTH
  136. #else // !AUTO_BED_LEVELING_GRID
  137. // Check the triangulation points
  138. #if ABL_PROBE_PT_1_X < MIN_PROBE_X || ABL_PROBE_PT_1_X > MAX_PROBE_X
  139. #error "The given ABL_PROBE_PT_1_X can't be reached by the probe."
  140. #elif ABL_PROBE_PT_2_X < MIN_PROBE_X || ABL_PROBE_PT_2_X > MAX_PROBE_X
  141. #error "The given ABL_PROBE_PT_2_X can't be reached by the probe."
  142. #elif ABL_PROBE_PT_3_X < MIN_PROBE_X || ABL_PROBE_PT_3_X > MAX_PROBE_X
  143. #error "The given ABL_PROBE_PT_3_X can't be reached by the probe."
  144. #elif ABL_PROBE_PT_1_Y < MIN_PROBE_Y || ABL_PROBE_PT_1_Y > MAX_PROBE_Y
  145. #error "The given ABL_PROBE_PT_1_Y can't be reached by the probe."
  146. #elif ABL_PROBE_PT_2_Y < MIN_PROBE_Y || ABL_PROBE_PT_2_Y > MAX_PROBE_Y
  147. #error "The given ABL_PROBE_PT_2_Y can't be reached by the probe."
  148. #elif ABL_PROBE_PT_3_Y < MIN_PROBE_Y || ABL_PROBE_PT_3_Y > MAX_PROBE_Y
  149. #error "The given ABL_PROBE_PT_3_Y can't be reached by the probe."
  150. #endif
  151. #endif // !AUTO_BED_LEVELING_GRID
  152. #endif // ENABLE_AUTO_BED_LEVELING
  153. /**
  154. * ULTIPANEL encoder
  155. */
  156. #if defined(ULTIPANEL) && !defined(NEWPANEL) && !defined(SR_LCD_2W_NL) && !defined(SHIFT_CLK)
  157. #error ULTIPANEL requires some kind of encoder.
  158. #endif
  159. /**
  160. * Delta has limited bed leveling options
  161. */
  162. #ifdef DELTA
  163. #ifdef ENABLE_AUTO_BED_LEVELING
  164. #ifndef AUTO_BED_LEVELING_GRID
  165. #error Only AUTO_BED_LEVELING_GRID is supported with DELTA.
  166. #endif
  167. #ifdef Z_PROBE_SLED
  168. #error You cannot use Z_PROBE_SLED with DELTA.
  169. #endif
  170. #ifdef Z_PROBE_REPEATABILITY_TEST
  171. #error Z_PROBE_REPEATABILITY_TEST is not supported with DELTA yet.
  172. #endif
  173. #endif
  174. #endif
  175. /**
  176. * Allen Key Z Probe requires Auto Bed Leveling grid and Delta
  177. */
  178. #if defined(Z_PROBE_ALLEN_KEY) && !(defined(AUTO_BED_LEVELING_GRID) && defined(DELTA))
  179. #error Invalid use of Z_PROBE_ALLEN_KEY.
  180. #endif
  181. /**
  182. * Dual X Carriage requirements
  183. */
  184. #ifdef DUAL_X_CARRIAGE
  185. #if EXTRUDERS == 1 || defined(COREXY) \
  186. || !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR \
  187. || !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) \
  188. || !HAS_X_MAX
  189. #error Missing or invalid definitions for DUAL_X_CARRIAGE mode.
  190. #endif
  191. #if X_HOME_DIR != -1 || X2_HOME_DIR != 1
  192. #error Please use canonical x-carriage assignment.
  193. #endif
  194. #endif // DUAL_X_CARRIAGE
  195. /**
  196. * Make sure auto fan pins don't conflict with the fan pin
  197. */
  198. #if HAS_AUTO_FAN && HAS_FAN
  199. #if EXTRUDER_0_AUTO_FAN_PIN == FAN_PIN
  200. #error You cannot set EXTRUDER_0_AUTO_FAN_PIN equal to FAN_PIN
  201. #elif EXTRUDER_1_AUTO_FAN_PIN == FAN_PIN
  202. #error You cannot set EXTRUDER_1_AUTO_FAN_PIN equal to FAN_PIN
  203. #elif EXTRUDER_2_AUTO_FAN_PIN == FAN_PIN
  204. #error You cannot set EXTRUDER_2_AUTO_FAN_PIN equal to FAN_PIN
  205. #elif EXTRUDER_3_AUTO_FAN_PIN == FAN_PIN
  206. #error You cannot set EXTRUDER_3_AUTO_FAN_PIN equal to FAN_PIN
  207. #endif
  208. #endif
  209. #if HAS_FAN && CONTROLLERFAN_PIN == FAN_PIN
  210. #error You cannot set CONTROLLERFAN_PIN equal to FAN_PIN
  211. #endif
  212. /**
  213. * Test required HEATER defines
  214. */
  215. #if EXTRUDERS > 3
  216. #if !HAS_HEATER_3
  217. #error HEATER_3_PIN not defined for this board
  218. #endif
  219. #elif EXTRUDERS > 2
  220. #if !HAS_HEATER_2
  221. #error HEATER_2_PIN not defined for this board
  222. #endif
  223. #elif EXTRUDERS > 1 || defined(HEATERS_PARALLEL)
  224. #if !HAS_HEATER_1
  225. #error HEATER_1_PIN not defined for this board
  226. #endif
  227. #endif
  228. #if !HAS_HEATER_0
  229. #error HEATER_0_PIN not defined for this board
  230. #endif
  231. /**
  232. * Warnings for old configurations
  233. */
  234. #ifdef X_HOME_RETRACT_MM
  235. #error [XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM
  236. #endif
  237. #endif //SANITYCHECK_H