Notifications
Clear all

Building Marlin 2.0 for the Ender 3 Max

Page 1 / 5

holmes4
(@holmes4)
Eminent Member Registered
Joined: 4 months ago
Posts: 47
Topic starter  

I have successfully built Marlin 2.0.7 for the Ender 3 Max with a 4.2.7 board. What follows is instructions for replicating what I did. Some notes:

  • I have added a BLTouch, so that is enabled. If you don't have one, then comment out the line enabling it (I'll highlight it).
  • I enabled Unified Bed Leveling, which is pretty neat, but requires some changes in the beginning G-code. I'll explain later
  • I tried enabling Linear Advance, but I was unable to get it to work, so it's disabled for now. I'll get back to this later.
  • The filament runout switch works - if triggered, it will do an M600 filament change, where it moves the hotend up and to the back left corner, waiting for you to insert new filament. Just make sure you purge enough. I tested that it does pause, but my attempt at replacing the filament resulted in a bad print. Maybe I didn't purge enough filament?
  • I have not tested this with a 4.2.2 board (which is what Creality ships), but it should work with the appropriate define (replace BOARD_CREALITY_V427 with BOARD_CREALITY_V4).

I did all this on Windows. It SHOULD be similar for other platforms. You will need a MicroSD card.

  • Download and install Microsoft Visual Studio Code. This is NOT the same as their regular Visual Studio.
  • Download the latest Marlin (2.0.7.2 as I write this) - expand it to a folder on your computer
  • Download the Zip I attach to this post and expand its contents to the Marlin subfolder of where you expanded the Marlin sources. This includes four files that would otherwise come from the Configurations separate download on the Marlin site.
  • Open Visual Studio Code
  • In the left column, click the Extensions icon (should be fifth down)
  • In the Search Extensions in Marketplace field, search for PlatformIO. Install PlatformIO IDE
  • A new "alien" icon should appear for PlatformIO. Click it, then click Open.
  • Browse to the folder where you unzipped the Marlin sources. There should be a platformio.ini file there, and an "Open Marlin 2.0x" button should be highlighted (this may change if you changed the folder name). Click it.
  • In the left column, you'll find configuration.h and configuration_adv.h. Open these and scan through them. I'll explain the changes I made, referencing approximate line numbers.

configuration.h

  • 132: change MOTHERBOARD to BOARD_CREALITY_V4 if you have the 4.2.2 board
  • 499-501: These are the hotend PID values that PID tuning found for me. You should run PID tuning on your own afterward.
  • 522 and 540-542: This is PID tuning for the bed
  • 599: I'm not sure why the Marlin configuration had THERMAL_PROTECTION_CHAMBER enabled, I disabled it. I'm not sure if the board has an ambient temp sensor
  • 703: I enabled ENDSTOP_INTERRUPTS_FEATURE - seemed to work
  • 747: For me, the default E-steps of 93 was underextruding, so I changed it to 96.96. You may want to run your own extrusion test. This can be modified from the menus
  • 847: It seemed right to disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP, since I had a BLTouch. It works - what can I say?
  • 850: Enabled USE_PROBE_FOR_Z_HOMING
  • 905: Enabled BLTOUCH. Obviously, if you don't have one, then uncomment 847 and comment this.
  • 992: These are the XYZ offsets of the BLTouch probe to the nozzle.
  • 1016: I like the two-pass probing
  • 1128-1129 and 1137: Max bed size and Z height
  • 1175: Enabled the runout sensor
  • 1241: Enabled Unified Bed Leveling
  • 1248: You have to have this define for the state of leveling after G28. It can be defined as true (leave leveling enabled) or false (disable leveling)
  • 1272: This enables the G26 command to print a level test pattern
  • 1319-1320: Defines points for mesh leveling. The inset of 40 is needed to keep the probe on the bed.
  • 1391: Seemed reasonable to enable Z_SAFE_HOMING
  • 1509-1513: Tweak these as you like for your filament choices.
  • 1529: Nozzle Park feature required for runout sensor

