Git Product home page Git Product logo

creality_ender_3_esp32_board's Introduction

ESP32 RepRap Controller Board for Creality Ender 3

Use at your own risk! This is just a personal project and work in progress, and I do not have any professional experience in this field. And although it does work nicely for me, the power supply and heaters have enough power to set your house on fire if not used correctly. Therefore be sure to think about the stuff you do yourself and respect all the necessary safety precautions!

This is a bare minimum RepRap mainboard that I created for my own Creality Ender 3, heavily based on the work of Simon Jouet.
He did a great job developing the HAL for the ESP32 for Marlin including the use of I2S and shift registers to drive the stepper drivers. I2S needs very little hardware overhead, but increases the somewhat limited number of GPIOs on the ESP32 significantly, allowing to also connect the stock Ender 3 display as well as a BLTouch and also parts cooling, control board and hotend fans independently. Additionally it provides perfect stepper timing (based on the ESP32's internal I2S clock).
He also developed his own ESP32 controller which this board is heavily based on.

This is the third iteration of the board, and although it has only been in use for a few hours yet, it does seem to work nicely in every respect. Will post updates here...

Technical Notes

  • The board is the bare minimum to help my Ender 3 to a 32 bit brain and WiFi. I use breakout boards wherever it makes sense to reduce complexity as much as possible. It is not primarly geared towards low cost, but towards little effort (although it took more of it than I hoped for in the beginning ;-) ).
  • The board is through hole and single sided with a few wire bridges. This is because I am so old that I am more used to THT than SMD, because most stuff is on on breakout boards anyway and because I wanted to mill the board on my CNC.
  • There is a PDF with schematic and board layout and a photo of my board available to get a quick look.
  • The board is larger (100 x 160 mm) than the stock Ender 3 mainboard, so you will need (to print) a different case for it. I will probably develop one some time, put it on Thingiverse and then link it from here.
  • SD card reader: I am using a microSD to regular SD extension and have the SD card reader mounted behind the display, so I used a microSD breakout board with the slot oriented inwards where I just plug in the extension cable. The board used to be 5V, but I shorted the voltage regulator with some solder to make it work with 3.3V.
  • Stepper Drivers: I use TMC2208 because they are quiet and relatively cheap. Since I am not interested in any tuning here, I hard-wired it's configuration pins. In case you want to use different drivers, you might have to cut traces on these pins or change the layout.
  • I have yet to make use of WiFi. My plan is to use ESP3D with Marlin integrated at some point in time, but I have yet to figure out how far Luc as gotten with the integration of ESP3 into Marlin.
  • The board should run stock Marlin for ESP32 (as my minor pull requests have all been merged now). For reference, my current personal setup including my complete configuration is available here.
  • In case you create your own board / layout, be sure to take special care of the I2S lines. The first two variants of my board also did work somehow, but the temperature readings were really, really noisy (jumping up and down wildly by 5-8 °C). It turned out that this was caused by my really poor routing of the I2S lines which injected lots of noise into VCC. The second iteration was better, but there was still more noise than I had hoped for, so I took more time for the layout of board revision r3, moved components and switched pins to separate I2S far from VCC and analog pins and to reduce the complexity of the layout, routed all power and analog lines by hand, placed a ground plane around the I2S lines and left only standard digital lines for the auto-router.
  • I used KiCad for the schematic and the board and TopoR Lite for auto-routing. TopoR works quite well, is available for free with some (totally acceptable) limitations and was pretty helpful as it also has a special single-sided mode, even though it took some time to get used to.
  • For milling, I used pcb2gcode, which also worked well for me since it allows to add safety margins easily by setting a cutter width larger than the actual cutter. It will still mill between traces that are closer together than theoretically possible with the specified cutter width (which FlatCAM unfortunately does not do), but leaves all other traces wider. And although it is command-line only, one can put all settings in a config file per project and it does dump out nice SVG files where it illustrates its calculations.

License: MIT

creality_ender_3_esp32_board's People

Contributors

felixstorm-c4a8 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

creality_ender_3_esp32_board's Issues

Thanks, and a Marlin Question

Thanks for this project. I made my own version with a few changes to suit my needs . 2-sided board with ample ground and power planes, jumper and connector options to use external drivers or Pololu sockets, options to use SPI to TMC drivers, etc. My repo is not yet up on GitHub yet, but will be soon.

I'm now debugging the board. My question is this - how much has your Marlin fork diverged? I'm wondering if I should start with your fork or the stock Marlin 2.0. I'm an experienced bare-metal programmer and electrical engineer so either way I'm not too worried. Just looking for the best starting point.

Stepper not respond

I make your prototype board for my ender 3, then i flash with your configuration. but stepper not move.
whats wrong ?? i'm using A4988 driver, 74HC595N.

what 74HC595 different with 74HC595N ?
what the different ??

Error compiling for CR10_STOCKDISPLAY

Thank you for the work done on Marlin firmware to fix many stuff on the ESP32 HAL.

I tried to compile bugfix-2.0.x which has all your changes, but when I try to compile for CR10_STOCKDISPLAY (the one that Ender-3 uses, right?), I get the following error. I was wondering how you went around this error.

