Monday, January 2, 2023

GRBL ESP32 CNC CASE

 
This is the Berlin (wood) workshop. We currently have three 6040s, one 9040, and we are building a collection of 3040s upstairs for little work. Managing all these CNC machines at once, in a loud and dusty environment, required some rethinking.
 
The traditional way to run CNCs is with a desktop computer assigned to each one, that sit nexts to it and you go to it every time you need to change a job. There exist, however, wonderful open source operators for arduino nano (GRBL) and ESP32 (GRBL ESP32). These make the woodshop into an internet of cutting things!
 
So, in GRBL ESP32, each machine is on the local network, and has a name that you type (such as tony.local) into a web browser. There are seven signals that then go to the CNC machine through a printer cable. We are currently working on making musical sense out of these square waves, but this report concerns itself only with making CNC machines work the best.

Each ESP32 fits perfectly inside a Busch-Jaeger "Ocean" Steckdose, which was already being used for the electrical wiring in the workshop. When I got one for myself I was rekindled on home improvement case hacks. It even has a rubbery cable relief that perfectly fits one usb cord and one printer cable, which is split up and soldered directly to the board. Extract all the electrical plug furnishings, and the protective flap on the front leaves a perfect little space for the SD card, also wired directly to the board.

Eventually, I realized something about the dusty, noisy environment. These are little computers, being left in the cold woodshop, with tons of electrical noise emanating from the spindles. Our biggest CNC was crashing a lot, and I made a plan to separate its grounds with opto-isolators. Now the ESP32 has its own private ground, which it does not share with the ground of the CNC driver. You can see in the following picture, floating above a layer of kapton tape, seven licorice jelly beans which are the optoisolators for each channel:
 
Inside an Ocean Steckdose with ESP32, seven licorice jellybeans are there to optoisolate grounds.
 
 
how to prep the opto-isolator spider ticks.

Another brashless view inside an Ocean Steckdose.

Schematic of the opto-isolator circuit, after Oskar Schlemmer.
 


Ocean Steckdose with GRBL ESP32, and in front, an Aquastar Steckdose with GRBL on a nano, which requires the nintendo game-style controller for movement and program control. This option is also solid, especially at 9600 baud.

Another view inside the Ocean Steckdose with ESP32. You can see the cathode resistors (around 150 ohm) for each optoisolator. Red button is hold, and there's a resume button on the opposite side.
 
Here is a handy chart that should work with any parallel (printer cable) driver on any machine bigger than a 3040.:
signal name
esp32 pin
parallel cable pin
nano pin
xstep 12 2 2
xdir 14     3 5
ystep
26
4
3
ydir
15
5
6
zstep
27
6
4
zdir
33
7
7
spindle PWM
2
1
11

Note, the SD card is wired according to the standard hacker instructions, where you solder directly to a microSD holder.

Under the 3040 size, CNCs don't usually offer a printer cable connection. They are usually only connected by USB, but usually they have their own GRBL driver and you can always hack into the TX and RX pins to use a nintendo-style (also called "random-style" in the 3018 manual) controller.

No comments:

Post a Comment