ESP32-Based Grbl CNC Control Board

Here is a -d- to make the link work. :slight_smile:

I made a case for it. https://www.thingiverse.com/thing:4531745

4 Likes

Hello
I have a small cnc and I would like to control it with the card I just received

the motors work perfectly but not the relay
here are the modifications that I made:
in config.h
// !!! For actual use, change the line above to select a board
// from Machines /, for example:
// # include “Machines / 3axis_v4.h”
#include “Machines / mpcnc_v1p2.h”

add the file mpcnc_v1p2.h in the Grbl_Esp32 folder

1 Like

Hi Nathan, firstly…fit some heatsinks to the stepper drivers.

Also do yourself a favour and buy some 4way jumper cable sleeves…those single ones will cause you connection problems down the line…

For your relay …did you uncomment //#define USE_SPINDLE_RELAY in mpcnc_v1p2.h?

Actually, that is my board in the photo. Those are not drivers; they are optos connected to my external drivers (one is just visible on the right). I had used all of my 4-position connectors when I wired this up so I used what I had.

it is not card, it was just to show the model

#ifdef USE_SPINDLE_RELAY
#define DEFAULT_SPINDLE_RPM_MAX 1.0 // must be 1 so PWM duty is alway 100% to prevent relay damage
#else
#define DEFAULT_SPINDLE_RPM_MAX 1000.0 // can be change to your spindle max
#endif

#define DEFAULT_SPINDLE_RPM_MIN 0.0 // rpm

#define DEFAULT_LASER_MODE 0 // false

Here is my montage

I also tried the relay directly on the pin of the esp32 it does not work either
if j Send M3 or M3 S1000, the relay must be activated?

OK.which pin on the esp32 are you looking at, SPINDLE_ENABLE, SPINDLE or SPINDLE_PWM? On your board both the spindle enable signal and the PWM output is fed into U8…a 3 to 5v level shifter, I found the spindle_enable function was reversed such that it went LOW on enable which cut off the spindle PWM. A fix was issued to me (fix 431) that corrected the problem by adding the option to reverse the spindle enable high/low in config.h, this resolved the issue and spindle pwm was then available at the interlock pins, but I was wanting to use PWM…you don’t appear to want PWM, just on/off.
I suggest you use Spindle_enable signal, available on esp32 pin GPIO32 and link that to R5 inste ad of the spindle signal to just drive the relay…it gets around having to play with the min and max spindle rpm to frig the pwm signal to either on of off, and the issue of U8 cutting the pwm signal off just when you want it on.
Schematic_1p2p1.zip (126.2 KB)

I believe the fix I was given has been included into the main branch but just in case it has not I have uploaded the config.h from the fix config.zip (16.0 KB)

Ah yes…I see now…my mistake. It is confusing though…posting a picture that is not related to the issue

1 Like

OK…but did you uncomment //#define USE_SPINDLE_RELAY in mpcnc_v1p2.h? without that, the firmware will think you are going to be using PWM and not utilise the relay.

no I had not uncommented // #define USE_SPINDLE_RELAY
now I can no longer upload to the ESP32
tank

I have found you can get answers to your questions on github. That might be the best way to solve your problem.

There is also a buildlog slack were you get answers usually the same day.

OK…well that might explain why the relay wouldn’t work. I find sometimes the ESP32 dev boards are a little tricky to get into programming mode…perseverance is required. If your ESP32 is busted and you want to buy a new one I would strongly recommend you get one that uses the CP2102 USB to serial chip and not the CH341.

Can anyone with a GRBL board test to see if Easel web-based software connects and can run the machine? That software is dead simple for what I need it to do and free. Will be switching my RAMBo/marlin board as soon as I can find a suitable GRBL alternative.

Thanks!

Have you looked at Bart Dring’s boards?

I tried…both a bare uno/cncshield that came up in windows as com21 and my cantilevered laser machine which comes up as com14…both GRBL1.1f…neither would connect with Easel as other(GRBL).
Perhaps it is to do with the driver I use for my (counterfeit) arduinos?.. I have to use a CH340 driver and just maybe Easel is looking for the bona fida Arduino driver?. I tried installing the downloaded Easel driver but windows is quite happy with the CH340 driver and wont install a 32bit driver on my 64 bit win7

…however, I was able to manually select the correct com port and got Easel to send gcode to the nano based controller…so it looks like you are in luck…Easel will work with an uno/cncshield…

…and that is quite a nice piece of free software, especially with the add on apps…thanks for sharing.

2 Likes

Thanks! For making basic 2d carvings like signs it’s great. Cuts out all the time I spend in Fusion360 on simple projects. Can also function as a code sender. Somewhat limited in the free version, but you get 2 free days a month, and that’s probably fine for my needs.

Looks like I’m about to head down a CNC Shield rabbit hole. Any advice? I have an Uno lying around already…do I just need to wire up one of the sub-$20 shields from Amazon?

Also looks like I can snag a Sainsmart controller with GRBL for $25 online. Might even be easier.

Hello I finished the station finally it works well