configuration_adv.h

  • 961: I enabled ADAPTIVE_STEP_SMOOTHING and it worked
  • 1082: If you have BLTouch, the Probe Offset Wizard in the menus is a great way to set your Z offset
  • 1202: Enabled POWER_LOSS_RECOVERY, since the Max has that
  • 1242: I enabled alphabetic sorting of the SD card display - your choice
  • 2095: Advanced pause required for runout sensor
  • 2586: I enabled SQUARE_WAVE_STEPPING which is said to optimize stepper pulses. Optional

Once you're happy with your changes, select File > Save All

  • In the bottom row of the screen is a checkmark icon: PlatformIO:Build. Click it. The first time you do this, it will download some additional dependencies, and will then build the firmware. If you get yellow warnings about duplicate components or some such, ignore them. Red errors need to be fixed.
  • If your build is successful, you will find a .BIN file in the Marlin-2.0.x\.pio\build\STM32F103RET6_creality folder. Each one has a date and time in the filename.
  • Copy the .BIN file to an empty MicroSD card. Safely eject the card.
  • Power down the printer and disconnect any USB cable.
  • Insert the MicroSD card and power on the printer. The display will be blank for 10-15 seconds, and then you should see an Ender logo followed by Marlin, and then the info screen.

Unified Bed Leveling

Follow the instructions here to create and save a mesh. This is another good web page with explanations. What I did was save the initial mesh in slot 1, and then I change my slicer's start G-code as follows. After G28, I add:

G29 A ; Enable UBL
G29 L1 ; Load mesh from slot 1
G29 F10 ; Fade out the effects after 10mm
G29 J ; Compensate for any tilting of the bed since mesh created

This last will probe just three points in a triangle - much faster than the normal 9-point BLTouch mesh.

Make sure you do an M500 after creating the initial mesh (or Store Settings from the menu)

I hope I got everything! Feel free to ask questions.

 

 

 


ReplyQuote
holmes4
(@holmes4)
Eminent Member Registered
Joined: 4 months ago
Posts: 47
Topic starter  

Once you're done with all the adjustments, send the printer an M503 command to list its settings. You should get something like this:

Recv: echo:  G21    ; Units in mm (mm)
Recv: echo:  M149 C ; Units in Celsius
Recv: 
Recv: echo:; Filament settings: Disabled
Recv: echo:  M200 S0 D1.75
Recv: echo:; Steps per unit:
Recv: echo: M92 X80.00 Y80.00 Z400.00 E93.00
Recv: echo:; Maximum feedrates (units/s):
Recv: echo:  M203 X500.00 Y500.00 Z5.00 E25.00
Recv: echo:; Maximum Acceleration (units/s2):
Recv: echo:  M201 X500.00 Y500.00 Z100.00 E5000.00
Recv: echo:; Acceleration (units/s2): P<print_accel> R<retract_accel> T<travel_accel>
Recv: echo:  M204 P500.00 R500.00 T500.00
Recv: echo:; Advanced: B<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate> J<junc_dev>
Recv: echo:  M205 B20000.00 S0.00 T0.00 J0.08
Recv: echo:; Home offset:
Recv: echo:  M206 X0.00 Y0.00 Z0.00
Recv: echo:; Unified Bed Leveling:
Recv: echo:  M420 S1 Z10.00
Recv: 
Recv: Unified Bed Leveling System v1.01 active
Recv: 
Recv: echo:; Active Mesh Slot: 1
Recv: echo:; EEPROM can hold 31 meshes.
Recv: 
Recv: echo:; Material heatup parameters:
Recv: echo:  M145 S0 H210 B60 F255
Recv: echo:  M145 S1 H240 B70 F255
Recv: echo:; PID settings:
Recv: echo:  M301 P20.02 I1.30 D77.01
Recv: echo:  M304 P215.83 I31.31 D991.80
Recv: echo:; Power-Loss Recovery:
Recv: echo:  M413 S1
Recv: echo:; Z-Probe Offset (mm):
Recv: echo:  M851 X40.00 Y-10.00 Z-2.72
Recv: echo:Filament load/unload lengths:
Recv: echo:  M603 L0.00 U100.00
Recv: echo:Filament runout sensor:
Recv: echo:  M412 S1

