MetalWorkerTools / grbl-L-Mega

An open source, embedded, high performance g-code-parser and CNC milling controller written in optimized C that will run on an Arduino Mega2560. Forked from GRBL modified for use on a lathe with spindle sync threading
https://github.com/MetalWorkerTools/grbl-L-Mega/wiki
Other
15 stars 9 forks source link

BLOCK_BUFFER_SIZE reduced? #1

Closed bdurbrow closed 4 years ago

bdurbrow commented 4 years ago

This is in the config.h for your fork...

`

define BLOCK_BUFFER_SIZE 34 // Uncomment to override default in planner.h.

`

I was wondering why? RAM use, CPU performance (particularly while threading?), or both?

HuubBuis commented 4 years ago

Threading uses a bit of addition ram for storing variables. To be (code) compatible to the Grbl-L version, these variables are defined globally (takes less ram but not so pretty code). To avoid over filling the RAM (will result in crash), the block buffer size is decreased so that not less RAM is available as compared to the original Grbl-Mega version. So the reason is to reduce RAM usage. Unlike a mill, on a lathe there aren't so many Gcodes lines to send so i don't expect any performance penalty. BLOCK_BUFFER_SIZE is a global setting and effects the block buffer throughout the whole program.