Guest User

Untitled

a guest
Jul 25th, 2021
118
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * For directions on how to use this firmware visit http://uf2.th3dstudio.com and click on your printer/board link
  3.  * NO IMPLIED SUPPORT OR WARRANTY IS PROVIDED WITH THIS FIRMWARE AND IS PROVIDED AS-IS
  4.  */
  5. #pragma once
  6. #define CONFIGURATION_H_VERSION 02000901
  7.  
  8. //===========================================================================
  9. //============================ TH3D Configuration ===========================
  10. //===========================================================================
  11.  
  12. // ONLY UNCOMMENT THINGS IN ONE PRINTER SECTION!!! IF YOU HAVE MULTIPLE MACHINES FLASH THEM ONE AT A TIME.
  13. // UNCOMMENT MEANS REMOVING THE // IN FRONT OF A #define XXXXXX LINE.
  14.  
  15. //===========================================================================
  16. // ******************   CREALITY PRINTERS W/V4.X BOARD    *******************
  17. //===========================================================================
  18. //------------------------------ V4.2.2 Board -------------------------------
  19. //#define ENDER3_V422_BOARD
  20. //#define ENDER3_MAX_V422_BOARD
  21. //#define ENDER3_V2_V422_BOARD
  22. //#define ENDER5_V422_BOARD
  23.  
  24. // V4.2.2 TMC Driver Settings - Uncomment if you have TMC drivers on a 4.2.2 Board to set driver timings
  25. //#define V422_TMC220X_DRIVERS //"A" or "B" Code on SD Slot
  26.  
  27. //------------------------------ V4.2.7 Board --------------------------------
  28. #define ENDER3_V427_BOARD
  29. //#define ENDER3_MAX_V427_BOARD
  30. //#define ENDER3_V2_V427_BOARD
  31. //#define ENDER5_V427_BOARD
  32.  
  33. //#define CR10_V427_BOARD
  34. //#define CR10MINI_V427_BOARD
  35. //#define CR10S4_V427_BOARD
  36. //#define CR10S5_V427_BOARD
  37. // NOTE: It is HIGHLY recommended to use an external bed MOSFET with the CR-10 series machines due to the high load the beds have.
  38. // While these boards work on 12V machines, they are designed for 24V printers that pull less current (specifically on the bed).
  39. // If you need a MOSFET, we carry one here: https://www.th3dstudio.com/product/high-amp-12v-24v-mosfet-heated-bed-or-hotend/
  40.  
  41. //------------------------------ V4.3.1 Board -------------------------------
  42. //#define ENDER6_V431_BOARD
  43.  
  44. // If you are using our EZOut V1/V2 (connected to LCD header) filament sensor kit please follow the install guide
  45. // and then uncomment the #define EZOUT_ENABLE line below.
  46. // Do NOT ever connect our filament sensor without the supplied adapter board.
  47. // Ender 3 V2 needs LCD converted to use an EZOut: https://support.th3dstudio.com/hc/guides/upgrades-printer-information/ender-3-v2-swapping-to-the-12864-creality-lcd-for-more-features/
  48. //#define EZOUT_ENABLE
  49.  
  50. // Creality CR-10S Series Filament Sensor
  51. // Connect the stock sensor to the "J1" port and uncomment the below line to enable the filament sensor.
  52. //#define CR10S_STOCKFILAMENTSENSOR
  53.  
  54. // EZABL Probe Mounts
  55. //#define CR10_OEM
  56. //#define ENDER3_OEM
  57. //#define ENDER3_V2_OEM
  58. //#define ENDER3_MAX_OEM
  59. //#define ENDER5_OEM
  60. //#define ENDER6_OEM
  61. #define CUSTOM_PROBE
  62.  
  63. // Ender 3 Specific Options
  64.  
  65. // Ender Xtender Kit Options
  66. //#define ENDER_XTENDER_300
  67. //#define ENDER_XTENDER_400
  68. //#define ENDER_XTENDER_400XL
  69. //#define ENDER_XTENDER_XL
  70.  
  71. // Ender 5 - Leadscrew Setting
  72. // If you have the new Ender 5/5 Pro Model that has the new 800steps/mm Z leadscrew uncomment the below option to set the correct steps/mm
  73. //#define ENDER5_NEW_LEADSCREW
  74.  
  75. //===========================================================================
  76. // *************************  END PRINTER SECTION   *************************
  77. //===========================================================================
  78.  
  79. //===========================================================================
  80. // EZABL Advanced Settings - EZABL_POINTS & EZABL_PROBE_EDGE are also used for other probes
  81. //===========================================================================
  82.  
  83. // Probing Grid Points - If you want more or less EZABL probe points change the number below, use odd numbers. Total points is # times #.
  84. #define EZABL_POINTS 3
  85.  
  86. // Probe Edge - How far from the edge of the bed to probe from. Use 50 if using binder clips. This also sets the edge inset value for MANUAL_MESH_LEVELING.
  87. #define EZABL_PROBE_EDGE 35
  88.  
  89. // Fast Probing - Works with most machines and all EZABL sensors (8mm/s)
  90. #define EZABL_FASTPROBE
  91.  
  92. // Superfast Probing - Only works with the EZABL Pro Sensors (15mm/s)
  93. //#define EZABL_SUPERFASTPROBE
  94.  
  95. // Heaters on During Probing - Heaters will stay on during probing - May reduce accuracy do not use unless told to by support
  96. //#define HEATERS_ON_DURING_PROBING
  97.  
  98. // Probing Steppers Off - This will cycle the XYE stepper motors during probing to reduce interference from them. When using this do NOT touch the X or Y during probing as they will not be locked.
  99. //#define PROBING_STEPPERS_OFF
  100.  
  101. // Slow Down Moves - Does your machine make weird noises/vibrations when it is probing the mesh? Enable this to slow down the speed between probe points.
  102. //#define SLOWER_PROBE_MOVES
  103.  
  104. // Grid Extrapolation - This will use the mesh data to make assumptions of the bed outside the probe area. Disable if you are getting incorrect results on the edges of the bed.
  105. #define EXTRAPOLATE_BEYOND_GRID
  106.  
  107. //================================================================================
  108. // CUSTOM PROBE SETTINGS - FOR EZABL OR BL TOUCH
  109. // If you have a probe mount that is not pre-setup in the firmware then uncomment
  110. // the CUSTOM_PROBE line above and enter your probe offsets below
  111. //================================================================================
  112. #if ENABLED(CUSTOM_PROBE)
  113.   /**
  114.   * Z Probe to nozzle (X,Y) offset, relative to (0, 0).
  115.   *
  116.   * In the following example the X and Y offsets are both positive:
  117.   *
  118.   *   #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 }
  119.   *
  120.   *     +-- BACK ---+
  121.   *     |           |
  122.   *   L |    (+) P  | R <-- probe (10,10)
  123.   *   E |           | I
  124.   *   F | (-) N (+) | G <-- nozzle (0,0)
  125.   *   T |           | H
  126.   *     |    (-)    | T
  127.   *     |           |
  128.   *     O-- FRONT --+
  129.   *   (0,0)
  130.   *
  131.   * Specify a Probe position as { X, Y, Z }
  132.   * Do NOT enter an number for the Z position in here. Store your offset in EEPROM.
  133.   *
  134.   * When is the offset POSITIVE?
  135.   * If the probe is right of the nozzle the offset on X is POSITIVE
  136.   * If the probe is behind of the nozzle the offset on Y is POSITIVE
  137.   *
  138.   * When is the offset NEGATIVE?
  139.   * If the probe is left of the nozzle the offset on X is NEGATIVE
  140.   * If the probe is in front of the nozzle the offset on Y is NEGATIVE
  141.   */
  142.   #define NOZZLE_TO_PROBE_OFFSET {-42.5, -5, 0}
  143. #endif
  144.  
  145.  
  146. //===========================================================================
  147. //******************** EXTRA FEATURES AND TWEAKS ****************************
  148. //===========================================================================
  149.  
  150. // EXTRUDER SETTINGS -------------------------------
  151. // Use to set custom esteps and/or reverse your E Motor direction if you are installing an extruder that needs the direction reversed.
  152. // If you reversed the wiring on your E motor already (like the Bondtech Guide says to do) then you do not need to reverse it in the firmware here.
  153.  
  154. // If you want to change the Esteps for your printer you can uncomment the below line and set CUSTOM_ESTEPS_VALUE to what you want - USE WHOLE NUMBERS ONLY
  155. // This option sets the esteps from the CUSTOM_ESTEPS_VALUE line below.
  156. // If you need to reverse the e motor direction also enabled the REVERSE_E_MOTOR_DIRECTION option.
  157. // Example EStep Values: TH3D Aluminum Extruder - 95 ESteps, TH3D Tough Extruder - 410 ESteps, BMG Extruder - 415 ESteps
  158. // When installing a Tough Extruder or E3D Titan or Bondtech that is Geared you likely need to enable the REVERSE_E_MOTOR_DIRECTION option
  159. //#define CUSTOM_ESTEPS
  160. #define CUSTOM_ESTEPS_VALUE 410
  161. //#define REVERSE_E_MOTOR_DIRECTION
  162.  
  163. // FILAMENT SENSOR UNLOAD SETTINGS -----------------
  164. // If you have a filament sensor that is physically mounted to the machine you can enable MOUNTED_FILAMENT_SENSOR to set the unload length to 0 to prevent filament from backing up in the sensor by uncommenting MOUNTED_FILAMENT_SENSOR
  165. //#define MOUNTED_FILAMENT_SENSOR
  166.  
  167. // If you have a direct drive machine with a filament sensor uncomment DIRECT_DRIVE_PRINTER to decrease the unload length from 100mm to 20mm
  168. //#define DIRECT_DRIVE_PRINTER
  169.  
  170. // THERMISTOR SETTINGS -----------------------------
  171.  
  172. // If you are using an E3D V6 Hotend (or Hemera) with their cartridge thermistor (not glass version) uncomment the below line.
  173. //#define V6_HOTEND
  174.  
  175. // If you are using a Tough Hotend from TH3D or any thermistors TH3D sells for your hotend uncomment the below line.
  176. //#define TH3D_HOTEND_THERMISTOR
  177.  
  178. // If you are using a known hotend thermistor value uncomment the below 2 lines and enter the thermistor number replacing the X after the #define KNOWN_HOTEND_THERMISTOR_VALUE
  179. //#define KNOWN_HOTEND_THERMISTOR
  180. //#define KNOWN_HOTEND_THERMISTOR_VALUE X
  181.  
  182. // If you have a hotend and thermistor capable of over 290C you can set the max temp value below.
  183. // Setting this higher than 290C on a stock or traditional thermistor will damage it. Refer to your thermistor documentation to see what max temp is.
  184. //#define HIGH_TEMP_THERMISTOR
  185. #define HIGH_TEMP_THERMISTOR_TEMP 350
  186.  
  187. // BED THERMISTOR SETTINGS -------------------------
  188.  
  189. // If you are using a thermistor TH3D sells for your bed uncomment the below line.
  190. //#define TH3D_BED_THERMISTOR
  191.  
  192. // If you are using a Keenovo with SSR and the Keenovo temperature sensor uncomment the below line.
  193. //#define KEENOVO_TEMPSENSOR
  194.  
  195. // If you are using a known bed thermistor value uncomment the below 2 lines and enter the thermistor number replacing the X after the #define KNOWN_BED_THERMISTOR_VALUE
  196. //#define KNOWN_BED_THERMISTOR
  197. //#define KNOWN_BED_THERMISTOR_VALUE X
  198.  
  199. // If you are using an AC bed with a standalone controller (Keenovo) uncomment the below line to disable the heated bed in the firmware
  200. //#define AC_BED
  201.  
  202. // MISC --------------------------------------------
  203.  
  204. // LCD Knob Direction
  205. // Turning your LCD knob clockwise should move DOWN in the menus/make values increase and counter-clockwise should move UP in the menus/make values decrease
  206. // If yours is behaving opposite then enable the REVERSE_KNOB_DIRECTION option below
  207. //#define REVERSE_KNOB_DIRECTION
  208.  
  209. // If you have a 5015 fan that whines when under 100% speed uncomment the below line.
  210. //#define FAN_FIX
  211.  
  212. // Use your own printer name - Uncomment both lines
  213. //#define CUSTOM_PRINTER_NAME
  214. //#define USER_PRINTER_NAME "CHANGE ME"
  215.  
  216. // If your printer is homing to the endstops hard uncomment this to change the homing speed/divisor to make it less aggressive.
  217. //#define SLOWER_HOMING
  218.  
  219. //===========================================================================
  220. //****************** COMMUNITY REQUESTED FEATURES ***************************
  221. //===========================================================================
  222.  
  223. // HOME OFFSET ADJUSTMENT --------------------------
  224. // If you need to adjust your XY home offsets from defaults then you can uncomment the HOME_ADJUST line below and enter your
  225. // custom XY offsets. This is provided for convenience and is unsupported with included product support.
  226. // How to use - measure (home XY then jog using the LCD 1mm at a time) the X and Y distance the nozzle is off
  227. // the build plate and then put those as NEGATIVE values below, positive values will NOT work (move your endstops to fix a positve offset).
  228. //#define HOME_ADJUST
  229. #define X_HOME_LOCATION -10
  230. #define Y_HOME_LOCATION -10
  231.  
  232. // PID BED TEMPERATURE CONTROL ---------------------
  233. // If you want PID Bed Temperature control enable the below line. You will need to tune it for your machine.
  234. // See the PID Bed setup guide here: https://support.th3dstudio.com/hc/guides/diy-guides/p-i-d-bed-calibration-guide/
  235. //#define ENABLE_PIDBED
  236.  
  237. // Z PROBE OFFSET WIZARD ---------------------------
  238. // Marlin has a Z Probe Offset Wizard now. If you want to enable this, uncomment the below line.
  239. //#define PROBE_OFFSET_WIZARD
  240.  
  241. // FINE BABYSTEPPING -------------------------------
  242. // Enabling the below line will set the babystep resolution from 0.025mm to 0.010mm for finer control.
  243. //#define FINE_BABYSTEPPING
  244.  
  245. // LINEAR ADVANCE ----------------------------------
  246. // See here on how to use Linear Advance: http://marlinfw.org/docs/features/lin_advance.html
  247. //#define LINEAR_ADVANCE
  248. // Change the K Value here or use M900 KX.XX in your starting code (recommended).
  249. #define LINEAR_ADVANCE_K 0
  250.  
  251. // BL TOUCH ----------------------------------------
  252. // There are 2 ways to connect the BL Touch to the V4.2.X boards - All on the 5 pin header or using 3 pins on the 5 pin header + Z Endstop port
  253. // For details on these 2 types of connections refer to our help center article here: https://support.th3dstudio.com/hc/product-information/3rd-party-control-boards/creality-boards/creality-v4-2-2-v4-2-7-board-bl-touch-wiring-options/
  254. // If you want to use the BL-Touch uncomment the BLTOUCH line below and uncomment #define CUSTOM_PROBE above and then enter in your offsets above in the CUSTOM PROBE section.
  255. #define BLTOUCH
  256. // If you are using the 5 pin header for all the BL Touch connections, uncomment the below line
  257. #define CREALITY_V42X_BLTOUCH_ON_5PIN
  258.  
  259. // MANUAL MESH LEVELING ----------------------------
  260. // If you want to use manual mesh leveling you can enable the below option. This is for generating a MANUAL mesh WITHOUT a probe.
  261. // Mesh Bed Leveling Documentation: http://marlinfw.org/docs/gcode/G029-mbl.html
  262. // NOTE: If you want to automate the leveling process our EZABL kits do this for you. Check them out here: http://EZABL.TH3DStudio.com
  263. //#define MANUAL_MESH_LEVELING
  264.  
  265. // POWER LOSS RECOVERY -----------------------------
  266. // Continue after Power-Loss feature will store the current state to the SD Card at the start of each layer
  267. // during SD printing. If this is found at bootup it will ask you if you want to resume the print.
  268. //
  269. // NOTE: This feature causes excessive wear on your SD card.
  270. //#define POWER_LOSS_RECOVERY
  271.  
  272. // ARC Support Override ----------------------------
  273. // Arc support is enabled by default on all builds but this takes up extra space. If you get compile errors due to the size being too large when enabling other options, then disable ARC_SUPPORT
  274. // by uncommenting the DISABLE_ARC_SUPPORT line below.
  275. //#define DISABLE_ARC_SUPPORT
  276.  
  277. //===========================================================================
  278. // **********************  END CONFIGURATION SETTINGS   *********************
  279. //===========================================================================
  280.  
  281. /**
  282.  * ****************************DO NOT TOUCH ANYTHING BELOW THIS COMMENT**************************
  283.  * Core machine settings are below. Do NOT modify these unless you understand what you are doing.
  284.  */
  285.  
  286. /**
  287.  * Machine Configuration Settings
  288.  */
  289.  
  290. //CR-10 Series V427 Settings
  291. #if ENABLED(CR10_V427_BOARD) || ENABLED(CR10MINI_V427_BOARD) || ENABLED(CR10S4_V427_BOARD) || ENABLED(CR10S5_V427_BOARD)
  292.   //V42X with TMC Driver Sanity Checks
  293.   #if ENABLED(LINEAR_ADVANCE)
  294.     #error "Linear Advance does NOT work on the V4.2.7 boards with the TMC drivers due to how Creality has them setup. Disable Linear Advance to continue."
  295.   #endif
  296.  
  297.   #define SERIAL_PORT 1
  298.  
  299.   #define BAUDRATE 115200
  300.  
  301.   #define CR10_STOCKDISPLAY
  302.   #define RET6_12864_LCD
  303.  
  304.   #if ENABLED(REVERSE_KNOB_DIRECTION)
  305.     #define REVERSE_ENCODER_DIRECTION
  306.   #endif
  307.  
  308.   #define MOTHERBOARD BOARD_CREALITY_V427
  309.  
  310.   #if ENABLED(CUSTOM_ESTEPS)
  311.     #define DEFAULT_AXIS_STEPS_PER_UNIT   { 80, 80, 400, CUSTOM_ESTEPS_VALUE }
  312.   #else
  313.     #define DEFAULT_AXIS_STEPS_PER_UNIT   { 80, 80, 400, 95 }
  314.   #endif
  315.  
  316.   #define DEFAULT_MAX_FEEDRATE          { 200, 200, 15, 50 }
  317.   #define DEFAULT_MAX_ACCELERATION      { 1000, 1000, 500, 5000 }
  318.  
  319.   #define DEFAULT_ACCELERATION          500
  320.   #define DEFAULT_RETRACT_ACCELERATION  500
  321.   #define DEFAULT_TRAVEL_ACCELERATION   1000
  322.  
  323.   #define CLASSIC_JERK
  324.   #if ENABLED(CLASSIC_JERK)
  325.     #if ENABLED(CR10S4_V427_BOARD) || ENABLED(CR10S5_V427_BOARD)
  326.       #define DEFAULT_XJERK                 5.0
  327.       #define DEFAULT_YJERK                 5.0
  328.     #else
  329.       #define DEFAULT_XJERK                 7.0
  330.       #define DEFAULT_YJERK                 7.0
  331.     #endif
  332.     #define DEFAULT_ZJERK  0.3
  333.   #endif
  334.  
  335.   #define DEFAULT_EJERK    5.0
  336.  
  337.   #define SHOW_BOOTSCREEN
  338.  
  339.   #define EXTRUDERS 1
  340.  
  341.   #if ENABLED(CR10_V427_BOARD)
  342.     #define X_BED_SIZE 300
  343.     #define Y_BED_SIZE 300
  344.     #define Z_MAX_POS 400
  345.     #define PRINTER_VOLTAGE_12
  346.   #endif
  347.  
  348.   #if ENABLED(CR10MINI_V427_BOARD)
  349.     #define X_BED_SIZE 300
  350.     #define Y_BED_SIZE 220
  351.     #define Z_MAX_POS 300
  352.     #define PRINTER_VOLTAGE_12
  353.   #endif
  354.  
  355.   #if ENABLED(CR10S4_V427_BOARD)
  356.     #define X_BED_SIZE 400
  357.     #define Y_BED_SIZE 400
  358.     #define Z_MAX_POS 400
  359.     #define PRINTER_VOLTAGE_12
  360.     #define SLOWER_PROBE_MOVES
  361.   #endif
  362.  
  363.   #if ENABLED(CR10S5_V427_BOARD)
  364.     #define X_BED_SIZE 500
  365.     #define Y_BED_SIZE 500
  366.     #define Z_MAX_POS 500
  367.     #define PRINTER_VOLTAGE_12
  368.     #define SLOWER_PROBE_MOVES
  369.   #endif
  370.  
  371.   #if ENABLED(HOME_ADJUST)
  372.     #define X_MIN_POS X_HOME_LOCATION
  373.     #define Y_MIN_POS Y_HOME_LOCATION
  374.   #else
  375.     #define X_MIN_POS 0
  376.     #define Y_MIN_POS 0
  377.   #endif
  378.  
  379.   #define USE_XMIN_PLUG
  380.   #define USE_YMIN_PLUG
  381.   #define USE_ZMIN_PLUG
  382.  
  383.   #define X_HOME_DIR -1
  384.   #define Y_HOME_DIR -1
  385.   #define Z_HOME_DIR -1
  386.  
  387.   #if NONE(V6_HOTEND, TH3D_HOTEND_THERMISTOR, KNOWN_HOTEND_THERMISTOR)
  388.     #define TEMP_SENSOR_0 1
  389.   #else
  390.     #if ENABLED(EZBOARD_PT100)
  391.       #define TEMP_SENSOR_0 20
  392.     #elif ENABLED(V6_HOTEND)
  393.       #define TEMP_SENSOR_0 5
  394.     #elif ENABLED(KNOWN_HOTEND_THERMISTOR)
  395.       #define TEMP_SENSOR_0 KNOWN_HOTEND_THERMISTOR_VALUE
  396.     #elif ENABLED(TH3D_HOTEND_THERMISTOR)
  397.       #define TEMP_SENSOR_0 1
  398.     #endif
  399.   #endif
  400.  
  401.   #define TEMP_SENSOR_1 0
  402.   #define TEMP_SENSOR_2 0
  403.   #define TEMP_SENSOR_3 0
  404.   #define TEMP_SENSOR_4 0
  405.   #define TEMP_SENSOR_5 0
  406.   #define TEMP_SENSOR_6 0
  407.   #define TEMP_SENSOR_7 0
  408.  
  409.   #if NONE(TH3D_BED_THERMISTOR, KEENOVO_TEMPSENSOR, KNOWN_BED_THERMISTOR, AC_BED)
  410.     #define TEMP_SENSOR_BED 1
  411.   #else
  412.     #if ENABLED(AC_BED)
  413.       #define TEMP_SENSOR_BED 0
  414.     #elif ENABLED(KNOWN_BED_THERMISTOR)
  415.       #define TEMP_SENSOR_BED KNOWN_BED_THERMISTOR_VALUE
  416.     #elif ENABLED(TH3D_BED_THERMISTOR)
  417.       #define TEMP_SENSOR_BED 1
  418.     #elif ENABLED(KEENOVO_TEMPSENSOR)
  419.       #define TEMP_SENSOR_BED 11
  420.     #endif
  421.   #endif
  422.  
  423.   #define TEMP_SENSOR_PROBE 0
  424.   #define TEMP_SENSOR_CHAMBER 0
  425.  
  426.   #define ENDSTOPPULLUPS
  427.  
  428.   #define X_MIN_ENDSTOP_INVERTING false
  429.   #define Y_MIN_ENDSTOP_INVERTING false
  430.   #define Z_MIN_ENDSTOP_INVERTING false
  431.   #define X_MAX_ENDSTOP_INVERTING false
  432.   #define Y_MAX_ENDSTOP_INVERTING false
  433.   #define Z_MAX_ENDSTOP_INVERTING false
  434.   #define Z_MIN_PROBE_ENDSTOP_INVERTING false
  435.  
  436.   #if ENABLED(CREALITY_V42X_BLTOUCH_ON_5PIN)
  437.     #define USE_PROBE_FOR_Z_HOMING
  438.   #else
  439.     #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
  440.   #endif
  441.  
  442.   #define X_DRIVER_TYPE TMC2208_STANDALONE
  443.   #define Y_DRIVER_TYPE TMC2208_STANDALONE
  444.   #define Z_DRIVER_TYPE TMC2208_STANDALONE
  445.   #define E0_DRIVER_TYPE TMC2208_STANDALONE
  446.  
  447.   #define ENDSTOP_INTERRUPTS_FEATURE
  448.  
  449.   #define X_ENABLE_ON 0
  450.   #define Y_ENABLE_ON 0
  451.   #define Z_ENABLE_ON 0
  452.   #define E_ENABLE_ON 0
  453.  
  454.   #define INVERT_X_DIR false
  455.   #define INVERT_Y_DIR false
  456.   #define INVERT_Z_DIR true
  457.  
  458.   #if ENABLED(REVERSE_E_MOTOR_DIRECTION)
  459.     #define INVERT_E0_DIR true
  460.   #else
  461.     #define INVERT_E0_DIR false
  462.   #endif
  463.  
  464.   #define INVERT_E1_DIR false
  465.   #define INVERT_E2_DIR false
  466.   #define INVERT_E3_DIR false
  467.   #define INVERT_E4_DIR false
  468.   #define INVERT_E5_DIR false
  469.   #define INVERT_E6_DIR false
  470.   #define INVERT_E7_DIR false
  471.  
  472.   #define ENCODER_PULSES_PER_STEP 4
  473.   #define ENCODER_STEPS_PER_MENU_ITEM 1
  474.  
  475.   #if ENABLED(EZOUT_ENABLE)
  476.     #define FILAMENT_RUNOUT_SENSOR
  477.     #define SPEAKER_KILL
  478.   #endif
  479.  
  480.   #if ENABLED(EZOUT_ENABLE) || ENABLED(CR10S_STOCKFILAMENTSENSOR)
  481.     #define FILAMENT_RUNOUT_SENSOR
  482.   #endif
  483.  
  484.   #if ENABLED(FILAMENT_RUNOUT_SENSOR)
  485.     #define FIL_RUNOUT_ENABLED_DEFAULT true // Enable the sensor on startup. Override with M412 followed by M500.
  486.     #define NUM_RUNOUT_SENSORS   1          // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each.
  487.     #if ENABLED(EZOUT_ENABLE)
  488.       #define FIL_RUNOUT_STATE     LOW       // Pin state indicating that filament is NOT present.
  489.     #else
  490.       #define FIL_RUNOUT_STATE     HIGH       // Pin state indicating that filament is NOT present.
  491.     #endif
  492.     #define FIL_RUNOUT_PULLUP               // Use internal pullup for filament runout pins.
  493.     //#define FIL_RUNOUT_PULLDOWN           // Use internal pulldown for filament runout pins.
  494.  
  495.     // Set one or more commands to execute on filament runout.
  496.     // (After 'M412 H' Marlin will ask the host to handle the process.)
  497.     #define FILAMENT_RUNOUT_SCRIPT "M600"
  498.  
  499.     // After a runout is detected, continue printing this length of filament
  500.     // before executing the runout script. Useful for a sensor at the end of
  501.     // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead.
  502.     //#define FILAMENT_RUNOUT_DISTANCE_MM 25
  503.  
  504.     #ifdef FILAMENT_RUNOUT_DISTANCE_MM
  505.       // Enable this option to use an encoder disc that toggles the runout pin
  506.       // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM
  507.       // large enough to avoid false positives.)
  508.       //#define FILAMENT_MOTION_SENSOR
  509.     #endif
  510.   #endif
  511. #endif
  512. // End CR-10 Series V427 Settings
  513.  
  514. //Ender 6 V431 Board Settings
  515. #if ENABLED(ENDER6_V431_BOARD)
  516.   //V431 with TMC Driver Sanity Checks
  517.   #if ENABLED(LINEAR_ADVANCE)
  518.     #error "Linear Advance does NOT work on the V4.3.1 boards with the TMC drivers due to how Creality has them setup. Disable Linear Advance to continue."
  519.   #endif
  520.  
  521.   #define SERIAL_PORT 1
  522.  
  523.   #define BAUDRATE 115200
  524.  
  525.   #define CR10_STOCKDISPLAY
  526.   #define RET6_12864_LCD
  527.  
  528.   #if ENABLED(REVERSE_KNOB_DIRECTION)
  529.     #define REVERSE_ENCODER_DIRECTION
  530.   #endif
  531.  
  532.   #ifndef MOTHERBOARD
  533.     #define MOTHERBOARD BOARD_CREALITY_V431
  534.   #endif
  535.  
  536.   #if ENABLED(CUSTOM_ESTEPS)
  537.     #define DEFAULT_AXIS_STEPS_PER_UNIT   { 80, 80, 400, CUSTOM_ESTEPS_VALUE }
  538.   #else
  539.     #define DEFAULT_AXIS_STEPS_PER_UNIT   { 80, 80, 400, 140 }
  540.   #endif
  541.  
  542.   #define DEFAULT_MAX_FEEDRATE          { 200, 200, 15, 50 }
  543.   #define DEFAULT_MAX_ACCELERATION      { 3000, 3000, 500, 5000 }
  544.  
  545.   #define DEFAULT_ACCELERATION          1500
  546.   #define DEFAULT_RETRACT_ACCELERATION  500
  547.   #define DEFAULT_TRAVEL_ACCELERATION   1500
  548.  
  549.   #define CLASSIC_JERK
  550.   #if ENABLED(CLASSIC_JERK)
  551.     #define DEFAULT_XJERK  10.0
  552.     #define DEFAULT_YJERK  10.0
  553.     #define DEFAULT_ZJERK  0.3
  554.   #endif
  555.  
  556.   #define DEFAULT_EJERK    5.0
  557.  
  558.   #define SHOW_BOOTSCREEN
  559.  
  560.   #define EXTRUDERS 1
  561.  
  562.   #define X_BED_SIZE 250
  563.   #define Y_BED_SIZE 250
  564.   #define Z_MAX_POS 400
  565.  
  566.   #if ENABLED(HOME_ADJUST)
  567.     #define X_MIN_POS X_HOME_LOCATION
  568.     #define Y_MIN_POS Y_HOME_LOCATION
  569.   #else
  570.     #define X_MIN_POS 0
  571.     #define Y_MIN_POS 0
  572.   #endif
  573.  
  574.   #define USE_XMAX_PLUG
  575.   #define USE_YMAX_PLUG
  576.   #define USE_ZMIN_PLUG
  577.  
  578.   #define X_HOME_DIR 1
  579.   #define Y_HOME_DIR 1
  580.   #define Z_HOME_DIR -1
  581.  
  582.   #if NONE(V6_HOTEND, TH3D_HOTEND_THERMISTOR, KNOWN_HOTEND_THERMISTOR)
  583.     #define TEMP_SENSOR_0 1
  584.   #else
  585.     #if ENABLED(EZBOARD_PT100)
  586.       #define TEMP_SENSOR_0 20
  587.     #elif ENABLED(V6_HOTEND)
  588.       #define TEMP_SENSOR_0 5
  589.     #elif ENABLED(KNOWN_HOTEND_THERMISTOR)
  590.       #define TEMP_SENSOR_0 KNOWN_HOTEND_THERMISTOR_VALUE
  591.     #elif ENABLED(TH3D_HOTEND_THERMISTOR)
  592.       #define TEMP_SENSOR_0 1
  593.     #endif
  594.   #endif
  595.  
  596.   #define TEMP_SENSOR_1 0
  597.   #define TEMP_SENSOR_2 0
  598.   #define TEMP_SENSOR_3 0
  599.   #define TEMP_SENSOR_4 0
  600.   #define TEMP_SENSOR_5 0
  601.   #define TEMP_SENSOR_6 0
  602.   #define TEMP_SENSOR_7 0
  603.  
  604.   #if NONE(TH3D_BED_THERMISTOR, KEENOVO_TEMPSENSOR, KNOWN_BED_THERMISTOR, AC_BED)
  605.     #define TEMP_SENSOR_BED 1
  606.   #else
  607.     #if ENABLED(AC_BED)
  608.       #define TEMP_SENSOR_BED 0
  609.     #elif ENABLED(KNOWN_BED_THERMISTOR)
  610.       #define TEMP_SENSOR_BED KNOWN_BED_THERMISTOR_VALUE
  611.     #elif ENABLED(TH3D_BED_THERMISTOR)
  612.       #define TEMP_SENSOR_BED 1
  613.     #elif ENABLED(KEENOVO_TEMPSENSOR)
  614.       #define TEMP_SENSOR_BED 11
  615.     #endif
  616.   #endif
  617.  
  618.   #define TEMP_SENSOR_PROBE 0
  619.   #define TEMP_SENSOR_CHAMBER 0
  620.  
  621.   #define DEFAULT_Kp 28.72
  622.   #define DEFAULT_Ki 2.62
  623.   #define DEFAULT_Kd 78.81
  624.  
  625.   #define DEFAULT_bedKp 462.10
  626.   #define DEFAULT_bedKi 85.47
  627.   #define DEFAULT_bedKd 624.59
  628.  
  629.   #define ENDSTOPPULLUPS
  630.  
  631.   #define X_MIN_ENDSTOP_INVERTING false
  632.   #define Y_MIN_ENDSTOP_INVERTING false
  633.   #define Z_MIN_ENDSTOP_INVERTING false
  634.   #define X_MAX_ENDSTOP_INVERTING false
  635.   #define Y_MAX_ENDSTOP_INVERTING false
  636.   #define Z_MAX_ENDSTOP_INVERTING false
  637.   #define Z_MIN_PROBE_ENDSTOP_INVERTING false
  638.  
  639.   #if ENABLED(BLTOUCH)
  640.     #define USE_PROBE_FOR_Z_HOMING
  641.   #else
  642.     #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
  643.   #endif
  644.  
  645.   #define X_DRIVER_TYPE TMC2208_STANDALONE
  646.   #define Y_DRIVER_TYPE TMC2208_STANDALONE
  647.   #define Z_DRIVER_TYPE TMC2208_STANDALONE
  648.   #define E0_DRIVER_TYPE TMC2208_STANDALONE
  649.  
  650.   #define ENDSTOP_INTERRUPTS_FEATURE
  651.  
  652.   #define X_ENABLE_ON 0
  653.   #define Y_ENABLE_ON 0
  654.   #define Z_ENABLE_ON 0
  655.   #define E_ENABLE_ON 0
  656.  
  657.   #define COREYX
  658.  
  659.   #define INVERT_X_DIR false
  660.   #define INVERT_Y_DIR false
  661.   #define INVERT_Z_DIR false
  662.  
  663.   #if ENABLED(REVERSE_E_MOTOR_DIRECTION)
  664.     #define INVERT_E0_DIR false
  665.   #else
  666.     #define INVERT_E0_DIR true
  667.   #endif
  668.  
  669.   #define INVERT_E1_DIR false
  670.   #define INVERT_E2_DIR false
  671.   #define INVERT_E3_DIR false
  672.   #define INVERT_E4_DIR false
  673.   #define INVERT_E5_DIR false
  674.   #define INVERT_E6_DIR false
  675.   #define INVERT_E7_DIR false
  676.  
  677.   #define ENCODER_PULSES_PER_STEP 4
  678.   #define ENCODER_STEPS_PER_MENU_ITEM 1
  679.  
  680.   #define FILAMENT_RUNOUT_SENSOR
  681.  
  682.   #if ENABLED(FILAMENT_RUNOUT_SENSOR)
  683.     #define FIL_RUNOUT_ENABLED_DEFAULT true // Enable the sensor on startup. Override with M412 followed by M500.
  684.     #define NUM_RUNOUT_SENSORS   1          // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each.
  685.     #define FIL_RUNOUT_STATE     LOW       // Pin state indicating that filament is NOT present.
  686.     #define FIL_RUNOUT_PULLUP               // Use internal pullup for filament runout pins.
  687.     //#define FIL_RUNOUT_PULLDOWN           // Use internal pulldown for filament runout pins.
  688.  
  689.     // Set one or more commands to execute on filament runout.
  690.     // (After 'M412 H' Marlin will ask the host to handle the process.)
  691.     #define FILAMENT_RUNOUT_SCRIPT "M600"
  692.  
  693.     // After a runout is detected, continue printing this length of filament
  694.     // before executing the runout script. Useful for a sensor at the end of
  695.     // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead.
  696.     //#define FILAMENT_RUNOUT_DISTANCE_MM 25
  697.  
  698.     #ifdef FILAMENT_RUNOUT_DISTANCE_MM
  699.       // Enable this option to use an encoder disc that toggles the runout pin
  700.       // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM
  701.       // large enough to avoid false positives.)
  702.       //#define FILAMENT_MOTION_SENSOR
  703.     #endif
  704.   #endif
  705.  
  706. #endif
  707. // End Ender 6 Settings
  708.  
  709. //Ender 3/3 MAX/5 V42X Board Settings
  710. #if ENABLED(ENDER3_V422_BOARD) || ENABLED(ENDER5_V422_BOARD) || ENABLED(ENDER3_V427_BOARD) || ENABLED(ENDER5_V427_BOARD) || ENABLED(ENDER3_MAX_V422_BOARD) || ENABLED(ENDER3_MAX_V427_BOARD)
  711.   //V42X with TMC Driver Sanity Checks
  712.   #if (ENABLED(V422_TMC220X_DRIVERS) || ENABLED(ENDER3_V427_BOARD) || ENABLED(ENDER5_V427_BOARD) || ENABLED(ENDER3_MAX_V427_BOARD)) && ENABLED(LINEAR_ADVANCE)
  713.     #error "Linear Advance does NOT work on the V4.2.X boards with the TMC drivers due to how Creality has them setup. Disable Linear Advance to continue."
  714.   #endif
  715.  
  716.   #define SERIAL_PORT 1
  717.  
  718.   #define BAUDRATE 115200
  719.  
  720.   #define CR10_STOCKDISPLAY
  721.   #define RET6_12864_LCD
  722.  
  723.   #if ENABLED(REVERSE_KNOB_DIRECTION)
  724.     #define REVERSE_ENCODER_DIRECTION
  725.   #endif
  726.  
  727.   #if ENABLED(ENDER3_V422_BOARD) || ENABLED(ENDER5_V422_BOARD) || ENABLED(ENDER3_MAX_V422_BOARD)
  728.     #ifndef MOTHERBOARD
  729.       #define MOTHERBOARD BOARD_CREALITY_V4
  730.     #endif
  731.   #else
  732.     #ifndef MOTHERBOARD
  733.       #define MOTHERBOARD BOARD_CREALITY_V427
  734.     #endif
  735.   #endif
  736.  
  737.   #if ENABLED(ENDER5_NEW_LEADSCREW)
  738.     #define CREALITY_Z_STEPS 800
  739.   #else
  740.     #define CREALITY_Z_STEPS 400
  741.   #endif
  742.  
  743.   #if ENABLED(CUSTOM_ESTEPS)
  744.     #define DEFAULT_AXIS_STEPS_PER_UNIT   { 80, 80, CREALITY_Z_STEPS, CUSTOM_ESTEPS_VALUE }
  745.   #else
  746.     #define DEFAULT_AXIS_STEPS_PER_UNIT   { 80, 80, CREALITY_Z_STEPS, 95 }
  747.   #endif
  748.  
  749.   #define DEFAULT_MAX_FEEDRATE          { 200, 200, 15, 50 }
  750.   #define DEFAULT_MAX_ACCELERATION      { 1000, 1000, 500, 5000 }
  751.  
  752.   #define DEFAULT_ACCELERATION          500
  753.   #define DEFAULT_RETRACT_ACCELERATION  500
  754.   #define DEFAULT_TRAVEL_ACCELERATION   1000
  755.  
  756.   #define CLASSIC_JERK
  757.   #if ENABLED(CLASSIC_JERK)
  758.     #define DEFAULT_XJERK  7.0
  759.     #define DEFAULT_YJERK  7.0
  760.     #define DEFAULT_ZJERK  0.3
  761.   #endif
  762.  
  763.   #define DEFAULT_EJERK    5.0
  764.  
  765.   #define SHOW_BOOTSCREEN
  766.  
  767.   #define EXTRUDERS 1
  768.  
  769.   #if ENABLED(ENDER5_V422_BOARD) || ENABLED(ENDER5_V427_BOARD)
  770.     #define X_BED_SIZE 220
  771.     #define Y_BED_SIZE 220
  772.     #define Z_MAX_POS 300
  773.   #elif ENABLED(ENDER3_MAX_V422_BOARD) || ENABLED(ENDER3_MAX_V427_BOARD)
  774.     #define X_BED_SIZE 300
  775.     #define Y_BED_SIZE 300
  776.     #define Z_MAX_POS 340
  777.   #else
  778.     #if ENABLED(ENDER_XTENDER_400)
  779.       #define X_BED_SIZE 400
  780.       #define Y_BED_SIZE 400
  781.       #define Z_MAX_POS 250
  782.     #elif ENABLED(ENDER_XTENDER_300)
  783.       #define X_BED_SIZE 300
  784.       #define Y_BED_SIZE 300
  785.       #define Z_MAX_POS 250
  786.     #elif ENABLED(ENDER_XTENDER_400XL)
  787.       #define X_BED_SIZE 400
  788.       #define Y_BED_SIZE 400
  789.       #define Z_MAX_POS 500
  790.     #elif ENABLED(ENDER_XTENDER_XL)
  791.       #define X_BED_SIZE 235
  792.       #define Y_BED_SIZE 235
  793.       #define Z_MAX_POS 500
  794.     #else
  795.       #define X_BED_SIZE 235
  796.       #define Y_BED_SIZE 235
  797.       #define Z_MAX_POS 250
  798.     #endif
  799.   #endif
  800.  
  801.   #if ENABLED(HOME_ADJUST)
  802.     #define X_MIN_POS X_HOME_LOCATION
  803.     #define Y_MIN_POS Y_HOME_LOCATION
  804.   #else
  805.     #define X_MIN_POS 0
  806.     #define Y_MIN_POS 0
  807.   #endif
  808.  
  809.   #if ENABLED(ENDER5_V422_BOARD) || ENABLED(ENDER5_V427_BOARD)
  810.     #define USE_XMAX_PLUG
  811.     #define USE_YMAX_PLUG
  812.     #define USE_ZMIN_PLUG
  813.   #else
  814.     #define USE_XMIN_PLUG
  815.     #define USE_YMIN_PLUG
  816.     #define USE_ZMIN_PLUG
  817.   #endif
  818.  
  819.   #if ENABLED(ENDER5_V422_BOARD) || ENABLED(ENDER5_V427_BOARD)
  820.     #define X_HOME_DIR 1
  821.     #define Y_HOME_DIR 1
  822.     #define Z_HOME_DIR -1
  823.   #else
  824.     #define X_HOME_DIR -1
  825.     #define Y_HOME_DIR -1
  826.     #define Z_HOME_DIR -1
  827.   #endif
  828.  
  829.   #if NONE(V6_HOTEND, TH3D_HOTEND_THERMISTOR, KNOWN_HOTEND_THERMISTOR)
  830.     #define TEMP_SENSOR_0 1
  831.   #else
  832.     #if ENABLED(EZBOARD_PT100)
  833.       #define TEMP_SENSOR_0 20
  834.     #elif ENABLED(V6_HOTEND)
  835.       #define TEMP_SENSOR_0 5
  836.     #elif ENABLED(KNOWN_HOTEND_THERMISTOR)
  837.       #define TEMP_SENSOR_0 KNOWN_HOTEND_THERMISTOR_VALUE
  838.     #elif ENABLED(TH3D_HOTEND_THERMISTOR)
  839.       #define TEMP_SENSOR_0 1
  840.     #endif
  841.   #endif
  842.  
  843.   #define TEMP_SENSOR_1 0
  844.   #define TEMP_SENSOR_2 0
  845.   #define TEMP_SENSOR_3 0
  846.   #define TEMP_SENSOR_4 0
  847.   #define TEMP_SENSOR_5 0
  848.   #define TEMP_SENSOR_6 0
  849.   #define TEMP_SENSOR_7 0
  850.  
  851.   #if NONE(TH3D_BED_THERMISTOR, KEENOVO_TEMPSENSOR, KNOWN_BED_THERMISTOR, AC_BED)
  852.     #define TEMP_SENSOR_BED 1
  853.   #else
  854.     #if ENABLED(AC_BED)
  855.       #define TEMP_SENSOR_BED 0
  856.     #elif ENABLED(KNOWN_BED_THERMISTOR)
  857.       #define TEMP_SENSOR_BED KNOWN_BED_THERMISTOR_VALUE
  858.     #elif ENABLED(TH3D_BED_THERMISTOR)
  859.       #define TEMP_SENSOR_BED 1
  860.     #elif ENABLED(KEENOVO_TEMPSENSOR)
  861.       #define TEMP_SENSOR_BED 11
  862.     #endif
  863.   #endif
  864.  
  865.   #define TEMP_SENSOR_PROBE 0
  866.   #define TEMP_SENSOR_CHAMBER 0
  867.  
  868.   #define DEFAULT_Kp 28.72
  869.   #define DEFAULT_Ki 2.62
  870.   #define DEFAULT_Kd 78.81
  871.  
  872.   #define DEFAULT_bedKp 462.10
  873.   #define DEFAULT_bedKi 85.47
  874.   #define DEFAULT_bedKd 624.59
  875.  
  876.   #define ENDSTOPPULLUPS
  877.  
  878.   #define X_MIN_ENDSTOP_INVERTING false
  879.   #define Y_MIN_ENDSTOP_INVERTING false
  880.   #define Z_MIN_ENDSTOP_INVERTING false
  881.   #define X_MAX_ENDSTOP_INVERTING false
  882.   #define Y_MAX_ENDSTOP_INVERTING false
  883.   #define Z_MAX_ENDSTOP_INVERTING false
  884.   #define Z_MIN_PROBE_ENDSTOP_INVERTING false
  885.  
  886.   #if ENABLED(CREALITY_V42X_BLTOUCH_ON_5PIN)
  887.     #define USE_PROBE_FOR_Z_HOMING
  888.   #else
  889.     #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
  890.   #endif
  891.  
  892.   #if ENABLED(ENDER3_V427_BOARD) || ENABLED(ENDER5_V427_BOARD) || ENABLED(V422_TMC220X_DRIVERS) || ENABLED(ENDER3_MAX_V427_BOARD)
  893.     #define X_DRIVER_TYPE TMC2208_STANDALONE
  894.     #define Y_DRIVER_TYPE TMC2208_STANDALONE
  895.     #define Z_DRIVER_TYPE TMC2208_STANDALONE
  896.     #define E0_DRIVER_TYPE TMC2208_STANDALONE
  897.   #elif ENABLED(ENDER3_MAX_V422_BOARD)
  898.     #define X_DRIVER_TYPE TMC2208_STANDALONE
  899.     #define Y_DRIVER_TYPE TMC2208_STANDALONE
  900.     #define Z_DRIVER_TYPE A4988
  901.     #define E0_DRIVER_TYPE A4988  
  902.   #else
  903.     #define X_DRIVER_TYPE A4988
  904.     #define Y_DRIVER_TYPE A4988
  905.     #define Z_DRIVER_TYPE A4988
  906.     #define E0_DRIVER_TYPE A4988
  907.   #endif
  908.  
  909.   #define ENDSTOP_INTERRUPTS_FEATURE
  910.  
  911.   #define X_ENABLE_ON 0
  912.   #define Y_ENABLE_ON 0
  913.   #define Z_ENABLE_ON 0
  914.   #define E_ENABLE_ON 0
  915.  
  916.   #define INVERT_X_DIR false
  917.   #define INVERT_Y_DIR false
  918.  
  919.   #if ENABLED(ENDER5_V422_BOARD) || ENABLED(ENDER5_V427_BOARD)
  920.     #define INVERT_Z_DIR false
  921.   #else  
  922.     #define INVERT_Z_DIR true
  923.   #endif
  924.  
  925.   #if ENABLED(REVERSE_E_MOTOR_DIRECTION)
  926.     #define INVERT_E0_DIR true
  927.   #else
  928.     #define INVERT_E0_DIR false
  929.   #endif
  930.  
  931.   #define INVERT_E1_DIR false
  932.   #define INVERT_E2_DIR false
  933.   #define INVERT_E3_DIR false
  934.   #define INVERT_E4_DIR false
  935.   #define INVERT_E5_DIR false
  936.   #define INVERT_E6_DIR false
  937.   #define INVERT_E7_DIR false
  938.  
  939.   #define ENCODER_PULSES_PER_STEP 4
  940.   #define ENCODER_STEPS_PER_MENU_ITEM 1
  941.  
  942.   #if ENABLED(EZOUT_ENABLE)
  943.     #define FILAMENT_RUNOUT_SENSOR
  944.     #define SPEAKER_KILL
  945.   #endif
  946.  
  947.   #if ENABLED(ENDER3_MAX_V422_BOARD) || ENABLED(ENDER3_MAX_V427_BOARD)
  948.     #define FILAMENT_RUNOUT_SENSOR
  949.   #endif
  950.  
  951.   #if ENABLED(FILAMENT_RUNOUT_SENSOR)
  952.     #define FIL_RUNOUT_ENABLED_DEFAULT true // Enable the sensor on startup. Override with M412 followed by M500.
  953.     #define NUM_RUNOUT_SENSORS   1          // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each.
  954.     #define FIL_RUNOUT_STATE     LOW       // Pin state indicating that filament is NOT present.
  955.     #define FIL_RUNOUT_PULLUP               // Use internal pullup for filament runout pins.
  956.     //#define FIL_RUNOUT_PULLDOWN           // Use internal pulldown for filament runout pins.
  957.  
  958.     // Set one or more commands to execute on filament runout.
  959.     // (After 'M412 H' Marlin will ask the host to handle the process.)
  960.     #define FILAMENT_RUNOUT_SCRIPT "M600"
  961.  
  962.     // After a runout is detected, continue printing this length of filament
  963.     // before executing the runout script. Useful for a sensor at the end of
  964.     // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead.
  965.     //#define FILAMENT_RUNOUT_DISTANCE_MM 25
  966.  
  967.     #ifdef FILAMENT_RUNOUT_DISTANCE_MM
  968.       // Enable this option to use an encoder disc that toggles the runout pin
  969.       // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM
  970.       // large enough to avoid false positives.)
  971.       //#define FILAMENT_MOTION_SENSOR
  972.     #endif
  973.   #endif
  974. #endif
  975. // End Ender 3/3 MAX/5 V42X Board Settings
  976.  
  977. // Ender 3 V2 Settings
  978. #if ENABLED(ENDER3_V2_V422_BOARD) || ENABLED(ENDER3_V2_V427_BOARD)
  979.   #define SERIAL_PORT 1
  980.   #define LCD_SERIAL_PORT 3
  981.  
  982.   #if ENABLED(MANUAL_MESH_LEVELING)
  983.     #error "Due to closed source LCD firmware, Manual Mesh Leveling is not available on the Ender 3 V2."
  984.   #endif
  985.  
  986.   #define BAUDRATE 115200
  987.  
  988.   #if ENABLED(ENDER3_V2_V422_BOARD) || ENABLED(ENDER3_V2_V422_BOARD)
  989.     #ifndef MOTHERBOARD
  990.       #define MOTHERBOARD BOARD_CREALITY_V4
  991.     #endif
  992.   #else
  993.     #ifndef MOTHERBOARD
  994.       #define MOTHERBOARD BOARD_CREALITY_V427
  995.     #endif
  996.   #endif
  997.  
  998.   #if ENABLED(CUSTOM_ESTEPS)
  999.     #define DEFAULT_AXIS_STEPS_PER_UNIT   { 80, 80, 400, CUSTOM_ESTEPS_VALUE }
  1000.   #else
  1001.     #define DEFAULT_AXIS_STEPS_PER_UNIT   { 80, 80, 400, 95 }
  1002.   #endif
  1003.  
  1004.   #define DEFAULT_MAX_FEEDRATE          { 200, 200, 15, 50 }
  1005.   #define DEFAULT_MAX_ACCELERATION      { 1000, 1000, 500, 5000 }
  1006.  
  1007.   #define DEFAULT_ACCELERATION          500
  1008.   #define DEFAULT_RETRACT_ACCELERATION  500
  1009.   #define DEFAULT_TRAVEL_ACCELERATION   1000
  1010.  
  1011.   #define CLASSIC_JERK
  1012.   #if ENABLED(CLASSIC_JERK)
  1013.     #define DEFAULT_XJERK  7.0
  1014.     #define DEFAULT_YJERK  7.0
  1015.     #define DEFAULT_ZJERK  0.3
  1016.   #endif
  1017.  
  1018.   #define DEFAULT_EJERK    5.0
  1019.  
  1020.   #define SHOW_BOOTSCREEN
  1021.  
  1022.   #define EXTRUDERS 1
  1023.  
  1024.   #define X_BED_SIZE 220
  1025.   #define Y_BED_SIZE 220
  1026.   #define Z_MAX_POS 250
  1027.   #define X_MIN_POS 0
  1028.   #define Y_MIN_POS 0
  1029.  
  1030.   #define USE_XMIN_PLUG
  1031.   #define USE_YMIN_PLUG
  1032.   #define USE_ZMIN_PLUG
  1033.  
  1034.   #define X_HOME_DIR -1
  1035.   #define Y_HOME_DIR -1
  1036.   #define Z_HOME_DIR -1
  1037.  
  1038.   #if NONE(V6_HOTEND, TH3D_HOTEND_THERMISTOR, KNOWN_HOTEND_THERMISTOR)
  1039.     #define TEMP_SENSOR_0 1
  1040.   #else
  1041.     #if ENABLED(EZBOARD_PT100)
  1042.       #define TEMP_SENSOR_0 20
  1043.     #elif ENABLED(V6_HOTEND)
  1044.       #define TEMP_SENSOR_0 5
  1045.     #elif ENABLED(KNOWN_HOTEND_THERMISTOR)
  1046.       #define TEMP_SENSOR_0 KNOWN_HOTEND_THERMISTOR_VALUE
  1047.     #elif ENABLED(TH3D_HOTEND_THERMISTOR)
  1048.       #define TEMP_SENSOR_0 1
  1049.     #endif
  1050.   #endif
  1051.  
  1052.   #define TEMP_SENSOR_1 0
  1053.   #define TEMP_SENSOR_2 0
  1054.   #define TEMP_SENSOR_3 0
  1055.   #define TEMP_SENSOR_4 0
  1056.   #define TEMP_SENSOR_5 0
  1057.   #define TEMP_SENSOR_6 0
  1058.   #define TEMP_SENSOR_7 0
  1059.  
  1060.   #if NONE(TH3D_BED_THERMISTOR, KEENOVO_TEMPSENSOR, KNOWN_BED_THERMISTOR, AC_BED)
  1061.     #define TEMP_SENSOR_BED 1
  1062.   #else
  1063.     #if ENABLED(AC_BED)
  1064.       #define TEMP_SENSOR_BED 0
  1065.     #elif ENABLED(KNOWN_BED_THERMISTOR)
  1066.       #define TEMP_SENSOR_BED KNOWN_BED_THERMISTOR_VALUE
  1067.     #elif ENABLED(TH3D_BED_THERMISTOR)
  1068.       #define TEMP_SENSOR_BED 1
  1069.     #elif ENABLED(KEENOVO_TEMPSENSOR)
  1070.       #define TEMP_SENSOR_BED 11
  1071.     #endif
  1072.   #endif
  1073.  
  1074.   #define TEMP_SENSOR_PROBE 0
  1075.   #define TEMP_SENSOR_CHAMBER 0
  1076.  
  1077.   #define DEFAULT_Kp 28.72
  1078.   #define DEFAULT_Ki 2.62
  1079.   #define DEFAULT_Kd 78.81
  1080.  
  1081.   #define DEFAULT_bedKp 462.10
  1082.   #define DEFAULT_bedKi 85.47
  1083.   #define DEFAULT_bedKd 624.59
  1084.  
  1085.   #define ENDSTOPPULLUPS
  1086.  
  1087.   #define X_MIN_ENDSTOP_INVERTING false
  1088.   #define Y_MIN_ENDSTOP_INVERTING false
  1089.   #define Z_MIN_ENDSTOP_INVERTING false
  1090.   #define X_MAX_ENDSTOP_INVERTING false
  1091.   #define Y_MAX_ENDSTOP_INVERTING false
  1092.   #define Z_MAX_ENDSTOP_INVERTING false
  1093.   #define Z_MIN_PROBE_ENDSTOP_INVERTING false
  1094.  
  1095.   #if ENABLED(CREALITY_V42X_BLTOUCH_ON_5PIN)
  1096.     #define USE_PROBE_FOR_Z_HOMING
  1097.   #else
  1098.     #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
  1099.   #endif
  1100.  
  1101.   #define X_DRIVER_TYPE TMC2208_STANDALONE
  1102.   #define Y_DRIVER_TYPE TMC2208_STANDALONE
  1103.   #define Z_DRIVER_TYPE TMC2208_STANDALONE
  1104.   #define E0_DRIVER_TYPE TMC2208_STANDALONE
  1105.  
  1106.   #define ENDSTOP_INTERRUPTS_FEATURE
  1107.  
  1108.   #define X_ENABLE_ON 0
  1109.   #define Y_ENABLE_ON 0
  1110.   #define Z_ENABLE_ON 0
  1111.   #define E_ENABLE_ON 0
  1112.  
  1113.   #define INVERT_X_DIR false
  1114.   #define INVERT_Y_DIR false
  1115.   #define INVERT_Z_DIR true
  1116.  
  1117.   #if ENABLED(REVERSE_E_MOTOR_DIRECTION)
  1118.     #define INVERT_E0_DIR true
  1119.   #else
  1120.     #define INVERT_E0_DIR false
  1121.   #endif
  1122.  
  1123.   #define INVERT_E1_DIR false
  1124.   #define INVERT_E2_DIR false
  1125.   #define INVERT_E3_DIR false
  1126.   #define INVERT_E4_DIR false
  1127.   #define INVERT_E5_DIR false
  1128.   #define INVERT_E6_DIR false
  1129.   #define INVERT_E7_DIR false
  1130.  
  1131.   #define DWIN_CREALITY_LCD
  1132.  
  1133.   #define ENCODER_PULSES_PER_STEP 4
  1134.   #define ENCODER_STEPS_PER_MENU_ITEM 1
  1135.  
  1136.   #define Z_PROBE_OFFSET_RANGE_MIN -10
  1137.   #define Z_PROBE_OFFSET_RANGE_MAX 10
  1138.   #define EXTRUDE_MAXLENGTH 1000
  1139.  
  1140.   #define POWER_LOSS_RECOVERY
  1141.  
  1142.   #if ENABLED(EZOUT_ENABLE)
  1143.     #define FILAMENT_RUNOUT_SENSOR
  1144.     #define SPEAKER_KILL
  1145.   #endif
  1146.  
  1147.   #if ENABLED(FILAMENT_RUNOUT_SENSOR)
  1148.     #define FIL_RUNOUT_ENABLED_DEFAULT true // Enable the sensor on startup. Override with M412 followed by M500.
  1149.     #define NUM_RUNOUT_SENSORS   1          // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each.
  1150.     #define FIL_RUNOUT_STATE     LOW       // Pin state indicating that filament is NOT present.
  1151.     #define FIL_RUNOUT_PULLUP               // Use internal pullup for filament runout pins.
  1152.     //#define FIL_RUNOUT_PULLDOWN           // Use internal pulldown for filament runout pins.
  1153.  
  1154.     // Set one or more commands to execute on filament runout.
  1155.     // (After 'M412 H' Marlin will ask the host to handle the process.)
  1156.     #define FILAMENT_RUNOUT_SCRIPT "M600"
  1157.  
  1158.     // After a runout is detected, continue printing this length of filament
  1159.     // before executing the runout script. Useful for a sensor at the end of
  1160.     // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead.
  1161.     //#define FILAMENT_RUNOUT_DISTANCE_MM 25
  1162.  
  1163.     #ifdef FILAMENT_RUNOUT_DISTANCE_MM
  1164.       // Enable this option to use an encoder disc that toggles the runout pin
  1165.       // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM
  1166.       // large enough to avoid false positives.)
  1167.       //#define FILAMENT_MOTION_SENSOR
  1168.     #endif
  1169.   #endif
  1170.  
  1171. #endif
  1172. // End Ender 3 V2 Settings
  1173.  
  1174. /*
  1175.  * All other settings are stored in the Configuration_backend.h file. Do not change unless you know what you are doing.
  1176.  */
  1177.  
  1178. #include "Configuration_backend.h"
RAW Paste Data