Marlin 2.0.4.4, Ender 3 Pro, BTT SKR 1.4 Turbo board with automatic bed levelling using the BLTouch v3.1

descriptionStandard

In this article the focus is the preparation of the Marlin 2.x branch (version 2.0.4.4) for use with the Ender 3 Pro and a custom configuration: BigTreeTech SKR 1.4 board, TMC2209 drivers, BLTouch. The BBT SKR board that is replacing the Creality Melzi board from the stock printer.

In this article I will not be covering the physical assembly of the SKR 1.4 Turbo board instead this article looks at preparing Marlin from source for the device. A word of caution the stock case will prove to be a tight fit* and will need some sort of mounting bracket at a minimum to convert the existing mounting holes matching the Melzi board to those found on BBT SKR 1.4 board.

* The heat sinks on the TMC2209’s are tall and when coupled with the SKR board I think it unlikely there will be enough clearance using the stock case.

Important information

There are newer versions of this article and Marlin configurations available:

Key Features

Here are some key features/highlights enabled in this custom version of Marlin 2.0.4.4:

  • TMC2209 drivers with Stealth-chop & Hybrid threshold enabled on X, Y, Z axis.
  • BLTouch for ABL Bilinear.
    • Bed levelling is used in addition to a Z-stop switch.
    • Menu for levelling bed corners.
    • Restore bed levelling after G28.
    • Probes bed twice for each point.
  • Movement on any axis is restricted until axis’s are homed.
  • Emergency stop interrupt commands supported
  • PID Tuning
  • Extruder fan after 50°C
  • Z Safe homing
  • Advanced pause and filament change

It’s assumed that you have the following equipment:

  • BTT SKR 1.4 Board.
  • BLTouch v3.1 (other versions of the BLTouch will work but you will need to adjust settings related to it and check your wiring).
  • Ender 3 or 3 Pro

Preparation

I have made my Marlin configurations available for download they feature the same changes mentioned in this article: https://gitlab.com/oddineers-public/marlin-ender-3/-/tree/Marlin-2.0.4.4/

If you wish to build your own variant from source; start by downloading the relevant Marlin releases used in this article from Marlin 2.0.4.4 branch:

Once you have downloaded the sources above you will need to extract them to an accessible location, use the following steps as a reference:

  • Extract Marlin 2.0.4.4
  • Extract the 4 files from the Ender 3 device configuration page and extract and copy the 4 files to the location where you extracted Marlin 2.0.4.4 sources.

PlatformIO Installation

I suggest VSCode as a quick method for compiling Marlin 2.0.x from source.

  1. Download VSCode and install.
  2. Open VSCode > Extension Manager
  3. Search for and Install  official PlatformIO IDE extension.

Alternatively if you already have a Python environment configured you can utilise pip to install PlatformIO:

pip install -U platformio

Docs: https://docs.platformio.org/en/latest/core.html#piocore

Firmware configuration modifications

Next we will be modifying 2 specific files from the release to customise the firmware for our requirement. For the Ender 3 Pro I made the following edits to files /Marlin/Configuration.h & /Marlin/Configuration_adv.h:

In file: /Marlin/Configuration.hfind and uncomment the following:

#define STRING_CONFIG_H_AUTHOR "(Steven, Ender-3)" 
#define CUSTOM_STATUS_SCREEN_IMAGE
#define SERIAL_PORT -1
#define SERIAL_PORT_2 0
#define BAUDRATE 115200
#define MOTHERBOARD BOARD_BTT_SKR_V1_4
#define CUSTOM_MACHINE_NAME "E3 SKR 1.4"
#define DEFAULT_NOMINAL_FILAMENT_DIA 1.75
#define AUTO_POWER_FANS           
#define TEMP_SENSOR_BED 1
#define BED_MAXTEMP      100
#define PID_EDIT_MENU           
#define PID_AUTOTUNE_MENU       
#define DEFAULT_Kp 21.73
#define DEFAULT_Ki 1.54
#define DEFAULT_Kd 76.55
#define PIDTEMPBED
#define Z_MIN_PROBE_ENDSTOP_INVERTING true 
#define X_DRIVER_TYPE  TMC2209
#define Y_DRIVER_TYPE  TMC2209
#define Z_DRIVER_TYPE  TMC2209
#define E0_DRIVER_TYPE TMC2209
#define ENDSTOP_NOISE_THRESHOLD 2
#define DEFAULT_AXIS_STEPS_PER_UNIT   { 80, 80, 400, 93 }
#define DEFAULT_MAX_FEEDRATE          { 500, 500, 5, 25 }
#define DEFAULT_MAX_ACCELERATION      { 500, 500, 100, 5000 }
#define DEFAULT_ACCELERATION          500    
#define DEFAULT_RETRACT_ACCELERATION  500    
#define DEFAULT_TRAVEL_ACCELERATION   500    
#define JUNCTION_DEVIATION_MM 0.08  
#define S_CURVE_ACCELERATION
#define BLTOUCH
#define NOZZLE_TO_PROBE_OFFSET { -46, -16, 0 }
#define MIN_PROBE_EDGE 15
#define MULTIPLE_PROBING 2
#define Z_AFTER_PROBING             5 
#define Z_MIN_PROBE_REPEATABILITY_TEST
#define WAIT_FOR_BED_HEATER     
#define DELAY_BEFORE_PROBING 100  
#define DISABLE_INACTIVE_EXTRUDER 
#define INVERT_X_DIR true
#define INVERT_E0_DIR true
#define NO_MOTION_BEFORE_HOMING  
#define X_BED_SIZE 235
#define Y_BED_SIZE 235
#define Z_MAX_POS 250
#define SOFT_ENDSTOPS_MENU_ITEM  
#define AUTO_BED_LEVELING_BILINEAR
#define RESTORE_LEVELING_AFTER_G28
#define EXTRAPOLATE_BEYOND_GRID
#define LCD_BED_LEVELING
#define MESH_EDIT_MENU        
#define LEVEL_BED_CORNERS
#define LEVEL_CENTER_TOO        
#define Z_SAFE_HOMING
#define HOMING_FEEDRATE_XY (20*60)
#define EEPROM_SETTINGS       
#define EEPROM_AUTO_INIT  
#define PREHEAT_1_TEMP_HOTEND 205
#define PREHEAT_1_TEMP_BED      0
#define PREHEAT_1_FAN_SPEED   255 
#define PREHEAT_2_TEMP_BED      0
#define PREHEAT_2_FAN_SPEED   255 
#define NOZZLE_PARK_FEATURE
#define DISPLAY_CHARSET_HD44780 WESTERN
#define SDSUPPORT
#define INDIVIDUAL_AXIS_HOMING_MENU
#define CR10_STOCKDISPLAY
#define NUM_SERVOS 1  