I have U8glib 1.19.1 installed.

In file included from /tmp/arduino_build_790171/sketch/src/lcd/dogm/../../inc/MarlinConfigPre.h:32:0,
                 from /tmp/arduino_build_790171/sketch/src/lcd/dogm/../../inc/MarlinConfig.h:28,
                 from /tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp:26:
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp: In function 'void ST7920_SWSPI_SND_8BIT(uint8_t)':
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h:33:25: error: 'LCD_PINS_ENABLE' was not declared in this scope
 #define ST7920_DAT_PIN  LCD_PINS_ENABLE
                         ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/../../inc/../core/macros.h:77:23: note: in definition of macro 'TEST'
 #define TEST(n,b) !!((n)&_BV(b))
                       ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/../../inc/../HAL/HAL_ESP32/fastio_ESP32.h:47:34: note: in expansion of macro 'IS_I2S_EXPANDER_PIN'
 #define WRITE(IO, v)            (IS_I2S_EXPANDER_PIN(IO) ? i2s_write(I2S_EXPANDER_PIN_INDEX(IO), v) : digitalWrite(IO, v))
                                  ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp:47:3: note: in expansion of macro 'WRITE'
   WRITE(ST7920_DAT_PIN, val & 0x80); ST7920_DELAY_2; \
   ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp:47:9: note: in expansion of macro 'ST7920_DAT_PIN'
   WRITE(ST7920_DAT_PIN, val & 0x80); ST7920_DELAY_2; \
         ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp:55:3: note: in expansion of macro 'ST7920_SND_BIT'
   ST7920_SND_BIT; // 1
   ^
In file included from /tmp/arduino_build_790171/sketch/src/lcd/dogm/../../inc/../HAL/HAL_ESP32/HAL.h:37:0,
                 from /tmp/arduino_build_790171/sketch/src/lcd/dogm/../../inc/MarlinConfig.h:30,
                 from /tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp:26:
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp: In function 'uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t*, u8g_dev_t*, uint8_t, void*)':
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h:34:25: error: 'LCD_PINS_RS' was not declared in this scope
 #define ST7920_CS_PIN   LCD_PINS_RS
                         ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/../../inc/../HAL/HAL_ESP32/fastio_ESP32.h:38:41: note: in definition of macro '_SET_OUTPUT'
 #define _SET_OUTPUT(IO)         pinMode(IO, OUTPUT)
                                         ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp:69:7: note: in expansion of macro 'OUT_WRITE'
       OUT_WRITE(ST7920_CS_PIN, LOW);
       ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp:69:17: note: in expansion of macro 'ST7920_CS_PIN'
       OUT_WRITE(ST7920_CS_PIN, LOW);
                 ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h:33:25: error: 'LCD_PINS_ENABLE' was not declared in this scope
 #define ST7920_DAT_PIN  LCD_PINS_ENABLE
                         ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/../../inc/../HAL/HAL_ESP32/fastio_ESP32.h:38:41: note: in definition of macro '_SET_OUTPUT'
 #define _SET_OUTPUT(IO)         pinMode(IO, OUTPUT)
                                         ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp:70:7: note: in expansion of macro 'OUT_WRITE'
       OUT_WRITE(ST7920_DAT_PIN, LOW);
       ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp:70:17: note: in expansion of macro 'ST7920_DAT_PIN'
       OUT_WRITE(ST7920_DAT_PIN, LOW);
                 ^
