Marlin 1.1.9, Ender 3 Pro and automatic bed levelling using the BLTouch v3.1

descriptionStandard

This article describes another firmware customisation for the Ender 3 Pro utilising Marlin version 1.1.9 with the latest bug fixes. This time enabling automatic bed levelling utilising the BLTouch v3.1. This has been tested on the Ender 3 Pro but should also work for the non-pro variant and possibly other similar 3D printers.

A previous article discussed another option utilising manual bed levelling on the stock Ender 3 Pro without the requirement of a BLTouch sensor.

Modifying Marlin 1.1.9 for the Ender 3

First you will need to download a copy of Marlin 1.1.9 to a working directory.

  • Using Git you can: git clone https://github.com/MarlinFirmware/Marlin.git
  • Or download the .zip from the releases page: Marlin 1.1.9

In configuration.h find and uncomment the following:

#define ENDSTOPPULLUP_ZMIN_PROBE  
#define Z_MIN_PROBE_ENDSTOP_INVERTING 

Additionally set to Z_MIN_PROBE_ENDSTOP_INVERTING to true:

#define Z_MIN_PROBE_ENDSTOP_INVERTING true

Still in configuration.h find and uncomment the following:

 #define BLTOUCH  

Just below the BLTOUCH define add:

#if ENABLED(BLTOUCH)
  #define SERVO0_PIN 27
#endif

Next you need to calculate your offset here’s the reference from the Marlin source. Keep in mind that you will need to measure the distance for both X and Y from your nozzle to the sensor:

/**
 *   Z Probe to nozzle (X,Y) offset, relative to (0, 0).
 *   X and Y offsets must be integers.
 *
 *   In the following example the X and Y offsets are both positive:
 *   #define X_PROBE_OFFSET_FROM_EXTRUDER 10
 *   #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
 *
 *      +-- BACK ---+
 *      |           |
 *    L |    (+) P  | R <-- probe (20,20)
 *    E |           | I
 *    F | (-) N (+) | G <-- nozzle (10,10)
 *    T |           | H
 *      |    (-)    | T
 *      |           |
 *      O-- FRONT --+
 *    (0,0)
 */

Next search for MIN_SOFTWARE_ENDSTOP_Z and comment it out:

#define MIN_SOFTWARE_ENDSTOP_Z

This setting allows one to move the Z axis below 0 which is used later to provide our Z-Offset.

Still in configuration.h find and uncomment the following:

#define AUTO_BED_LEVELING_BILINEAR
#define Z_SAFE_HOMING

In configuration_adv.h find and uncomment the following lines:

#define BABYSTEP_ZPROBE_OFFSET 
#define BLTOUCH_DELAY 500
#define BLTOUCH_SET_5V_MODE

Optionally you can change the babystep multiplier; this determines how much the Z axis is moved with each turn on the control knob. The default increment is 0.025mm:

BABYSTEP_MULTIPLICATOR 2

I’d advise on keeping the multiplier low; yes it does result in more turns to move the Z axis either up or down but it also means that there is a greater degree of accuracy which ultimately is the point behind the upgrade.

A note on Z-Offset; in this guide the Z-Offset refers to the nozzles offset from the BLTouch sensor.