To Örebro University

oru.seÖrebro University Publications
Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
Parsing and translating ISO 6983 CNC G-code between dialects
Örebro University, School of Science and Technology.
2025 (English)Independent thesis Basic level (professional degree), 10 credits / 15 HE creditsStudent thesis
Abstract [en]

The goal of this work is to try to create a parser and translator for Computer Numerical Control (CNC) code based on ISO 6983-1:2009[3], better known as G-code, between different dialects and machine implementations. Besides different choices in how common language features are implemented between vendors, there are often non-standard-compliant changes to the language content, and on top of this machines using G-code varies quite a lot in functionality, and thus implement quite different set of features on top of the basic language. The goal of this project is to start from the basic level defined in the standard and work upward to see to what extent a general parser/translator can be implemented and if any unsurmountable obstacles make themselves known. The intended use case for a potential end product is simplifying the conversion of CNC controlled production work between different machines that a company may have available to them, in the case where the programs are not defined through a separate CAD/CAM process but rather by manual programming. There will always be a need for user input before a translated program can be used on a real machine, since the tooling and setup of the machines may vary in a way that cannot easily be known at translation time, but it could potentially save time from having to redo programs from scratch. During the project, a minimal viable product is developed to serve as a proof of concept and as a vehicle to find some of the spots where translation will be more difficult to handle in the general case. The method chosen for this attempt is to first implement a minimal, mostly standard compliant, parser, then add those features needed to define a set of basic operations for two specific machines in use by the sponsoring company, and thus search in an iterative manner for where the pain points are for implementation, and refactoring the solution as needed to address those. Translation is done by creating a parse tree defined by the operations, commands, and parameters that codes refer to, one block at a time. This tree is then read by the output generator and transformed according to case-by-case rules until it defines a tree consisting only of those building blocks the target machine supports while as far as possible preserving the physical expressions this tree would take when run in a machine. This transformed tree can then be used to generate G-code usable by the target machine.

Place, publisher, year, edition, pages
2025. , p. 27
Keywords [en]
Industrial machines, CNC, Parsing, Translation, G-code
National Category
Computer Engineering
Identifiers
URN: urn:nbn:se:oru:diva-122427OAI: oai:DiVA.org:oru-122427DiVA, id: diva2:1983924
Subject / course
Computer Engineering
Supervisors
Examiners
Available from: 2025-07-14 Created: 2025-07-14 Last updated: 2025-07-14Bibliographically approved

Open Access in DiVA

Parsing and translating ISO 6983 CNC G-code between dialects(364 kB)477 downloads
File information
File name FULLTEXT01.pdfFile size 364 kBChecksum SHA-512
0333bf26090b4617367515d75f3b1d4a576f1862d42f4897cd02d6c9e6f32ab3a42c57c9822016986cd2adcadd4cd0e6c270db50d796d05191a7e3e1dc8837cc
Type fulltextMimetype application/pdf

By organisation
School of Science and Technology
Computer Engineering

Search outside of DiVA

GoogleGoogle Scholar
Total: 483 downloads
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 293 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf