What is the Gcode? Transforming your 3D models to the language of printers

Recent Articles

Blog Search

 What is the Gcode? Transforming your 3D models to the language of printers
Jan162019

What is the Gcode? Transforming your 3D models to the language of printers

As we discussed in a previous blog post, STLs are the main files used in 3D printing . But, does our printer understand these files? The answer is no. The control systems used by our printers need specific movement instructions for motors and other elements. This is where the GCode language comes into play .

GCode comes from "Geometric Code" and is responsible for telling the 3D printer where to move and how much material to extrude in each step of 3D printing . If you have been in the world of 3D printing for a short time, you may not have seen these codes. The Slicing programs are automatically responsible for generating it without the user having to interact with it.

Even so, it is very important to know how this language works since it can be very useful when solving problems and to be able to do more advanced things with our 3D printers.

How the Gcode works

A Gcode line looks similar to this:

G1 X-5.3 Y-8.25 Z0.7 F3000.0 E0.0433



This particular code tells the 3D printer to move in a straight line up to the coordinates X -5.3 Y-8.25 Z 0.7 with a FeedRate of 3000 and that also extrudes 0.0433 along the way.


Let's see it in parts:

  • G1 : All Gcode lines start with a command. In this case G1. This is the Gcode command for a constant movement in a straight line.
  • X : From the command what comes are the parameters that indicate how the command has to be performed. In this case, it receives the X coordinate where the movement must end.
  • Y : Y coordinate where the movement should end.
  • Z : Z coordinate where the movement should end.
  • F : This parameter is the Feed Rate and indicates the speed of movement
  • E . This parameter indicates the amount of material that will be extruded by the 3D printer along the way.

All Gcodes that start with the letter G refer to movement actions. But as you'll be thinking right now, 3D printers do more than just move. That's why there are The Mcodes . Similar to the Gcode in their operation, they implement other orders for the 3D printer such as the M140 used to set the temperature of the hot bed or the M190 that makes the printer wait until it reaches a certain temperature.

The most important Gcodes

There are certain Gcodes that are the most used in 3D printing , in this section we will see them and explain them all.

G0 "Fast movement"

This command tells the 3D printer to move at the maximum allowed speed to specific coordinates . The execution of the G0 does not allow to extrude during the movement. It is normally used at the beginning of printing to bring the head to the starting point or during printing for movements that do not need to perform plastic extrusion.

G1 "Controlled movement"

With this Gcode we indicate to the 3D printer that it moves to a specific point, but we can also specify the speed at which the movement will be made and if we want it to extrude plastic along the way. It is the command that you will find the most if you look at a gcode before printing, since it is the one used during 3D printing itself.

G17, G18 and G19 "Select the planes of movement"

These Gcodes are used to indicate to the 3D printer on what plane the nozzle movement should perform.

G17 indicates the XY plane, G18 the ZX plane and G19 the YZ plane.

G28 "Ir al origen"

This is the command that is used to tell the 3D printer to bring the extrusion head to the home position , for most printers it is (0,0,0).

G90 "Absolute movement"

This command indicates that the subsequent movement commands received by our 3D printer will be referenced on the origin of this, as we have said before (0,0,0). This means that if we are in the X 5 coordinate and the next GCode is G0 X10 the printer head will move to X10.

G91 "Relative movement"

Unlike the previous one, this GCode indicates to the printer that it must move in relation to the current coordinates. Following the previous example, if we were in X 5 and after a G91 the next Gcode was G0 X10 the head this time would move to X 15.

Comments on the GCodes

As in any programming language, it is possible to insert comments in the Gcodes to indicate their meaning or whatever we want. For this it is necessary to insert the comment in the same line as the GCode using the ";" symbol.

The structure of a GCode for 3D printing

Now that we have seen how the Gcodes work , it is time to d ever as a valid file for 3D printing is composed .

The gcodes for 3D printing are divided into 3 parts: Preparation, printing and finishing.

Preparation

Before starting to print, we need the 3D printer to perform certain tasks. These can be: heat the nozzle, heat the bed, go to the origin ...

A real example of this would be the following:

G90; Establishes absolute movement
M82; Establishes extrusion values ​​as absolute
M106 S0; Plug in the fan at a speed of 0
M140 S100; Sets the temperature of the hot bed to 100
M190 S100; Tells the printer to wait until the temperature of the bed has been reached