You'll want to verify that the settings are what you want - if not, use the M commands to set them.


ReplyQuote
Jslwelch
(@jslwelch)
Active Member Registered
Joined: 4 months ago
Posts: 12
 

In the project wizard, what board selected?


ReplyQuote
holmes4
(@holmes4)
Eminent Member Registered
Joined: 4 months ago
Posts: 47
Topic starter  

I did not use the project wizard - just opened the PlatformIO project already in the Marlin sources. I then edited configuration.h to specify the correct board type. I used the predefined Creality\Ender 3\CrealityV427 configuration (from the Configurations download on the Marlin github) as a base.


ReplyQuote
Wunderman
(@wunderman)
New Member Registered
Joined: 3 months ago
Posts: 4
 

Having issues getting this to work on my end for some reason, would it be possible for you to upload a .bin file for the stock board. I was looking for a way to fix my offsets for a Micro Swiss direct drive and then I found this. 🙂


ReplyQuote
holmes4
(@holmes4)
Eminent Member Registered
Joined: 4 months ago
Posts: 47
Topic starter  

With or without BLTouch? Note that I won't be able to test it.


ReplyQuote
Wunderman
(@wunderman)
New Member Registered
Joined: 3 months ago
Posts: 4
 

@holmes4 With the Bltouch. I should be able to tweak all my offsets in Marlin 2.0 so that should fix my calibration issues.


ReplyQuote
pablopunta
(@pablopunta)
Active Member Registered
Joined: 3 months ago
Posts: 5
 

if u upload a bin file w/o bl touch i can test for u, i have a 4.2.2 board.-

 


ReplyQuote
holmes4
(@holmes4)
Eminent Member Registered
Joined: 4 months ago
Posts: 47
Topic starter  

The attached Zip has Marlin 2.0.7 for 4.2.2 boards, with and without BLtouch. The "with" is set for auto bilinear mesh leveling, the without has mesh leveling which can be accessed from the menus for manual leveling. Let me know how they work.

I recommend running PID tuning and extrusion tests after installing. The E-steps may not be right for your setup.


ReplyQuote
holmes4
(@holmes4)
Eminent Member Registered
Joined: 4 months ago
Posts: 47
Topic starter  

Has anyone tried these builds yet?

I decided to replace the 4.2.7 board with an SKR Mini E3 V2.0, along with a TFT touch panel. It comes with a Marlin 2.0 build, but I built my own 2.0.7.2 version. The major thing I wanted from this was Linear Advance, which simply does not work on the Creality boards. Haven't got the BLTouch working right yet (I think I have an issue with the connector), but otherwise it works well and I am enjoying the color touchscreen. What's fun is that you can switch between a graphic touch UI and a standard Marlin menu.


ReplyQuote
Wunderman
(@wunderman)
New Member Registered
Joined: 3 months ago
Posts: 4
 

I Just tried the Bltouch variant earlier. It worked perfectly. 


holmes4 liked
ReplyQuote
oliverhbailey
(@oliverhbailey)
New Member Registered
Joined: 3 months ago
Posts: 4
 

Actually, if you download the header files for the Ender 3 Pro V 1.5, that contains all the source and is properly setup for the Creality V4. This is for version 4.0.7.2 source tree. Just changing the version of the motherboard does not provide a successful firmware build.

 


ReplyQuote
Fanatic1074
(@fanatic1074)
Active Member Registered
Joined: 3 months ago
Posts: 8
 

@holmes4

Ok how do you flash this firmware?  Ive been just putting mine on an SD card naming it firmware.bin and its been doing it.  I cant get this one to flash.


ReplyQuote
holmes4
(@holmes4)
Eminent Member Registered
Joined: 4 months ago
Posts: 47
Topic starter  

@Fanatic1074 For the Creality boards, it can be named anything with a .bin (lowercase) file type. The rest of the card must (I think) be empty. I've done this many times.


ReplyQuote
Fanatic1074
(@fanatic1074)
Active Member Registered
Joined: 3 months ago
Posts: 8
 

@holmes4

Ok, ill keep messing with it.  Thanks!


ReplyQuote
Page 1 / 5