ESP32 Ground Control and Firmware in One

Looks awesome!

Okay so the 5V regulator was working fine, I just set up the feedback voltage divider wrong so it was outputting 1.6 V instead of 5V. One mod wire later and all the LEDs are lit up.

1 Like

What’s the max current capacity of the traces from the +12/24 supply?

How will the ATmega328 be programmed? Will it be done by the esp32?

1 Like

At the start of the trace it is 6mm wide, so my PCB calculator state 14A at a 20C temp rise.
The thinnest is the short leads from drivers to motor connectors, which are 0.75 mm which my PCB calculator says is around 3A at 30C temp rise.
Certainly 3A continuous on all drivers with short peaks to 9A should be more than okay.
We can always order boards with thicker copper if current capacity is too low.

Yes. The reset pin is connected to the ATmega so the ESP32 is able to put it into programming mode (which is triggered by holding the reset pin high). Then it can be programmed over SPI. This is equivalent to ISP programming.

This is actually what I am working on right now. When I assembled the board the absolute first thing I wanted to do was spin a motor. Which turned out to be a difficult task because the motors are only attached to the ATmega.

There exist a bunch of projects to reprogram an Arduino from an ESP32, however none that I can find are useful. They all assume there is a bootloader on the Arduino and can communicate via UART. I am currently going to try to port avrdude since it appears to be the closest to what I need.

I will make it such that a firmware.hex file is uploaded to SPIFFS on the ESP32 and can be flashed from there to the Arduino.

2 Likes

Can you just use an external programmer? Once you have it working reliably you shouldn’t have to change the ATMega firmware.

Not all that easily - would require soldering wires to the board temporarily. I would rather just get this over with.

Anyway, just wanted to give the update that I have the ATmega flashing firmware for ESP32 ready to go and I have gotten the motor to spin successfully. Also, I have the encoder counter working so I can spin the motor specific amounts.

I am currently working on off the first revision of the ATmega firmware - it needs improvements such as being able to control motor channels other than the first one.

Then I can work on modify GRBL_ESP32.

4 Likes

Glad to find your project. I was just about to order some 5206 SMDs. I love the ESP32. Do you really still need the crusty Arduino?

SPIFFs is a flat file system everyone is moving to LittleFS as a file system on the ESP. You can store your gcode on the LittleFS partition.

GRBL ESP32, uses ESP3D ( https://github.com/luc-github/ESP3D-WEBUI) as the web interface. That is also used to drive Marlin 2.0 on the ESP32. So you can just customize the WEBUI. Its pretty nice.

Max

PS I just bought a cheap Hot air Station around $30. Works pretty well. With a bit of solder paste no one should be afraid of SMD. You can even order a Solder stencil for $10.

Heh, yeah, I have always hated how outdated/underpowered they are compared to ARM 100+MHz. But whenever I need some glue logic I still reach for them. Its tough to beat their level of simple/cheap. Here they are just for ā€œreceive bytes, toggle pinsā€.

Any recommendations for future projects?

Perhaps, there just isnt much space. There is only 2MB for filesystem. WEBUI along with space for updates leaves only 1MB.

Yeah its something I need to get into. I have nearly bought a toaster oven (for soldering, not food prep :stuck_out_tongue:) on a few occasions

1 Like

one advantage of the arduino is it’s very predictable timing. the more
sophisticated the chip you use, the more chances there are that timing becomes
unpredictable due to interctions between cores or external inputs.

David Lang

I love ESP32, but I do keep a bunch of Nanos around.:slight_smile:

Yeah, necroposting, I know. Has this had a chance to go any further? Last summer I converted my 2008 mini-router (6x9, inches and not feet) to one of Bart’s boards and grbl_esp32 (and FluidNC when I get around to ordering a replacement DevC board), now I’m towards the end (or maybe at the beginning…) of making my 4th axis BobsCNC Revolution work with FluidNC. The hardware was amazingly simple, a $10US WeMos D1 R32 (clone, not real WeMos who never actually made an ESP32 board) in an Uno formfactor, with a CNC shield V3 and 4 DRV8825s, around $20US all in with a few junkbox drivers, not counting the board the junkbox shield from who knows where blew the wireless on. The embedded server web pages work fine, and it’s very nice to edit a text config and reload it in a few minutes instead of recompiling. Many, but not all, config items can be changed from the web page for testing, but are lost on reboot.

It’s a true 4 axis setup, XYZA, although I don’t have a way to test Y. The X home switch appears to be sticking, and FluidNC seems to have issues if homing goes funny. Otherwise working pretty well, haven’t done any torture tests but it’s been carving trees and an elk on a 2’ long piece of birch (aka driveway brush) dried for a bit over 6 months. Maybe an hour roughing, 3 finishing with a 1/8" ballnose. Another hour or so rounding out the blank typing fun commands like G1 X400 A30000 F2000. Controller seems to holding up. UGS’s visualizer freaks out on the 150K line gcode file sizes (even with the java space increased to a GB) and it has to be restarted afterwards to make the jog controls work, but it keeps sending gcode until the file ends. Estimates the job as around 100,000 minutes :). Not quite prime time yet but close

2 Likes

I’m still working on it. There are some issues to be worked out, but it’s mostly working. The big issue is that I can’t really launch anything until the chip shortage get’s sorted out. The wait time for the parts I want to use is sitting at around a year right now :roll_eyes: …hopefully that will improve soon-ish

It’s hitting non-chip parts too. I currently have had JST sockets on backorder for… months now. PCB’s though, not a problem. JLC PCB still cranking those things out.

1 Like

Yeah. Making production quantities is way harder than hobbyist onesies. Mouser’s got over 2600 DevKitC boards on hand but I’m guessing it’s the motor driver chips that are the problem. I’m a fan of replaceable processor modules. Besides blowing one integrated board it makes it easier to save off a known-good configuration and swap modules.

Are you using FluidNC as a base and adding kinematics? There’s already something there for wallbot plotters, but it looks too simplistic for anything close to a Maslow.

1 Like

Yeah, exactly. I haven’t ported over from GRBL ESP32 (the earlier version) to FluidNC yet, but I don’t expect that to be too hard. It’s the chip shortage that’s really the main issue.

2 Likes

This read was exciting. I just wish I understood how this stuff works.

1 Like