Hot answers tagged

25 votes
Accepted

Is there a G-code for waiting?

The G-code to delay is G4. G4 P60000 will wait for one minute. The P is in milliseconds. ...
user avatar
  • 1,531
15 votes
Accepted

Why do some models appear broken in slicing software?

My understanding is that this occurs when the object is not a true solid. Since an STL holds the triangulation of each face and spline, the slicing engine is not "smart" enough to determine ...
user avatar
  • 6,214
14 votes

Is there a G-code for waiting?

An alternative solution to using a hard delay with the G4 dwell command, is to increase the time that the temperature set with M109 has to be held before it continues with the next command. In Marlin,...
user avatar
13 votes
Accepted

What is the purpose of asterix (*) in Gcode?

That is a checksum. It's added by the host software to the G-code, to allow some basic verification by the firmware that the G-code was transmitted unchanged. It doesn't change the meaning of the G-...
user avatar
12 votes
Accepted

Cura: set z-offset

You can trick the printer into applying an offset using the G92 command: G0 Z0 G92 Z0.1 First, we move the nozzle to ...
user avatar
12 votes
Accepted

What is G92 used for in G-code

The G92 command is used to set the start position (origin) of one of more axes (including the current extruder) to any arbitrary value. The command ...
user avatar
  • 2,972
12 votes

Are parentheses allowed within a G-code comment?

This is not universally valid G-code, and how it is handled depends on the implementation. You can use this style of comment on some machines, but not all. The way parsing used to be implemented in ...
user avatar
12 votes
Accepted

What is a printer console/terminal?

There are several programs that could serve as a console to connect to a printer, put let's start somewhere: the USB connection. Step 1: Connection with USB When connecting the printer via USB for the ...
user avatar
  • 19.2k
11 votes
Accepted

Music from the printer?

Yes, it has been done before, see here and here. The README file of the first repository linked above contains a detailed explanation of the basic idea/calculations involved. A short excerpt: As ...
user avatar
  • 4,537
9 votes
Accepted

Writing G-code : swiping at start of print

The lazy way: Skirt/Brim With my TronXY X1 I learned pretty fast, that this first bit of extrusion on an unheated bed can totally mess up the first layer by being just in the way, as explained in the ...
user avatar
  • 19.2k
9 votes
Accepted

Writing G-code: Audible Alert at end of print

Let's put the parts one by one: Wait for bed temperature being at 30 °C: M190 R30 Play Bleep for 1/5th of a second: ...
user avatar
  • 19.2k
8 votes
Accepted

E axis vs Z axis

G-CODE can be confusing as historically it was developed for machining tools rather than FDM printers, and thus: not all available commands make sense for a 3D printer some of the command do slightly ...
user avatar
  • 4,537
8 votes
Accepted

Is G-code read line by line?

Yes, G-code is read line by line. G-code is a numerical control programming language. It basically instructs the machine sequentially line by line to do a specific task. The printer than executes the ...
user avatar
  • 30.3k
8 votes
Accepted

Move print bed to front at the end of a print rather than the back

Note that this reference states that: Because the behavior of G28 is unspecified, it is recommended not to automatically include ...
user avatar
  • 30.3k
8 votes
Accepted

Converting an undirected graph to optimal G-code paths

Quote of comment of R.. GitHub STOP HELPING ICE on question reads: Pretty sure it is NP-complete (equivalent to travelling salesman problem), no? – This is correct; this is route optimization ...
user avatar
  • 451
7 votes
Accepted

How do I set the G-code buffer size on Marlin?

Marlin does allow one to change the size of the buffers, in Configuration_adv.h. In the current version there's an ifdef that switches between two cases, one with ...
user avatar
  • 822
7 votes

Cura: set z-offset

For Cura 3.1(?)+: Install the plugin: Menu / Plugins / Browse Plugins... / scroll to "Z Offset plugin" <-- Install Configure the setting: ...
user avatar
  • 171
7 votes

Music from the printer?

I actually did this, on my Malyan M150. After not that much experimentation at all it turned out that the frequency of the produced tone scales linearly with the speed of the motors. Due to the ...
user avatar
  • 221
7 votes
Accepted

G-Code for resetting to 100% speed

You can put the speed to 100 % by G-code command: M220 S100. The M220command is described here. Know that speed changes ...
user avatar
  • 30.3k
7 votes
Accepted

Add a laser module to Reprap Guru Prusa i3

By connecting to the D9 output header (see RAMPS 1.4 shield schematic below) you only have 2 wires that represent a scheduled load and ground. You actually need to connect the positive (red) lead to ...
user avatar
  • 30.3k
7 votes
Accepted

What is the difference between M420 S and M420 S1?

TL;DR Short answer: "There is no difference!". Long answer G-code is parsed line by line. The parser in the firmware reads the command and the options (also called parameters) following it, ...
user avatar
  • 30.3k
7 votes
Accepted

Using auto-bed leveling, do I need to initiate G29 before every print?

No, it is not necessary to call G29 before every print to "auto level the bed" 1) provided that: the bed surface has not changed (e.g. large load or ...
user avatar
  • 30.3k
6 votes
Accepted

Printer randomly moves to home during printing, then resumes as normal

The issue was due to a corrupt SD-card, which was occasionally having some garbage read from it. It turns out that Marlin will try interpret a corrupt move command like ...
user avatar
6 votes
Accepted

Turning off heatbed for the last few layers. Good idea or not?

It's not a bad idea, and you should try it. But only on prints with some height, because: The goal of the heated bed is to ensure adhesion for the first few layers. Without the heat on the bottom ...
user avatar
6 votes

Calculating the estimated print time of an already sliced file

First of all, there are some nice open source analyzers written in JavaScript that you can use online, or read the source to, at https://www.gcodeanalyser.com/ and http://gcode.ws/. Their predictions ...
user avatar
6 votes

What is G92 used for in G-code

To supplement the accepted answer, and answer a question in the answer's comments (which should not be there), consider the E value as another axis - the axis of the filament. If you executed: ...
user avatar
  • 2,282
6 votes
Accepted

Any code to move up Z axis after finishing the printing?

You can use: G91 G1 Z10 G91 make the printer use ralative positioning, while G1 Z10 would ...
user avatar
  • 4,537
6 votes
Accepted

G4 S20 vs. G4 P2000

The answer is that it depends on the type of firmware you are using. Let us look at the documentation of G4 to find that G4 is ...
user avatar
  • 30.3k
6 votes

What does a stand alone "T" index value do?

T stands for "Tool" and has its origin in the origins of .gcode being for other automated machine controls. Depending on the machine, everything could be a tool for ...
user avatar
  • 19.2k
6 votes
Accepted

How to post-process G-code to make prints faster using splines and arcs?

I would have liked to answer linking to credible official sources, but I cannot add references either on direct B-spline printing. So I'm writing down my thoughts. I've familiarized myself in B-...
user avatar
  • 30.3k

Only top scored, non community-wiki answers of a minimum length are eligible