In file included from /tmp/arduino_build_790171/sketch/src/lcd/dogm/../../inc/MarlinConfigPre.h:32:0,
                 from /tmp/arduino_build_790171/sketch/src/lcd/dogm/../../inc/MarlinConfig.h:28,
                 from /tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp:26:
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h:34:25: error: 'LCD_PINS_RS' was not declared in this scope
 #define ST7920_CS_PIN   LCD_PINS_RS
                         ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/../../inc/../core/macros.h:77:23: note: in definition of macro 'TEST'
 #define TEST(n,b) !!((n)&_BV(b))
                       ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/../../inc/../HAL/HAL_ESP32/fastio_ESP32.h:47:34: note: in expansion of macro 'IS_I2S_EXPANDER_PIN'
 #define WRITE(IO, v)            (IS_I2S_EXPANDER_PIN(IO) ? i2s_write(I2S_EXPANDER_PIN_INDEX(IO), v) : digitalWrite(IO, v))
                                  ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h:90:36: note: in expansion of macro 'WRITE'
 #define ST7920_CS()              { WRITE(ST7920_CS_PIN,1); U8G_DELAY(); }
                                    ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h:90:42: note: in expansion of macro 'ST7920_CS_PIN'
 #define ST7920_CS()              { WRITE(ST7920_CS_PIN,1); U8G_DELAY(); }
                                          ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp:73:7: note: in expansion of macro 'ST7920_CS'
       ST7920_CS();
       ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h:34:25: error: 'LCD_PINS_RS' was not declared in this scope
 #define ST7920_CS_PIN   LCD_PINS_RS
                         ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/../../inc/../core/macros.h:77:23: note: in definition of macro 'TEST'
 #define TEST(n,b) !!((n)&_BV(b))
                       ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/../../inc/../HAL/HAL_ESP32/fastio_ESP32.h:47:34: note: in expansion of macro 'IS_I2S_EXPANDER_PIN'
 #define WRITE(IO, v)            (IS_I2S_EXPANDER_PIN(IO) ? i2s_write(I2S_EXPANDER_PIN_INDEX(IO), v) : digitalWrite(IO, v))
                                  ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h:91:36: note: in expansion of macro 'WRITE'
 #define ST7920_NCS()             { WRITE(ST7920_CS_PIN,0); }
                                    ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h:91:42: note: in expansion of macro 'ST7920_CS_PIN'
 #define ST7920_NCS()             { WRITE(ST7920_CS_PIN,0); }
                                          ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp:91:7: note: in expansion of macro 'ST7920_NCS'
       ST7920_NCS();
       ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h:34:25: error: 'LCD_PINS_RS' was not declared in this scope
 #define ST7920_CS_PIN   LCD_PINS_RS
                         ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/../../inc/../core/macros.h:77:23: note: in definition of macro 'TEST'
 #define TEST(n,b) !!((n)&_BV(b))
                       ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/../../inc/../HAL/HAL_ESP32/fastio_ESP32.h:47:34: note: in expansion of macro 'IS_I2S_EXPANDER_PIN'
 #define WRITE(IO, v)            (IS_I2S_EXPANDER_PIN(IO) ? i2s_write(I2S_EXPANDER_PIN_INDEX(IO), v) : digitalWrite(IO, v))
                                  ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h:90:36: note: in expansion of macro 'WRITE'
 #define ST7920_CS()              { WRITE(ST7920_CS_PIN,1); U8G_DELAY(); }
                                    ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h:90:42: note: in expansion of macro 'ST7920_CS_PIN'
 #define ST7920_CS()              { WRITE(ST7920_CS_PIN,1); U8G_DELAY(); }
                                          ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp:103:7: note: in expansion of macro 'ST7920_CS'
       ST7920_CS();
       ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h:34:25: error: 'LCD_PINS_RS' was not declared in this scope
 #define ST7920_CS_PIN   LCD_PINS_RS
                         ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/../../inc/../core/macros.h:77:23: note: in definition of macro 'TEST'
 #define TEST(n,b) !!((n)&_BV(b))
                       ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/../../inc/../HAL/HAL_ESP32/fastio_ESP32.h:47:34: note: in expansion of macro 'IS_I2S_EXPANDER_PIN'
 #define WRITE(IO, v)            (IS_I2S_EXPANDER_PIN(IO) ? i2s_write(I2S_EXPANDER_PIN_INDEX(IO), v) : digitalWrite(IO, v))
                                  ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h:91:36: note: in expansion of macro 'WRITE'
 #define ST7920_NCS()             { WRITE(ST7920_CS_PIN,0); }
                                    ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h:91:42: note: in expansion of macro 'ST7920_CS_PIN'
 #define ST7920_NCS()             { WRITE(ST7920_CS_PIN,0); }
                                          ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp:118:7: note: in expansion of macro 'ST7920_NCS'
       ST7920_NCS();
       ^
In file included from /tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_DOGM.cpp:42:0:
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_DOGM.h:50:36: error: 'LCD_PINS_ENABLE' was not declared in this scope
     #define U8G_PARAM LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS       // Number of stripes can be adjusted in ultralcd_st7920_u8glib_rrd.h with PAGE_HEIGHT
                                    ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_DOGM.cpp:78:15: note: in expansion of macro 'U8G_PARAM'
 U8G_CLASS u8g(U8G_PARAM);
               ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_DOGM.h:50:53: error: 'LCD_PINS_RS' was not declared in this scope
     #define U8G_PARAM LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS       // Number of stripes can be adjusted in ultralcd_st7920_u8glib_rrd.h with PAGE_HEIGHT
                                                     ^
/tmp/arduino_build_790171/sketch/src/lcd/dogm/ultralcd_DOGM.cpp:78:15: note: in expansion of macro 'U8G_PARAM'
 U8G_CLASS u8g(U8G_PARAM);
               ^
Error compiling for board ESP32 Dev Module.

After declaring the pins required, I get the following error instead.

/tmp/arduino_build_790171/sketch/src/HAL/HAL_AVR/u8g_com_HAL_AVR_sw_spi.cpp: In function 'void u8g_com_arduino_init_shift_out(uint8_t, uint8_t)':
/tmp/arduino_build_790171/sketch/src/HAL/HAL_AVR/u8g_com_HAL_AVR_sw_spi.cpp:71:15: error: cannot convert 'volatile uint32_t* {aka volatile unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment
   u8g_outData = portOutputRegister(digitalPinToPort(dataPin));
               ^
/tmp/arduino_build_790171/sketch/src/HAL/HAL_AVR/u8g_com_HAL_AVR_sw_spi.cpp:72:16: error: cannot convert 'volatile uint32_t* {aka volatile unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment
   u8g_outClock = portOutputRegister(digitalPinToPort(clockPin));

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.