Connect with us

GRBL Arduino and SD Card Reader for Headless CNC

Discussion in 'Microcontrollers, Programming and IoT' started by TehMaxwell, Mar 23, 2015.

Scroll to continue with content
  1. TehMaxwell

    TehMaxwell

    14
    4
    Mar 21, 2015
    Hey all,

    This is a quick question about the serial ports on the Arduino. But first some background information to put the idea into context.

    I am looking ahead to next years A Level Project - this years was a Robotic Arm, see my introduction post for info on that! - and thinking about the option I have. Now one option I am extremely interested in is the idea of using GRBL to make a CNC Router capable of cutting Foam, Plywood and other materials. During research I almost dismissed the idea down to the fact that it would be too simple, to get good marks a project needs to incorporate electronics, programming and structural design. And as GRBL uses the Arduino and Stepper Drivers (Which are too much work for me to make) there would be no circuitry or programming needed to make a functional CNC Machine. I was about to dismiss the idea (much to my own disappointment) when my teacher asked me if there was anything I could add to it to make it more challenging. I hadn't really thought of it, but what I had researched was as simple as you like in terms of a CNC Router. No end stops. No LCD display. Just the raw driver and mechanical structure.

    It occurred to me that our school laser cutters use some Memory to store the files that are sent to them, this is so that you can run the job multiple times without having to resend the file. This was a perfect extension for the project! Memory is something that is rarely delved into at A Level, as it involves a higher level of understanding about coding and SPI protocol in some cases. But I like a bit of research, so I started to obsessively research the idea in my spare time. It turns out due to the fact that GRBL takes up all of the Arduino's Memory you need to use two Arduinos to complete this idea. One to read from the memory and one to run GRBL. The data is sent over the Serial Ports.

    Now this is where my question comes in! (Took me a while didn't it, I'm a sucker for a good story though.) I understand that you can use a Master Writer/Slave Reader Setup to send data across the Serial Ports. And that certain pins can be used to "bypass" the USB B serial connection on the Arduino. The problem I have is, if this is done, would GRBL still be able to interpret the data you were sending across or even read it? And if it can, how do you have to send it across for GRBL to accept the format? Can you just send the lines of G Code as separate data strings?

    Hope you guys can help!

    Sam
     
  2. Gryd3

    Gryd3

    4,098
    875
    Jun 25, 2014
    You will need to determine how information is sent to the GRBL program written on the Arduino.. If all you're wanting to do is save and read a program, perhaps you should look into changing your approach to using an SD card.
    Of course, if GRBL is simply expecting values to be sent to it via, serial then you can have any other device feed it information. Please note that some of the saved files can be very very large depending on the movements programmed for a particular job...
     
  3. TehMaxwell

    TehMaxwell

    14
    4
    Mar 21, 2015
    Thanks for the information!!

    So by changing your approach what do you mean exactly? And what sort of devices could also send the information? The problem is GRBL takes up all the available memory on one Arduino, so you need to run two in parallel of you want to read an SD card or anything like that.

    Thanks for the help!
     
  4. Gryd3

    Gryd3

    4,098
    875
    Jun 25, 2014
    Well, I took a quick look at it, and it appears as though the serial commands can be sent extremely easily.
     
  5. TehMaxwell

    TehMaxwell

    14
    4
    Mar 21, 2015
    Thats good to know! Thank you so much. That correlates with what my research said, but I wasn't sure. This makes life a whole lot easier, as whatever device your reading from you should be able to just send a string that contains the next line of G Code. I love it when something is this optimized, credit to the programmers of GRBL.

    Seriously considering this CNC Machine now, if I do I will post a thread!

    Thanks for all the help, I'm really really grateful! :D
     
    Gryd3 likes this.
  6. mausi_mick

    mausi_mick

    1
    0
    Jul 21, 2015
    I have build a view years agoa small cnc machine with headless connection via sd-card under grbl 6.... But it was not flexible enough . Therefore I build a small board with
    2 x 16x Keyboards over I2C, a small Graphic SPI-Display (240x320) with a SD-Card on board. The CPU is a modified Arduino NANO with 16 MHz. I changed the supply from 5V to 3.6v , therefore I have no trouble with 3,3V Moduls like SPI-RAM 23K256 (for messages from grbl) and ext. EEPROM 24C128 (self gener. (error)messages. I tested the controller over Rx Tx.
    on the display I get information from grbl (UART,rx-tx) . The grbl run now with 9.i (115200 Baud).
    I hope that i will be more flexible with the keyboards to change the grbl Parameters or to start G-Code commands.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-