G-code is a programming language that was first used to instruct CNC (computer numerical control) machines how to fabricate objects and is now also used for 3D printers. It is a text-based language that consists of a series of commands, each of which tells the machine to perform a specific action. G-code can be used to control multiple axes of motion with precision which makes it ideal for 3D printers. In collaboration with computer-aided design (CAD) software it can be used to create complex, multi-dimensional parts and objects. This makes it ideal for use in a wide range of industries, including aerospace, automotive, and medical device manufacturing.

Image: Sample G-code from G-Code simulator

Since G-code’s inception in the 1950s, there has been the 1960s main standardization version and a final revision in the 1980s. Very little has changed with the exception of some academic work related to EGCL (Extended G-code Language) and macros and parametric programing. G-code is primarily used in FFF/FDM (Fused Filament Fabrication/Fused Deposition Modelling) 3D printers. Other additive manufacturing processes such as laser based processes use a range of different control languages or a proprietary language. OpenVectorFormat (OVF) attempts to unify formats for laser based 3D printing by having a “truly open, feature rich format”. OVF was created because nearly all of the formats “lack the capability to store meta-data about parts and processing steps, which is required to associate process monitoring information with specific steps of the processing job.”

Typically in the 3D printing process the operator is not manually entering G-code, rather the CAD software is used to generate the code. So why does it matter if G-code or something else is used? From a cybersecurity standpoint G-code is very easy to learn and subvert. G-code was not created for 3D printing or with cybersecurity in mind. Also, each slicing software adds on their own G-code commands to the basic G-code geometric commands. These are commonly commands performed at the start or end of a build such as bed heating or power on/off. There are many types of 3D printing firmware and often, each developer adds their own new feature. This has created many slightly different G-code variants which can lead to major compatibility issues, as commands that work for one machine might not work for another.

Will we see G-code being replaced? The global 3D printing software and services market was valued at USD 14.98 billion in 2021. It is expected to reach USD 101.59 million by 2030. With such a huge growth forecast for 3D printing software it is possible that we could see some expansion of G-code or a new control code developed. While there are pros and cons to G-code it remains highly widely used and effective for its intended purpose and it’s doubtful that we will see it replaced in the near future. With G-code here to stay it is imperative that we implement cybersecurity measures for G-code. BISON analyzes the G-code executed and compares it to a trusted file. The user will be alerted to any discrepancies in G-code commands. It also gives the user a digital visual representation of the part by recreating the G-code. This gives the user valuable insight into their part and verifies that what is printed is as intended. 

If you are interested in learning more about securing Additive Manufacturing or a demonstration of BreakPoint Lab’s BISON AM solution capability, please contact us at info@breakpoint-labs.com