Author Topic: Mach3 or GRLB, reading the G-CODE directly from an SD Card?  (Read 703 times)

0 Members and 1 Guest are viewing this topic.

Offline salihkanberTopic starter

  • Regular Contributor
  • *
  • Posts: 150
  • Country: us
  • Empowering Towards Great Robotics
    • Empowering Towards Great Robotics
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!
Empowering Towards Great Robotics
 

Online langwadt

  • Super Contributor
  • ***
  • Posts: 4721
  • Country: dk
Re: Mach3 or GRLB, reading the G-CODE directly from an SD Card?
« Reply #1 on: June 02, 2024, 12:30:55 am »
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!

anything that can talk serial port (over usb) can stream gcode to grbl
 
The following users thanked this post: salihkanber

Online moffy

  • Super Contributor
  • ***
  • Posts: 2091
  • Country: au
Re: Mach3 or GRLB, reading the G-CODE directly from an SD Card?
« Reply #2 on: June 02, 2024, 01:08:41 am »
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.
 
The following users thanked this post: salihkanber

Offline H.O

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: se
Re: Mach3 or GRLB, reading the G-CODE directly from an SD Card?
« Reply #3 on: June 02, 2024, 05:36:06 am »
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.
 
The following users thanked this post: salihkanber

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13085
Re: Mach3 or GRLB, reading the G-CODE directly from an SD Card?
« Reply #4 on: June 02, 2024, 06:57:24 am »
Why reinvent the wheel? Offline controllers that stream G-code from SD card to GRBL 1.1x are readily available.    Simply google for grbl offline controller and 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.
 
The following users thanked this post: salihkanber

Offline salihkanberTopic starter

  • Regular Contributor
  • *
  • Posts: 150
  • Country: us
  • Empowering Towards Great Robotics
    • Empowering Towards Great Robotics
Re: Mach3 or GRLB, reading the G-CODE directly from an SD Card?
« Reply #5 on: June 02, 2024, 08:54:55 am »
Why reinvent the wheel? Offline controllers that stream G-code from SD card to GRBL 1.1x are readily available.    Simply google for grbl offline controller and 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.

You 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?
« Last Edit: June 02, 2024, 09:09:39 am by salihkanber »
Empowering Towards Great Robotics
 

Offline salihkanberTopic starter

  • Regular Contributor
  • *
  • Posts: 150
  • Country: us
  • Empowering Towards Great Robotics
    • Empowering Towards Great Robotics
Re: Mach3 or GRLB, reading the G-CODE directly from an SD Card?
« Reply #6 on: June 02, 2024, 09:00:41 am »
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.

Thank 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!
Empowering Towards Great Robotics
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13085
Re: Mach3 or GRLB, reading the G-CODE directly from an SD Card?
« Reply #7 on: June 02, 2024, 09:40:06 am »
Err . . . See the gnea GRBL wiki: https://github.com/gnea/grbl/wiki for the serial protocol, specifically the https://github.com/gnea/grbl/wiki/Grbl-v1.1-Interface page.

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.
« Last Edit: June 04, 2024, 12:29:39 am by Ian.M »
 
The following users thanked this post: salihkanber

Offline salihkanberTopic starter

  • Regular Contributor
  • *
  • Posts: 150
  • Country: us
  • Empowering Towards Great Robotics
    • Empowering Towards Great Robotics
Re: Mach3 or GRLB, reading the G-CODE directly from an SD Card?
« Reply #8 on: June 02, 2024, 01:14:04 pm »
Err . . . See the gnea GRBL wiki: https://github.com/gnea/grbl/wikifor the serial protocol, specifically the https://github.com/gnea/grbl/wiki/Grbl-v1.1-Interface page.

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.

Thank 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?
« Last Edit: June 02, 2024, 01:52:28 pm by salihkanber »
Empowering Towards Great Robotics
 

Offline H.O

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: se
Re: Mach3 or GRLB, reading the G-CODE directly from an SD Card?
« Reply #9 on: June 02, 2024, 02:05:07 pm »
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.

Thank 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!

Very 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.
« Last Edit: June 02, 2024, 02:07:25 pm by H.O »
 
The following users thanked this post: salihkanber

Offline salihkanberTopic starter

  • Regular Contributor
  • *
  • Posts: 150
  • Country: us
  • Empowering Towards Great Robotics
    • Empowering Towards Great Robotics
Re: Mach3 or GRLB, reading the G-CODE directly from an SD Card?
« Reply #10 on: June 02, 2024, 02:48:32 pm »
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.

Thank 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!

Very 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.

It was very helpful, thanks for your time
Empowering Towards Great Robotics
 

Offline salihkanberTopic starter

  • Regular Contributor
  • *
  • Posts: 150
  • Country: us
  • Empowering Towards Great Robotics
    • Empowering Towards Great Robotics
Re: Mach3 or GRLB, reading the G-CODE directly from an SD Card?
« Reply #11 on: June 03, 2024, 07:57:46 pm »
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!
« Last Edit: June 03, 2024, 07:59:23 pm by salihkanber »
Empowering Towards Great Robotics
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf