Close

Progress with GRBL for EDM

A project log for G-EDM

The G-EDM is an electrical discharge machine that supports sinker EDM, EDM engraving, EDM drilling and Wire EDM operations. #Drahterodieren

gedm-devgedm-dev 06/18/2023 at 10:390 Comments

GRBL is a very cool project but it is not suitable for EDM without deep changes.

The process of GRBLis well made:

1. Take a line of GCode

2. Parse the line

3. Pass the line to the planner that creates blocks of instructions and puts them into a buffer. It defaults to a maximum of 16 blocks that can be place in the planner buffer or 15 if the blocks contain the current line number..

4. An ISR timer interrupt routine grabs a block from the planner and copies the block into the segment buffer to work with it.

5. Each time the interrupt is called it does one step. It counts the steps it has done and if ready it purges the current segment buffer block and goes to the next one.

6. There is also a second planner buffer for system motions. It is implemented in a way that after such a system motion is executed it fully restores the default ring buffer.

It is not possible to just retract an axis without a deep change of the segment or planner buffer. And this is what I'm going to do next.

There are multiple ways to alter the code to make it suitable for EDM and I'm pretty sure the fork will turn out nice in the end.

GRBL can accept different sources for inputs and creates an inputbufffer for each of them. The main protocol loops over each of those possible inputsources to check for new lines. I think this is somehow messy and removed all of them except the main internal input buffer. So instead of looping over 4 possible inputsources it now knows that there is only one source for inputs.

The changes already done reduced GRBL code from about 2.7mb to 2.4mb.

Completely purged the WebUI, Bluetooth, WIFI, Telnet, Bluetooth, xModem, UART stuff.

Replaced the internal Serial communication.

Removed different loops that want to loop over all clients to send messages or fetch inputs.

Replaced the SD card code with a custom class.

Created an API that connects the Touchinputs or SD card to the specific GRBL functions.

And some other stuff.

Discussions