Print

This is the phase where 3D printing takes place. It consists mainly of movements of the extruder in the XY plane while extruded material and movements in Z to change layer.

An example:

G1 X108.587 Y111.559 F525; Controlled movement in XY
G1 X108.553 Y111.504 F525; Controlled movement in XY
G1 Z0.345 F500; Change of layer
G1 X108.551 Y111.489 F525; Controlled movement in XY
G1 X108.532 Y111.472 F525; Controlled movement in XY

Ending

At the end of the printing we need to leave the printer ready for the following: This is: stop heating, pick up the motors, take the extruder to the origin ...

G28; Take the printer to the origin
M104 S0; Stop heating
M140 S0; Turn off the bed
M84; Shut down the engines

Bidirectional communication

So far we have seen how to send GCodes to our printer, but it is also possible that the printer sends information to us. This information is usually what we see on the screens of our 3D printer or on the control consoles.

The 3D printer can send 3 different states:

  • OK : if everything went well
  • RS : if you need a particular line to be sent again
  • !! : this indicates an error in the hardware. In this case the machine will automatically turn off and the printing will be canceled.

The information that we see on the screen, such as temperature or current coordinates, are sent using M commands such as M105 for temperature or M114 and 117 for coordinates.

If you want to see all the GCodes, you can consult them in the official wiki of the reprap project

We hope that this knowledge about GCodes will help you in the use of 3D printing . Soon we will bring you a more detailed article on how to correct problems using GCodes .

Greetings and see you printing

Join us on our social networks for more articles like this!

Newsletter

