Mach3 or GRLB, reading the G-CODE directly from an SD Card? - Page 1
Forum section: electronics / projects

author: salihkanber
author_rank: Regular Contributor
timestamp: June 02, 2024, 12:16:42 am
content: Hello Guys! Mach3 or GRLB systems require a G-Code reader - interpretter card usb-connected to a computer with related sw.My question is: can we read from an sd card and usb-send g codes to those cards with a rasp pico (probably) directly (without a computer and related sw)?Any comments, links, feedback will be highly appreciated! Thank you!

author: langwadt
author_rank: Super Contributor
timestamp: June 02, 2024, 12:30:55 am
content: Quote from: salihkanber on June 02, 2024, 12:16:42 amanything that can talk serial port (over usb) can stream gcode to grbl

author: moffy
author_rank: Super Contributor
timestamp: June 02, 2024, 01:08:41 am
content: Yes, you just need the code to read the SD card then to configure the USB port as a serial device, with a simple serial transmit program on the pico. GRBL requires a send then wait then response structure so that you don't overflow its buffers.

author: H.O
author_rank: Frequent Contributor
timestamp: June 02, 2024, 05:36:06 am
content: A Mach3 compatible motion control board does not work like that, it does not accept G-code. Stick with GRBL for what you want to do.

author: Ian.M
author_rank: Super Contributor
timestamp: June 02, 2024, 06:57:24 am
content: Why reinvent the wheel? Offline controllers that stream G-code from SD card to GRBL 1.1x are readily available. Simply google forgrbl offline controllerand you'll find plenty from Amazon, Ebay and the usual far east e-bazaar sites. They generally hook up to the GRBL ATmega328Ps UART RX and TX pins, but may also need to share its RESET signal and need to tap its USB Vbus so they can deactivate to avoid conflicts when a PC is connected to the GRBL board's USB port. If you want to roll your own, there are several projects on Github, some of which can run on older commercial offline controller hardware, and others that are Arduino based.

author: salihkanber
author_rank: Regular Contributor
timestamp: June 02, 2024, 08:54:55 am
content: Quote from: Ian.M on June 02, 2024, 06:57:24 amYou are totally right, thank you.. Already put an order on one..I am planning to build a versatile cnc-like 3 axis multi-purpose machine structure, which then be used as a pick-and-place robot, silicone filler applicator etc.With your help, now I think the offline GRLB G-code system will be a good choice to build such a machine. To change the functionality of the machine: change the end effector, change the g code and then push the button..Is it an ok-to-go way or am I reinventing the wheel again or what do you guys think?

author: salihkanber
author_rank: Regular Contributor
timestamp: June 02, 2024, 09:00:41 am
content: Quote from: H.O on June 02, 2024, 05:36:06 amThank you, with your help already switched to GRBL direction.. Now, just out of an engineering curiosity... How can I learn about the USB serial communication protocol between the Mach3 board and the computer, and how-which data is sent and received?If you know, could you or anybody summarize it a bit or share a resource link?Thank you!

author: Ian.M
author_rank: Super Contributor
timestamp: June 02, 2024, 09:40:06 am
content: Err . . . See the gnea GRBL wiki:https://github.com/gnea/grbl/wikifor the serial protocol, specifically thehttps://github.com/gnea/grbl/wiki/Grbl-v1.1-Interfacepage.N.B. GRBL doesn't require a USB link, it can be controlled over any sort of serial link using RS-232 framing and no flow control. Its just that the original Arduino platform and most of the purpose built GRBL boards include a USB <=> logic level serial converter, that appears as a USB COM port to the host.

author: salihkanber
author_rank: Regular Contributor
timestamp: June 02, 2024, 01:14:04 pm
content: Quote from: Ian.M on June 02, 2024, 09:40:06 amThank you man, totally understood the GRBL side.. Can you also provide info on Mach3 communication protocol too?And, what do you think of using offline GRBL on the multi function machines? Change the g code and change the functionality? Can it be the right way to go?

author: H.O
author_rank: Frequent Contributor
timestamp: June 02, 2024, 02:05:07 pm
content: Quote from: salihkanber on June 02, 2024, 09:00:41 amVery brief:With GRBL, GRBL is the G-code interpreter, motion planner and motion controler. It accepts high level G-code commands via its serial interface and outputs control signals (step & direction) to the motor drivers. Anything than can send plain text commands can "run" the GRBL device.With Mach3, Mach3 is the G-code interpreter and motion planner while the attached board is the motion controller.Mach3 reads the G-code commands from a file, interprets it and plans the motion. It is then up to the developer of the attached board (the motion controller) to craft a plugin for Mach3 to act as a middle man between Mach3 and the board, be it USB attached or Ethernet attached. Therefor Mach3 does not have a specified communication protocol. There is, however, documentation available on how to write plugins,here, for example.Hope that makes sense.

author: salihkanber
author_rank: Regular Contributor
timestamp: June 02, 2024, 02:48:32 pm
content: Quote from: H.O on June 02, 2024, 02:05:07 pmIt was very helpful, thanks for your time

author: salihkanber
author_rank: Regular Contributor
timestamp: June 03, 2024, 07:57:46 pm
content: FTSOSK I'd like to share more.. First of all, I reviewed the GRBL Controller models consisting of 1 and 2 units.As I mentioned in the previous posts, since we will use them in the control systems of our own machines and we can create and send G-codes in different ways, the models consisting of 2 units are more suitable for us at the moment.I ordered the two models attached below. I will use the first one as a G-code interpreter & motor controller, and I am getting the second one primarily to examine the test and G-code transfer offline.I plan to replace this second one with our own modules (with RP-Pico) in a short time and then will come our own 1 unit controllers (there are already GRBL Pico modules on the market still not sure how effective they are).Am I re-inventing the wheel? Then OMG!