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


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
  • Or download the .zip from the releases page: Marlin 1.1.9

In configuration.h find and uncomment the following:


Additionally set to Z_MIN_PROBE_ENDSTOP_INVERTING to true:


Still in configuration.h find and uncomment the following:

 #define BLTOUCH  

Just below the BLTOUCH define add:

  #define SERVO0_PIN 27

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:
 *      +-- 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:


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:


In configuration_adv.h find and uncomment the following lines:

#define BLTOUCH_DELAY 500

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:


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.