49 Comments

    • Avatar
      Feb 5, 2020  /  19:17  /  Reply
      Joomy

      Meilleures options pour la chirurgie de la prostate
      En ce qui concerne l'ablation de la prostate, la chirurgie traditionnelle et la chirurgie assistée par robot semblent être égales. Ce qui est important, c'est l'expertise du chirurgien, qu'il effectue l'opération directement ou qu'il contrôle le robot qui le fait.

      La FDA approuve un nouveau test PSA
      Le test de l'indice de santé de la prostate nouvellement approuvé est destiné aux hommes de 50 ans et plus avec un PSA total dans la "zone grise" - entre 4,0 et 10 nanogrammes par millilitre - et dont l'examen physique ne trouve aucun signe de cancer.

    • Avatar
      May 14, 2020  /  06:10  /  Reply
      sophie

      I really loved reading your blog. It was very well authored and easy to understand. Unlike other blogs I have read which are really not that good.Thanks alot! This is great function in game sims 4 cheats : Bowling. Let create the perfedct hangout with a bowling lane in your sims house

    • Avatar
      May 31, 2020  /  16:33  /  Reply
      drain cleaning company

      Hi buddies, it is great written piece entirely defined, continue the good work constantly. drain cleaning company

    • Avatar
      Jun 8, 2020  /  07:52  /  Reply
      Johney

      They delivered high-quality ideas while also responding to ux design firm and adjusting to feedback. There were a few ambiguities in project management, but they ultimately produced a quality proposal.

    • Avatar
      Jul 1, 2020  /  09:22  /  Reply
      LeptoConnect

      I am genuinely thankful to the holder of this web page who has shared this wonderful paragraph at at this place LeptoConnect

      • Avatar
        Jul 5, 2020  /  09:17  /  Reply
        Alen

        The answers are looking great with the communication level. I agree to the connection for the level formulae to set the conditions up. buy votes

    • Avatar
      Jul 1, 2020  /  09:27  /  Reply
      Resurge

      If your looking for Online Illinois license plate sticker renewals then you have need to come to the right place.We offer the fastest Illinois license plate sticker renewals in the state. Resurge

    • Avatar
      Jul 1, 2020  /  09:31  /  Reply
      Diabetes Freedom

      Thanks a lot for one’s intriguing write-up. It’s actually exceptional. Searching ahead for this sort of revisions. Diabetes Freedom

    • Avatar
      Jul 1, 2020  /  09:35  /  Reply
      Leptitox

      Your work is very good and I appreciate you and hopping for some more informative posts Leptitox

    • Avatar
      Jul 1, 2020  /  09:38  /  Reply
      Burn Fat Series

      Hey There. I found your blog using msn. This is a very well written article. I’ll be sure to bookmark it and come back to read more of your useful info. Thanks for the post. I’ll definitely return. Burn Fat Series

    • Avatar
      Jul 1, 2020  /  09:42  /  Reply
      LeptoConnect

      Thanks for the nice blog. It was very useful for me. I'm happy I found this blog. Thank you for sharing with us,I too always learn something new from your post. LeptoConnect

    • Avatar
      Jul 1, 2020  /  09:45  /  Reply
      Leptitox

      Hi to everybody, here everyone is sharing such knowledge, so it’s fastidious to see this site, and I used to visit this blog daily Leptitox

    • Avatar
      Jul 1, 2020  /  09:49  /  Reply
      Resurge

      This is a great post. I like this topic.This site has lots of advantage.I found many interesting things from this site. It helps me in many ways.Thanks for posting this again. Resurge

    • Avatar
      Jul 1, 2020  /  09:53  /  Reply
      Resurge

      They're produced by the very best degree developers who will be distinguished for your polo dress creating. You'll find polo Ron Lauren inside exclusive array which include particular classes for men, women. Resurge

    • Avatar
      Jul 1, 2020  /  09:57  /  Reply
      Resurge

      Thanks a lot for one’s intriguing write-up. It’s actually exceptional. Searching ahead for this sort of revisions. Resurge

    • Avatar
      Jul 1, 2020  /  10:00  /  Reply
      Resurge Supplement

      Your work is very good and I appreciate you and hopping for some more informative posts Resurge Supplement

    • Avatar
      Jul 1, 2020  /  10:03  /  Reply
      Testogen Review

      I am looking for and I love to post a comment that "The content of your post is awesome" Great work! Testogen Review

    • Avatar
      Jul 1, 2020  /  10:08  /  Reply
      Brain Training for Dogs

      I feel really happy to have seen your webpage and look forward to so many more entertaining times reading here. Thanks once more for all the details. Brain Training for Dogs

    • Avatar
      Jul 1, 2020  /  10:12  /  Reply
      Mind Body Matrix Pain Relief Cream

      Very nice article. I enjoyed reading your post. very nice share. I want to twit this to my followers. Thanks !. Mind Body Matrix Pain Relief Cream

    • Avatar
      Jul 1, 2020  /  10:15  /  Reply
      Reading Head Start

      This is a great post. I like this topic.This site has lots of advantage.I found many interesting things from this site. It helps me in many ways.Thanks for posting this again. Reading Head Start

    • Avatar
      Jul 1, 2020  /  10:18  /  Reply
      Resurge

      This is very educational content and written well for a change. It's nice to see that some people still understand how to write a quality post! Resurge

    • Avatar
      Jul 2, 2020  /  12:23  /  Reply
      home insurance chicago

      Your work is very good and I appreciate you and hopping for some more informative posts home insurance chicago

    • Avatar
      Jul 3, 2020  /  14:10  /  Reply
      rick the railroad guy

      After reading your article I was amazed. I know that you explain it very well. And I hope that other readers will also experience how I feel after reading your article. rick the railroad guy

    • Avatar
      Jul 3, 2020  /  14:31  /  Reply
      graphic accounts

      Such a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. graphic accounts

    • Avatar
      Jul 3, 2020  /  14:38  /  Reply
      darlene cadwell

      Wonderful blog post. This is absolute magic from you! I have never seen a more wonderful post than this one. You've really made my day today with this. I hope you keep this up! darlene cadwell

    • Avatar
      Jul 3, 2020  /  14:39  /  Reply
      Max

      I really appreciate your blog. your way of working is really great.its really awesome and cool. thanks for sharing the nice post. best entrence matting

    • Avatar
      Jul 3, 2020  /  15:05  /  Reply
      maid land lodge

      I would also motivate just about every person to save this web page for any favorite assistance to assist posted the appearance. maid land lodge

    • Avatar
      Jul 3, 2020  /  15:13  /  Reply
      serving bread

      Good to become visiting your weblog again, it has been months for me. Nicely this article that i've been waited for so long. I will need this post to total my assignment in the college, and it has exact same topic together with your write-up. Thanks, good share. serving bread

    • Avatar
      Jul 3, 2020  /  15:25  /  Reply
      south east angle

      Interesting post. I Have Been wondering about this issue, so thanks for posting. Pretty cool post.It 's really very nice and Useful post.Thanks south east angle

    • Avatar
      Jul 3, 2020  /  15:32  /  Reply
      top shelf high

      I’m excited to uncover this page. I need to to thank you for ones time for this particularly fantastic read!! I definitely really liked every part of it and i also have you saved to fav to look at new information in your site. top shelf high

    • Avatar
      Jul 3, 2020  /  15:40  /  Reply
      cosmetic laser

      i am for the first time here. I found this board and I in finding It truly helpful & it helped me out a lot. I hope to present something back and help others such as you helped me. cosmetic laser

    • Avatar
      Jul 3, 2020  /  15:59  /  Reply
      claremore development

      It's late finding this act. At least, it's a thing to be familiar with that there are such events exist. I agree with your Blog and I will be back to inspect it more in the future so please keep up your act. claremore development

    • Avatar
      Jul 3, 2020  /  16:06  /  Reply
      legendary insights

      A great website with interesting and unique material what else would you need. legendary insights

    • Avatar
      Jul 3, 2020  /  17:13  /  Reply
      legendary insights

      A great website with interesting and unique material what else would you need. legendary insights

    • Avatar
      Jul 3, 2020  /  17:21  /  Reply
      stonefish spine

      It's late finding this act. At least, it's a thing to be familiar with that there are such events exist. I agree with your Blog and I will be back to inspect it more in the future so please keep up your act. stonefish spine

    • Avatar
      Jul 3, 2020  /  17:28  /  Reply
      susan sell severett

      A great website with interesting and unique material what else would you need. susan sell severett

    • Avatar
      Jul 3, 2020  /  17:35  /  Reply
      swiss asia finance

      After reading your article I was amazed. I know that you explain it very well. And I hope that other readers will also experience how I feel after reading your article. swiss asia finance

    • Avatar
      Jul 3, 2020  /  17:42  /  Reply
      seinfelds scholars

      Such a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. seinfelds scholars

    • Avatar
      Jul 3, 2020  /  17:51  /  Reply
      loris health

      Wonderful blog post. This is absolute magic from you! I have never seen a more wonderful post than this one. You've really made my day today with this. I hope you keep this up! loris health

    • Avatar
      Jul 5, 2020  /  15:27  /  Reply
      best places to travel right now

      Very nice article. I enjoyed reading your post. very nice share. I want to twit this to my followers. Thanks !. best places to travel right now

    • Avatar
      Jul 6, 2020  /  12:57  /  Reply
      John

      This blog is very effective and valuable. I am very glad to read your blog. I hope you will soon share your next post about this discussion. Thanks for sharing and keep sharing. Gymnastic mats

    • Avatar
      Jul 6, 2020  /  13:34  /  Reply
      James

      This blog is my favorite blog because i got information here step by step.Your style of the presentation of the so good. Thanks. To get rubber sheet Visit Rubbersheetcompany.co.uk

    • Avatar
      Jul 6, 2020  /  14:11  /  Reply
      ganan

      You have shared very useful content which i like reading.I have learned a lot which will help me in future.Keep sharing more similar stuff. Durable rubber gym mats

    • Avatar
      Jul 7, 2020  /  13:33  /  Reply
      women's hiking socks

      Very nice article. I enjoyed reading your post. very nice share. I want to twit this to my followers. Thanks !. women's hiking socks

    • Avatar
      Jul 7, 2020  /  18:53  /  Reply
      jonny jack

      I can recommend primarily decent and even responsible tips, as a result view it: mexican restaurant

    • Avatar
      Jul 8, 2020  /  19:27  /  Reply
      jonny jack

      I am always searching online for storys that can accommodate me. There is obviously a multiple to understand about this. I feel you made few salubrious points in Attributes moreover. Detain busy, awesome career! taco time

    • Avatar
      Jul 9, 2020  /  09:43  /  Reply
      Max

      Your blog is really awesome and cool. its really good and cool post. its really good and cool post. i really appreciate your blog. thanks for sharing the nice post.thanks for sharing. Buy Coir matting Online

Leave a Comment

Cart 0 Shopping Cart

No products

Free shipping! Shipping
0,00 € Total

Check out