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.1KB

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