GRBL_ESP32 🇬🇧
Hello everyone,
I am creating this ESP32 dedicated topic to help any beginners like me out there that are frightened when it comes to electronics/development. Also, a huge thanks to @Philippe and @Peter Donovan who are the brains behind this tutorial!
Why the upgrade?
- Faster (boots in 2 seconds)
- Powerful (dual-core 32bits Ă Less prone to G code errors)
- Spindle relay control
- Wifi/Bluetooth with a Web ESP3D interface (no need to USB all the time, but in case you do, you can use UGS or CNCjs)
- Misting control
- PWM Laser control
- Probe connector
- Micro SD
- And probably much more…
First what you’ll need in comparison to the Arduino/CNC Shield:
- 1x ESP32 GRBL board (I have this one:https://www.tindie.com/products/33366583/grbl_esp32-mpcnc-cnc-controller-ver-122/) Note to buy the board without ESP32 since the program we will generate is custom. It is important to note that the developer of this board gives you access to a slack channel that is very active/knowledgable, and the owner answers every question you might have.
- 1x ESP32 Controller (I have this one: https://www.mouser.com/ProductDetail/espressif/esp32-devkitc-32d/?qs=%252bEew9%252b0nqrDsObWEpDx6YQ%3D%3D&countrycode=US¤cycode=USD)
- If you are using external drivers (I have DM542Ts for the NEMA23), you’ll need these adaptors (https://www.tindie.com/products/33366583/external-stepper-motor-driver-ver-11/) instead of using the regular stepper motor driver modules (e.g. DRV8825)
Before installing the ESP32 on the Board, you’ll need to program it:
Prepare the computer
- Download and Install Visual Studio Code
- Download and Install Platformio IDE
- Plug the ESP32 Controller via USB to your computer.
- Check that it’s recognized: Device Manager > Ports (you should see another port)
- If you don’t see the controller in the ports list, check the USB list. It should be here with a warning; this means you need to install the drivers so it’s properly recognized by Windows.
- Check now that you can see the board in the Devices tab in Platformio (click refresh if not)
Prepare Files
- Download files https://github.com/tokaphi/Grbl_Esp32
- In Visual studio, File > Add folder to Workspace and look for the folder you just downloaded
- Under GRBL_ESP32 folder > Machine, open the file “topscnc_heavy.h”
- Modify this file based on your machine configuration (sizes, accelerations, etc)
- Close and Save topscnc_heavy.h
Compile and Upload
- Click on the Build icon (small check icon in the bottom left of your screen) No worries if you get warnings such as “HOMING_CYCLE_0” redefined, this won't prevent the successful install)
- Click on the Upload icon (right arrow icon in the bottom left of your screen). Wait a little but you should see a SUCCESS in green after 20/30 seconds.
Connect
Unplug and plug again the controller. Now, you should now see a new wifi network called “GRBL_ESP”. The password is 12345678. The ESP3D control interface will automatically popup once connected.
Missing file
Once connected to the controller, it will ask you for Index.html.gz
You can find the file in the original folder you downloaded on Github in the previous step
You are done with the microcontroller!You can now install it on the board. Be careful with the direction!
Modifications you’ll want to make to the $ parameters can be done through the interface (Wrench GRBL Icon at the top). No need to go back to visual studio. Unless major mods of course.
As for the rest of the install: I created a wiring diagram for beginners like me, hope this helps! You can also find the wiring for an optocoupler to avoid EMI... https://www.dropbox.com/s/m4e9qbq3mhpfq14/CNC%20Wiring.pdf?dl=0
As noted on the diagram, be aware of the inversion for the secondary Y motor like the picture below
I'm almost done with my setup but I will update this original post as I go if need be.
Enjoy!
@Turlutte ; Big thanks for thèse synthetic ans helpfull topic
I just order Esp32 GRBL board, ESP32 controller and optocoupler board. In time i reciever the goods i will take a look at software feature. Thanks one more time Turlutte for spending the time for this topic ....
Avec tres grand plaisir! Glad it helps. @Philippe is a big help and knowledgable on the topic. He commented on Grozby88's machine when he had Gcode missed steps and EMI issues, that's when I decided to investigate more the electronic side.
Bart Dring is very fast, the board is already on the way and he send me a email with several links to help on ESP32 backround and way to contact him....I am really pleased with first steps esp32 experience based on BD work.
The slack channel is very active and he answers/help everybody. This is very impressive indeed.
Since CNCjs is still in use for edge finding, Eric Naer is using a macro that should work here i think. All détails here : https://www.youtube.com/watch?v=WLbf2-m6VN0
Super! Merci!
Thanks for this post, i will probably port my CNC to an ESP32 !
So i received my esp32 board

I trie to upload GRBL32 following what you write but it failled. See the sreen capture



Hi, i found the issue....by my self : in the file "topcnc_heavy.h" 2 lines was missing in the beginning of the code
line 16 : #defineX2_DIRECTION_P INX_DIRECTION_PIN
line 18 : #defineY2_DIRECTION_P INY_DIRECTION_PIN
With 2 adds building goes to end and succed.
But yet as we haven't a second X motor, i don't know how this grbl will react on our topcnc????