Configuring Marlin 2.0 for an Ender 3/Pro and BLTouch


Setting up Marlin is fiddly at the best of times. Having to revise your configurations every update certainly doesn’t help. This is a no nonsense, simple guide (and note to self) to configuring Marlin 2.0 for the Ender 3/Pro with BLTouch ABL sensor. I’m using an SKR v1.4 Turbo. The same applies for the original Creality Melzi 1.X.X boards, just be sure to save as much space as possible!

The Template

Firstly, you’ll need the Marlin firmware with the appropriate template settings.

  1. Start by downloading the latest stable release of Marlin from here.
  2. Extract the zip.
  3. Copy the 4 files from config/examples/Creality/Ender-3 to the Marlin/ folder, overwriting the 2 already there.

Configuration.h

Open the new Marlin/Configuration.h file using a text editor suitable for code, like Sublime Text or Notepad++. We’ll customise our configuration now:

  1. Change STRING_CONFIG_H_AUTHOR to clearly differentiate the configuration from the default
  2. Disable SHOW_BOOTSCREEN and SHOW_CUSTOM_BOOTSCREEN to save space by commenting out the lines (prefix them with # )
  3. Ensure you have the correct BAUDRATE. The original Ender 3 was configured to 115200 by Creality, but the newer Ender 3 Pro (and newer Creality motherboards) default to 250000. You may be fine with 250000 on an older Ender 3.
  4. Change CUSTOM_MACHINE_NAME to represent your printer, e.g. "Ender 3 Pro"
  5. If you’re using a BLTouch ABL sensor:
    1. Uncomment #define BLTOUCH
    2. #define SERVO0_PIN 27 is not required to set up your BLTouch in Marlin 2.x, as it’s defined in the pins folder by default
    3. You’ll need to customise the offset between Probe and Extruder. In Marlin 1.x, this was done with X, Y and Z_PROBE_OFFSET_FROM_EXTRUDER. In Marlin 2.x, they’re now combined in NOZZLE_TO_PROBE_OFFSET. Instructions are in the comments. Using the Creality BLTouch Kit bracket, mine is { -43, -9, 0 }. It’s safer to leave Z as 0 here are calibrate this yourself later.
    4. To keep the probe away from the edge of the bed, increase MIN_PROBE_EDGE to 20
    5. You can increase XY_PROBE_SPEED to 10000 to speed up probing slightly
    6. Uncomment #define AUTO_BED_LEVELING_BILINEAR to enable bilinear ABL
    7. By default, bilinear ABL uses a 3×3 grid. You can change this by editing GRID_MAX_POINTS_X under EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR). Mine is set to 5, for a 5×5 grid
    8. Uncomment #define LCD_BED_LEVELING to add bed leveling menu items
  6. If your bed is non-standard, you’ll need to adjust the size and/or travel limits to make sure Marlin knows this. I use bulldog clips to secure a glass bed. To ensure the nozzle stays clear of the clips, I’ve changed the following: Y_BED_SIZE from 235 to 199, X_MIN_POS from 0 to -2, Y_MIN_POS from 0 to -24.
  7. Uncomment Z_SAFE_HOMING. This prevents your Z homing from occuring without prior X and Y homing. Without this, you may accidentally miss the bed when homing Z.
  8. To increase the homing speed, increase HOMING_FEEDRATE_XY from (20*60) to (40*60) and HOMING_FEEDRATE_Z from (4*60) to (8*60).
  9. If you want to use PID to efficiently heat your bed, uncomment #define PIDTEMPBED. You’ll need to calibrate this later.
  10. If you’re using a “silent” Creality board v1.1.4 or v1.1.5, you’re using TMC2208 drivers in standalone mode. Uncomment X, Y, Z and E0_DRIVER_TYPE and set them to TMC2208_STANDALONE.
  11. To save space, uncomment #define SLIM_LCD_MENUS. This will remove many menu items that you won’t need if controlling using a PC or OctoPrint.
  12. To save space:
    1. Comment out #define SPEAKER. This will stop fully disable the speaker.
    2. If you won’t be printing from SD card, comment out #define SDSUPPORTand #define POWER_LOSS_RECOVERY. If you are still using an SD card, it’s time to look into OctoPi.
    3. If you can do without scrolling long file names on the display, comment out #define SCROLL_LONG_FILENAMES.
  13. Save the file and close the file.

Configuration_adv.h

