1

I'm not sure that this is the right place to post this question, but I figured it was a good start since it deals with code... if not, please point me to the right forum, thanks.

I'm looking to create a G-Code interpreter on a C/C++/FPGA embedded system and I'm not quite sure of how to translate G-code into motor movement signals. This is a project for a proprietary system so there's a lot of extras I don't need like variable gearing ratios, etc. Does anyone know where I can find this info, or know if there's an open source interpreter that I can view as an aid?

Thanks all!

toolic
  • 57,801
  • 17
  • 75
  • 117
Jedi Engineer
  • 493
  • 3
  • 11
  • 29
  • There is a free G-code interpreter here, perhaps you can use it for inspiration as it is open source. http://smoothieware.org/ – Weather Vane Dec 10 '14 at 12:54
  • There is no universal standard, CNC vendors pick G-codes to match their controller or tool design. Also a reason why this is never done in hardware. Just pick a CNC vendor you like and follow their programming manual. – Hans Passant Dec 10 '14 at 13:00
  • See [The NIST RS274NGC Interpreter](http://www.nist.gov/manuscript-publication-search.cfm?pub_id=823374). There's also [LinuxCNC](http://linuxcnc.org/)'s [Documentation](http://linuxcnc.org/index.php/english/documentation) page and it's [rs274ngc](https://github.com/jepler/linuxcnc-mirror/tree/master/src/emc/rs274ngc) interpreter. –  Dec 10 '14 at 14:20
  • Hi,what have you did in the end? I have also a project where I need to implement a CNC on an FPGA and it's hard to find some resources or code for this – O.Rares Mar 18 '18 at 12:29

1 Answers1

3

There are many open source implementations of G-code interpreters for 3D printers and home-made CNC machines. Even though there is no universal standard (as Hans mentions in comments), the open source community arrived at a consensus that seems to be generally accepted (description can be found on reprap wiki).

Reprap website also provides a list of open source firmwares and interpreters used in 3D printers and CNC machines, which you can use as a start. I am not sure if there is an open source implementation on an FPGA, though, as most open source projects use an Arduino or similar mainstream controllers.

Personally, for CNC machines, I have successfully used the grbl firmware, which many other firmware implementations derive from (e.g., Marlin).

Martin Prazak
  • 1,476
  • 12
  • 20
  • Thank you @martin_pr for the insight. I realize a lot of people use pre-made controllers, I just wanted the challenge of making one myself. Plus I had a few ideas I wanted to incorporate as well. But thanks for the links and the info! – Jedi Engineer Dec 10 '14 at 20:24