View the full file on BitBucket: Configuration.h

In file: /Marlin/Configuration_adv.h find and uncomment the following:

#define THERMAL_PROTECTION_BED_PERIOD 20    
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 
#define WATCH_BED_TEMP_PERIOD 60                
#define WATCH_BED_TEMP_INCREASE 2               
#define THERMAL_PROTECTION_CHAMBER_PERIOD 20    
#define WATCH_CHAMBER_TEMP_PERIOD 60            
#define WATCH_CHAMBER_TEMP_INCREASE 2           
#define E0_AUTO_FAN_PIN P2_04
#define QUICK_HOME                       
#define BLTOUCH_DELAY 500
#define BLTOUCH_SET_5V_MODE
#define Z_STEPPER_ALIGN_XY { {  10, 190 }, { 100,  10 }, { 190, 190 } }
#define Z_STEPPER_ALIGN_ITERATIONS 3    
#define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } 
#define LCD_INFO_MENU
#define STATUS_MESSAGE_SCROLLING
#define LCD_SET_PROGRESS_MANUALLY
#define PRINT_PROGRESS_SHOW_DECIMALS 
#define LONG_FILENAME_HOST_SUPPORT
#define SCROLL_LONG_FILENAMES
#define SDCARD_CONNECTION ONBOARD
#define STATUS_HEAT_PERCENT       
#define BABYSTEPPING
#define DOUBLECLICK_FOR_Z_BABYSTEPPING    
#define BABYSTEP_ZPROBE_OFFSET          
#define PTC_MAX_BED_TEMP 110
#define ARC_SUPPORT               
#define MIN_ARC_SEGMENTS   24   
#define N_ARC_CORRECTION   25   
#define BLOCK_BUFFER_SIZE 32 
#define BLOCK_BUFFER_SIZE 32 
#define BUFSIZE 32
#define TX_BUFFER_SIZE 32
#define RX_BUFFER_SIZE 1024
#define EMERGENCY_PARSER
#define ADVANCED_PAUSE_FEATURE
#define PAUSE_PARK_RETRACT_LENGTH           0.5  
#define PARK_HEAD_ON_PAUSE                    
#define FILAMENT_LOAD_UNLOAD_GCODES           
#define X_CURRENT       600        
#define Y_CURRENT       600
#define Z_CURRENT       600
#define E0_CURRENT      500
#define CHOPPER_TIMING CHOPPER_DEFAULT_24V
#define MONITOR_DRIVER_STATUS
#define HYBRID_THRESHOLD
#define CANCEL_OBJECTS

View the full file on BitBucket: Configuration_adv.h

Important note on Probe offsets

Keep in mind that in using this; you will likely need to adjust your X, Y, Z offset settings specific to your setup; note in my hardware configuration I utilise a custom fan mount the Hero Me Gen3 based; this means that the Probe offsets defined in my configuration may not be suitable for your hardware setup. The change is simple and the key settings to look for is NOZZLE_TO_PROBE_OFFSET. Once found, this branch of Marlin requires the offsets to be defined as an array: {x, y, z}.

Updating Probe offset values manually using G-code M851

In the following examples I show the offset values I would use after flashing a new firmware these are sent using G-code. You will need to adjust these offsets to accommodate your own requirements.

Set the Z offset for the BLTouch by sending G-code:

M851 Z-1.46 

Set the X and Y distance (probe left front of nozzle) by sending G-code:

M851 X-46.00 Y-16.00 

Save the setting to the EEPROM by sending G-code:

M500

Setting Fade Height manually via G-code M420

Set the Fade Height with G-Code:

M420 Z10