Open the new Marlin/Configuration_adv.h file in your chosen text editor.

  1. If you’re using a BLTouch:
    1. Uncomment #define BLTOUCH_DELAY and change from 500 to 200. This reduces the pause after each individual probe.
    2. Babystepping allows the nozzle to move a tiny amount without changing the recorded coordinates for the hotend. This is usually used for calibrating your Z Offset for a perfect first layer. You can increase BABYSTEP_MULTIPLICATOR_Z and _XY to 10 for faster motion.
    3. Uncomment BABYSTEP_ZPROBE_OFFSET and #define BABYSTEP_ZPROBE_GFX_OVERLAY
  2. If you want to use Linear Advance to increase your print quality at higher speeds, uncomment #define LIN_ADVANCE and set LIN_ADVANCE_K from 0.22 to 0, which will enable the feature but turn it off. Your GCODE will need to specify the K value, which you’ll calibrate later. You need different K values for different filament types. Note that LinearsAdvance is not compatible with the TMC2208 stepper driver in Standalone mode (using StealthChop), so will not worth with Creality “silent” boards v1.1.4 and v1.1.5.
  3. To save space, comment out #define ARC_SUPPORT. This feature is used by other types of CNC machines, but usually not 3D printers.
  4. If you want to display progress and time remaining from another system with the M73 command, such as OctoPrint, uncomment LCD_SET_PROGRESS_MANUALLY. If your system will also send the M73 R parameter to update the time remaining, uncomment USE_M73_REMAINING_TIME.
  5. Marlin watches the rate of temperature increase for hotend and bed. If it’s too slow, it will trigger an error and halt your print. If you have the windows open for ventilation and it’s cold out, this can be a problem. Increase WATCH_BED_TEMP_PERIOD a little if you have this issue.
  6. Save your changes and close the file.

To The Printer!

  1. Take a copy of your M503 output to save your current printer settings. You’ll need to put some of these back later.
  2. Open Marlin/Marlin.ino with the Arduino IDE and write the new firmware to your printer.
  3. Run M502 to set all settings to those specified in your firmware files, then M500 to store these settings in the EEPROM.
  4. Depending on your configuration, you’ll now want to calibrate your Z-Probe Offset, PID for Hotend and Heated Bed and Linear Advance, or set them from your previous values.

19 responses to “Configuring Marlin 2.0 for an Ender 3/Pro and BLTouch”

  1. Daniel! .. THANK YOU .. this worked perfectly .. I did have to disable SD Card printing to get it to fit though …. (but I left all the menus in tact)

  2. I followed this to the letter but I seem to blow the memory allowance. How did you get this to work?

    • Double check you’ve followed every step to disable the functionality you won’t need. Admittedly, I also disabled SD card, so easily had enough space. You may need to disable some other functionality, maybe M73, Linear Advance or PID heating. Otherwise, have a google for saving space on Marlin 2, there may be something else you can do without that I’ve missed.

  3. SAME problem I cant really disable carrd reader so I dont have enough space

    • You’ll need to think carefully about what features you can live without and disable them to bring down the space your firmware requires.

  4. So I followed this, and I’d definitely like to use the printer with an sd card rather than being hooked up to my computer all the time, and it says that the region “text” overflowed by 8832 bytes.

    • You’ll need to think carefully about what features you can live without and disable them to bring down the space your firmware requires.

  5. Many thanks for this guide, I was a few days in with no success but finally managed to get things sorted.

  6. Works great! Was able to save space and get rid of the nasty overflow error.

  7. my extruder hits the right side but goes along the front fine and the right side but it just doesnt go left from there

  8. Hi, I have been struggling with Antclabs v3.1 BLTouch on BTT SKR1.4 Turbo board with Marlin for 4 weeks now. Have viewed numerous you tube and web based instrcutions without any luck. Your article got the closest but BLTouch failed at 1st probe every time for bed levelling.
    Any help with config for this to work woul dbe a life (and marriage) saver.

  9. Looks like Configuration.h should be PROBING_MARGIN, not MIN_PROBE_EDGE. Couldn’t find the MIN_PROBE_EDGE and set MIN_PROBE_MARGIN to 20 and it works as expected.

    • Thanks – the Marlin team aren’t one for backwards compatibility, so expect variable names to change without warning when you update to newer versions.

    • Forget it, I’ve found it on github (I’m not really familiar with github 🙁 )

  10. This described lines are not available in Configuration.h for Ender 3 with board 4.2.7:
    #define SERVO0_PIN 27
    #define MIN_PROBE_EDGE
    #define XY_PROBE_SPEED
    #define LCD_BED_LEVELING

  11. Ok, I understood like half of this. Where do I go to learn about this subject from the beginning? I know nothing about marlin comment uncomment ect.

    • to comment something, add // to the beginning
      to uncomment, remove the // from the beginning
      Marlin uses the same programing as arduino. there are tons of tutorials out there for arduino.