Ender 3 – MKS Gen L – Marlin 2.0.5.3 Upgrade

We had upgraded our Ender 3 to Marlin 2.0.5.3, this will provide the steps that we did. As noted, we are using the MKS Gen L board and not the board the Ender 3 comes with.

With the new Marlin firmware, it is better in our opinion to compile it via PlatformIO in Visual Studio Code than in the Arduino IDE. It is recommended to record any values stored such as current z-offset, extrusion settings, etc before flashing the updated firmware as these values will need to be placed back afterwards.

Environment Setup

Please follow these steps to setup the environment:

  1. Install Microsoft’s Visual Studio Code from https://code.visualstudio.com/
  2. Install the following extensions: PlatformIO (by PlatformIO) & Auto Build Marlin (by Marlin Firmware)
  3. Relaunch Visual Studio Code.
  4. Download Marlin Firmware Version 2.0.5.3 from https://marlinfw.org/ and extract the zip folder.
  5. To make the changes to be much less, download the Ender-3 configuration from the Github repo as well: Link

Configuration

Let’s get started with configuring the project:

  1. Place the Ender 3 example config files (configuration.h and configuration_adv.h, optional _Bootscreen.h and _Statusscreen.h) that was downloaded under step 4 under Marlin/src directory.
  2. Click on the PlatformIO module in Visual Studio Code, click open project and select the directory where the platformio.ini file is located
  3. Modify the configuration.h as follows:
    1. Remove #define CONFIG_EXAMPLES_DIR "Creality/Ender-3/CrealityV1" line, it may have a different path
    2. If the _Bootscreen.h and/or _Statusscreen.h has been copied; either to un-comment or comment (//) the lines beginning with associated lines beginning with #define SHOW_CUSTOM_BOOTSCREEN and/or #define CUSTOM_STATUS_SCREEN_IMAGE
    3. Change line from #define MOTHERBOARD BOARD_MELZI_CREALITY to #define MOTHERBOARD BOARD_MKS_GEN_L
    4. Change the stepper directions to opposite; end result values should be: #define INVERT_X_DIR false , #define INVERT_Y_DIR false ,& #define INVERT_Z_DIR true
    5. Change the extruder direction to the opposite; end result value should be #define INVERT_E0_DIR false
    6. Make any additional changes you may need for your setup.
  4. Modify the Configuration_adv.h as below:
    1. Set the line #define E0_AUTO_FAN_PIN to #define E0_AUTO_FAN_PIN 7

Building the firmware

To build the firmware, the Marlin Auto Build extension will be used in Visual Studio Code:

  1. On the Marlin Firmware Auto Build extension, click Refresh button. The values will be updated to what is in the configuration files.
  2. Click on the Build button next to mega2560 ; this should give a succeeded message in the terminal output. If it doesn’t give a success message, please review the configuration files for configuration issues.
  3. On successful build, plug in the MKS Gen L board via USB and press the Upload button.

After the upload, don’t forget to place back any custom values prior.

A good practice is to archive this firmware somewhere (plus a simple date stamp) where it can be used as a future reference to newer Marlin firmware versions.

Ender 3 – MKS Gen L and BLTouch Upgrade

After breaking my Ender 3 board by acciendent, I decided to switch to a MKS Gen L board. Contained in this article are the steps that I’ve taken to swap boards. I am writing this after the fact, I do apologize if I miss any details.

WARNING: This deals with handling electronics and electricity. Follow at your own risk.

Required Equipment & Software

  • MKS Gen L Board
  • Computer
  • Arduino IDE
  • Screwdrivers (insulated one for adjusting stepper drivers)
  • Multi Meter

Step 1 – Print a Case & (Optional) BLTouch mount

Print a case for the MKS Gen L board and optionally the BLTouch mount beforehand. Following are the models I’ve used:

MKS Gen L Case by TeachingTech: https://www.thingiverse.com/thing:3311643

BLTouch Mount for Ender 3 created by registerdthing https://www.thingiverse.com/thing:3003725 .

Step 2 – Label current connections

IMPORTANT: Turn Power Off and Unplug Power Cord

After opening the case, label the current connections on the Ender 3. Below is an image describing what everything is.

Step 3 – Write down current Ender 3 Firmware settings

Write down/take photos of current Ender 3 Firmware Settings for acceleration, steps, etc.

Step 4 – Measure Stepper Drivers’s Voltage

Measure the stepper drivers’ voltage when it’s powered on. Only connect your multi-meter negative lead to the main negative terminal and positive lead to each stepper driver potentiometer and record the voltage value. These will be used for future reference in tuning the external stepper drivers.

Step 7 – Install Stepper Drivers

Install stepper drivers onto the MKS Gen L board. Keep track of which stepper model you use, they may be needed for preparing the firmware.

Step 5 – Prepare MKS Gen L Firmware

Next we will be preparing Marlin 1.1.9 Firmware to be flashed onto the MKS Gen L board. Obviously, we will be including the configuration for the BLTouch and we are keeping the original Ender 3 display. Note: Since we are keeping our original display, we are going to lose the SD card functionality. To get this functionality back, replacing the Ender 3 original display with one that has a SD card.

  1. Download Marlin 1.1.9 release firmware from github.com. Direct link: https://github.com/MarlinFirmware/Marlin/releases/tag/1.1.9
  2. Extract files from the zip or tar.gz archive
  3. Copy files from Marlin Example Configurations/Creality/Ender-3 to Marlin Folder. Overwrite files that already exist.
  4. Within Configuration.h change the following:
    1. #define MOTHERBOARD BOARD_MELZI_CREALITY to #define MOTHERBOARD BOARD_MKS_GEN_L
    2. #define INVERT_X_DIR true to #define INVERT_X_DIR false
    3. #define INVERT_Y_DIR true to #define INVERT_Y_DIR false
    4. #define INVERT_Z_DIR false to #define INVERT_Z_DIR true
    5. #define INVERT_E0_DIR true to #define INVERT_E0_DIR false
    6. #define E0_AUTO_FAN_PIN -1 to #define E0_AUTO_FAN_PIN 7
  5. (Optional) BLTouch Configuration.h changes:
    1. //#define BLTOUCH to #define BLTOUCH
    2. //#define BLTOUCH_DELAY 375 to #define BLTOUCH_DELAY 375
    3. #define X_PROBE_OFFSET_FROM_EXTRUDER 10 to #define X_Probe_OFFSET_FROM_EXTRUDER -42
    4. #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 to #define Y_PROBE_OFFSET_FROM_EXTRUDER -5
    5. //#define AUTO_BED_LEVELING_BILINEAR to #define AUTO_BED_LEVELING_BILINEAR
    6. //#define Z_SAFE_HOMING to #define Z_SAFE_HOMING
  6. Install U8glib package under Sketch -> Libraries -> Manage Libraries
  7. Configure the stepper driver settings under Configuration.h. Search #define X_DRIVER_TYPE and change the options to match the same models used. A4988 is automatically assumed the stepper driver for all stepper locations.
  8. Try click on the check mark on the top left, this will compile the project and ensure no errors shows up on the bottom status window.

Step 6 – Flash Firmware

Connect the MKS Gen L board to the computer with Arduino IDE installed. Ensure under Tools -> Board is set to Mega 2560, Tools -> Processor is Mega 2560, and you’ve selected the proper port. Then click the button on the top left with an arrow pointing right.

Step 8 – Swap cases & boards

Warning: Turn off power and unplug power.

Unplug and unscrew everything from the Ender 3 board, by now each should be labeled to where they go. They should correspond with the labeling on the MKS Gen L board.

Note for the Ender 3 sensors, you may need to trim off the bottom left notch as shown above.

Step 10 – (Optional) Install BLTouch

I installed the BLTouch Mount for Ender 3 created by registerdthing https://www.thingiverse.com/thing:3003725 .

For plugging in the BLTouch, the 2 pin connector goes into the z min sensor with black to the middle pin and white to the S(signal) pin. The 3 pin one (brown, red, & orange pins) plugs into the last 3 pin socket as shown in this picture.

Step 9 – Adjust Stepper Drivers

Turn on the power and adjust the stepper driver potentiometers with an insulated screw driver and measure with a multimeter to get as close as you can get to the values you’ve written down under step 4. Essentially, the same as measuring in step 4.

Step 11 – Calibrate

With BLTouch, include G29 after G28 command in all GCODEs and adjust the bed corners to be within 0.1 mm or better of each other. Also, adjust the Z offset when Z axis is at 0 after G28 and G29 commands using https://nate15329.com/3d-printer-calibration/.