How to Send G-Code to Your 3D Printer: The Right Way
There are a few ways that 3D printer users send g-code files to their machines, all of which do work fairly well. This article will show you the main ways that people send their G-code files and will identify the best ways to do so.
The best way to send G-Code files to your 3D printer is to expand your 3D printer to use Wi-Fi capabilities using a Raspberry Pi & OctoPrint software. This allows you to wirelessly transfer files to your printer, allowing you to also control it to start prints remotely.
This is the basic answer on how to do it, so if you want more detail behind it and some other key information, keep on reading.
What is G-Code in a 3D Printer?
G-Code (Geometric Code) is a numerically controlled programming language, and a file type that contains instructions your 3D printer can understand. It translates commands such as the heating of your nozzle or print bed, down to each X, Y & Z axis movement that your 3D printer makes.
These G-Code instruction files are made through the use of a slicer software application, which have easy-to-use interfaces to make specific adjustments to the way your 3D prints operate.
First, you’ll import a CAD model into your slicer, then you have the choice of adjusting several variables. Once you’re happy with your temperature settings, speed settings, layer height, support settings, and all the above, you then hit slice, which creates that G-Code file.
An example of G-Code looks like this:
G1 X50 Y0 Z0 F3000 E0.06
G1 – command to move nozzle around the print bed
X, Y, Z – point on corresponding axis to move to
F – speed at which to extrude per minute
E – how much filament to extrude
What are the Best Ways to Send G-Code Files to my 3D Printer?
Sending G-Code files to your 3D printer is a pretty easy task for the most part, allowing you to create those beautiful and creative 3D print models. People wonder what are the best ways people actually send files to their 3D printer, which I wanted to help answer.
After creating your G-Code file from your favorite slicer, there are a few ways that people do this:
- Inserting (Micro) SD Card into your 3D printer
- USB Cable connecting your 3D printer to a computer or laptop
- Through Wi-Fi connectivity
Now these are the main methods to send G-Code files to your 3D printer, but they can be quite complicated in some ways when you start introducing other factors such as Arduino, but this article will make use of the simpler methods.
Inserting (Micro) SD Card Into Your 3D Printer
Using an SD card is one of the most common and general ways of sending the G-Code to your 3D printer. Almost all 3D printers have an SD card slot which is commonly used for just this purpose.
You can easily send the G-Code to an SD or MicroSD card after slicing your CAD model on the computer or laptop. My Ender 3 came with a MicroSD card and a USB card reader, which allows you to save files directly.
Save the G-Code file onto the MicroSD Card and insert it into the MicroSD card slot on the printer.
This is probably the most used method of sending G-Code files to a 3D printer, due to its simplicity and effectiveness to get the job done without extra applications or devices.
Try not to make the mistake of unplugging the SD card while in the 3D printing process or your model will stop.
USB Cable Connected to a Computer or Laptop
Instead of using an SD card, we can directly connect our 3D printer to a computer or laptop using a simple cable. This is a less common method, but it is pretty effective for 3D printing, especially if it is close-by.
The one drawback that comes with this option is that if you use your laptop then you have to keep your laptop running for the whole time because standby mode can stop the printing process and may ruin your project as well.
Therefore, it is recommended to always go for a desktop computer while sending G-Code through a USB.
Check out my article on Do You Need a Good Computer for 3D Printing, to see some great computers that you can use with your 3D printer, especially great for slicing large files.
USB Through the Chrome Browser
This is one of the simplest methods to send G-Code to your 3D printer. First, you will need to add an extension of “G-Code Sender” into your Chrome browser.
Install this extension by clicking on the “Add to Chrome” button. After the installation process is completed, open the G-Code sender app.
Now connect your computer with a 3D printer using a USB cable. Open Settings from the top bar menu and select the port that includes text as “tty.usbmodem” and then set the communication speed to its maximum range.
Now you can send the G-Code directly to your 3D printer by writing commands in the console from this application.
Sending G-Code Through Wi-Fi Connectivity
The ever-growing method to send G-Code to your 3D is through the Wi-Fi option. This option has changed the whole scenario of 3D printing and has taken the printing experience to the next level.
There are many applications and software that can be used for this process such as OctoPrint, Repetier-Host, AstroPrint, etc.
To use Wi-Fi as a path of sending G-Code, you need to either add a Wi-Fi SD card or USB, implement the AstroBox, or use OctoPrint or Repetier-Host with a Raspberry Pi.
OctoPrint
Probably one of the most loved additions to 3D printer control is with using OctoPrint, an open-source software that is user-friendly. Within OctoPrint, there is a terminal tab which shows you current G-Code that is running, as well as the return.
Once you get used to using OctoPrint, you’ll find it pretty easy to send G-Code to your 3D printer.
You can do a lot more than send G-Code to your 3D printer, so have a look through the many useful plugins that OctoPrint has if you are interested.
This HowChoo video below goes into great detail on what you need, how to get set up, and how to run things afterwards.
Using Repetier-Host to Send G-Code to 3D Printer
When you open the Repetier-Host application there will be four main tables at the top right side of the interface. The tabs will be as “Object Placement”, “Slicer”, “G-Code Editor”, and “Manual Control”.
Object Placement is the tab in which you will upload the STL files containing your printing model. Make sure that the model is perfectly scaled and is ready to be printed.
After this, go to the “Slicer” tab and click on the ‘Slice with Slic3r’ button or ‘CuraEngine’ located at the top of the tab. This step will turn the solid STL print model into the layers and instructions that your 3D printer can understand.
You can also see the printing process in a layer by layer visualization to make sure that there is no improvement needed.
The “Manual Control” is the tab in which you will have the option to send the G-Code directly to the printer by typing your command in the G-Code text area located at the top of the tab.
After typing the command, click on the “Send” button and the printer will immediately start compiling and implementing the action you required with your G-Code command.
In the “Manual Control” tab you will have a lot of control options that you can access to make changes. You will have the option to turn off a stepper motor while turning on the other one.
The filament flow rate, extrusion speed, heat bed temperature and many other things in this tab can be adjusted at your desire.
What Are Some G-Code Commands for My 3D Printer?
The video below explains what you need and takes you through the process to send G-Code to your 3D printer. It also shows you some common G-Code commands that are used by many 3D printer users.
G0 & G1 are commands used to move the 3D print head around the print bed. The difference between G0 & G1 is that G1 is telling the program that you are going to do an extrusion of filament after the movement.
G28 homes your print head to the front left corner (G28 ; Go Home (0,0,0))
- G0 & G1 – Print head movements
- G2 & G3 – Controlled arc movements
- G4 – Dwell or delay/pause
- G10 & G11 – Retraction & unretraction
- G28 – Move to home/origin
- G29 – Detailed Z-probe – leveling
- G90 & G91 – Setting relative/absolute positioning
- G92 – Set position
RepRap has the ultimate G-Code Database for all thing G-Code which you can check out.