MarlinFirmware / Configurations

Configurations for Marlin Firmware
https://marlinfw.org
GNU General Public License v3.0
2.06k stars 3.37k forks source link

[FR] Creality Ender 3 V2 with SKR Mini E3 V2.0 #535

Closed blazewicz closed 2 years ago

blazewicz commented 3 years ago

Updates

Description

The BIGTREETECH SKR Mini E3 V2.0 board is viable drop-in replacement for Creality's v4.2.2 board. Mine got fried (bed heater MOSFET blew up) and SKR seemed to be the best alternative to buying new board from Creality.

Unlike previous versions of Ender 3 (1, 2), the V2 doesn't have upstream configurations for this board. It was already discussed in https://github.com/MarlinFirmware/Marlin/issues/19858, but at that point adding support for DWIN display wasn't possible without modifications to Marlin's code.

One culprit is that SKR display port has slightly different pinout than DWIN and requires slight modification to the ribbon cable. There is an #error added to Marlin source that needs to be commented out, above that line there is graphical instruction on how to modify the connection. (https://github.com/MarlinFirmware/Marlin/pull/22288)

Full board documentation can be found in BIGTREETECH's GitHub, there is active discussion with success stories here:

Configuration Details

Note about build environments

The _btt_USB variants seems to work out-of-the box but USB connection might be unstable (see https://github.com/MarlinFirmware/Marlin/issues/22431).

Variants without _USB i.e. STM32F103RC_btt and STM32F103RE_btt are stable but require slight modification to local Arduino framework files:

--- ~/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/usb/usbd_ep_conf.c  2021-07-19 00:26:39.000000000 +0200
+++ ~/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/usb/usbd_ep_conf.c  2021-07-19 00:26:30.000000000 +0200
@@ -37,7 +37,7 @@
 #else
   {0x00,       PMA_EP0_OUT_ADDR, PCD_SNG_BUF},
   {0x80,       PMA_EP0_IN_ADDR,  PCD_SNG_BUF},
-  {CDC_OUT_EP, PMA_CDC_OUT_ADDR, PCD_DBL_BUF},
+  {CDC_OUT_EP, PMA_CDC_OUT_ADDR, PCD_SNG_BUF},
   {CDC_IN_EP,  PMA_CDC_IN_ADDR,  PCD_SNG_BUF},
   {CDC_CMD_EP, PMA_CDC_CMD_ADDR, PCD_SNG_BUF}
 #endif
blazewicz commented 3 years ago

Installation is very easy and board has exactly same dimmensions as Creality v4.2.2 and v4.2.7, connector layout is also very similar.

Only hardware modification required is a display cable adapter made with 8 dupont F-M cables.

Ender3_V2_BTT_SKR_Mini_V2_Board

Wiring diagram:

Zrzut ekranu 2021-07-3 o 12 59 57

below are all required modifications to Ender 3 V2 configurations (thanks @jernejp21, https://github.com/bigtreetech/BIGTREETECH-SKR-mini-E3/issues/424#issuecomment-707094814):

--- ../Configurations/config/examples/Creality/Ender-3 V2/Configuration.h   2021-07-02 10:58:20.000000000 +0200
+++ Marlin/Configuration.h  2021-07-02 12:38:43.000000000 +0200
@@ -104,7 +104,7 @@
  *
  * :[-1, 0, 1, 2, 3, 4, 5, 6, 7]
  */
-#define SERIAL_PORT 1
+#define SERIAL_PORT -1

 /**
  * Serial Port Baud Rate
@@ -141,9 +141,17 @@

 // Choose the name from boards.h that matches your setup
 #ifndef MOTHERBOARD
-  #define MOTHERBOARD BOARD_CREALITY_V4
+  #define MOTHERBOARD BOARD_BTT_SKR_MINI_E3_V2_0
 #endif

 // Name displayed in the LCD "Ready" message and Info menu
 #define CUSTOM_MACHINE_NAME "Ender-3 V2"

@@ -833,9 +841,9 @@
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
  * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
  */
-#define X_DRIVER_TYPE TMC2208_STANDALONE
-#define Y_DRIVER_TYPE TMC2208_STANDALONE
-#define Z_DRIVER_TYPE TMC2208_STANDALONE
+#define X_DRIVER_TYPE TMC2209
+#define Y_DRIVER_TYPE TMC2209
+#define Z_DRIVER_TYPE TMC2209
 //#define X2_DRIVER_TYPE A4988
 //#define Y2_DRIVER_TYPE A4988
 //#define Z2_DRIVER_TYPE A4988
@@ -844,7 +852,7 @@
 //#define I_DRIVER_TYPE  A4988
 //#define J_DRIVER_TYPE  A4988
 //#define K_DRIVER_TYPE  A4988
-#define E0_DRIVER_TYPE TMC2208_STANDALONE
+#define E0_DRIVER_TYPE TMC2209
 //#define E1_DRIVER_TYPE A4988
 //#define E2_DRIVER_TYPE A4988
 //#define E3_DRIVER_TYPE A4988
@@ -1293,9 +1301,9 @@
 // @section machine

 // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
-#define INVERT_X_DIR false
-#define INVERT_Y_DIR false
-#define INVERT_Z_DIR true
+#define INVERT_X_DIR true
+#define INVERT_Y_DIR true
+#define INVERT_Z_DIR false
 //#define INVERT_I_DIR false
 //#define INVERT_J_DIR false
 //#define INVERT_K_DIR false
@@ -1303,7 +1311,7 @@
 // @section extruder

 // For direct drive extruder v9 set to true, for geared extruder set to false.
-#define INVERT_E0_DIR false
+#define INVERT_E0_DIR true
 #define INVERT_E1_DIR false
 #define INVERT_E2_DIR false
 #define INVERT_E3_DIR false

--- ../Configurations/config/examples/Creality/Ender-3 V2/Configuration_adv.h   2021-07-02 10:58:20.000000000 +0200
+++ Marlin/Configuration_adv.h  2021-07-02 15:13:14.000000000 +0200
@@ -469,7 +469,7 @@
  * The fan turns on automatically whenever any driver is enabled and turns
  * off (or reduces to idle speed) shortly after drivers are turned off.
  */
-//#define USE_CONTROLLER_FAN
+#define USE_CONTROLLER_FAN
 #if ENABLED(USE_CONTROLLER_FAN)
   //#define CONTROLLER_FAN_PIN -1        // Set a custom pin for the controller fan
   //#define CONTROLLER_FAN_USE_Z_ONLY    // With this option only the Z axis is considered
@@ -2550,7 +2550,7 @@
   #define INTERPOLATE      true

   #if AXIS_IS_TMC(X)
-    #define X_CURRENT       800        // (mA) RMS current. Multiply by 1.414 for peak current.
+    #define X_CURRENT       580        // (mA) RMS current. Multiply by 1.414 for peak current.
     #define X_CURRENT_HOME  X_CURRENT  // (mA) RMS current for sensorless homing
     #define X_MICROSTEPS     16        // 0..256
     #define X_RSENSE          0.11
@@ -2568,7 +2568,7 @@
   #endif

   #if AXIS_IS_TMC(Y)
-    #define Y_CURRENT       800
+    #define Y_CURRENT       580
     #define Y_CURRENT_HOME  Y_CURRENT
     #define Y_MICROSTEPS     16
     #define Y_RSENSE          0.11
@@ -2586,7 +2586,7 @@
   #endif

   #if AXIS_IS_TMC(Z)
-    #define Z_CURRENT       800
+    #define Z_CURRENT       580
     #define Z_CURRENT_HOME  Z_CURRENT
     #define Z_MICROSTEPS     16
     #define Z_RSENSE          0.11
@@ -2649,7 +2649,7 @@
   #endif

   #if AXIS_IS_TMC(E0)
-    #define E0_CURRENT      800
+    #define E0_CURRENT      700
     #define E0_MICROSTEPS    16
     #define E0_RSENSE         0.11
     #define E0_CHAIN_POS     -1
@@ -2813,7 +2813,7 @@
    * Define your own with:
    * { <off_time[1..15]>, <hysteresis_end[-3..12]>, hysteresis_start[1..8] }
    */
-  #define CHOPPER_TIMING CHOPPER_DEFAULT_12V        // All axes (override below)
+  #define CHOPPER_TIMING CHOPPER_DEFAULT_24V        // All axes (override below)
   //#define CHOPPER_TIMING_X  CHOPPER_TIMING        // For X Axes (override below)
   //#define CHOPPER_TIMING_X2 CHOPPER_TIMING_X
   //#define CHOPPER_TIMING_Y  CHOPPER_TIMING        // For Y Axes (override below)

Note that enabling SERIAL_PORT_2 will cause compilation errors, this is due to:

blazewicz commented 3 years ago

Here's Proof-Of-Concept 3DBenchy:

Ender3_V2_BTT_SKR_Mini_V2_Benchy

Ender3_V2_BTT_SKR_Mini_V2_DWIN

blazewicz commented 3 years ago

Env used in BTT repo, i.e. STM32F103RC_btt_maple (link) compiles, but neither display nor serial over USB works.

With STM32F103RC_btt it works, but without USB CDC. Everything works only with STM32F103RC_btt_USB.

blazewicz commented 3 years ago

At the moment enabling serial port simultaneously on USB (serial port -1) and TFT pins (serial port 2) is impossible due to: https://github.com/MarlinFirmware/Marlin/issues/22299

looxonline commented 3 years ago

Env used in BTT repo, i.e. STM32F103RC_btt_maple (link) compiles, but neither display nor serial over USB works.

With STM32F103RC_btt it works, but without USB CDC. Everything works only with STM32F103RC_btt_USB.

You can get serial to work by editing the STM32Duino code and changing the USB_EP to single buffer instead of double buffer.

RipperDrone commented 3 years ago

@blazewicz Did u test this combo long enough to tell for sure it does not create freeze issues on the printer anymore? Have it up and running now, but getting random freezes... :-( (have created a new issue ticket with more description today. I know this has been a subject in the past already, but latest fixes in serial comm should have fixed it, but apprently haven't for me... my env is STM32F103RC_btt_512K)

blazewicz commented 3 years ago

@RipperDrone I'm not sure if this is the same issue you're refering to, but every few hours USB serial connection resets and so I can't run longer prints from Octoprint. It might be related to USB serial buffer, but I haven't verified it yet.

Also once in a while I get random Z offset error. Once it prints perfect and at next print, after homing nozzle is too high and I get no adhesion. Only full printer restart helps. I use standard Z stop, no ABL.

blazewicz commented 3 years ago

@RipperDrone have you checked whether your board has original ST chip or GigaDevice clone?

RipperDrone commented 3 years ago

@blazewicz Thank you for following up.

blazewicz commented 3 years ago

no, it's not like an occasional USB buffer overflow every couple hours, it freezes after few minutes already when the printer is warm. After cold start, I MIGHT be able to finish one xyz test cube, but printer will hang on the second already. After that it will hang on every single print, from the point it's starting - sometimes during heating phase already. This, it might be related to so e thermal issue / not necessarily to USB? It happens as well when disconnecting PC from USB and printing from SD card. Of course, the 2 USB ports are opened by Malin, anyways...

Oh, ok, I was able to successfully run 10h+ prints from SD card so I guess its not related to the firmware, maybe your hardware is faulty.

I have not checked for the chip version, but ordered from BTT store directly on Amazon since I was afraid of clones. Cannot check anymore, sending it back and will try a replacement one next week, just to be sure that hardware is ok

Sadly now, during the chip shortage its a lottery what you get.

I read that some boards might have flawed 512k flash. Emory in upper half, and I compiled in _btt_512k eng so far. Should I rather try _btt eng instead when firmware filesize fits in?

I don't think it matters, nothing in linker script is aligned to the end of flash, so as long as binary is <256k there's no difference. Of course its better when linker knows actual size of target flash.

BTW I think _btt_512k env was replaced with STM32F103RE_btt, you should update your repo.

blazewicz commented 3 years ago

You can get serial to work by editing the STM32Duino code and changing the USB_EP to single buffer instead of double buffer.

@looxonline: true, I changed following and USB serial works. I wish there was a switch.

--- ~/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/usb/usbd_ep_conf.c  2021-07-19 00:26:39.000000000 +0200
+++ ~/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/usb/usbd_ep_conf.c  2021-07-19 00:26:30.000000000 +0200
@@ -37,7 +37,7 @@
 #else
   {0x00,       PMA_EP0_OUT_ADDR, PCD_SNG_BUF},
   {0x80,       PMA_EP0_IN_ADDR,  PCD_SNG_BUF},
-  {CDC_OUT_EP, PMA_CDC_OUT_ADDR, PCD_DBL_BUF},
+  {CDC_OUT_EP, PMA_CDC_OUT_ADDR, PCD_SNG_BUF},
   {CDC_IN_EP,  PMA_CDC_IN_ADDR,  PCD_SNG_BUF},
   {CDC_CMD_EP, PMA_CDC_CMD_ADDR, PCD_SNG_BUF}
 #endif
Ulvhedin commented 3 years ago

I can confirm above solution works: Ender 3 Pro, SKR Mini E3 v2.0, chipset GigaDevice GD32F103RET6.

MakManIfest commented 3 years ago

I have followed this mod to the T for a Voxelab Aquila but I'm having issues with freezing and resetting when I home Z. I am using a 3D touch setup on the probe port of the BTT SKR mini e3 v2. I've triple checked all the pins are connected correctly and figure it is something in the firmware. Started by checking the code in the sections that were modified and discovered in pins_BTT_SKR_MINI_E3_common.h that the USB connect pin is set to PA14 which is the same as one of the signal lines on the probe port. What should I change this to?

EDIT: Never mind, signal line on probe is PC14 not PA14.

Another issue is that the input on the screen is backward. Previously I would rotate the knob clockwise to increase numbers ie nozzle temp, or to scroll down the menus, Now I have to rotate counter clockwise. Not a huge issue but it is annoying. How can I change that as well?

MakManIfest commented 3 years ago

Update: Turns out the screen freezing and reset was happening after completion of homing any axis. Home X only... freeze. Home All, it homes all axis then freezes.

However, I tried applying blazewicz changes (including those found here https://github.com/MarlinFirmware/Marlin/pull/22288/files#diff-5a0102cf6df090779b130b924a2511da4922373bfc60c8c4eca427343ba6cc73R120-R124) to Alexqzd's fork V1.3.5 for the Aquila and everything seems to be working fine on the initial testing. I'll go ahead and finish applying my personal settings and run some test prints.

jrneulight commented 3 years ago

Is the freezing issue fixed and USB issue fixed now? If so, what changes need to be made to fix those issues. I am planning on ordering an SKR Mini E3 V2 for my Ender 3 v2 to use with separate Dual Z and Octoprint. Thank you

@blazewicz

ColinM9991 commented 3 years ago

I'll be going through this process in the coming days as my SKR mini has arrived this week.

Are these steps still accurate for the latest revision or is it now easier to use the SKR

ColinM9991 commented 3 years ago

Are there any other wiring diagrams that are more comprehensible?

It is unclear what the viewing angle is of the diagram attached and the pin-out table in the common.h

Which wires exactly should be crossed? Any examples that respect the original colour coding of the Ender 3 v2 display cable?

Update Got there in the end. Soon I'll upload a colour chart for the stock display/IDC cable.

Jaans commented 3 years ago

~Are there any other wiring diagrams that are more comprehensible?~

~It is unclear what the viewing angle is of the diagram attached and the pin-out table in the common.h~

~Which wires exactly should be crossed? Any examples that respect the original colour coding of the Ender 3 v2 display cable?~

Update Got there in the end. Soon I'll upload a colour chart for the stock display/IDC cable.

FWIW, I found the following from @Damquis to be very helpful: https://github.com/bigtreetech/BIGTREETECH-SKR-mini-E3/issues/424#issuecomment-862795145 The colors used match my Creality ribbon cable colors so that made the mapping easier.

I now have a fully working Ender3v2 with the following configured:

A big thanks to everybody for their help and contribution!

ColinM9991 commented 3 years ago

~Are there any other wiring diagrams that are more comprehensible?~ ~It is unclear what the viewing angle is of the diagram attached and the pin-out table in the common.h~ ~Which wires exactly should be crossed? Any examples that respect the original colour coding of the Ender 3 v2 display cable?~ Update Got there in the end. Soon I'll upload a colour chart for the stock display/IDC cable.

FWIW, I found the following from @Damquis to be very helpful: bigtreetech/BIGTREETECH-SKR-mini-E3#424 (comment) The colors used match my Creality ribbon cable colors so that made the mapping easier.

I now have a fully working Ender3v2 with the following configured:

  • BTT SKR Mini E3 v2.0 motherboard
  • EZ ABL Pro 18mm probe sensor
  • OctoPI working over USB
  • BondTech Extruder (bowden)
  • Linear Advance
  • Marlin 2.0.9.2 and DWIN Enhanced (Rotary working) Site Note: Still working out exactly why, but the printed surface deposits are so much smoother than when I used the Creality 4.2.2 board.

A big thanks to everybody for their help and contribution!

Thank you!

Mine was slightly different. It was 1 Black 2 White 3 Grey 4 Purple 6 Yellow 8 Orange 9 Blue 10 Green

As it was my first time crimping an IDC connector there was a bit of confusion as to what the orientation was of the diagrams.

In the end I managed to crimp a cable and the printer is now up and running with BLTouch, just have to calibrate again and shift my calibration to the Conf file do I don't have to do that every time.

Also, a big thank you to everybody who has been looking at this!

awrabb6 commented 3 years ago

How can I go about local adruino framework? I can not compile my firmware with flashing from SD, I get an error saying SD flashing was only compatible with atmega2560 boards so I suspect this might fix my issue

thinkyhead commented 2 years ago

Duplicate of #649